:root {
  color-scheme: dark;
  --bg: #08120b;
  --bg2: #102317;
  --panel: #132b1b;
  --panel2: #1a3823;
  --soft: rgba(255, 255, 255, 0.08);
  --soft-2: rgba(255, 255, 255, 0.12);
  --text: #f4fff4;
  --muted: #c9e7cd;
  --gold: #ffd76a;
  --green: #7dff95;
  --green-2: #39d16d;
  --accent: #8ef7b0;
  --danger: #ff9f9f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at top, rgba(125, 255, 149, 0.18), transparent 35%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100%;
}

body {
  min-height: 100vh;
}

.page-shell {
  width: min(1120px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

.hero {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border: 1px solid var(--soft);
  border-radius: 28px;
  padding: 22px 20px;
  box-shadow: var(--shadow);
}

.hero-badge {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 215, 106, 0.14);
  border: 1px solid rgba(255, 215, 106, 0.35);
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 12px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.05;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.game-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 18px;
  margin-top: 18px;
}

.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--soft);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.player-select {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.player-select label {
  font-weight: 700;
}

select {
  background: #0d1a11;
  color: var(--text);
  border: 1px solid var(--soft-2);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 1rem;
}

.primary-btn,
.secondary-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  background: linear-gradient(180deg, #ffd76a, #ffbf2f);
  color: #1b1500;
}

.secondary-btn {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid var(--soft-2);
}

.status-card,
.trail-card,
.question-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--soft);
  border-radius: 20px;
  padding: 16px;
}

.status-card {
  margin-bottom: 16px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.status-row:last-child {
  border-bottom: none;
}

.trail-card h2,
.question-card h2 {
  margin-top: 0;
}

.trail {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.step {
  min-height: 82px;
  border-radius: 18px;
  border: 1px solid var(--soft);
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 0.92rem;
  line-height: 1.2;
  position: relative;
}

.step.done {
  background: linear-gradient(180deg, rgba(57,209,109,0.26), rgba(57,209,109,0.12));
  border-color: rgba(125,255,149,0.4);
}

.step.current {
  outline: 3px solid rgba(255,215,106,0.65);
  transform: translateY(-2px);
}

.step.goal {
  background: linear-gradient(180deg, rgba(255,215,106,0.24), rgba(255,215,106,0.08));
  border-color: rgba(255,215,106,0.35);
}

.step .icon {
  display: block;
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.trail-note,
.small-note {
  color: var(--muted);
}

.question-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.category-badge,
.question-number {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--soft-2);
  font-size: 0.92rem;
  font-weight: 700;
}

.choices {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.choice-btn {
  width: 100%;
  text-align: left;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--soft-2);
  border-radius: 14px;
  padding: 14px 14px;
  font-size: 1rem;
  cursor: pointer;
}

.choice-btn:hover {
  background: rgba(255,255,255,0.1);
}

.choice-btn.correct {
  background: rgba(57, 209, 109, 0.2);
  border-color: rgba(125,255,149,0.5);
}

.choice-btn.wrong {
  background: rgba(255, 120, 120, 0.15);
  border-color: rgba(255,159,159,0.4);
}

.feedback {
  min-height: 28px;
  margin-top: 14px;
  font-weight: 700;
}

.feedback.good {
  color: var(--green);
}

.feedback.bad {
  color: var(--danger);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.legend {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

.dot.current {
  background: var(--gold);
}

.dot.done {
  background: var(--green-2);
}

.dot.goal {
  background: #ffe38e;
}

.footer {
  text-align: center;
  color: var(--muted);
  padding-top: 16px;
  font-size: 0.95rem;
}

.hidden {
  display: none !important;
}

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

  .trail {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100vw - 14px, 100%);
    padding-top: 10px;
  }

  .hero,
  .panel {
    padding: 14px;
    border-radius: 20px;
  }

  .trail {
    grid-template-columns: repeat(2, 1fr);
  }

  .step {
    min-height: 74px;
    font-size: 0.88rem;
  }
}