:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --ink: #172033;
  --muted: #667085;
  --panel: #ffffff;
  --line: #dde3ee;
  --accent: #0f8b8d;
  --accent-dark: #087275;
  --success: #168a4a;
  --danger: #c43d35;
  --shadow: 0 18px 50px rgba(36, 48, 75, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top left, rgba(15, 139, 141, 0.12), transparent 34rem),
    linear-gradient(135deg, #f6f7fb 0%, #eef3f8 100%);
}

button {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  margin-bottom: 24px;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.brand img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 8px 18px rgba(36, 48, 75, 0.14);
}

.eyebrow,
.label {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.label {
  margin-bottom: 8px;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.2rem, 5vw, 4.7rem);
}

h1 span {
  color: var(--accent-dark);
}

.stats-grid {
  display: grid;
  grid-template-columns: minmax(118px, auto) repeat(2, 92px);
  gap: 10px;
}

.stat {
  min-width: 0;
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(36, 48, 75, 0.08);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.game-panel {
  padding: 26px;
  border: 1px solid rgba(221, 227, 238, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.menu-panel {
  padding: 26px;
  border: 1px solid rgba(221, 227, 238, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.mode-card {
  display: grid;
  min-height: 210px;
  padding: 22px;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.mode-card:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 139, 141, 0.55);
  box-shadow: 0 16px 34px rgba(36, 48, 75, 0.14);
}

.mode-card span {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mode-card strong {
  align-self: center;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.02;
}

.mode-card small {
  align-self: end;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
}

.level-row {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.progress-shell {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #f4b942);
  transition: width 220ms ease;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.choice-card {
  position: relative;
  display: grid;
  min-height: 210px;
  padding: 18px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.choice-card:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: rgba(15, 139, 141, 0.55);
  box-shadow: 0 16px 34px rgba(36, 48, 75, 0.14);
}

.choice-card:disabled {
  cursor: default;
}

.choice-card.correct {
  border-color: var(--success);
  background: #f0fbf5;
}

.choice-card.incorrect {
  border-color: var(--danger);
  background: #fff4f3;
}

.choice-card img {
  width: min(100%, 280px);
  height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(23, 32, 51, 0.13));
}

.feedback-row {
  display: flex;
  min-height: 48px;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
}

.feedback-row p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.primary-button,
.secondary-button {
  min-width: 118px;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  color: #ffffff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #ffffff;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding: 24px 0;
  }

  .topbar,
  .level-row {
    grid-template-columns: 1fr;
  }

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

  .game-panel,
  .menu-panel {
    padding: 16px;
  }

  .brand img {
    width: 56px;
    height: 56px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .mode-card {
    min-height: 150px;
  }

  .choice-card {
    min-height: 160px;
  }

  .choice-card img {
    height: 108px;
  }

  .feedback-row {
    align-items: stretch;
    flex-direction: column;
  }
}
