/* tv.css — styling for the TV client.
   The TV client is meant to be shown on a large screen in front of a group of
   players, so we lean into a bright, kid-friendly look with generous sizing. */

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #1a3008;
  background:
    radial-gradient(circle at 25% 15%, rgba(255, 255, 255, .45), transparent 28%),
    linear-gradient(145deg, #c8f4d0, #77bd88 60%, #4f8b62);
  overflow: hidden;
}

#app { width: 100%; height: 100%; }

/* Each <section.screen> fills the viewport. We hide the inactive ones
   via the [hidden] attribute, which the JS toggles when transitioning. */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.screen[hidden] { display: none; }

/* ---------- Lobby screen ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.brand h1 {
  font-size: 64px;
  margin: 0;
  letter-spacing: -1px;
  color: #1a3008;
  text-shadow: 0 4px 0 rgba(255,255,255,.4);
}
.brand-eye { font-size: 60px; line-height: 1; }

.lobby-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 1400px;
  width: 100%;
}

.qr-card, .countdown-card {
  background: rgba(255, 255, 255, .35);
  border: 2px solid rgba(255, 255, 255, .65);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(20, 70, 30, .22);
  backdrop-filter: blur(6px);
}

.qr-card { text-align: center; }
.qr-card h2, .countdown-card h2 {
  margin: 0 0 14px;
  font-size: 28px;
  color: #14411f;
}
#qr-canvas {
  background: white;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.join-url { color: rgba(20, 50, 25, .82); margin: 12px 0 4px; word-break: break-all; font-size: 16px; }
.game-code { font-size: 20px; margin: 8px 0 0; }
.game-code strong {
  font-size: 28px;
  letter-spacing: 1px;
  background: rgba(255,255,255,.6);
  padding: 4px 14px;
  border-radius: 12px;
  color: #14411f;
}

.countdown-card { display: flex; flex-direction: column; }
.countdown-number {
  font-size: 180px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  margin: 16px 0 8px;
  color: #14411f;
  text-shadow: 0 6px 0 rgba(255,255,255,.5);
  /* When the number gets pulsed we use a CSS animation for a tiny "tick". */
  transition: transform .15s ease-out;
}
.countdown-number.tick { transform: scale(1.12); }

.countdown-hint {
  text-align: center;
  font-size: 18px;
  margin: 0 0 18px;
  color: rgba(20, 50, 25, .85);
}

.players-roster h3 {
  margin: 12px 0 8px;
  font-size: 22px;
  color: #14411f;
}
#players-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}
#players-list li {
  background: rgba(255,255,255,.55);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #14411f;
  display: flex;
  align-items: center;
  gap: 8px;
}
#players-list li .team-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
#players-list li .team-dot.green { background: #5da72a; }
#players-list li .team-dot.red   { background: #c8412b; }

/* ---------- Starting screen ---------- */
.starting-title {
  font-size: 130px;
  margin: 0;
  color: #14411f;
  text-shadow: 0 8px 0 rgba(255,255,255,.5);
}
.starting-sub {
  font-size: 36px;
  color: #14411f;
}
#starting-countdown { font-weight: 800; font-size: 60px; }

/* ---------- Game screen ---------- */
.hud {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  background: rgba(255,255,255,.4);
  border-radius: 16px;
  padding: 12px 18px;
  box-shadow: 0 8px 24px rgba(20,70,30,.18);
  z-index: 10;
}
.hud-block { display: flex; flex-direction: column; align-items: center; min-width: 70px; }
.hud-block-wide { min-width: 200px; }
.hud-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: rgba(20,50,25,.7); }
.hud-value { font-size: 22px; font-weight: 700; color: #14411f; }

.board-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
#board {
  background:
    radial-gradient(circle at 12% 10%, rgba(255,255,255,.6), transparent 30%),
    linear-gradient(145deg, #d6f0db, #9ed5ab 60%, #6fae84);
  border-radius: 28px;
  border: 10px solid rgba(255,255,255,.65);
  box-shadow: 0 28px 70px rgba(20, 70, 30, .35);
  max-width: 92vw;
  max-height: 82vh;
}

/* ---------- Finished screen ---------- */
.finish-title {
  font-size: 110px;
  margin: 0 0 16px;
  color: #14411f;
  text-shadow: 0 6px 0 rgba(255,255,255,.5);
}
.finish-sub { font-size: 32px; margin: 0 0 30px; color: #14411f; }
.big-btn {
  font-size: 24px;
  padding: 16px 36px;
  border: 0;
  border-radius: 999px;
  background: #246b38;
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
}
.big-btn:hover { background: #1c5a2d; }
