/* Team-iPad — bewusst minimal, aber nicht absichtlich haesslich.
   Ziel: Layout, Touchgroessen, Typografie und Standalone-Verhalten sind auf
   echter Hardware bereits beurteilbar. Das finale Design folgt spaeter. */

:root {
  --bg: #0b1020;
  --surface: #161d33;
  --surface-hi: #1e2745;
  --line: #2a3455;
  --text: #eef2ff;
  --muted: #9aa7c7;
  --accent: #4f7cff;
  --good: #2fbf71;
  --bad: #e0555a;
  --warn: #e8a33d;
  --radius: 16px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.45;
  /* Textauswahl waehrend einer Frage ist nur stoerend. */
  -webkit-user-select: none;
  user-select: none;
}

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  gap: 16px;
}

.boot {
  margin: auto;
  color: var(--muted);
}

/* --- Kopfzeile ---------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
}

.team {
  font-weight: 600;
  font-size: 20px;
}

.team small {
  display: block;
  font-weight: 400;
  font-size: 14px;
  color: var(--muted);
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}
.dot.online {
  background: var(--good);
}
.dot.offline {
  background: var(--bad);
}
.dot.connecting {
  background: var(--warn);
}

.score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 22px;
}

/* --- Karten -------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.center {
  margin: auto;
  text-align: center;
  max-width: 680px;
}

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

.prompt {
  font-size: clamp(22px, 3.2vw, 34px);
  font-weight: 650;
  line-height: 1.25;
  margin: 0 0 24px;
}

/* --- Antwortkacheln ------------------------------------------------------ */

.options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 700px) {
  .options {
    grid-template-columns: 1fr;
  }
}

.option {
  /* Mindestens 88 px hoch: sicher treffbar, auch mit Fettfingern und im
     Halbdunkeln. Apple empfiehlt 44 pt — auf der Buehne ist das zu wenig. */
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  font-size: 20px;
  font-family: inherit;
  text-align: left;
  color: var(--text);
  background: var(--surface-hi);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  transition:
    transform 0.08s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.option:active {
  transform: scale(0.985);
}

.option .letter {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

.option[data-selected='true'] {
  border-color: var(--accent);
  background: rgba(79, 124, 255, 0.16);
}

.option[data-correct='true'] {
  border-color: var(--good);
  background: rgba(47, 191, 113, 0.16);
}

.option[data-wrong='true'] {
  border-color: var(--bad);
  background: rgba(224, 85, 90, 0.14);
}

.option:disabled {
  opacity: 0.75;
}

/* --- Timer und Fusszeile ------------------------------------------------- */

.footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 15px;
}

.timer {
  font-variant-numeric: tabular-nums;
  font-size: 40px;
  font-weight: 700;
  color: var(--text);
}

.timer.urgent {
  color: var(--warn);
}

.pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-hi);
  border: 1px solid var(--line);
  font-size: 15px;
}

.pill.sending {
  color: var(--warn);
  border-color: var(--warn);
}
.pill.saved {
  color: var(--good);
  border-color: var(--good);
}
.pill.error {
  color: var(--bad);
  border-color: var(--bad);
}

.result {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 8px;
}
.result.good {
  color: var(--good);
}
.result.bad {
  color: var(--bad);
}

/* Verbindungsverlust legt sich ueber alles — das Team soll nicht in eine
   tote Oberflaeche tippen. */
.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(11, 16, 32, 0.92);
  text-align: center;
  padding: 24px;
  z-index: 10;
}
