:root {
  --sky-top: #89f7fe;
  --sky-bottom: #66a6ff;
  --cream: #fff8e7;
  --ink: #1b1464;
  --muted: #4a4580;
  --pink: #ff6b9d;
  --orange: #ffa502;
  --yellow: #ffd54f;
  --green: #2ed573;
  --blue: #1e90ff;
  --purple: #7c4dff;
  --shadow: 0 12px 30px rgba(27, 20, 100, .18);
  --radius: 22px;
  --header-h: 78px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", "Comic Sans MS", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-top) 0%, #c2e9fb 38%, var(--cream) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}
img, canvas { max-width: 100%; }
a { color: #4c1d95; }
.skip-link {
  position: absolute; left: -999px; top: 0;
}
.skip-link:focus { left: 12px; z-index: 80; background: #fff; padding: .6rem 1rem; }
.container { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }

.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.cloud {
  position: absolute; background: #fff; border-radius: 40px; opacity: .75;
  animation: drift 28s linear infinite;
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: #fff; border-radius: 50%;
}
.cloud.c1 { width: 140px; height: 46px; top: 90px; left: -160px; animation-duration: 36s; }
.cloud.c1::before { width: 60px; height: 60px; top: -28px; left: 18px; }
.cloud.c1::after { width: 80px; height: 80px; top: -40px; left: 50px; }
.cloud.c2 { width: 110px; height: 38px; top: 180px; left: -200px; animation-duration: 44s; animation-delay: -12s; }
.cloud.c2::before { width: 50px; height: 50px; top: -22px; left: 14px; }
.cloud.c2::after { width: 64px; height: 64px; top: -32px; left: 40px; }
.cloud.c3 { width: 160px; height: 50px; top: 40px; left: -180px; animation-duration: 50s; animation-delay: -20s; opacity: .55; }
.cloud.c3::before { width: 70px; height: 70px; top: -32px; left: 22px; }
.cloud.c3::after { width: 90px; height: 90px; top: -46px; left: 58px; }
.float-star {
  position: absolute; color: #ffe066; font-size: 1.4rem;
  animation: twinkle 2.8s ease-in-out infinite;
  text-shadow: 0 0 8px #fff;
}
.s1 { top: 16%; left: 8%; }
.s2 { top: 28%; right: 12%; animation-delay: .6s; }
.s3 { top: 12%; right: 28%; animation-delay: 1.2s; font-size: 1rem; }
.s4 { top: 36%; left: 22%; animation-delay: 1.8s; }
@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(140vw); }
}
@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0); opacity: .7; }
  50% { transform: scale(1.25) rotate(12deg); opacity: 1; }
}

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(10px);
  border-bottom: 4px solid #ffd54f;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; }
