.screen { display: none; }
.screen.active { display: block; }

/* ---- Check-Screen (Spieltag-Check) ---- */
#screen-check { min-height: 100vh; justify-content: center; align-items: flex-start; padding: 32px 16px 64px; }
#screen-check.active { display: flex; }
#screen-check .phone { width: 100%; max-width: 440px; }
#screen-check header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
#screen-check .meta { font-size: 12.5px; font-weight: 600; color: var(--muted); }
#screen-check h1 { font-size: 21px; font-weight: 800; margin: 14px 0 2px; }
#screen-check .sub { font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 18px; }
#screen-check .card { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 16px 18px; margin-bottom: 14px; }
#screen-check .card h2 { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
#screen-check .pupil { display: flex; align-items: center; justify-content: space-between; padding: 11px 4px; border-bottom: 1.5px solid var(--line); font-size: 15px; font-weight: 700; }
#screen-check .pupil:last-child { border-bottom: none; }
#screen-check .pupil.out { color: var(--faint); text-decoration: line-through; }
#screen-check .switch { width: 52px; height: 30px; border-radius: 99px; position: relative; background: var(--accent); cursor: pointer; flex-shrink: 0; }
#screen-check .switch::after { content: ''; position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; }
#screen-check .switch.off { background: var(--chip); }
#screen-check .switch.off::after { right: auto; left: 3px; }
#screen-check .balance-note { background: var(--accent-bg); color: var(--accent-ink); border-radius: 12px; padding: 11px 14px; font-size: 13px; font-weight: 600; line-height: 1.5; margin-bottom: 14px; }
#screen-check .check-error { color: var(--coral-ink); font-weight: 700; font-size: 13px; margin-top: 8px; text-align: center; min-height: 1px; }
#screen-check .teams { display: flex; gap: 12px; }
#screen-check .team { flex: 1; border-radius: 14px; padding: 12px 14px; }
#screen-check .team.a { background: var(--coral-bg); }
#screen-check .team.b { background: var(--teal-bg); }
#screen-check .team h3 { font-size: 14px; font-weight: 800; margin-bottom: 8px; }
#screen-check .team.a h3 { color: var(--coral-ink); }
#screen-check .team.b h3 { color: var(--teal-ink); }
#screen-check .team ul { list-style: none; font-size: 14px; font-weight: 700; }
#screen-check .team.a li { color: var(--coral-ink); }
#screen-check .team.b li { color: var(--teal-ink); }
#screen-check .team li { padding: 4px 0; }
#screen-check .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
#screen-check .actions .btn { width: 100%; padding: 14px; font-size: 16px; }
#screen-check .footnote { text-align: center; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: 12px; }

/* ---- Ready-Screen ---- */
#screen-ready { min-height: 100vh; justify-content: center; align-items: center; text-align: center; padding: 20px; }
#screen-ready.active { display: flex; }
#screen-ready .box { max-width: 480px; }
#screen-ready h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; margin-bottom: 14px; }
#screen-ready p { font-size: 15px; font-weight: 600; color: var(--muted); margin-bottom: 30px; line-height: 1.6; }
#screen-ready .btn { padding: 16px 36px; font-size: 18px; }

/* ---- Play-Screen (Spielansicht) ---- */
#screen-play { min-height: 100vh; padding: 24px clamp(16px, 4vw, 48px); }
#screen-play.active { display: flex; flex-direction: column; }
#screen-play .topbar { display: flex; justify-content: space-between; align-items: center; max-width: min(1500px, 92vw); margin: 0 auto 10px; width: 100%; }
#screen-play .topbar .right { display: flex; gap: 10px; align-items: center; }
#screen-play .round-chip { font-size: 13px; font-weight: 800; color: var(--muted); background: var(--chip); border-radius: 99px; padding: 6px 14px; }
#screen-play .end-btn { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 13px; background: transparent; color: var(--faint); border: 2px solid var(--line); border-radius: 99px; padding: 6px 14px; cursor: pointer; }
#screen-play .end-btn:hover { color: var(--muted); border-color: var(--faint); }
#screen-play .stage { width: 100%; max-width: min(1500px, 92vw); margin: 0 auto; flex: 1; display: flex; flex-direction: column; justify-content: center; }

#screen-play .scoreline { display: flex; justify-content: center; align-items: center; gap: 22px; margin: 8px 0 16px; }
#screen-play .scorebox { border-radius: 16px; padding: 10px 28px; text-align: center; }
#screen-play .scorebox .t { font-size: 15px; font-weight: 800; }
#screen-play .scorebox .s { font-size: clamp(34px, 5.5vw, 90px); font-weight: 800; line-height: 1.1; }
#screen-play .scorebox.a { background: var(--coral-bg); }
#screen-play .scorebox.a .t { color: var(--coral-ink); }
#screen-play .scorebox.a .s { color: var(--coral); }
#screen-play .scorebox.b { background: var(--teal-bg); }
#screen-play .scorebox.b .t { color: var(--teal-ink); }
#screen-play .scorebox.b .s { color: var(--teal); }
#screen-play .colon { font-size: 28px; font-weight: 800; color: var(--faint); }

