/* ============================================================
   PANDA KICK — DESIGN SYSTEM
   ============================================================ */

:root {
  /* Backgrounds */
  --bg:           #0B0F14;
  --surface:      #141A22;
  --surface-alt:  #1C242E;
  --border:       #2A3441;

  /* Text */
  --text:         #F5F7FA;
  --text-dim:     #8A97A6;

  /* Brand */
  --mint:         #00E0A4;
  --mint-deep:    #00B584;
  --purple:       #7C5CFF;
  --orange:       #FF7A3D;

  /* Feedback */
  --correct:      #22C55E;
  --wrong:        #EF4444;
  --gold:         #F5C542;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  font-weight: 500;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* ============================================================
   SCREENS
   ============================================================ */

.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: 24px 20px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
}
.screen.active { display: flex; }

/* ============================================================
   PITCH BACKGROUND (subtle football lines, no green)
   ============================================================ */

.pitch-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.05;
  background-image:
    radial-gradient(circle at 50% 50%, transparent 78px, var(--text) 79px, transparent 80px),
    linear-gradient(to right, var(--text) 0 1px, transparent 1px),
    linear-gradient(to bottom, var(--text) 0 1px, transparent 1px);
  background-size: 200px 200px, 100px 100px, 100px 100px;
  background-position: center center, 0 0, 0 0;
}

/* ============================================================
   HOME SCREEN
   ============================================================ */

.home-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}

.logo-mark {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 24px rgba(0, 224, 164, 0.35));
}

.brand {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--text);
}

.brand::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  margin: 12px auto 0;
  background: linear-gradient(90deg, var(--mint), var(--purple));
  border-radius: 2px;
}

.tagline {
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 12px;
  margin-bottom: 40px;
}

/* Difficulty buttons */

.difficulty-picker {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 340px;
}

.diff-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diff-btn:active {
  transform: scale(0.97);
  background: var(--surface-alt);
}

.diff-btn[data-diff="easy"]:active { border-color: var(--mint); }
.diff-btn[data-diff="pro"]:active  { border-color: var(--orange); }

.diff-label {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
}

.diff-btn[data-diff="easy"] .diff-label { color: var(--mint); }
.diff-btn[data-diff="pro"]  .diff-label { color: var(--orange); }

.diff-sub {
  font-size: 13px;
  color: var(--text-dim);
}

/* Home stats */

.home-stats {
  display: flex;
  gap: 40px;
  margin-top: 48px;
}

.stat { text-align: center; }

.stat-num {
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
}

.stat-lbl {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ============================================================
   GAME SCREEN
   ============================================================ */

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  background: var(--mint);
  color: #001a13;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.5px;
  padding: 5px 10px;
  border-radius: 6px;
}

.diff-switch {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 16px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.diff-switch:active { color: var(--mint); }

.topbar-right {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.score {
  font-size: 22px;
  font-weight: 900;
  color: var(--mint);
}

.score-sep { color: var(--text-dim); font-size: 16px; }

.q-count {
  font-size: 13px;
  color: var(--text-dim);
  margin-left: 6px;
}

/* Progress bar */

.progress-bar {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 4px;
  background: var(--surface-alt);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 28px;
}

.progress-fill {
  height: 100%;
  width: 5%;
  background: linear-gradient(90deg, var(--mint), var(--mint-deep));
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Question */

.question-wrap {
  position: relative;
  z-index: 1;
  margin-bottom: 28px;
}

.category-tag {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--purple);
  margin-bottom: 10px;
}

.question-text {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
}

/* Answers */

.answers {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.answer-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 14px;
}

.answer-btn:active:not(.locked) {
  transform: scale(0.98);
  background: var(--surface-alt);
  border-color: var(--mint);
}

.answer-letter {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.answer-btn.correct {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--correct);
}
.answer-btn.correct .answer-letter {
  background: var(--correct);
  color: #001a0a;
}

.answer-btn.wrong {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--wrong);
}
.answer-btn.wrong .answer-letter {
  background: var(--wrong);
  color: #1a0000;
}

.answer-btn.locked {
  cursor: not-allowed;
}
.answer-btn.locked:not(.correct):not(.wrong) {
  opacity: 0.45;
}

/* Bottom bar */

.bottom-bar {
  position: relative;
  z-index: 1;
  margin-top: 20px;
}

.next-btn {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--mint), var(--mint-deep));
  color: #001a13;
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.2s ease;
}

.next-btn:active:not(:disabled) { transform: scale(0.98); }

.next-btn:disabled {
  background: var(--surface-alt);
  color: var(--text-dim);
  cursor: not-allowed;
}

/* ============================================================
   END SCREEN
   ============================================================ */

.net-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  background-image:
    linear-gradient(to right, var(--text) 1px, transparent 1px),
    linear-gradient(to bottom, var(--text) 1px, transparent 1px);
  background-size: 18px 18px;
}

.end-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.end-label {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--text-dim);
}

.end-score {
  font-size: 72px;
  font-weight: 900;
  color: var(--mint);
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 40px rgba(0, 224, 164, 0.4);
}

.end-msg {
  font-size: 16px;
  color: var(--text-dim);
  margin-bottom: 40px;
}

.end-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.btn-primary {
  padding: 18px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--mint), var(--mint-deep));
  color: #001a13;
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1.5px;
  cursor: pointer;
}
.btn-primary:active { transform: scale(0.98); }

.btn-ghost {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
}
.btn-ghost:active { background: var(--surface); }
