:root {
  --bg-top: #f4efe2;
  --bg-bottom: #dff3ec;
  --panel: rgba(255, 252, 246, 0.88);
  --panel-strong: #fffdf9;
  --line: rgba(24, 41, 54, 0.1);
  --text: #1c2c37;
  --muted: #5e6a73;
  --primary: #11795d;
  --primary-dark: #0a5844;
  --secondary: #ef8f34;
  --accent: #1f9ed3;
  --danger: #d9534f;
  --shadow: 0 22px 50px rgba(28, 44, 55, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(239, 143, 52, 0.2), transparent 26%),
    radial-gradient(circle at bottom right, rgba(31, 158, 211, 0.18), transparent 30%),
    linear-gradient(145deg, var(--bg-top), var(--bg-bottom));
}

.skip-link {
  position: absolute;
  left: 14px;
  top: -48px;
  z-index: 999;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--line);
  transition: top 140ms ease;
}

.skip-link:focus {
  top: 14px;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  flex: 1;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 12px;
}

.site-header .nav-wrap {
  min-height: 58px;
}

.site-header .logo-home {
  min-height: 58px;
}

.site-header .logo img {
  height: 52px;
}

.site-header .menu a {
  padding: 0.42rem 0.68rem;
  font-size: 0.88rem;
}

.hero {
  position: static;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 12px;
  align-items: start;
  min-height: 0;
  height: auto;
  overflow: visible;
}

.hero__copy,
.game-panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  min-width: 0;
}

.hero__copy {
  padding: 22px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(31, 158, 211, 0.2), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(240, 251, 246, 0.9));
}

.hero__copy::after {
  content: "";
  position: absolute;
  inset: auto -38px -44px auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(17, 121, 93, 0.18), rgba(17, 121, 93, 0));
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  font-size: 0.83rem;
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.34rem 0.65rem;
  border-radius: 999px;
  background: rgba(17, 121, 93, 0.1);
  border: 1px solid rgba(17, 121, 93, 0.14);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

h1 {
  font-size: clamp(2rem, 3.2vw, 3.15rem);
  line-height: 0.98;
  max-width: 18ch;
  letter-spacing: -0.04em;
  text-wrap: balance;
  margin-top: 0.45rem;
  color: #000;
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.hero__text,
.challenge-prompt,
.info-block p,
.feedback-box p,
.result-summary,
.helper-text {
  color: var(--muted);
  line-height: 1.65;
}

.hero__text {
  max-width: 58ch;
  margin-top: 0.65rem;
  font-size: 0.96rem;
  line-height: 1.45;
  margin-bottom: 0;
}

.game-panel {
  padding: 22px;
}

.game-panel--intro {
  align-self: start;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(249, 255, 252, 0.98));
}

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

.quick-steps,
.play-guide {
  display: grid;
  gap: 10px;
}

.quick-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.quick-steps span,
.play-guide span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(17, 121, 93, 0.16);
  color: var(--text);
  font-weight: 800;
  line-height: 1.25;
}

.quick-steps strong {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
}

.player-box,
.ranking-box,
.progress-box,
.bncc-note {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.field-label--spaced {
  margin-top: 14px;
}

.text-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.text-input:focus {
  outline: 2px solid rgba(17, 121, 93, 0.2);
  border-color: var(--primary);
}

.helper-text {
  margin: 10px 0 0;
  font-size: 0.95rem;
}

.helper-text--center {
  text-align: center;
}

.intro-actions,
.action-row,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.action-row #submitButton,
.action-row #nextButton {
  min-width: 190px;
}

.button {
  border: 0;
  border-radius: 16px;
  padding: 14px 22px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
  font-weight: 800;
}

.button:hover {
  transform: translateY(-2px);
}

.button:focus-visible,
.mini-button:focus-visible,
.option-button:focus-visible,
.sequence-step:focus-visible,
.text-input:focus-visible {
  outline: 3px solid rgba(31, 158, 211, 0.35);
  outline-offset: 2px;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.button--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 14px 26px rgba(17, 121, 93, 0.24);
}

.button--secondary {
  color: #fff;
  background: linear-gradient(135deg, #ef8f34, #d96b1b);
  box-shadow: 0 14px 26px rgba(239, 143, 52, 0.24);
}

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

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.game-panel--challenge {
  min-width: 0;
  order: 1;
  position: relative;
  border: 2px solid rgba(17, 121, 93, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 252, 247, 0.96));
  box-shadow: 0 24px 58px rgba(17, 121, 93, 0.2);
}

.game-panel--status {
  padding-bottom: 24px;
  order: 2;
}

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

.status-card {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.status-card__label {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.status-card__value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
}

.progress-box__head,
.ranking-box__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 600;
}

.progress-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(24, 41, 54, 0.1);
  overflow: hidden;
}

.progress-bar__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  transition: width 220ms ease;
}

.challenge-head {
  margin-bottom: 22px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(17, 121, 93, 0.08);
  border: 1px solid rgba(17, 121, 93, 0.14);
}

.play-guide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.play-guide span {
  justify-content: center;
  text-align: center;
  background: rgba(31, 158, 211, 0.08);
  border-color: rgba(31, 158, 211, 0.18);
  color: #174458;
}

