:root {
  --bg: #eef7ff;
  --bg-2: #f8fbff;
  --card: rgba(255, 255, 255, 0.82);
  --card-strong: rgba(255, 255, 255, 0.94);
  --text: #12304f;
  --muted: #5f7896;
  --line: rgba(24, 84, 148, 0.12);
  --blue: #3f86e8;
  --blue-deep: #195fbf;
  --yellow: #ffd857;
  --yellow-deep: #f4bf17;
  --green: #32b86d;
  --red: #ef5f6c;
  --shadow: 0 18px 50px rgba(26, 90, 164, 0.14);
  --radius: 26px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(99, 175, 255, 0.25), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 216, 87, 0.22), transparent 25%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  min-height: 100vh;
}
button { font: inherit; }

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 24px;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(63, 134, 232, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 134, 232, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(40px);
  opacity: .55;
  pointer-events: none;
}
.orb-1 {
  width: 260px;
  height: 260px;
  background: rgba(63, 134, 232, 0.22);
  top: 70px;
  right: -40px;
}
.orb-2 {
  width: 220px;
  height: 220px;
  background: rgba(255, 216, 87, 0.28);
  bottom: 80px;
  left: -30px;
}

.topbar,
.game-frame {
  position: relative;
  z-index: 2;
}

.topbar {
  max-width: 1180px;
  margin: 0 auto 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--blue-deep);
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(225,240,255,.95));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.7);
}

.topbar h1, .hero-card h2, .feedback-card h2, .results-card h2, .study-card h2, .case-card h2 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--blue-deep);
  font-weight: 800;
}

.glass-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.7);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.game-frame {
  max-width: 1180px;
  margin: 0 auto;
}

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

.hero-card,
.feedback-card,
.results-card,
.study-card {
  padding: 30px;
}

.hero-card {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 22px;
  min-height: 70vh;
  align-items: stretch;
}

.hero-copy,
.hero-panel {
  display: flex;
  flex-direction: column;
}

.hero-copy { justify-content: center; }
.hero-text {
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.7;
  max-width: 60ch;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 26px 0;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.choice-btn {
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, opacity .18s ease;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  padding: 14px 20px;
  font-weight: 700;
}
.primary-btn {
  color: #12304f;
  background: linear-gradient(135deg, var(--yellow), #ffe993);
  box-shadow: 0 10px 22px rgba(244, 191, 23, 0.28);
}
.secondary-btn {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
}
.ghost-btn {
  color: var(--blue-deep);
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(63,134,232,.16);
}
.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.choice-btn:hover {
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.stat-pill,
.mini-panel,
.feedback-box,
.study-item,
.result-stat,
.hud,
.case-card,
.choices-panel {
  background: var(--card-strong);
  border: 1px solid var(--line);
}
.stat-pill {
  border-radius: 18px;
  padding: 14px 16px;
  min-width: 110px;
}
.stat-number {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
}
.stat-label {
  color: var(--muted);
  font-size: .9rem;
}
.hero-panel {
  justify-content: center;
  gap: 16px;
}
.mini-panel {
  border-radius: 24px;
  padding: 20px;
}
.pulse-panel {
  background: linear-gradient(135deg, rgba(63,134,232,.15), rgba(255,216,87,.18));
}
.mini-label,
.box-label {
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .76rem;
  font-weight: 800;
  color: var(--blue-deep);
}
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-cloud span,
.badge-pill {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .86rem;
  font-weight: 700;
  background: rgba(63,134,232,.1);
  color: var(--blue-deep);
}

.hud {
  padding: 16px 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
  border-radius: 24px;
}
.hud-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hud-block.grow { min-width: 0; }
.hud-label { color: var(--muted); font-size: .82rem; }
.meter-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(63,134,232,.1);
  overflow: hidden;
}
.meter-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--yellow), var(--blue));
  border-radius: 999px;
  transition: width .25s ease;
}

