:root {
  color-scheme: light;
  --page: #f7f9fc;
  --surface: #ffffff;
  --text: #18212f;
  --muted: #687386;
  --line: #dfe5ed;
  --accent: #2457d6;
  --accent-soft: #edf2ff;
  --visual-viewport-height: 100svh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--page);
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent), transparent 55%);
  outline-offset: 4px;
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.import-panel { margin-bottom: 1rem; }
.import-panel h2 { margin: .2rem 0; }
.import-panel > p { color: var(--muted); }

.app-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  background:
    radial-gradient(circle at 10% 0%, rgba(36, 87, 214, 0.12), transparent 34rem),
    var(--page);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 760px);
  min-width: 0;
  margin: 0 auto;
  padding: 1rem clamp(1rem, 4vw, 2rem);
}

.brand {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.prototype-badge,
.language-pill {
  width: fit-content;
  padding: 0.35rem 0.65rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #cbd8ff;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  width: 100%;
  padding: clamp(1rem, 5vw, 2.5rem) 1rem 3rem;
}

.screen {
  width: min(100%, 680px);
  min-width: 0;
}

.start-screen,
.complete-screen {
  text-align: center;
}

.start-screen .language-pill {
  margin: 0 auto 1.2rem;
}

.start-screen h1,
.complete-screen h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.75rem, 11vw, 5.4rem);
  line-height: 0.96;
  letter-spacing: -0.065em;
}

.start-screen p,
.complete-screen p {
  max-width: 34rem;
  margin: 0 auto 2rem;
  color: #536074;
  font-size: clamp(1.05rem, 3vw, 1.22rem);
}

.primary-button {
  min-height: 54px;
  padding: 0.8rem 1.35rem;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(36, 87, 214, 0.2);
  font-weight: 750;
  cursor: pointer;
}

.primary-button:hover {
  background: #1847bc;
}

.primary-button:focus-visible,
.choice:focus-visible,
.suggestions button:focus-visible {
  outline: 3px solid rgba(36, 87, 214, 0.35);
  outline-offset: 3px;
}