.brand-logo { width: 52px; height: 52px; }
.brand-word { display: flex; flex-direction: column; line-height: 1.1; }
.brand-word strong { font-size: 1.25rem; }
.brand-word small { color: var(--muted); font-size: .78rem; }
.nav-toggle {
  display: none; width: 46px; height: 46px; border: 0; border-radius: 14px;
  background: var(--yellow); cursor: pointer;
}
.nav-toggle span { display: block; height: 3px; margin: 6px 10px; background: var(--ink); border-radius: 2px; }
.main-nav { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.main-nav a, .nav-user {
  text-decoration: none; color: var(--ink); font-weight: 700;
  padding: .45rem .8rem; border-radius: 999px;
}
.main-nav a:hover, .main-nav a.is-active { background: #ffeaa7; }
.nav-cta { background: var(--pink) !important; color: #fff !important; }
.nav-user { background: #dfe6ff; }

main { position: relative; z-index: 1; }

.hero { padding: 2.2rem 0 1rem; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 2rem; align-items: center; }
.eyebrow {
  display: inline-block; background: #fff; border-radius: 999px; padding: .25rem .8rem;
  font-weight: 800; color: var(--purple); box-shadow: var(--shadow);
}
.hero h1, h1 { font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.12; margin: .6rem 0; }
.lead { font-size: 1.15rem; color: var(--muted); }
.rainbow-text {
  background: linear-gradient(90deg, #ff6b6b, #ffa502, #2ed573, #1e90ff, #a55eea);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: hue 6s linear infinite;
}
@keyframes hue { to { filter: hue-rotate(360deg); } }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.4rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 0; border-radius: 999px; padding: .85rem 1.4rem; font-weight: 800;
  cursor: pointer; text-decoration: none; font-size: 1rem; font-family: inherit;
  box-shadow: 0 8px 0 rgba(0,0,0,.12); transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.btn-primary { background: linear-gradient(180deg, #ffd54f, #ff9f1a); color: var(--ink); }
.btn-ghost { background: #fff; color: var(--ink); }
.btn-warn { background: linear-gradient(180deg, #ffe082, #ffb300); color: var(--ink); }
.btn-success { background: linear-gradient(180deg, #69f0ae, #00c853); color: #083b1f; }
.btn-danger { background: linear-gradient(180deg, #ff8a80, #e53935); color: #fff; }
.btn-small { padding: .4rem .8rem; font-size: .85rem; box-shadow: 0 4px 0 rgba(0,0,0,.1); }
.btn-xl { font-size: 1.15rem; padding: 1rem 1.7rem; }
.btn-block { width: 100%; }
.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.bounce-in { animation: pop .7s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

.hero-mascot { text-align: center; position: relative; }
.mascot { width: min(280px, 70vw); height: auto; filter: drop-shadow(0 18px 0 rgba(27,20,100,.12)); }
.floaty { animation: floaty 3.4s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-12px); } }
.speech-bubble {
  display: inline-block; margin-top: .4rem; background: #fff; border-radius: 18px;
  padding: .5rem 1rem; font-weight: 800; box-shadow: var(--shadow);
  animation: wiggle 2.6s ease-in-out infinite;
}
@keyframes wiggle { 40% { transform: rotate(-2deg); } 70% { transform: rotate(2deg); } }

.news-band { background: #7c4dff; color: #fff; padding: .85rem 0; }
.news-band .container { display: flex; gap: .8rem; align-items: center; }
.news-label { background: #ffd54f; color: var(--ink); padding: .15rem .6rem; border-radius: 999px; font-weight: 800; }
.news-band p { margin: 0; }

.section { padding: 2.4rem 0 3rem; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 1.6rem; }
.feature-grid, .grade-grid, .level-map { display: grid; gap: 1rem; }
.feature-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature-card, .grade-card, .level-card, .auth-card, .admin-card, .contact-card, .legal-content {
  background: #fff; border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow);
}
.feature-card {
  text-align: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}
.feature-card h3 {
  margin: 0 0 .45rem;
  font-size: 1.15rem;
  line-height: 1.25;
}
.feature-card p {
  margin: 0;
  font-size: .95rem;
  line-height: 1.4;
  overflow-wrap: break-word;
  max-width: 28ch;
}
.feature-ico {
  flex: 0 0 auto;
  font-size: 2rem; display: grid; place-items: center;
  width: 64px; height: 64px; margin: 0 auto .7rem;
  background: #fff8e7; border-radius: 18px;
}
.feature-card.c1 { border-top: 8px solid #ff6b6b; }
.feature-card.c2 { border-top: 8px solid #ffa502; }
.feature-card.c3 { border-top: 8px solid #2ed573; }
.feature-card.c4 { border-top: 8px solid #1e90ff; }
.feature-card.c5 { border-top: 8px solid #7c4dff; }

.grade-grid { grid-template-columns: repeat(3, 1fr); }
.grade-card {
  text-decoration: none; color: inherit; text-align: center;
  border: 4px solid var(--g); min-height: 160px;
  display: flex; flex-direction: column; justify-content: center; gap: .3rem;
  transition: transform .2s;
}
.grade-card:hover { transform: translateY(-6px) rotate(-1deg); }
.grade-num {
  width: 64px; height: 64px; margin: 0 auto; border-radius: 50%;
  background: var(--g); color: #fff; display: grid; place-items: center;
  font-size: 1.6rem; font-weight: 900;
}

.page-hero { padding: 1.6rem 0 .4rem; text-align: center; }
.grade-hero { background: color-mix(in srgb, var(--g) 22%, transparent); }
.grade-switch { display: flex; justify-content: center; gap: .4rem; flex-wrap: wrap; margin-top: 1rem; }
.grade-hero .btn { margin-top: .35rem; }
.chip {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; text-decoration: none; color: var(--ink); font-weight: 800; box-shadow: var(--shadow);
}
.chip.is-active { background: var(--ink); color: #fff; }

.level-map { grid-template-columns: repeat(4, 1fr); }
.level-card {
  text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: .2rem;
  border: 3px solid #ffeaa7; min-height: 180px; position: relative;
}
.level-card:hover { transform: translateY(-4px); }
.level-card.is-done { border-color: #2ed573; background: #f3fff6; }
.level-card.is-locked { opacity: .55; pointer-events: none; filter: grayscale(.3); }
.level-emoji { font-size: 1.8rem; }
.level-no { font-size: .8rem; font-weight: 800; color: var(--purple); }
.star-row { letter-spacing: .15rem; margin-top: auto; }
.star { color: #dfe6e9; font-size: 1.2rem; }
.star.is-on { color: #ffc107; text-shadow: 0 0 8px #ffeaa7; }
.lock { font-size: .8rem; color: var(--muted); }

.auth-section { padding: 2rem 0 3rem; }
.auth-card { max-width: 440px; margin: 0 auto; }
.auth-mascot { text-align: center; }
.auth-mascot .mascot { width: 120px; }
.form-group { margin-bottom: 1rem; }
label { display: block; font-weight: 800; margin-bottom: .35rem; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
  width: 100%; padding: .75rem .9rem; border-radius: 14px; border: 3px solid #dfe6ff;
  font: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple); }
.form-check { margin: .4rem 0 1rem; }
.form-check label { display: flex; align-items: flex-start; gap: .55rem; font-weight: 700; cursor: pointer; }
.form-check input { width: 1.15rem; height: 1.15rem; margin-top: .15rem; flex: none; accent-color: #7c4dff; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.form-hint { color: var(--muted); }
.hp-field { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.alert {
  border-radius: 16px; padding: .9rem 1rem; margin-bottom: 1rem; font-weight: 700;
}
.alert-error { background: #ffe3e3; color: #c0392b; }
.alert-success { background: #d4f8e8; color: #0b7a45; }
.alert-info { background: #e8f4ff; color: #1b1464; }

.game-shell { width: min(860px, calc(100% - 1.4rem)); margin: 1rem auto 3rem; }
.game-top { display: flex; align-items: center; gap: 1rem; justify-content: space-between; }
.back-link { font-weight: 800; text-decoration: none; }
.game-meta { text-align: center; }
.pill { display: inline-block; background: var(--g, var(--purple)); color: #fff; border-radius: 999px; padding: .1rem .7rem; font-size: .8rem; font-weight: 800; }
.sound-toggle { border: 0; background: #fff; border-radius: 50%; width: 48px; height: 48px; font-size: 1.3rem; cursor: pointer; box-shadow: var(--shadow); }
.progress-track { height: 14px; background: #fff; border-radius: 999px; margin: 1rem 0; overflow: hidden; box-shadow: inset 0 2px 6px rgba(0,0,0,.08); }
#progress-bar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff6b6b, #ffd54f, #2ed573); transition: width .4s ease; }
.game-stage {
  background: #fff; border-radius: 28px; padding: 1.4rem; min-height: 360px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.exercise-card { animation: slideUp .35s ease; position: relative; z-index: 1; padding-right: 4.5rem; }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } }
.instruction { font-weight: 800; color: var(--purple); margin-bottom: .4rem; }
.prompt { font-size: 1.4rem; margin: .4rem 0 1rem; }
.choice-grid { display: grid; gap: .7rem; }
.choice-btn, .word-chip, .drop-slot, .drag-item {
  border: 3px solid #dfe6ff; background: #f8f6ff; border-radius: 16px;
  padding: .85rem 1rem; font: inherit; font-weight: 800; cursor: pointer;
}
.choice-btn:hover, .word-chip:hover, .drag-item:hover { border-color: var(--purple); transform: translateY(-2px); }
.choice-btn.is-correct, .drop-slot.is-correct { background: #d4f8e8; border-color: #2ed573; }
.choice-btn.is-wrong, .game-stage.is-wrong { animation: shake .45s; }
.choice-btn.is-wrong { background: #ffe3e3; border-color: #ff6b6b; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
.order-board, .drag-board { display: flex; flex-wrap: wrap; gap: .6rem; min-height: 64px; }
.drop-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .8rem; }
.drop-slot { min-height: 54px; background: #fffef4; border-style: dashed; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.drag-pool { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.drag-item { background: #ffeaa7; }
.drag-item.is-placed { opacity: .35; }
.speak-btn { margin-left: .4rem; border: 0; background: #dfe6ff; border-radius: 999px; padding: .2rem .6rem; cursor: pointer; font-weight: 800; }
.feedback {
  margin-top: 1rem; padding: 1rem; border-radius: 18px; font-size: 1.2rem; font-weight: 800; text-align: center;
}
.feedback.good { background: #d4f8e8; color: #0b7a45; animation: pop .4s; }
.feedback.bad { background: #ffe3e3; color: #c0392b; }
.mascot-react { position: absolute; right: 12px; top: 12px; width: 72px; height: 78px; transition: transform .3s; z-index: 2; }
.mascot-react svg { width: 72px; height: auto; display: block; }
.mascot-react.is-happy { transform: scale(1.15) rotate(-8deg); }
.mascot-react.is-sad { transform: rotate(12deg); }
.win-screen { text-align: center; padding: 1.5rem .5rem; }
.win-stars { font-size: 3rem; letter-spacing: .3rem; animation: pop .6s; }
.confetti-layer { pointer-events: none; position: absolute; inset: 0; overflow: hidden; }
.confetti { position: absolute; width: 10px; height: 16px; top: -20px; animation: fall 1.2s linear forwards; }
@keyframes fall { to { transform: translateY(420px) rotate(280deg); opacity: 0; } }

.vocab-hero .lead { margin-bottom: 0; }
.vocab-section { padding-top: .4rem; }
.vocab-badge-wrap { text-align: center; margin-bottom: 1.2rem; }
.vocab-badge {
  display: inline-block; background: linear-gradient(180deg, #ffeaa7, #ffd54f);
  color: var(--ink); font-weight: 800; padding: .35rem 1rem; border-radius: 999px;
  box-shadow: var(--shadow);
}
.vocab-stats {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: .7rem;
  margin-bottom: 1.2rem;
}
.vocab-stat {
  background: #fff; border-radius: 18px; padding: .85rem .6rem; text-align: center;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .15rem;
}
.vocab-stat-ico { font-size: 1.2rem; }
.vocab-stat strong { font-size: 1.35rem; line-height: 1.1; }
.vocab-stat small { color: var(--muted); font-weight: 700; }
.vocab-star-meter {
  grid-column: 1 / -1; background: #fff; border-radius: 18px; padding: .85rem 1rem;
  box-shadow: var(--shadow);
}
.vocab-star-meter span { font-weight: 800; }
.vocab-star-track { margin: .45rem 0 .25rem; }
.vocab-star-track span {
  display: block; height: 100%; background: linear-gradient(90deg, #ffd54f, #ff9f1a, #2ed573);
  width: 0; transition: width .4s ease;
}
.vocab-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 1rem; margin-bottom: 1rem; }
.vocab-card {
  background: #fff; border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow);
}
.vocab-card h2 { margin: 0 0 .4rem; font-size: 1.35rem; }
.vocab-quiz-top { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.vocab-stage { min-height: 280px; margin-top: .4rem; }
.vocab-idle { text-align: center; padding: 1.5rem .5rem; position: relative; z-index: 1; }
.vocab-idle p { font-weight: 800; color: var(--muted); }
.vocab-list { display: flex; flex-direction: column; gap: .55rem; }
.vocab-row {
  display: flex; justify-content: space-between; gap: .8rem; align-items: center;
  background: #f8f6ff; border: 2px solid #dfe6ff; border-radius: 16px; padding: .7rem .85rem;
  flex-wrap: wrap;
}
.vocab-row-words { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-weight: 800; }
.vocab-row-words em { font-style: normal; color: var(--purple); }
.vocab-row-meta { display: flex; align-items: center; gap: .55rem; }
.vocab-strength {
  display: inline-block; width: 72px; height: 10px; background: #e8e4ff; border-radius: 999px; overflow: hidden;
}
.vocab-strength i { display: block; height: 100%; background: linear-gradient(90deg, #7c4dff, #2ed573); }
.vocab-pill {
  display: inline-flex; border-radius: 999px; padding: .1rem .5rem; font-size: .75rem; font-weight: 800;
}
.vocab-pill.is-ok { background: #d4f8e8; color: #0b7a45; }

.podium-section .section-head a,
.highscore-page .section-head a,
.highscore-you {
  text-decoration: none;
  font-weight: 800;
}
.highscore-you {
  display: inline-block;
  margin: .6rem 0 0;
  background: #fff;
  border-radius: 999px;
  padding: .35rem .9rem;
  box-shadow: var(--shadow);
}
.podium {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  grid-template-areas: "p2 p1 p3";
  align-items: end;
  gap: .7rem;
  max-width: 780px;
  margin: 0 auto;
}
.podium-n1 {
  grid-template-columns: minmax(180px, 280px);
  grid-template-areas: "p1";
  justify-content: center;
}
.podium-n2 {
  grid-template-columns: 1fr 1.2fr;
  grid-template-areas: "p2 p1";
  max-width: 520px;
}
.podium-place {
  text-align: center;
  position: relative;
  animation: podiumIn .7s cubic-bezier(.2, 1.3, .4, 1) both;
}
.podium-place.p1 { grid-area: p1; animation-delay: .08s; }
.podium-place.p2 { grid-area: p2; animation-delay: .2s; }
.podium-place.p3 { grid-area: p3; animation-delay: .32s; }
.podium-crown {
  min-height: 1.5rem;
  font-size: 1.7rem;
  line-height: 1;
}
.p1 .podium-crown { animation: floaty 2.4s ease-in-out infinite; }
.podium-medal { font-size: 2rem; line-height: 1; margin-bottom: .25rem; }
.p1 .podium-medal { animation: medalPop 1.6s ease-in-out infinite; }
.podium-name {
  display: block;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
  margin: .15rem 0 .1rem;
}
.podium-stars {
  display: block;
  font-weight: 800;
  color: #c2410c;
  margin-bottom: .45rem;
}
.podium-block {
  border-radius: 18px 18px 10px 10px;
  color: #fff;
  font-weight: 900;
  font-size: 1.7rem;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.p1 .podium-block {
  height: 148px;
  background: linear-gradient(180deg, #ffe566, #ffb300);
  color: var(--ink);
}
.p2 .podium-block {
  height: 108px;
  background: linear-gradient(180deg, #eceff4, #9aa5b1);
  color: #1b1464;
}
.p3 .podium-block {
  height: 86px;
  background: linear-gradient(180deg, #f8d2a8, #d48b3c);
}
.p1 .podium-block::after {
  content: "";
  position: absolute;
  inset: -40% -60%;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  animation: shine 2.8s ease-in-out infinite;
}
.podium-place.is-me .podium-name { color: var(--purple); }
.podium-place.p1::before,
.podium-place.p1::after {
  content: "✦";
  position: absolute;
  top: 1.2rem;
  color: #ffd54f;
  animation: twinkle 1.6s ease-in-out infinite;
  text-shadow: 0 0 8px #fff;
  pointer-events: none;
}
.podium-place.p1::before { left: .2rem; }
.podium-place.p1::after { right: .2rem; animation-delay: .5s; }
@keyframes podiumIn {
  from { opacity: 0; transform: translateY(28px) scale(.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes medalPop {
  0%, 100% { transform: scale(1) rotate(-6deg); }
  50% { transform: scale(1.12) rotate(6deg); }
}
@keyframes shine {
  0% { transform: translateX(-30%); }
  100% { transform: translateX(30%); }
}

.highscore-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}
.highscore-card h2 { margin: 0 0 .8rem; }
.highscore-list { list-style: none; padding: 0; margin: 0; }
.highscore-row {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) auto auto;
  gap: .6rem;
  align-items: center;
  padding: .7rem .8rem;
  border-radius: 14px;
  border-bottom: 1px solid #eef0ff;
}
.highscore-row.is-top { background: #fff8e1; border-bottom-color: transparent; margin-bottom: .35rem; }
.highscore-row.is-me { box-shadow: inset 0 0 0 3px #7c4dff; }
.highscore-rank { font-weight: 900; font-size: 1.15rem; }
.highscore-name { font-weight: 800; overflow-wrap: anywhere; }
.highscore-name small { color: var(--purple); }
.highscore-meta { color: var(--muted); font-weight: 700; font-size: .85rem; }
.highscore-stars { font-weight: 900; color: #c2410c; white-space: nowrap; }

.split { display: grid; grid-template-columns: .8fr 1.2fr; gap: 1.2rem; }

.contact-layout { align-items: stretch; }
.contact-aside, .contact-form-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.35rem 1.3rem 1.5rem;
  box-shadow: var(--shadow);
}
.contact-aside {
  border-top: 8px solid var(--purple);
  display: flex;
  flex-direction: column;
}
.contact-aside h2,
.contact-form-card h2 {
  margin: .4rem 0 .55rem;
  font-size: 1.45rem;
  line-height: 1.2;
}
.contact-form-card h2 { margin-top: 0; }
.contact-address {
  margin: 0 0 1.15rem;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}
.contact-points { display: grid; gap: .7rem; margin-top: auto; }
.contact-point {
  display: block;
  background: #f8f6ff;
  border: 2px solid #dfe6ff;
  border-radius: 16px;
  padding: .75rem .9rem;
  color: inherit;
  text-decoration: none;
}
.contact-point-label {
  display: block;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: .2rem;
}
.contact-point strong,
.contact-point a {
  display: block;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}
.contact-page a,
.contact-page a:hover,
.contact-page a:focus,
.contact-page a:visited {
  text-decoration: none;
}
.contact-captcha-slot { margin-top: .2rem; }
.legal-content h2 { margin-top: 1.6rem; }
.obf-rev { unicode-bidi: bidi-override; direction: rtl; }
.obf-mail-at::before { content: "@"; }
.obf-mail.is-ready .obf-mail-fallback { display: none; }
.obf-mail-ch { display: inline; }
.protected-media { position: relative; display: inline-block; overflow: hidden; }
.protected-canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.protected-media[data-fit="cover"] .protected-canvas { object-fit: cover; }
.protected-overlay { position: absolute; inset: 0; }
.brand-logo.protected-media, .footer-logo.protected-media { width: 52px; height: 52px; }
.footer-logo.protected-media { width: 48px; height: 48px; }

.site-footer { position: relative; z-index: 1; background: #1b1464; color: #ffeaa7; padding: 2rem 0 2.2rem; margin-top: 1rem; }
.site-footer a,
.site-footer a:hover,
.site-footer a:focus,
.site-footer a:visited {
  color: #fff;
  text-decoration: none;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1.4rem; }
.footer-logo-wrap { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 800; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin: .35rem 0; }
.footer-bottom { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 1.4rem; font-size: .9rem; }
.copyright-admin-link { text-decoration: none; color: inherit; }
.copyright-link { text-decoration: none; }
.visitor-count { opacity: .45; font-size: .8rem; }

.music-toggle {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 72;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd54f, #ff9f1a);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-family: inherit;
}
.music-toggle:hover { transform: translateY(-2px); }
.music-toggle.is-off { background: #dfe6e9; color: #636e72; }
.music-toggle .icon-off { display: none; }
.music-toggle.is-off .icon-on { display: none; }
.music-toggle.is-off .icon-off { display: block; }
.music-toggle:not(.is-off) { animation: pulse 2s ease-in-out infinite; }

.cookie-banner {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(20px);
  width: min(640px, calc(100% - 1.4rem)); background: #fff; border-radius: 22px;
  box-shadow: var(--shadow); padding: 1rem; z-index: 70; opacity: 0; pointer-events: none;
  border: 4px solid #ffd54f;
}
.cookie-banner.is-visible { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.cookie-actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: .6rem; }
.cookie-blocker { position: fixed; inset: 0; background: rgba(27,20,100,.35); z-index: 60; display: none; }
.cookie-blocker.is-visible { display: block; }
html.cookie-consent-pending, body.cookie-consent-pending { overflow: hidden; }

.admin-header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; flex-wrap: wrap; }
.admin-nav { display: flex; flex-wrap: wrap; gap: .4rem; }
.admin-nav a { background: #fff; padding: .45rem .8rem; border-radius: 999px; text-decoration: none; font-weight: 800; }
.admin-nav a.is-active { background: var(--ink); color: #fff; }
.admin-login { padding: 3rem 0; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: .6rem; border-bottom: 1px solid #eee; vertical-align: middle; }
.admin-table tr.is-blocked td { background: #fff6f6; }
.admin-table tr.is-pending td { background: #fffbeb; }
.admin-table tr.is-selected td { background: #fff8e1; }
.admin-table-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.admin-inline-form { display: inline; margin: 0; }
.status-pill {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: .15rem .65rem; font-weight: 800; font-size: .8rem;
}
.status-pill.is-ok { background: #d4f8e8; color: #0b7a45; }
.status-pill.is-off { background: #ffe0e0; color: #c0392b; }
.status-pill.is-wait { background: #fff3cd; color: #8a6d00; }
.admin-setting-card { margin-bottom: 1rem; max-width: 640px; }
.admin-nav a { display: inline-flex; align-items: center; gap: .35rem; }
.nav-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; border-radius: 999px;
  background: #fff3cd; color: #8a6d00; font-size: .75rem;
}
.admin-edit-card { margin-bottom: 1rem; max-width: 640px; }
.admin-edit-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .4rem; }

@media (max-width: 900px) {
  .hero-grid, .grade-grid, .level-map, .footer-grid, .split, .vocab-layout { grid-template-columns: 1fr 1fr; }
  .vocab-stats { grid-template-columns: repeat(3, 1fr); }
  .nav-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; right: 1rem; top: calc(var(--header-h) + 8px);
    background: #fff; border-radius: 18px; padding: .8rem; flex-direction: column; min-width: 220px;
    box-shadow: var(--shadow);
  }
  .main-nav.is-open { display: flex; }
}
@media (max-width: 640px) {
  .hero-grid, .grade-grid, .level-map, .footer-grid, .split, .form-row, .drop-row, .vocab-layout { grid-template-columns: 1fr; }
  .vocab-stats { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .game-top { flex-wrap: wrap; }
  .podium,
  .podium-n1,
  .podium-n2 {
    grid-template-columns: 1fr;
    max-width: 360px;
    justify-content: stretch;
  }
  .podium-n1 { grid-template-areas: "p1"; }
  .podium-n2 { grid-template-areas: "p1" "p2"; }
  .podium-n3 { grid-template-areas: "p1" "p2" "p3"; }
  .p1 .podium-block, .p2 .podium-block, .p3 .podium-block { height: 72px; }
  .highscore-row { grid-template-columns: 2.6rem minmax(0, 1fr) auto; }
  .highscore-meta { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