.case-layout {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  gap: 18px;
}
.case-card,
.choices-panel {
  padding: 24px;
  border-radius: 26px;
}
.case-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
  background: rgba(63,134,232,.09);
  color: var(--blue-deep);
}
.badge.difficulty.easy { background: rgba(50,184,109,.12); color: #197647; }
.badge.difficulty.medium { background: rgba(255,216,87,.18); color: #8a6700; }
.badge.difficulty.hard { background: rgba(239,95,108,.12); color: #a72a36; }
.case-prompt {
  color: var(--text);
  line-height: 1.8;
  font-size: 1.02rem;
}
.tone-chip {
  display: inline-flex;
  margin-top: 20px;
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(63,134,232,.12), rgba(255,216,87,.16));
  font-weight: 700;
}
.choices-head h3 { margin: 0; }
.choices-head p { color: var(--muted); margin-top: 6px; }
.choices-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.choice-btn {
  text-align: left;
  min-height: 138px;
  padding: 18px;
  background: white;
  border: 1px solid rgba(63,134,232,.12);
  box-shadow: 0 10px 24px rgba(24, 84, 148, 0.08);
}
.choice-btn strong {
  display: block;
  line-height: 1.45;
  color: var(--text);
}
.choice-top {
  display: inline-block;
  margin-bottom: 10px;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--blue-deep);
  font-weight: 800;
}
.choice-btn.correct {
  background: linear-gradient(180deg, rgba(50,184,109,.13), white);
  border-color: rgba(50,184,109,.38);
}
.choice-btn.wrong {
  background: linear-gradient(180deg, rgba(239,95,108,.12), white);
  border-color: rgba(239,95,108,.38);
}
.choice-btn:disabled { cursor: default; opacity: 1; }

.feedback-card,
.results-card,
.study-card {
  max-width: 980px;
  margin: 0 auto;
}
.feedback-burst {
  display: inline-flex;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  margin-bottom: 14px;
}
.feedback-burst.correct { background: rgba(50,184,109,.14); color: #197647; }
.feedback-burst.wrong { background: rgba(239,95,108,.14); color: #a72a36; }
.feedback-summary { color: var(--muted); font-size: 1rem; }
.feedback-grid,
.results-panels,
.howto-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}
.feedback-box,
.result-stat,
.study-item {
  padding: 18px;
  border-radius: 22px;
}
.feedback-actions { margin-top: 24px; }

.results-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}
.result-stat span { color: var(--muted); display: block; margin-bottom: 10px; }
.result-stat strong { font-size: 1.7rem; }
.badges-list,
.strength-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.strength-item {
  min-width: 110px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(63,134,232,.08);
  color: var(--blue-deep);
  font-weight: 700;
}
.empty-note { color: var(--muted); }

.study-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.study-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.study-chip {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,216,87,.25);
  font-weight: 800;
  color: #8a6700;
}
.study-meta {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.study-meta div {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(63,134,232,.06);
}
.study-meta span { display: block; color: var(--muted); margin-bottom: 5px; font-size: .88rem; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 28, 50, 0.42);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 30;
}
.modal-overlay.hidden { display: none; }
.modal-card {
  width: min(860px, 100%);
  padding: 26px;
}

@media (max-width: 960px) {
  .hero-card,
  .case-layout,
  .feedback-grid,
  .results-panels,
  .howto-grid,
  .study-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 700px) {
  .page-shell { padding: 14px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .hero-card,
  .feedback-card,
  .results-card,
  .study-card,
  .case-card,
  .choices-panel,
  .modal-card {
    padding: 20px;
  }
  .hero-card { min-height: auto; }
  .choices-grid,
  .results-stats,
  .hud {
    grid-template-columns: 1fr;
  }
  .hero-actions { flex-direction: column; }
  .primary-btn,
  .secondary-btn,
  .ghost-btn {
    width: 100%;
  }
}