.session-status {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.session-status > div {
  display: grid;
  gap: 0.05rem;
}

.status-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.session-status strong {
  font-size: 1.25rem;
}

.score-box {
  text-align: right;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  margin-bottom: 1rem;
  background: #dfe5ed;
  border-radius: 999px;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 180ms ease;
}

.var-badge {
  width: fit-content;
  margin: 0 auto 0.7rem;
  padding: 0.35rem 0.7rem;
  color: #9c2d17;
  background: #fff0eb;
  border: 1px solid #f5c1b5;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.word-card {
  display: grid;
  min-height: 330px;
  padding: clamp(1.5rem, 6vw, 3rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(31, 43, 61, 0.09);
}

.word-card.is-revealing {
  cursor: pointer;
}

.word-card.is-revealing:focus-visible {
  outline: 3px solid rgba(36, 87, 214, 0.35);
  outline-offset: 4px;
}

#question-view {
  align-self: center;
  text-align: center;
}

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

.word-card h2 {
  margin: 0.65rem 0;
  font-size: clamp(2rem, 8vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.choice {
  min-height: 72px;
  padding: 0.75rem;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(31, 43, 61, 0.16);
  font-size: 1.2rem;
  font-weight: 850;
  text-transform: lowercase;
  cursor: pointer;
}

.choice:hover {
  filter: saturate(1.12) brightness(0.98);
  transform: translateY(-2px);
}

.choice-know {
  color: #fff;
  background: #16a34a;
}

.choice-unsure {
  color: #352900;
  background: #facc15;
}

.choice-no {
  color: #fff;
  background: #ef4444;
}

.answer-form {
  align-self: center;
  display: grid;
  gap: 0.75rem;
}

.answer-form label {
  font-weight: 750;
}

.answer-form input {
  width: 100%;
  min-height: 58px;
  padding: 0.75rem 1rem;
  color: var(--text);
  background: #fbfcfe;
  border: 2px solid #b8c4d5;
  border-radius: 14px;
  font-size: 1.2rem;
}

.answer-form input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(36, 87, 214, 0.12);
}

.suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.suggestions:empty {
  display: none;
}

.suggestions button {
  min-height: 42px;
  padding: 0.55rem 0.75rem;
  color: #33415a;
  background: var(--accent-soft);
  border: 1px solid #cbd8ff;
  border-radius: 10px;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.answer-reveal {
  align-self: center;
  display: grid;
  justify-items: center;
  gap: 1rem;
  text-align: center;
}

.answer-reveal strong {
  color: var(--accent);
  font-size: clamp(2.4rem, 10vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}

.points-delta {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 850;
}

.points-positive {
  color: #08783f;
  background: #dcfce7;
}

.points-negative {
  color: #b42318;
  background: #fee4e2;
}

.return-button {
  min-height: 44px;
  padding: 0.6rem 0.9rem;
  color: #465267;
  background: #fff;
  border: 1px solid #b8c4d5;
  border-radius: 12px;
  font-weight: 750;
  cursor: pointer;
}

.return-button:hover {
  color: var(--text);
  border-color: #8997aa;
  background: #f7f9fc;
}

.return-button:focus-visible {
  outline: 3px solid rgba(36, 87, 214, 0.35);
  outline-offset: 3px;
}

.complete-mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 1.25rem;
  color: #fff;
  background: #138a5b;
  border-radius: 50%;
  font-size: 2.4rem;
  font-weight: 800;
}

.collection-button {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 48px;
  margin: -1rem auto 1.5rem;
  padding: .65rem 1rem;
  color: #7a4b00;
  background: linear-gradient(135deg,#fff8d6,#ffe59a);
  border: 1px solid #efc95d;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(151,105,10,.12);
  font-weight: 850;
  cursor: pointer;
}

.collection-button > span { color: #e7a900; font-size: 1.15rem; }
.collection-button > b { min-width: 1.7rem; padding: .1rem .45rem; color: #fff; background: #b77900; border-radius: 999px; }

.reward-active {
  background: radial-gradient(circle at 50% 26%,rgba(255,220,100,.3),transparent 24rem),radial-gradient(circle at 15% 15%,rgba(36,87,214,.13),transparent 27rem),var(--page);
}

.reward-active .game-shell { padding-top: 1rem; }
.complete-screen { position: relative; isolation: isolate; }
.complete-screen .reward-eyebrow { display: inline-block; margin-bottom: .45rem; color: #a56500; font-size: .84rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.complete-screen h1 { margin-bottom: 1rem; font-size: clamp(2.1rem,7vw,4.1rem); }
.reward-stage { display: grid; place-items: center; min-height: 390px; perspective: 1200px; }

.football-card {
  position: relative;
  width: min(100%,320px);
  aspect-ratio: 313/437;
  padding: 0;
  background: transparent;
  border-radius: 25px;
  box-shadow: 0 28px 65px rgba(42,31,4,.25),0 7px 18px rgba(42,31,4,.18);
  overflow: hidden;
}

.football-card-inner { position: relative; width: 100%; height: 100%; overflow: hidden; background: #fff; border: 0; border-radius: 25px; }
.football-card img { display: block; width: 100%; height: 100%; object-fit: contain; }
.football-card-glow { position: absolute; inset: 0; background: linear-gradient(112deg,transparent 18%,rgba(255,255,255,.06) 34%,rgba(255,245,176,.55) 48%,rgba(255,255,255,.08) 60%,transparent 78%); mix-blend-mode: screen; transform: translateX(-130%); }
.football-card-copy { display: none; }
.football-card-copy span { color: #ffe594; font-size: .76rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.football-card-copy strong { font-size: clamp(1.45rem,5vw,2rem); line-height: 1; letter-spacing: -.035em; }
.card-count { position: absolute; top: .75rem; right: .75rem; display: grid; place-items: center; min-width: 2.8rem; min-height: 2.2rem; padding: .25rem .55rem; color: #382700; background: #ffe58e; border: 2px solid rgba(255,255,255,.8); border-radius: 999px; box-shadow: 0 4px 15px rgba(0,0,0,.25); }

.reward-card { opacity: 0; transform: translateY(70px) rotateY(-150deg) scale(.72); }
.reward-reveal .reward-card { animation: reward-card-enter 1.05s cubic-bezier(.18,.85,.25,1.18) forwards,reward-card-float 3.2s 1.1s ease-in-out infinite; }
.reward-reveal .reward-card .football-card-glow { animation: reward-shine 1.05s .55s ease-out forwards; }
.reward-copy { min-height: 1.8rem; margin: .65rem auto .15rem !important; color: #4c596d !important; font-size: 1rem !important; }
.reward-score { margin: 0 auto .8rem !important; color: #687386 !important; font-size: .92rem !important; }
.reward-actions { display: flex; justify-content: center; gap: .65rem; flex-wrap: wrap; }

.reward-confetti { position: absolute; inset: 0; z-index: -1; overflow: visible; pointer-events: none; }
.reward-confetti i { --x: 0px; --r: 180deg; position: absolute; top: 8%; left: 50%; width: 9px; height: 18px; opacity: 0; background: #f4c542; border-radius: 3px; }
.reward-confetti i:nth-child(2n) { background: #2457d6; }
.reward-confetti i:nth-child(3n) { background: #ef4444; }
.reward-confetti i:nth-child(4n) { width: 12px; height: 12px; background: #20b87a; border-radius: 50%; }
.reward-confetti i:nth-child(1) { --x: -290px; --r: 310deg; left: 48%; }
.reward-confetti i:nth-child(2) { --x: -220px; --r: 190deg; left: 49%; }
.reward-confetti i:nth-child(3) { --x: -155px; --r: 420deg; left: 50%; }
.reward-confetti i:nth-child(4) { --x: -90px; --r: 250deg; left: 48%; }
.reward-confetti i:nth-child(5) { --x: -35px; --r: 520deg; left: 50%; }
.reward-confetti i:nth-child(6) { --x: 35px; --r: 330deg; left: 50%; }
.reward-confetti i:nth-child(7) { --x: 90px; --r: 470deg; left: 52%; }
.reward-confetti i:nth-child(8) { --x: 150px; --r: 250deg; left: 50%; }
.reward-confetti i:nth-child(9) { --x: 205px; --r: 390deg; left: 51%; }
.reward-confetti i:nth-child(10) { --x: 260px; --r: 210deg; left: 52%; }
.reward-confetti i:nth-child(11) { --x: -250px; --r: 460deg; left: 48%; }
.reward-confetti i:nth-child(12) { --x: 285px; --r: 550deg; left: 52%; }
.reward-reveal .reward-confetti i { animation: reward-confetti 1.45s .18s cubic-bezier(.16,.72,.36,1) forwards; }

.cards-screen { width: min(100%,820px); }
.cards-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .3rem; }
.cards-heading h1 { margin: .45rem 0 0; font-size: clamp(2.6rem,8vw,4.8rem); line-height: .95; letter-spacing: -.06em; }
.cards-summary { margin: 0 0 1.35rem; color: var(--muted); }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 1.1rem; align-items: start; }
.collection-card { width: 100%; transition: transform 180ms ease,box-shadow 180ms ease; }
.collection-card:hover { transform: translateY(-5px) rotate(.4deg); box-shadow: 0 35px 70px rgba(42,31,4,.28),0 9px 20px rgba(42,31,4,.18); }
.collection-card .football-card-copy strong { font-size: clamp(1.15rem,3.8vw,1.55rem); }
.cards-empty { grid-column: 1/-1; display: grid; justify-items: center; padding: 3rem 1.2rem; color: #687386; background: #fff; border: 1px dashed #c9d1dc; border-radius: 24px; text-align: center; }
.cards-empty > span { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: .8rem; color: #c58a00; background: #fff4c4; border-radius: 50%; font-size: 2rem; }
.cards-empty strong { color: var(--text); font-size: 1.15rem; }
.cards-empty p { margin: .35rem 0 0; }

@keyframes reward-card-enter {
  0% { opacity: 0; transform: translateY(70px) rotateY(-150deg) scale(.72); }
  62% { opacity: 1; transform: translateY(-12px) rotateY(9deg) scale(1.035); }
  100% { opacity: 1; transform: translateY(0) rotateY(0) scale(1); }
}
@keyframes reward-card-float { 0%,100% { transform: translateY(0) rotateZ(0); } 50% { transform: translateY(-7px) rotateZ(.45deg); } }
@keyframes reward-shine { to { transform: translateX(135%); } }
@keyframes reward-confetti {
  0% { opacity: 0; transform: translate(0,110px) rotate(0) scale(.4); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x),470px) rotate(var(--r)) scale(1); }
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

@media (max-width: 480px) {
  .app-header .prototype-badge { display: none; }
  .account-actions { gap: .45rem; }
  .header-language-switch button { padding-inline: .5rem; }
  .alex-bundle-head { flex-direction: column; align-items: stretch; }
  .alex-bundle-head .primary-button { width: 100%; }
  .reward-stage { min-height: 340px; }
  .reward-card { width: min(78vw,275px); }
  .cards-heading { align-items: stretch; flex-direction: column; }
  .cards-heading .return-button { width: 100%; }
  .cards-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
  .collection-card { border-radius: 17px; padding: 5px; }
  .collection-card .football-card-inner { border-radius: 12px; }
  .collection-card .football-card-copy { padding: 2.4rem .65rem .65rem; }
  .collection-card .football-card-copy span { font-size: .6rem; }
  .collection-card .football-card-copy strong { font-size: 1rem; }
}

.header-language-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  background: #e9edf4;
  border-radius: 999px;
}

.header-language-switch button {
  min-height: 34px;
  padding: 0.25rem 0.65rem;
  color: #59667a;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.header-language-switch button.is-selected {
  color: var(--accent);
  background: #fff;
  box-shadow: 0 2px 8px rgba(31,43,61,.1);
}

.language-la {
  --accent: #8b3fd1;
  --accent-soft: #f5edff;
  --page: #fbf8ff;
}

.learning-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: -0.75rem auto 1.5rem;
}

.learning-summary span {
  padding: 0.4rem 0.65rem;
  color: #536074;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
}

.learning-summary .streak-pill { color: #9a3412; background: #fff7ed; border-color: #fed7aa; }
.learning-summary .streak-pill::before { content: "🔥"; margin-right: .2rem; filter: grayscale(1); }
.learning-summary .streak-pill.is-active::before { filter: none; }

.alex-bundle-list {
  display: grid;
  min-width: 0;
  gap: 0.85rem;
  width: min(100%, 680px);
  margin: 0 auto;
  text-align: left;
}

.alex-bundle-card {
  min-width: 0;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(31,43,61,.07);
}

.alex-bundle-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.alex-bundle-head h2 { margin: 0; font-size: 1.25rem; line-height: 1.25; }
.alex-bundle-head p { margin: .25rem 0 0; color: var(--muted); }
.alex-bundle-head .primary-button { min-width: 112px; }
.bundle-study-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-top: .8rem; }
.direction-switch { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .45rem .7rem; color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent), white 68%); border-radius: 12px; font-size: .88rem; font-weight: 750; cursor: pointer; }
.direction-switch input { width: 20px; height: 20px; accent-color: var(--accent); }
.bundle-active-progress { margin: .8rem 0 0; padding: .6rem .75rem; color: var(--accent); background: var(--accent-soft); border-radius: 10px; font-weight: 750; }
.bundle-empty-history { margin: .75rem 0 0; color: var(--muted); font-size: .9rem; }
.bundle-history { display: grid; gap: .35rem; margin-top: .8rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.bundle-history > strong { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.bundle-history span { display: grid; grid-template-columns: 1fr auto auto; gap: .8rem; align-items: center; font-size: .9rem; }
.bundle-history b { font-weight: 700; }

.warmup-badge {
  width: fit-content;
  margin: 0 auto 0.7rem;
  padding: 0.35rem 0.7rem;
  color: #6b3a00;
  background: #fff5d6;
  border: 1px solid #f2d285;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.text-button {
  padding: 0.35rem 0;
  color: var(--accent);
  background: transparent;
  border: 0;
  font-weight: 750;
  cursor: pointer;
}

.login-screen {
  max-width: 520px;
  text-align: center;
}

.login-screen .language-pill {
  margin: 0 auto 1rem;
}

.login-screen h1 {
  margin-bottom: 0.5rem;
  font-size: clamp(2.3rem, 9vw, 4rem);
}

.login-screen > p {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.login-card,
.admin-card {
  padding: clamp(1rem, 4vw, 1.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 14px 36px rgba(31, 43, 61, 0.08);
}

.login-card {
  display: grid;
  gap: 0.8rem;
  text-align: left;
}

.login-card label,
.bundle-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 750;
}

.login-card input,
.bundle-form input,
.bundle-form select,
.bundle-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.8rem;
  color: var(--text);
  background: #fbfcfe;
  border: 1px solid #b8c4d5;
  border-radius: 11px;
}

.bundle-form textarea {
  resize: vertical;
  line-height: 1.45;
}

.role-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.role-button {
  min-height: 48px;
  color: #465267;
  background: #f2f5f9;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}

.role-button.is-selected {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #9bb4ff;
  box-shadow: inset 0 0 0 1px #9bb4ff;
}

.form-error {
  margin: 0;
  padding: 0.65rem 0.8rem;
  color: #a12018;
  background: #fff0ed;
  border: 1px solid #ffc9c2;
  border-radius: 10px;
  font-weight: 650;
}

.parent-area {
  width: min(100%, 900px);
}

.parent-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.parent-heading h1 {
  margin: 0.5rem 0 0;
}

.bundle-form {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.bundle-form h2,
.bundle-card h2 {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.form-actions,
.bundle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.bundle-list {
  display: grid;
  gap: 0.75rem;
}

.bundle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.bundle-card p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.bundle-actions button {
  min-height: 42px;
  padding: 0.5rem 0.7rem;
  color: #33415a;
  background: #f2f5f9;
  border: 1px solid #c8d1de;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.bundle-actions .danger-button {
  color: #a12018;
  background: #fff4f2;
  border-color: #ffc9c2;
}

.status-chip {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.5rem;
  color: #465267;
  background: #eef1f5;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-active { color: #08783f; background: #dcfce7; }
.status-completed { color: #2457d6; background: #edf2ff; }
.status-disabled { color: #667085; background: #e4e7ec; }
.bundle-card.is-disabled { opacity: .62; background: #f2f4f7; }

.bundle-card { flex-wrap: wrap; }
.form-grid > label, .form-grid input { min-width: 0; max-width: 100%; }
.bundle-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin: 0.65rem 0 0;
}
.bundle-stats dt { color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.bundle-stats dd { margin: 0.1rem 0 0; font-weight: 800; }
.bundle-stats small { display: block; color: var(--muted); font-weight: 500; font-size: 0.75rem; }
.hard-words { flex-basis: 100%; border-top: 1px solid var(--line); padding-top: 0.75rem; }
.hard-words > p { margin: 0 0 0.6rem; font-size: 0.88rem; }
.hard-words ul { display: grid; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.hard-words label { display: flex; align-items: center; gap: 0.7rem; min-height: 44px; padding: 0.35rem 0.5rem; border-radius: 10px; cursor: pointer; }
.hard-words label:hover { background: #f2f5f9; }
.hard-words input { width: 22px; height: 22px; flex: none; }
.hard-words small { display: block; color: var(--muted); font-size: 0.8rem; }

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

.empty-page {
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--surface);
}

.site-footer {
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer a {
  font-size: 0.95rem;
  color: inherit;
}

.preview-dialog { width: min(calc(100% - 1.5rem), 680px); max-height: min(86svh, 820px); padding: 1rem; color: var(--text); background: var(--surface); border: 0; border-radius: 22px; box-shadow: 0 24px 80px rgba(24,33,47,.28); }
.preview-dialog::backdrop { background: rgba(24,33,47,.55); backdrop-filter: blur(3px); }
.preview-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.preview-heading h2 { margin: .2rem 0 0; }
.dialog-close { width: 44px; height: 44px; color: var(--muted); background: #f2f5f9; border: 0; border-radius: 50%; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.preview-description { color: var(--muted); }
.preview-words { display: grid; max-height: 56svh; overflow: auto; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: 14px; }
.preview-word { display: grid; grid-template-columns: 2rem minmax(0,1fr) minmax(0,1fr); gap: .65rem; padding: .7rem; align-items: start; }
.preview-word + .preview-word { border-top: 1px solid var(--line); }
.preview-word > span { color: var(--muted); font-size: .82rem; }
.preview-word strong,.preview-word b { overflow-wrap: anywhere; }
.preview-word b { color: var(--accent); }

.docs-page {
  background: var(--page);
}

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0.75rem max(1rem, env(safe-area-inset-left));
  color: var(--surface);
  background: #18212f;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.docs-topbar a {
  color: inherit;
  font-weight: 650;
  text-decoration: none;
}

.docs-topbar span {
  color: #b9c3d1;
  font-size: 0.9rem;
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 860px);
  gap: 2rem;
  justify-content: center;
  width: min(100%, 1220px);
  margin: 0 auto;
  padding: 2rem 1.25rem 5rem;
}

.docs-toc {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.docs-toc strong {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.docs-toc ul {
  margin: 0;
  padding-left: 1.1rem;
}

.docs-toc li {
  margin: 0.35rem 0;
}

.docs-toc ul ul {
  margin-top: 0.3rem;
  font-size: 0.9rem;
}

.docs-toc a {
  color: #465267;
  text-decoration: none;
}

.docs-toc a:hover {
  color: var(--accent);
}

.docs-content {
  min-width: 0;
  padding: clamp(1.25rem, 4vw, 3rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(31, 43, 61, 0.06);
}

.docs-content > h1:not(:first-child) {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 2px solid var(--line);
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  scroll-margin-top: 88px;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2rem, 6vw, 3.15rem);
  letter-spacing: -0.035em;
}

h2 {
  margin-top: 2.7rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

h3 {
  margin-top: 2rem;
  font-size: 1.25rem;
}

p,
ul,
ol,
blockquote,
table,
pre {
  margin-top: 0;
  margin-bottom: 1.15rem;
}

li + li {
  margin-top: 0.35rem;
}

code {
  padding: 0.12rem 0.35rem;
  background: var(--accent-soft);
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

pre {
  max-width: 100%;
  overflow: auto;
  padding: 1rem;
  color: #f5f7fb;
  background: #18212f;
  border-radius: 10px;
}

pre code {
  padding: 0;
  color: inherit;
  background: transparent;
}

blockquote {
  margin-left: 0;
  padding: 0.75rem 1rem;
  color: #465267;
  background: #f5f7fa;
  border-left: 4px solid #9aabc2;
}

.table-wrap,
.docs-content table {
  max-width: 100%;
}

table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-spacing: 0;
  border-collapse: collapse;
}

th,
td {
  padding: 0.7rem 0.8rem;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--line);
}

th {
  background: #f2f5f9;
}

@media (max-width: 800px) {
  .docs-topbar span {
    display: none;
  }

  .docs-layout {
    display: block;
    padding: 1rem 0.75rem 3rem;
  }

  .docs-toc {
    position: static;
    max-height: none;
    margin-bottom: 1rem;
  }

  .docs-toc ul ul {
    display: none;
  }

  .docs-content {
    border-radius: 14px;
  }
}

@media (hover: none), (max-width: 560px) {
  .game-shell {
    align-items: start;
    padding-top: 1rem;
  }

  .word-card {
    min-height: 290px;
    border-radius: 20px;
  }

  .choice {
    min-height: 64px;
  }

  .site-footer {
    padding: 1rem;
  }

  .verification-active {
    grid-template-rows: 1fr;
  }

  .verification-active .app-header,
  .verification-active .site-footer {
    display: none;
  }

  .verification-active .game-shell {
    place-items: start center;
    min-height: var(--visual-viewport-height);
    padding: max(0.35rem, env(safe-area-inset-top)) 0.75rem 0.35rem;
  }

  .keyboard-open {
    overflow: hidden;
  }

  .keyboard-open .game-shell {
    height: var(--visual-viewport-height);
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
  }

  .keyboard-open #game-screen {
    margin: 0;
  }

  .keyboard-open .session-status {
    margin-bottom: 0.15rem;
  }

  .keyboard-open .progress-track {
    margin-bottom: 0.25rem;
  }

  .is-verifying .session-status {
    margin-bottom: 0.25rem;
  }

  .is-verifying .status-label {
    font-size: 0.68rem;
  }

  .is-verifying .session-status strong {
    font-size: 1rem;
    line-height: 1.1;
  }

  .is-verifying .progress-track {
    height: 6px;
    margin-bottom: 0.4rem;
  }

  .is-verifying .var-badge {
    margin-bottom: 0.35rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
  }

  .is-verifying .warmup-badge {
    margin-bottom: 0.35rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
  }

  .is-verifying .word-card {
    min-height: 0;
    padding: 0.75rem;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(31, 43, 61, 0.08);
  }

  .is-verifying #question-view {
    align-self: start;
  }

  .is-verifying .word-card h2 {
    margin: 0 0 0.45rem;
    font-size: clamp(1.35rem, 6vw, 1.8rem);
    line-height: 1.05;
  }

  .is-verifying .answer-form {
    align-self: start;
    gap: 0.4rem;
  }

  .is-verifying .answer-form label {
    font-size: 0.85rem;
    line-height: 1.2;
  }

  .is-verifying .answer-form input {
    min-height: 48px;
    padding: 0.55rem 0.75rem;
    font-size: 1.05rem;
  }

  .is-verifying .suggestions {
    gap: 0.35rem;
  }

  .is-verifying .suggestions button {
    min-height: 40px;
    padding: 0.4rem 0.5rem;
    font-size: 0.9rem;
    line-height: 1.15;
  }

  .is-verifying .primary-button {
    min-height: 46px;
    padding: 0.55rem 0.75rem;
  }

  .keyboard-open .is-verifying .word-card {
    padding: 0.55rem 0.65rem;
  }

  .keyboard-open .is-verifying .word-card h2 {
    margin-bottom: 0.25rem;
    font-size: clamp(1.15rem, 4.5vw, 1.55rem);
  }

  .keyboard-open .is-verifying .answer-form {
    gap: 0.3rem;
  }

  .keyboard-open .is-verifying .answer-form label {
    font-size: 0.78rem;
  }

  .keyboard-open .is-verifying .answer-form input {
    min-height: 44px;
    padding-block: 0.4rem;
  }

  .keyboard-open .is-verifying .suggestions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem;
  }

  .keyboard-open .is-verifying .suggestions button {
    min-height: 34px;
    padding: 0.3rem 0.4rem;
    font-size: 0.82rem;
  }

  .keyboard-open .is-verifying .primary-button {
    min-height: 40px;
    padding-block: 0.4rem;
  }

  .parent-heading,
  .bundle-card {
    align-items: stretch;
    flex-direction: column;
  }

  .bundle-card { flex-wrap: nowrap; }
  .hard-words { flex-basis: auto; }

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

  .app-header {
    flex-wrap: wrap;
  }

  .account-actions {
    gap: 0.4rem;
  }

  .header-language-switch button {
    padding-inline: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reward-reveal .reward-card,
  .reward-reveal .reward-card .football-card-glow,
  .reward-reveal .reward-confetti i {
    animation: none;
  }
  .reward-card { opacity: 1; transform: none; }
}