#screen-play .fieldwrap { width: 100%; margin-bottom: 8px; }
#screen-play svg.field { width: 100%; display: block; }

#screen-play .duel { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 18px 0 6px; }
#screen-play .duel .pill { border-radius: 99px; padding: 10px 30px; font-weight: 800; font-size: clamp(20px, 3.2vw, 56px); }
#screen-play .duel .pill.a { background: var(--coral-bg); color: var(--coral-ink); }
#screen-play .duel .pill.b { background: var(--teal-bg); color: var(--teal-ink); }
#screen-play .duel .vs { font-size: 16px; font-weight: 700; color: var(--muted); }

#screen-play .content { text-align: center; min-height: 210px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; }
#screen-play .prompt-label { font-size: 15px; font-weight: 800; color: var(--muted); letter-spacing: 0.5px; }
#screen-play .bigcard {
  background: var(--card); border: 2px solid var(--line); border-radius: 20px;
  padding: clamp(18px, 3vw, 40px) clamp(30px, 6vw, 90px);
  font-size: clamp(30px, 6vw, 96px); font-weight: 800; max-width: 90%;
}
#screen-play .bigcard.answer { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-ink); }

#screen-play .controls { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
#screen-play .controls .btn { padding: 14px 32px; font-size: 17px; }
#screen-play .keyhint { text-align: center; font-size: 12.5px; font-weight: 600; color: var(--faint); margin-top: 14px; }

.goal-overlay {
  position: fixed; inset: 0; display: none;
  justify-content: center; align-items: center;
  background: rgba(245, 247, 242, 0.9); z-index: 50;
}
.goal-overlay.show { display: flex; }
.goal-overlay .msg { font-size: clamp(50px, 10vw, 160px); font-weight: 800; animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); text-align: center; line-height: 1.15; }
.goal-overlay .msg small { display: block; font-size: 0.35em; color: var(--muted); }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---- End-Screen ---- */
#screen-end { text-align: center; position: relative; min-height: 100vh; overflow: hidden; }
#screen-end.active { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 4vh 20px; }
#screen-end .trophy { width: clamp(110px, 16vw, 260px); margin: 0 auto 4px; opacity: 0; transform: scale(0.4) translateY(24px); }
#screen-end.play .trophy { animation: rise 0.75s cubic-bezier(0.2, 1.5, 0.4, 1) 0.15s forwards; }
#screen-end h2 { font-size: clamp(34px, 6.5vw, 96px); font-weight: 800; margin-bottom: 4px; opacity: 0; }
#screen-end .final { font-size: clamp(44px, 9vw, 140px); font-weight: 800; margin: 8px 0 22px; opacity: 0; }
#screen-end.play h2 { animation: fadeup 0.5s ease 0.55s forwards; }
#screen-end.play .final { animation: fadeup 0.5s ease 0.75s forwards; }
#screen-end .winners { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 0 auto 28px; max-width: 700px; }
#screen-end .wpill { border-radius: 99px; padding: 10px 26px; font-weight: 800; font-size: clamp(17px, 2.6vw, 34px); opacity: 0; }
#screen-end .wpill.a { background: var(--coral-bg); color: var(--coral-ink); }
#screen-end .wpill.b { background: var(--teal-bg); color: var(--teal-ink); }
#screen-end.play .wpill { animation: fadeup 0.45s ease forwards; }
#screen-end .endnote { font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 22px; opacity: 0; }
#screen-end.play .endnote, #screen-end.play .btn { animation: fadeup 0.5s ease 1.6s forwards; }
#screen-end .btn { opacity: 0; padding: 14px 32px; font-size: 16px; }
@keyframes rise { to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes fadeup { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.confetti {
  position: absolute; top: -24px; border-radius: 3px; opacity: 0;
  animation-name: fall; animation-timing-function: linear; animation-fill-mode: forwards;
}
@keyframes fall {
  0% { opacity: 0; transform: translateY(0) rotate(0deg); }
  6% { opacity: 1; }
  88% { opacity: 1; }
  100% { opacity: 0; transform: translateY(82vh) rotate(520deg); }
}

@media (prefers-reduced-motion: reduce) {
  .goal-overlay .msg, #screen-end.play .trophy, #screen-end.play h2, #screen-end.play .final,
  #screen-end.play .wpill, #screen-end.play .endnote, #screen-end.play .btn { animation: none; opacity: 1; transform: none; }
  .confetti { display: none; }
}