.challenge-prompt {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.45;
  font-weight: 700;
  color: var(--text);
}

#challengeTitle,
.challenge-prompt {
  overflow-wrap: anywhere;
}

#challengeTitle {
  font-size: 1.05rem;
  line-height: 1.25;
  color: var(--muted);
  font-weight: 700;
}

.difficulty-badge {
  display: none;
  align-items: center;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(17, 121, 93, 0.12);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.challenge-area {
  min-height: 280px;
  padding: 12px;
  border-radius: calc(var(--radius-lg) + 8px);
  background: rgba(17, 121, 93, 0.08);
  border: 2px dashed rgba(17, 121, 93, 0.32);
}

.placeholder-card,
.question-card,
.sequence-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  min-height: 100%;
}

.option-grid,
.sequence-options,
.leaderboard-list {
  display: grid;
  gap: 14px;
}

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

.selected-steps {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.selected-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.selected-step__number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  background: var(--primary);
}

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

.option-button,
.sequence-step {
  width: 100%;
  text-align: left;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  font-weight: 600;
  font-size: 1.05rem;
}

.option-button:hover,
.sequence-step:hover {
  transform: translateY(-2px);
  border-color: rgba(17, 121, 93, 0.4);
  box-shadow: 0 10px 20px rgba(24, 41, 54, 0.08);
}

.option-button.is-selected,
.sequence-step.is-selected {
  border-color: var(--primary);
  background: rgba(17, 121, 93, 0.12);
  box-shadow: 0 0 0 3px rgba(17, 121, 93, 0.16);
}

.question-card__meta {
  margin-bottom: 18px;
  color: var(--muted);
}

.info-block {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.info-block h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  color: var(--text);
}

.mini-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(24, 41, 54, 0.08);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  transition: background 180ms ease;
}

.mini-button:hover {
  background: rgba(24, 41, 54, 0.14);
}

.mini-button--inline {
  padding: 8px 10px;
  font-size: 0.9rem;
}

.feedback-box {
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: 18px;
  border-left: 6px solid var(--primary);
  background: rgba(255, 255, 255, 0.8);
}

.feedback-box.is-correct {
  border-left-color: #1f9d69;
  background: rgba(31, 157, 105, 0.08);
}

.feedback-box.is-wrong {
  border-left-color: var(--danger);
  background: rgba(217, 74, 88, 0.08);
}

.feedback-box h3 {
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--text);
}

.learning-text {
  font-weight: 600;
  margin: 10px 0 0;
}

.leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.leaderboard-item,
.leaderboard-empty {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(17, 121, 93, 0.06);
}

.leaderboard-empty {
  grid-template-columns: 1fr;
  color: var(--muted);
}

.leaderboard-rank {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
}

.leaderboard-player {
  font-weight: 700;
}

.leaderboard-meta {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.leaderboard-score {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
}

.result-screen {
  text-align: center;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0;
}

.result-metrics div {
  padding: 18px;
  border-radius: 18px;
  background: rgba(17, 121, 93, 0.08);
}

.result-metrics span {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.result-metrics strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
}

.flash {
  animation: flash 480ms ease;
}

@keyframes flash {
  0% { transform: scale(1); }
  30% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.bncc-summary {
  margin-top: 24px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(17, 121, 93, 0.06);
  text-align: left;
}

.bncc-summary h3 {
  margin-bottom: 8px;
  color: var(--text);
}

@media (max-width: 1024px) {
  .hero,
  .game-layout {
    grid-template-columns: 1fr;
  }

  .game-panel--challenge {
    order: 1;
  }

  .game-panel--status {
    order: 2;
  }

  .sequence-layout {
    grid-template-columns: 1fr;
  }

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

  .quick-steps,
  .play-guide {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding-top: 10px;
    padding-bottom: 8px;
  }

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

  .status-grid,
  .result-metrics {
    grid-template-columns: 1fr 1fr;
  }

  h1 {
    font-size: 1.9rem;
    max-width: 100%;
  }

  .button {
    width: 100%;
    justify-content: center;
  }

  .challenge-area {
    padding: 8px;
  }
}

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

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

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

  h1 {
    font-size: 1.65rem;
  }

  .result-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 950px) and (orientation: landscape) {
  .page-shell {
    padding-top: 12px;
    padding-bottom: 6px;
  }

  .hero__copy,
  .game-panel {
    padding: 14px;
  }

  .challenge-head {
    margin-bottom: 12px;
  }

  #challengeTitle {
    font-size: 1rem;
    line-height: 1.2;
  }

  .challenge-prompt {
    font-size: 1.08rem;
    line-height: 1.45;
  }

  .difficulty-badge {
    padding: 6px 10px;
    font-size: 0.72rem;
    margin-bottom: 10px;
  }

  .challenge-area {
    min-height: 170px;
  }

  .placeholder-card,
  .question-card,
  .sequence-card {
    padding: 16px;
  }

  .quick-steps,
  .play-guide {
    gap: 8px;
  }

  .quick-steps span,
  .play-guide span {
    padding: 10px 12px;
  }

  .action-row {
    margin-top: 16px;
  }

  .action-row .button {
    flex: 1 1 calc(50% - 6px);
    width: auto;
    padding: 12px 14px;
  }
}

