/* Pig — online mode (group platform). Only loaded by index.html and only
 * applies when ?p= is in the URL (online.js sets #pig-online-root display). */

#pig-online-root {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  font-family: 'Arimo', system-ui, -apple-system, sans-serif;
  color: #1d1d1f;
}

.pig-online-banner {
  background: #fff8e1;
  border: 1px solid #f4d28a;
  color: #5d4500;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 14px;
}

#pig-online-status {
  margin: 0 0 12px;
  min-height: 1.2em;
  color: #444;
}

#pig-online-status.error {
  color: #b00020;
}

.pig-online-card {
  background: #fff;
  border: 1px solid #e6e6ea;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pig-online-section-title {
  margin: 0 0 12px;
  font-family: 'League Spartan', system-ui, sans-serif;
  font-weight: 800;
  font-size: 22px;
}

.pig-hint {
  color: #6e6e73;
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 12px;
}

/* ===== Buttons ========================================================= */

.pig-online-btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  border: 0;
  border-radius: 12px;
  background: #43a047;
  color: #fff;
  cursor: pointer;
  margin-top: 8px;
}

.pig-online-btn:disabled {
  background: #c8c8cc;
  color: #fff;
  cursor: not-allowed;
}

.pig-online-btn.secondary {
  background: #f2f2f7;
  color: #1d1d1f;
}

.pig-online-btn.secondary:disabled {
  background: #f2f2f7;
  color: #aaa;
}

.pig-online-btn.switch {
  background: #fff;
  color: #007aff;
  border: 1px solid #007aff;
}

.pig-online-btn.danger {
  background: #b00020;
  color: #fff;
}

.pig-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.pig-action-row .pig-online-btn {
  margin-top: 0;
}

/* ===== Roster ========================================================== */

.pig-roster {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}

.pig-roster-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f1f1f4;
}

.pig-roster-item:last-child {
  border-bottom: 0;
}

.pig-roster-name {
  font-weight: 600;
}

.pig-roster-total {
  font-variant-numeric: tabular-nums;
  color: #1d1d1f;
  font-weight: 700;
  margin-right: 8px;
}

.pig-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f2f2f7;
  color: #6e6e73;
  letter-spacing: 0.5px;
}

.pig-badge-you {
  background: #e6f1fb;
  color: #0a64b0;
}

.pig-badge-host {
  background: #fff2cf;
  color: #6b4d00;
}

.pig-remove-btn {
  background: transparent;
  border: 0;
  color: #b00020;
  font-size: 18px;
  cursor: pointer;
  padding: 0 6px;
  margin-left: 8px;
}

/* ===== Playing screen ================================================== */

.pig-playing-header {
  text-align: center;
  margin-bottom: 8px;
}

.pig-playing-turn {
  display: block;
  font-size: 18px;
  font-weight: 700;
  font-family: 'League Spartan', system-ui, sans-serif;
}

.pig-scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.pig-score-card {
  background: #f8f8fb;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.pig-score-card.is-current {
  background: #fff2cf;
  outline: 2px solid #f4d28a;
}

.pig-score-name {
  font-size: 13px;
  font-weight: 600;
  color: #6e6e73;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pig-score-total {
  font-size: 28px;
  font-weight: 800;
  font-family: 'League Spartan', system-ui, sans-serif;
  line-height: 1.1;
  margin-top: 2px;
}

.pig-score-togo {
  font-size: 11px;
  color: #6e6e73;
  margin-top: 2px;
}

.pig-dice-area {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 16px 0;
  min-height: 100px;
}

.pig-pot-display {
  text-align: center;
  padding: 12px;
  background: #f8f8fb;
  border-radius: 10px;
  margin: 8px 0 16px;
  font-family: 'League Spartan', system-ui, sans-serif;
}

.pig-pot-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #6e6e73;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pig-pot-value {
  display: block;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 2px;
}

.pig-last-action {
  text-align: center;
  font-size: 14px;
  color: #444;
  min-height: 1.2em;
  margin: 8px 0;
}

.pig-spectator {
  background: #fff8e1;
  border: 1px solid #f4d28a;
  color: #5d4500;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
  margin-top: 12px;
}

/* ===== Won screen ====================================================== */

.pig-won-trophy {
  font-size: 48px;
  text-align: center;
  margin: 8px 0;
}

.pig-won-winner {
  text-align: center;
  font-family: 'League Spartan', system-ui, sans-serif;
  font-weight: 800;
  font-size: 26px;
  margin: 0 0 6px;
}

.pig-won-score {
  text-align: center;
  color: #6e6e73;
  margin: 0 0 16px;
}

/* ===== Host details ==================================================== */

.pig-host-more {
  margin-top: 12px;
  border-top: 1px solid #f1f1f4;
  padding-top: 12px;
}

.pig-host-more summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #6e6e73;
  padding: 4px 0;
}

.pig-host-warning {
  font-size: 13px;
  color: #6e6e73;
  margin: 8px 0;
}

.pig-host-roster-label {
  font-size: 13px;
  color: #6e6e73;
  margin: 8px 0 4px;
}

/* ===== Fallback (no platform context) ================================== */

#pig-platform-required {
  max-width: 600px;
  margin: 40px auto;
  padding: 24px;
  text-align: center;
}
