/* Player-facing Round view — Variant A ("departures board"), spec §7.1.
   Ported from prototypes/player-round-view-prototype.html <style> — Variant A
   rules only (shared court card, empty states, flash, new-round pill), plus a
   reconnecting indicator. Variants B/C, the switcher and the dev strip are not
   ported. */

:root {
  --ink: #1c1c1e;
  --dim: #6b6b70;
  --faint: #9a9aa0;
  --line: #e3e3e6;
  --bg: #fbfbf9;
  --accent: #2f6f4f;
  --flash: #fff6cc;
  --warn-bg: #fff4e0;
  --warn-line: #e0a94a;
  --warn-ink: #8a5a00;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  font:
    15px/1.5 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}

[hidden] {
  display: none !important;
}

h1 {
  font-size: 21px;
  margin: 0 0 2px;
}

h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  margin: 0 0 8px;
}

.dim {
  color: var(--dim);
}

.faint {
  color: var(--faint);
}

/* ---------- grade chips ---------- */
.grade {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 6px;
  font-size: 10.5px;
  line-height: 16px;
  color: var(--dim);
  background: #fff;
  white-space: nowrap;
  vertical-align: middle;
}
.g80 {
  border-color: #7fae8f;
  color: #2f6f4f;
  background: #eef5f0;
}
.g70 {
  border-color: #9ab6cf;
  color: #33627e;
  background: #eef3f7;
}
.g60 {
  border-color: #cbb488;
  color: #7a5a1e;
  background: #f7f2e6;
}
.g50 {
  border-color: #cfa0a0;
  color: #8a3b3b;
  background: #f7ecec;
}

/* ---------- layout ---------- */
.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 14px 24px;
}
.empty {
  max-width: 480px;
  margin: 12vh auto 0;
  text-align: center;
  padding: 0 22px 24px;
}
.empty .big {
  font-size: 40px;
  margin-bottom: 10px;
}
.empty h1 {
  font-size: 22px;
}
.empty p {
  color: var(--dim);
}
.empty .checkedin {
  margin: 18px 0 14px;
}

/* ---------- new-round flash + pill ---------- */
@keyframes flash {
  from {
    background: var(--flash);
  }
  to {
    background: transparent;
  }
}
.flashing {
  animation: flash 1.4s ease-out;
}
.newpill {
  position: fixed;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  z-index: 70;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.newpill.show {
  opacity: 1;
}
.updated {
  font-size: 12px;
  color: var(--faint);
}

/* ---------- reconnecting indicator (hidden while connected) ---------- */
.reconnecting {
  position: fixed;
  right: 12px;
  bottom: 12px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn-ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  z-index: 60;
}

/* ---------- shared court card ---------- */
.court {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 10px 12px;
}
.court-h {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
}
.court-h b {
  font-size: 14px;
}
.court-players {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}
.plr {
  font-size: 14px;
  white-space: nowrap;
}

/* ---------- A: departures board ---------- */
.A-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 4px;
}
.A-round {
  font-size: 26px;
  font-weight: 700;
}
.A-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.A-grid .court {
  padding: 11px 12px;
}
.A-grid .plr {
  font-size: 15px;
}
.A-rest {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.A-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.A-cloud .chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 13px;
  background: #fff;
}
@media (max-width: 460px) {
  .A-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- round history (ADR-0010) ---------- */
.A-history {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.A-history h2 {
  font-size: 15px;
  margin: 0 0 10px;
}
.history-round {
  margin-bottom: 18px;
}
.history-round:last-child {
  margin-bottom: 0;
}
.history-round-h {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}
