:root {
  --green: #004225;
  --green-2: #07391f;
  --green-3: #0b5a36;
  --gold: #FFB612;
  --gold-soft: rgba(255, 182, 18, 0.18);
  --white: #f7fff9;
  --muted: rgba(247, 255, 249, 0.72);
  --glass: rgba(255, 255, 255, 0.1);
  --glass-strong: rgba(255, 255, 255, 0.16);
  --line: rgba(255, 255, 255, 0.18);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 28px;
  --footer-height: 86px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  background:
    radial-gradient(circle at top left, rgba(255, 182, 18, 0.24), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(10, 126, 73, 0.55), transparent 28rem),
    linear-gradient(140deg, var(--green), #001c10 78%);
  overflow-x: hidden;
  padding-bottom: calc(var(--footer-height) + 28px);
}

.stadium-glow,
.pitch-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

.stadium-glow {
  background:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.pitch-lines {
  z-index: -1;
  background:
    linear-gradient(90deg, transparent 8%, rgba(255,255,255,0.06) 8.3%, transparent 8.6%, transparent 91.4%, rgba(255,255,255,0.06) 91.7%, transparent 92%),
    linear-gradient(0deg, transparent 22%, rgba(255,255,255,0.05) 22.4%, transparent 22.8%, transparent 50%, rgba(255,255,255,0.07) 50.3%, transparent 50.7%, transparent 78%, rgba(255,255,255,0.05) 78.4%, transparent 78.8%);
  opacity: 0.8;
}

.shell {
  width: min(1120px, calc(100% - 28px));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 22px;
  align-items: stretch;
  padding-block: 28px 18px;
}

.hero-copy {
  min-height: 320px;
  border-radius: 36px;
  padding: clamp(24px, 5vw, 48px);
  background: linear-gradient(135deg, rgba(255,255,255,0.13), rgba(255,255,255,0.04));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  position: relative;
  overflow: hidden;
}

.hero-copy::after {
  content: "EAT";
  position: absolute;
  right: -12px;
  bottom: -28px;
  font-size: clamp(86px, 16vw, 190px);
  font-weight: 950;
  color: rgba(255, 182, 18, 0.07);
  letter-spacing: -0.1em;
}

.eyebrow,
.section-kicker,
.card-label {
  margin: 0 0 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 800;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  font-size: clamp(2.7rem, 8vw, 6.4rem);
  line-height: 0.88;
  margin-bottom: 18px;
  letter-spacing: -0.08em;
}
h2 {
  font-size: clamp(1.35rem, 3vw, 2.15rem);
  margin-bottom: 10px;
  letter-spacing: -0.04em;
}
h3 { margin-bottom: 10px; }
.hero-text {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.65;
  position: relative;
  z-index: 1;
}

.hero-actions,
.builder-actions,
.quiz-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  color: var(--white);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
button:active { transform: scale(0.96); }
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(255, 182, 18, 0.52);
  outline-offset: 3px;
}

.primary-btn,
.ghost-btn,
.small-btn {
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 850;
}
.primary-btn {
  background: var(--gold);
  color: #1b1602;
  box-shadow: 0 12px 32px rgba(255, 182, 18, 0.28);
}
.ghost-btn,
.small-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--line);
  color: var(--white);
}
.small-btn { padding: 10px 14px; }

.glass-card {
  background: linear-gradient(150deg, var(--glass-strong), rgba(255,255,255,0.055));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  border-radius: 36px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 320px;
}

.bok-badge {
  width: 90px;
  aspect-ratio: 1;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: var(--gold-soft);
  border: 1px solid rgba(255, 182, 18, 0.36);
}
.bok-badge svg { width: 64px; fill: var(--gold); }
.meter {
  height: 12px;
  background: rgba(255,255,255,0.13);
  border-radius: 999px;
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #fff0a1);
}

.main-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}
.panel {
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 26px);
  min-width: 0;
}
.span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; }
.span-12 { grid-column: span 12; }

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.section-heading.compact { align-items: center; }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(255, 182, 18, 0.14);
  color: var(--gold);
  border: 1px solid rgba(255, 182, 18, 0.28);
  padding: 8px 12px;
  font-size: 0.83rem;
  font-weight: 850;
}

