/**
 * Spelarvy — mobil-first, vertikal, fokus på en sak åt gången.
 */

:root {
  --p-bg: #1a1a2e;
  --p-bg-2: #2a2a48;
  --p-text: #ffffff;
  --p-muted: #aab1c4;
  --p-accent: #4cc2ff;
  --p-success: #5dd693;
  --p-danger: #ff5c5c;
  --p-warn: #ffc857;
  --p-choice-1: #e74c3c;
  --p-choice-2: #3498db;
  --p-choice-3: #f39c12;
  --p-choice-4: #2ecc71;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--p-bg);
  color: var(--p-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

.play__main {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

[hidden] { display: none !important; }

/* ========== Screens ========== */

.play-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.75rem;
  padding: 1rem;
}
.play-screen h1, .play-screen h2 {
  margin: 0;
  font-weight: 700;
}
.play-screen h1 { font-size: 2rem; }
.play-screen h2 { font-size: 1.5rem; }
.play__brand {
  font-size: 0.95rem;
  color: var(--p-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
}
.muted { color: var(--p-muted); }
.play__status-icon {
  font-size: 5rem;
  line-height: 1;
}
.play__lobby-countdown {
  margin: 1.5rem 0;
  text-align: center;
}
.play__lobby-countdown-num {
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1;
  margin: 0.25rem 0;
  color: var(--p-accent, #6acdff);
}
.play__get-ready-heading {
  font-size: 2.75rem;
  margin: 1rem 0 0 0;
  text-align: center;
}
.play__intro-num {
  font-size: 12rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  color: var(--p-accent, #6acdff);
}

/* ========== Nickname-form ========== */

#nickname-form {
  width: 100%;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}
#nickname-input {
  background: var(--p-bg-2);
  color: var(--p-text);
  border: 2px solid var(--p-bg-2);
  border-radius: 0.75rem;
  padding: 1rem;
  font-size: 1.25rem;
  font: inherit;
  font-size: 1.25rem;
  outline: none;
  text-align: center;
}
#nickname-input:focus { border-color: var(--p-accent); }
.btn-primary {
  background: var(--p-accent);
  color: #0a1620;
  border: none;
  border-radius: 0.75rem;
  padding: 1rem;
  font: inherit;
  font-weight: 700;
  font-size: 1.15rem;
  cursor: pointer;
}
.btn-primary:active { transform: scale(0.98); }
.play__error {
  color: var(--p-danger);
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
}

/* ========== Answer-screen ========== */

.play-screen--answer {
  justify-content: flex-start;
  padding-top: 0;
}
.play__qmeta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  color: var(--p-muted);
  padding: 0.75rem 0.5rem;
}
.play__countdown {
  font-weight: 700;
  color: var(--p-warn);
  font-size: 1.5rem;
}
.play__question {
  font-size: 1.4rem;
  margin: 0.5rem 0 1rem 0;
  text-align: center;
  line-height: 1.3;
}
.play__choices {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 1rem;
}
.play-choice {
  border: none;
  border-radius: 1rem;
  padding: 1.25rem 0.75rem;
  font: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--p-text);
  min-height: 8rem;
  cursor: pointer;
  text-align: center;
  word-break: break-word;
}
.play-choice--1 { background: var(--p-choice-1); }
.play-choice--2 { background: var(--p-choice-2); }
.play-choice--3 { background: var(--p-choice-3); }
.play-choice--4 { background: var(--p-choice-4); }
.play-choice:active:not(:disabled) { transform: scale(0.97); }
.play-choice:disabled { opacity: 0.45; cursor: default; }
.play-choice.is-selected {
  outline: 4px solid var(--p-accent);
  opacity: 1;
}
.play__waiting {
  color: var(--p-muted);
  margin-top: 1rem;
  font-style: italic;
}

/* ========== Reveal ========== */

.play-screen--reveal h2 {
  font-size: 2rem;
}
.play__reveal-points {
  font-size: 1.5rem;
  color: var(--p-warn);
  font-weight: 700;
  margin: 0;
}

/* ========== Leaderboard / podium / finished ========== */

.play__rank-line {
  font-size: 1.5rem;
  margin: 0.25rem 0;
}
.play__score-line {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--p-warn);
  margin: 0;
}

/* ========== Connection banner ========== */

.conn-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--p-bg-2);
  color: var(--p-text);
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.95rem;
  border-bottom: 3px solid var(--p-accent);
  z-index: 10;
}
.conn-banner--warn { border-bottom-color: var(--p-warn); }
.conn-banner--error { border-bottom-color: var(--p-danger); }