.word-player {
  display: grid;
  gap: 18px;
}
.word-stack {
  display: grid;
  gap: 4px;
}
.label,
.search-label {
  color: var(--muted);
  font-size: 0.82rem;
}
#wodWord {
  color: var(--gold);
  font-size: clamp(2.8rem, 7vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.08em;
}
.phonetic {
  color: #fff4bb;
  font-size: 1.15rem;
  font-weight: 800;
}
.translation { color: var(--muted); }
.player-ui {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 62px;
  gap: 12px;
  align-items: center;
}
.play-btn,
.speed-btn {
  height: 54px;
  border-radius: 18px;
  background: rgba(255, 182, 18, 0.17);
  color: var(--gold);
  border: 1px solid rgba(255, 182, 18, 0.32);
  font-weight: 950;
}
.speed-btn[aria-pressed="true"] {
  color: #191400;
  background: var(--gold);
}
.fake-track {
  height: 14px;
  background: rgba(255,255,255,0.12);
  border-radius: 99px;
  overflow: hidden;
}
.fake-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}
.fake-track.playing span { animation: track 1.4s ease-in-out forwards; }
@keyframes track { to { width: 100%; } }
.support-note,
.feedback {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.search-input {
  width: 100%;
  margin: 8px 0 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.11);
  color: var(--white);
  border-radius: 18px;
  padding: 13px 14px;
}
.search-input::placeholder { color: rgba(247,255,249,0.48); }
.dictionary-list {
  display: grid;
  gap: 10px;
  max-height: 480px;
  overflow: auto;
  padding-right: 4px;
}
.dict-card {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 22px;
  background: rgba(0,0,0,0.13);
}
.dict-icon {
  width: 50px;
  aspect-ratio: 1;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255, 182, 18, 0.14);
  font-size: 1.55rem;
}
.dict-word {
  display: block;
  color: var(--gold);
  font-size: 1.45rem;
  font-weight: 950;
  letter-spacing: -0.045em;
}
.dict-phonetic {
  display: block;
  color: #fff4bb;
  font-weight: 700;
  font-size: 0.92rem;
}
.dict-translation {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.stompi-rule {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.stompi-rule span {
  display: grid;
  place-items: center;
  height: 50px;
  border-radius: 18px;
  background: var(--gold-soft);
  color: var(--gold);
  font-weight: 950;
  font-size: 1.35rem;
  border: 1px solid rgba(255, 182, 18, 0.26);
}
.stompi-rule small {
  grid-column: 1 / -1;
  color: var(--muted);
}
.builder-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.chip-bank,
.drop-zone {
  min-height: 172px;
  padding: 12px;
  border: 1px dashed rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.07);
  border-radius: 22px;
  display: flex;
  align-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}
.drop-zone.drag-over {
  border-color: var(--gold);
  background: rgba(255, 182, 18, 0.12);
}
.fragment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.24);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.17);
  font-weight: 800;
  touch-action: manipulation;
}
.fragment-chip small {
  color: var(--gold);
  font-weight: 950;
}
.fragment-chip.correct { border-color: rgba(75, 255, 172, 0.55); }
.fragment-chip.wrong { border-color: rgba(255, 115, 115, 0.7); }
.feedback.good { color: #93ffc0; }
.feedback.bad { color: #ffb3a8; }

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255,255,255,0.08);
  border-radius: 18px;
  margin-bottom: 14px;
}
.score-row strong { color: var(--gold); font-size: 1.5rem; }
.quiz-card {
  min-height: 206px;
  display: grid;
  gap: 12px;
}
.quiz-prompt {
  padding: 16px;
  border-radius: 22px;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.12);
}
.quiz-prompt span {
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}
.quiz-prompt strong {
  color: var(--gold);
  font-size: 2.2rem;
  letter-spacing: -0.06em;
}
.options {
  display: grid;
  gap: 8px;
}
.option {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.14);
}
.option.selected {
  background: rgba(255, 182, 18, 0.18);
  border-color: rgba(255, 182, 18, 0.54);
}
.option.correct { background: rgba(75, 255, 172, 0.15); border-color: rgba(75, 255, 172, 0.5); }
.option.incorrect { background: rgba(255, 115, 115, 0.14); border-color: rgba(255, 115, 115, 0.5); }

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.note-grid article {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}
.note-grid p { color: var(--muted); line-height: 1.55; margin-bottom: 0; }
.note-grid strong { color: var(--gold); }

.footer-nav {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(620px, calc(100% - 22px));
  height: 72px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px;
  border-radius: 28px;
  background: rgba(0, 44, 25, 0.68);
  border: 1px solid rgba(255,255,255,0.17);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.42);
  z-index: 50;
}
.footer-nav button {
  border-radius: 21px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  gap: 2px;
  font-size: 1.08rem;
}
.footer-nav span { font-size: 0.68rem; font-weight: 850; }
.footer-nav button.active,
.footer-nav button:hover {
  color: var(--gold);
  background: rgba(255, 182, 18, 0.13);
}

@media (max-width: 860px) {
  .hero,
  .main-grid,
  .builder-layout,
  .note-grid {
    grid-template-columns: 1fr;
  }
  .span-5,
  .span-7,
  .span-12 { grid-column: span 1; }
  .hero-card { min-height: 230px; }
  .section-heading { flex-direction: column; }
  .section-heading.compact { flex-direction: row; align-items: center; }
  .dictionary-list { max-height: none; }
}

@media (max-width: 520px) {
  .shell { width: min(100% - 18px, 1120px); }
  .hero-copy { min-height: 360px; }
  .player-ui { grid-template-columns: 52px minmax(0, 1fr) 56px; }
  .play-btn, .speed-btn { height: 50px; border-radius: 16px; }
  .stompi-rule { gap: 5px; }
  .stompi-rule span { height: 42px; border-radius: 14px; }
  .primary-btn, .ghost-btn { flex: 1; }
  .footer-nav { height: 66px; border-radius: 24px; }
  .footer-nav span { font-size: 0.62rem; }
}
