/* ============================================================
   StudyDeck "Bold blocks" theme: flat color, thick ink outlines, hard shadows,
   chunky type and lots of springy motion. Loaded after styles.css and wins the cascade.
   ============================================================ */

/* ============ Tokens ============ */
:root {
  --ink: #141414;               /* outlines and hard shadows */
  --line: var(--ink);
  --shadow-ink: var(--ink);

  --primary: #FF5B37;           /* tomato: main actions */
  --primary-strong: #E8431F;
  --primary-soft: #FFE3DA;
  --primary-ink: #B8321A;       /* tomato dark enough for text */
  --on-primary: #141414;
  --accent: #FFC93C;            /* sun: rewards, streaks */
  --accent-2: #3B6CF6;          /* blue */
  --accent-soft: #FFF1C9;
  --mint: #2DBE8C;
  --lilac: #B79CFF;

  --bg: #FFFBF2;
  --surface: #FFFFFF;
  --surface-2: #F4EEDF;
  --text: #141414;
  --muted: #5C574D;
  --border: #E4DCC8;            /* soft dividers inside components */

  --good: #12804F; --good-soft: #D2F5E6;
  --bad: #D0381F;  --bad-soft: #FFE1D9;
  --warn: #9A6400; --warn-soft: #FFF1C9;
  --star: #FFB627;

  --shadow-sm: 2px 2px 0 var(--shadow-ink);
  --shadow: 4px 4px 0 var(--shadow-ink);
  --shadow-lg: 6px 6px 0 var(--shadow-ink);
  --glow: 3px 3px 0 var(--shadow-ink);
  --radius: 18px;
  --radius-sm: 12px;
  --bounce: cubic-bezier(.3, 1.35, .5, 1);
  --topbar-bg: rgba(255, 251, 242, .9);
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
}
[data-theme="dark"] {
  --ink: #F3EEE3;
  --line: #F3EEE3;
  --shadow-ink: #000;
  --primary: #FF6A48;
  --primary-strong: #FF8466;
  --primary-soft: rgba(255, 106, 72, .18);
  --primary-ink: #FF9C83;
  --on-primary: #141414;
  --accent-soft: rgba(255, 201, 60, .16);
  --bg: #17151C;
  --surface: #24212B;
  --surface-2: #2E2A37;
  --text: #F3EEE3;
  --muted: #B9B1A3;
  --border: #3B3646;
  --good: #4FDBA5; --good-soft: rgba(79, 219, 165, .16);
  --bad: #FF8A72;  --bad-soft: rgba(255, 138, 114, .16);
  --warn: #FFC93C; --warn-soft: rgba(255, 201, 60, .14);
  --topbar-bg: rgba(23, 21, 28, .9);
}

/* ============ Base ============ */
body { font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16px; }
h1, h2, h3, .brand-name, .qprompt, .face-text, .hero-stat b, .stats b, .timer, .score-ring, .wl-copy h1, .wl-h, .count {
  font-family: var(--display); letter-spacing: -.025em;
}
h1 { font-weight: 800; font-size: clamp(30px, 4.2vw, 48px); line-height: 1.02; }
h2 { font-weight: 800; }
::selection { background: var(--accent); color: #141414; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }
body::after { display: none; } /* no film grain: flat color */

/* ============ Background: floating outlined shapes ============ */
.blob, .dots { display: none; }
.backdrop::before {
  content: ""; position: absolute; inset: -60px;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 14%, transparent) 1.4px, transparent 1.6px);
  background-size: 30px 30px; animation: pan 80s linear infinite;
}
[data-theme="dark"] .backdrop::before { opacity: .45; }
.floaters span {
  bottom: -140px; width: 54px; height: 54px; border-radius: 14px; background: var(--primary); backdrop-filter: none;
  border: 2px solid var(--line); box-shadow: 3px 3px 0 var(--shadow-ink); animation-name: shapeRise;
}
.floaters span:nth-child(2) { background: var(--accent); border-radius: 50%; border-color: var(--line); width: 44px; height: 44px; }
.floaters span:nth-child(3) { background: var(--accent-2); clip-path: polygon(50% 0, 100% 100%, 0 100%); border: 0; box-shadow: none; width: 52px; height: 46px; }
.floaters span:nth-child(4) { background: var(--mint); border-radius: 999px; width: 76px; height: 28px; border-color: var(--line); }
.floaters span:nth-child(5) { background: var(--lilac); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); border: 0; box-shadow: none; width: 56px; height: 56px; }
.floaters span:nth-child(6) { background: var(--surface); border-radius: 50%; width: 30px; height: 30px; border-color: var(--line); }
.floaters span:nth-child(7) { background: var(--accent); width: 40px; height: 40px; border-radius: 10px; border-color: var(--line); }
@keyframes shapeRise {
  0% { transform: translateY(0) rotate(-10deg); opacity: 0; }
  8% { opacity: .9; }
  50% { transform: translateY(-60vh) translateX(16px) rotate(60deg); }
  92% { opacity: .75; }
  100% { transform: translateY(-125vh) translateX(-10px) rotate(120deg); opacity: 0; }
}
.floaters { opacity: .22; }
[data-theme="dark"] .floaters { opacity: .16; }

/* ============ Top bar ============ */
.topbar { background: var(--topbar-bg); border-bottom: 2px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.brand-name { font-weight: 800; font-size: 23px; }
.logo-img { border: 2px solid var(--line); border-radius: 11px; box-shadow: 2px 2px 0 var(--shadow-ink); transition: transform .5s var(--bounce); }
.brand:hover .logo-img { transform: rotate(-6deg) scale(1.04); }
@keyframes wiggle { 25% { rotate: 3deg; } 50% { rotate: -2deg; } 75% { rotate: 1deg; } }
.search input { border: 2px solid var(--line); border-radius: 12px; background: var(--surface); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.search input:focus { border-color: var(--line); box-shadow: 4px 4px 0 var(--accent-2); transform: translate(-2px, -2px); }
.kbd { border: 2px solid var(--line); border-radius: 6px; color: var(--text); font-family: "Figtree", sans-serif; }
.topbar .btn.ghost { position: relative; }
.topbar .btn.ghost::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 3px; border-radius: 3px; background: var(--primary);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--bounce);
}
.topbar .btn.ghost:hover { background: transparent; transform: none; box-shadow: none; }
.topbar .btn.ghost:hover::after { transform: scaleX(1); }
.streak { background: var(--accent); color: #141414; border: 2px solid var(--line); box-shadow: 2px 2px 0 var(--shadow-ink); }
[data-theme="dark"] .streak { color: #141414; }
.signin-pill { border: 2px solid var(--line) !important; box-shadow: 2px 2px 0 var(--shadow-ink); }
.signin-tip { border: 2px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }

/* ============ Buttons: press-in-able blocks ============ */
.btn {
  border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font-weight: 700;
  box-shadow: 3px 3px 0 var(--shadow-ink);
  transition: transform .18s var(--bounce), box-shadow .18s var(--bounce), background .2s, color .2s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow-ink); border-color: var(--line); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-ink); transition-duration: .06s; }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--line); box-shadow: 3px 3px 0 var(--shadow-ink); }
.btn.primary:hover { background: var(--primary); box-shadow: 4px 4px 0 var(--shadow-ink); }
.btn.primary .ic { transition: transform .35s var(--bounce); }
.btn.primary:hover .ic { transform: scale(1.08); }
.btn.ghost { border-color: transparent; box-shadow: none; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); box-shadow: none; transform: translateY(-1px); }
.btn.on { background: var(--accent); color: #141414; border-color: var(--line); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--line); }
.btn.small { border-radius: 10px; box-shadow: 2px 2px 0 var(--shadow-ink); }
.btn.small:hover { box-shadow: 3px 3px 0 var(--shadow-ink); }
.btn.big { border-radius: 14px; font-family: var(--display); font-weight: 800; font-size: 18px; box-shadow: 4px 4px 0 var(--shadow-ink); }
.btn.big:hover { box-shadow: 5px 5px 0 var(--shadow-ink); }
.btn:disabled, .btn:disabled:hover { transform: none; box-shadow: 2px 2px 0 var(--shadow-ink); }
.icon-btn { color: var(--text); border: 2px solid transparent; transition: transform .35s var(--bounce), background .2s, border-color .2s; }
.icon-btn:hover { background: var(--accent); color: #141414; border-color: var(--line); transform: scale(1.04); }
#themeBtn:hover { transform: rotate(30deg) scale(1.04); }
.link { color: var(--primary-ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.back { color: var(--text); }
.back:hover { color: var(--primary-ink); }

/* ============ Surfaces ============ */
.panel, .row-card, .term-row, .tq, .opt, .fb-card, .dropzone, .mode-switch, .ai-files li, .quiz-progress {
  border: 2px solid var(--line);
}
.panel { border-radius: 20px; box-shadow: var(--shadow); }
.field { border: 2px solid var(--line); border-radius: 12px; transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.field:focus { border-color: var(--line); box-shadow: 4px 4px 0 var(--accent-2); transform: translate(-2px, -2px); }
.row-card { box-shadow: var(--shadow); }
.row-card:focus-within { border-color: var(--line); box-shadow: 6px 6px 0 var(--accent-2); }
.row-fields textarea { border-bottom: 2px dashed var(--border); }
.row-fields textarea:focus { border-bottom: 2px solid var(--primary); }
.add-row { border: 2px dashed var(--line); color: var(--text); }
.add-row:hover { border-style: solid; background: var(--accent-soft); box-shadow: var(--shadow-sm); transform: translate(-1px, -1px); }
.pill { background: var(--accent); color: #141414; border: 2px solid var(--line); font-weight: 800; }

[data-theme="dark"] .pill { color: #141414; }
code { border: 1.5px solid var(--border); }

/* ============ Home ============ */
.hero {
  background: var(--accent-2); color: #fff; border: 2px solid var(--line); border-radius: 26px; box-shadow: 8px 8px 0 var(--shadow-ink);
  animation: heroIn .7s var(--bounce) both;
}
.hero::before {
  opacity: 1; background-image: radial-gradient(rgba(255, 255, 255, .28) 1.6px, transparent 1.9px); background-size: 24px 24px;
  -webkit-mask-image: none; mask-image: none;
}
.hero::after {
  width: 180px; height: 180px; right: -40px; top: -50px; border-radius: 50%; background: var(--accent); border: 2px solid var(--ink);
  animation: spinSlow 14s ease-in-out infinite;
}
[data-theme="dark"] .hero::after { border-color: #141414; }
@keyframes spinSlow { 50% { transform: translate(-8px, 6px); } }
@keyframes heroIn { from { opacity: 0; transform: translateY(12px); } }
.hero h1 { color: #fff; font-size: clamp(30px, 4.4vw, 50px); }
.hero p { opacity: 1; font-size: 17px; }
.hero-stat {
  background: var(--surface); color: var(--text); border: 2px solid #141414; border-radius: 14px; backdrop-filter: none; box-shadow: 3px 3px 0 #141414;
  animation: popIn .6s var(--bounce) both;
}
.hero-stat:nth-child(1) { animation-delay: .25s; background: var(--accent); color: #141414; }
.hero-stat:nth-child(2) { animation-delay: .35s; }
.hero-stat:nth-child(3) { animation-delay: .45s; background: var(--mint); color: #141414; }
.hero-stat:nth-child(4) { animation-delay: .55s; background: var(--primary); color: #141414; }
.hero-stat:hover { transform: translate(-1px, -2px); box-shadow: 4px 4px 0 #141414; }
.hero-stat span { opacity: .85; font-weight: 600; }
.hero-stat.fire b { color: inherit; }
.hero-stat.fire .ic { fill: var(--primary); stroke: #141414; }
.hero .btn { background: #fff; color: #141414; border-color: #141414; box-shadow: 3px 3px 0 #141414; }
.hero .btn:hover { box-shadow: 4px 4px 0 #141414; }
.hero .btn.glass { background: transparent; color: #fff; border: 2px solid #fff; box-shadow: none; }
.hero .btn.glass:hover { background: rgba(255, 255, 255, .15); box-shadow: 4px 4px 0 #141414; }
@keyframes popIn { from { opacity: 0; transform: scale(.92); } }

.section-head h2 { position: relative; display: inline-block; }
.section-head h2::after, .wl-h::after {
  content: ""; display: block; height: 6px; margin-top: 2px; border-radius: 6px; background: var(--primary);
  transform-origin: left; animation: underlineIn .8s var(--bounce) .3s both;
}
@keyframes underlineIn { from { transform: scaleX(0); } }
.wl-h::after { width: 80px; margin: 8px auto 0; }

.set-card {
  border: 2px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  transition: transform .3s var(--bounce), box-shadow .3s var(--bounce);
}
.set-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow-ink); border-color: var(--line); }
.set-card:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-ink); }
.cover { background: var(--c1); border-bottom: 2px solid var(--line); }
.cover::before { -webkit-mask-image: none; mask-image: none; opacity: .7; background-size: 14px 14px; }
.cover::after { border: 2px solid rgba(20, 20, 20, .5); background: var(--c2); }
.set-card > .cover-emoji { border: 2px solid var(--line); border-radius: 14px; box-shadow: 3px 3px 0 var(--shadow-ink); }
.set-card:hover .cover-emoji { transform: translateY(-3px) rotate(-4deg); }
.cover > .pill { background: var(--surface); color: var(--text); border: 2px solid var(--line); backdrop-filter: none; box-shadow: none; }
.set-card h3 { font-family: var(--display); font-weight: 800; font-size: 20px; }
.mastery { height: 12px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.mastery > div { background: var(--mint); border-radius: 999px; }
.spot::after { display: none; }

/* ============ Set page ============ */
.mode-tile {
  border: 2px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); font-family: var(--display);
  transition: transform .3s var(--bounce), box-shadow .3s var(--bounce), background .2s;
}
.mode-tile:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow-ink); border-color: var(--line); background: var(--accent-soft); }
.mode-tile:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-ink); }
.mode-tile small { font-family: "Figtree", sans-serif; }
.mode-icon { background: var(--accent); color: #141414; border: 2px solid var(--line); border-radius: 14px; }
.mode-tile:nth-child(3n+2) .mode-icon { background: var(--mint); }
.mode-tile:nth-child(3n) .mode-icon { background: var(--lilac); }
.mode-tile:hover .mode-icon { background: var(--primary); color: #141414; transform: rotate(-6deg) scale(1.06); }
@keyframes jelly { 30% { scale: 1.25 .8; } 50% { scale: .85 1.15; } 70% { scale: 1.08 .95; } }
.term-row { border-radius: 14px; }
.term-row:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-sm); border-color: var(--line); }
.term-row .t { font-weight: 800; border-right: 2px dashed var(--border); }
.switch input { border: 2px solid var(--line); height: 24px; width: 42px; background: var(--surface-2); }
.switch input::after { top: 2px; left: 2px; border: 2px solid var(--line); box-shadow: none; width: 16px; height: 16px; }
.switch input:checked { background: var(--mint); }
.switch input:checked::after { transform: translateX(18px); }

/* ============ Study chrome ============ */
.mode-switch { border-radius: 16px; box-shadow: var(--shadow); }
.mode-switch a { color: var(--text); transition: background .2s, transform .3s var(--bounce); }
.mode-switch a:hover { background: var(--accent-soft); }
.mode-switch a.active { background: var(--primary); color: #141414; box-shadow: inset 0 0 0 2px var(--line); }
.opts-bar select, .fc-options select, .setup-grid select, .setup-grid input[type=number] { border: 2px solid var(--line); }

.progress { height: 16px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); }
.progress.thin { height: 12px; }
.progress > div, .qp-bar div, .mini-bar i {
  background-color: var(--mint); border-right: 2px solid var(--line);
  background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .35) 0 8px, transparent 8px 16px);
  background-size: 22.6px 22.6px; animation: stripes 2.4s linear infinite;
}
.progress > div::after { display: none; }
@keyframes stripes { to { background-position: 22.6px 0; } }
.qp-bar { border: 2px solid var(--line); }

/* ============ Flashcards ============ */
.flashcard .face { border: 2px solid var(--line); border-radius: 26px; box-shadow: 8px 8px 0 var(--shadow-ink); }
.flashcard .face::before { display: none; }
.flashcard .back { background: var(--accent-soft); }
.flashcard:hover .face { border-color: var(--line); }
.flashcard:hover { animation: none; }
.flashcard .face { transition: transform .8s var(--bounce); }
.flashcard.in-next { animation: cardNext .55s var(--bounce); }
.flashcard.in-prev { animation: cardPrev .55s var(--bounce); }
@keyframes cardNext { from { opacity: 0; transform: translateX(50px) rotate(2deg); } }
@keyframes cardPrev { from { opacity: 0; transform: translateX(-50px) rotate(-2deg); } }
.face-text { font-weight: 800; }
.round { border: 2px solid var(--line); box-shadow: 3px 3px 0 var(--shadow-ink); }
.round:hover:not(:disabled) { border-color: var(--line); color: var(--text); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow-ink); background: var(--accent-soft); }
.round:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow-ink); }
.round.good, .round.bad { border-color: var(--line); }
.round.good:hover { background: var(--mint); color: #141414; border-color: var(--line); }
.round.bad:hover { background: var(--primary); color: #141414; border-color: var(--line); }
.track-counts span { border: 2px solid var(--line); }

/* ============ Questions ============ */
.qcard { border: 2px solid var(--line); border-radius: 24px; box-shadow: 8px 8px 0 var(--shadow-ink); animation: qPop .55s var(--bounce) both; }
@keyframes qPop { from { opacity: 0; transform: translateY(12px); } }
.qcard.celebrate { background: var(--accent-soft); border-color: var(--line); }
.qlabel { color: var(--text); }
.qlabel::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--primary); border: 2px solid var(--line); margin-right: 4px; }
.qprompt { font-weight: 800; }
.choice {
  border: 2px solid var(--line); border-radius: 16px; box-shadow: 3px 3px 0 var(--shadow-ink); font-weight: 700; font-size: 17px;
  animation: choiceIn .5s var(--bounce) both;
  transition: transform .2s var(--bounce), box-shadow .2s var(--bounce), background .2s;
}
@keyframes choiceIn { from { opacity: 0; transform: translateY(8px); } }
.choice:hover:not(:disabled) { border-color: var(--line); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow-ink); background: var(--accent-soft); }
.choice:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow-ink); }
.choice .key { border: 2px solid var(--line); background: var(--surface); color: var(--text); }
.choice.correct { border-color: var(--line); background: var(--mint); color: #141414; animation: correctBounce .7s var(--bounce); }
.choice.correct .key { background: #fff; color: #141414; }
.choice.wrong { border-color: var(--line); background: var(--primary); color: #141414; animation: shake .45s; }
.choice.wrong .key { background: #fff; color: #141414; }
@keyframes correctBounce { 40% { transform: scale(1.025); } }
.fb { font-family: var(--display); font-size: 20px; }
.fb.good-t { animation: popIn .5s var(--bounce) both; }
.fb-card { box-shadow: var(--shadow); }
.fb-card.good { border-color: var(--line); background: var(--good-soft); }
.fb-card.bad { border-color: var(--line); background: var(--bad-soft); }
.fb-card.warn { border-color: var(--line); background: var(--accent-soft); }
.ai-help { border: 2px solid var(--line) !important; border-radius: 16px !important; background: var(--accent-soft) !important; box-shadow: var(--shadow); animation: popIn .45s var(--bounce) both; }
.ai-help-head { color: var(--text) !important; }

/* ============ Test ============ */
.tq { border-radius: 18px; box-shadow: var(--shadow); }
.tq.right { border-color: var(--line); background: color-mix(in srgb, var(--mint) 18%, var(--surface)); }
.tq.wrongq { border-color: var(--line); background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
.tq.pop { animation: correctBounce .6s var(--bounce); }
.opt { border-radius: 12px; transition: transform .2s var(--bounce), background .2s, box-shadow .2s; }
.opt:hover { border-color: var(--line); transform: translateX(2px); }
.opt:has(input:checked) { border-color: var(--line); background: var(--accent-soft); box-shadow: 3px 3px 0 var(--shadow-ink); }
.score-ring { background: conic-gradient(var(--mint) calc(var(--p) * 1%), var(--surface-2) 0); border: 2px solid var(--line); box-shadow: var(--shadow); }
.score-ring::before { border: 2px solid var(--line); }
.quiz-progress { box-shadow: var(--shadow); }

/* ============ Match ============ */
.timer { background: var(--accent); color: #141414; border: 2px solid var(--line); box-shadow: 3px 3px 0 var(--shadow-ink); }
[data-theme="dark"] .timer { color: #141414; }
.tile { border: 2px solid var(--line); box-shadow: 3px 3px 0 var(--shadow-ink); font-weight: 700; }
.tile:hover { border-color: var(--line); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow-ink); }
.tile.sel { border-color: var(--line); background: var(--accent); color: #141414; transform: scale(1.02); box-shadow: 4px 4px 0 var(--shadow-ink); }
.tile.bad { border-color: var(--line); background: var(--primary); color: #141414; }
.tile.gone { transform: scale(.6); }

/* ============ AI page ============ */
.dropzone { border-style: dashed; border-radius: 22px; }
.dropzone:hover, .dropzone.over { border-color: var(--line); border-style: solid; background: var(--accent-soft); box-shadow: var(--shadow); transform: translate(-2px, -2px); }

.drop-icon { border: 2px solid var(--line) !important; background: var(--accent) !important; color: #141414 !important; box-shadow: 3px 3px 0 var(--shadow-ink); }

/* ============ Toast ============ */
#toast { background: #141414; color: #FFFBF2; border: 2px solid #141414; border-radius: 14px; box-shadow: 4px 4px 0 var(--primary); transition: opacity .25s, transform .5s var(--bounce); }
[data-theme="dark"] #toast { background: #FFFBF2; color: #141414; border-color: #FFFBF2; }
#toast.show { transform: translate(-50%, 0) scale(1); }
#toast.reward { background: var(--accent); color: #141414; border-color: #141414; box-shadow: 4px 4px 0 #141414; }

/* ============ Welcome page ============ */
.wl-kicker { background: var(--accent); color: #141414; border: 2px solid var(--line); box-shadow: 2px 2px 0 var(--shadow-ink); }
.wl-copy h1 { font-size: clamp(38px, 6vw, 72px); line-height: .98; font-weight: 800; }
.wl-face { border: 2px solid var(--line); box-shadow: 6px 6px 0 var(--shadow-ink); }
.wl-face b { font-family: var(--display); }
.wl-face.back { background: var(--accent); color: #141414; }
.wl-card:nth-child(2) .wl-face:not(.back) { background: var(--mint); color: #141414; }
.wl-card:nth-child(3) .wl-face:not(.back) { background: var(--lilac); color: #141414; }
.wl-card .wl-face small { color: inherit; opacity: .75; }
.wl-free { border: 2px solid var(--line); box-shadow: var(--shadow); background: var(--surface); }
.wl-free svg { color: var(--primary); }
.wl-feature, .wl-steps li { border: 2px solid var(--line); box-shadow: var(--shadow); transition: transform .3s var(--bounce), box-shadow .3s var(--bounce); }
.wl-feature:hover, .wl-steps li:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow-ink); }
.wl-feature .wd { border-bottom: 2px solid var(--line); }
.wl-steps li::before { background: var(--primary); color: #141414; border: 2px solid var(--line); font-family: var(--display); }
.wl-steps li:nth-child(2)::before { background: var(--accent); }
.wl-steps li:nth-child(3)::before { background: var(--mint); }
.wl-final { background: var(--primary); color: #141414; border: 2px solid var(--line); box-shadow: 8px 8px 0 var(--shadow-ink); }
.wl-final .muted { color: #141414; opacity: .8; }

/* ============ Studio, Explore, Classes, misc cards ============ */
.studio-tool, .studio-item, .ex-card, .cl-card, .lb-card, .gt-level, .acct-card, .account-card, .look-panel, .sheet, .studio-sheet {
  border: 2px solid var(--line) !important; box-shadow: var(--shadow);
}
.studio-tool, .studio-item, .ex-card, .cl-card, .gt-level { transition: transform .3s var(--bounce), box-shadow .3s var(--bounce) !important; }
.studio-tool:hover, .studio-item:hover, .ex-card:hover, .cl-card:hover, .gt-level:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow-ink); }
.studio-banner { border: 2px solid var(--line); box-shadow: var(--shadow); }
.site-footer { border-top: 2px solid var(--line); }
.site-footer a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; transition: color .2s; }
.site-footer a:hover { color: var(--primary-ink); }
.h-icon { background: var(--accent); color: #141414; border: 2px solid var(--line); box-shadow: 2px 2px 0 var(--shadow-ink); }

/* ============ Motion helpers (driven by motion.js) ============ */
/* Headline words that bounce in one by one */
.sd-word { display: inline-block; animation: wordIn .5s var(--ease) both; animation-delay: calc(var(--w) * 40ms + 60ms); }
@keyframes wordIn { from { opacity: 0; transform: translateY(.25em); } }
/* Shapes that burst from a click */
.sd-burst { position: fixed; z-index: 80; pointer-events: none; width: 8px; height: 8px; border: 2px solid #141414; border-radius: 3px; animation: burst .7s cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes burst {
  from { transform: translate(-50%, -50%) scale(.8) rotate(0); opacity: .9; }
  to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.3) rotate(var(--rot)); opacity: 0; }
}
/* Page transitions */
#app.enter > .page, #app.enter > section, #app.enter > .welcome { animation: pageIn .55s var(--bounce) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }
.rise { animation: riseBounce .6s var(--bounce) both; animation-delay: calc(min(var(--i, 0), 10) * 35ms); }
@keyframes riseBounce { from { opacity: 0; transform: translateY(10px); } }
.big-emoji { animation: floatSpin 4s ease-in-out infinite; }
@keyframes floatSpin { 50% { transform: translateY(-5px); } }
.spinner { border-width: 3px; }

/* ============ Responsive ============ */
@media (max-width: 760px) {
  .hero { box-shadow: 5px 5px 0 var(--shadow-ink); }
  .hero::after { width: 110px; height: 110px; }
  .qcard, .flashcard .face { box-shadow: 5px 5px 0 var(--shadow-ink); }
  .floaters span:nth-child(n+4) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .backdrop::before { animation: none; }
}

/* ============ Live game: standings and the grand finale ============ */
.live-lb { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.live-lb li {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow-sm); font-weight: 700;
  transition: transform .8s var(--bounce), background .4s; animation: riseBounce .45s var(--ease) both; animation-delay: calc(var(--i) * 90ms);
}
.live-lb .lb-rank { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--line); font-family: var(--display); font-weight: 800; color: var(--text); }
.live-lb .lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-lb .lb-score { font-family: var(--display); font-size: 20px; font-variant-numeric: tabular-nums; min-width: 60px; text-align: right; }
.live-lb .lb-plus { color: #141414; background: var(--mint); border: 2px solid var(--line); border-radius: 999px; padding: 1px 9px; font-size: 13px; font-weight: 800; opacity: 0; transform: scale(.6); }
.live-lb .lb-miss { color: var(--muted); font-size: 13px; font-weight: 600; opacity: 0; }
.live-lb.counting li { animation: none; }
.live-lb.counting .lb-plus { animation: popIn .45s var(--bounce) forwards; }
.live-lb.counting .lb-plus, .live-lb.counting .lb-miss { opacity: 1; transform: none; transition: opacity .3s; }
.live-lb li.climb { background: var(--accent-soft); }
.live-lb li.leader { background: var(--accent); color: #141414; }
.live-lb li.leader .lb-rank { background: #fff; color: #141414; }
.live-lb li.leader .lb-name::after { content: " 👑"; }

.finale {
  position: fixed; inset: 0; z-index: 75; display: grid; grid-template-rows: auto auto auto 1fr auto; justify-items: center;
  padding: 24px 20px 40px; overflow: hidden; background: #0E0D12; color: #FFFBF2; opacity: 0; transition: opacity .5s var(--ease);
}
.finale.in { opacity: 1; }
.finale.out { opacity: 0; }
.finale-spot {
  position: absolute; inset: -20%; pointer-events: none;
  background: radial-gradient(circle at var(--sx, 30%) 40%, rgba(255, 251, 242, .16), transparent 28%), radial-gradient(circle at var(--sx2, 70%) 50%, rgba(255, 201, 60, .12), transparent 24%);
  animation: sweep 6s ease-in-out infinite alternate;
}
.finale.tense .finale-spot { animation-duration: .9s; }
.finale.win .finale-spot { background: radial-gradient(circle at 50% 55%, rgba(255, 201, 60, .35), transparent 45%); animation: none; }
@property --sx { syntax: '<percentage>'; inherits: false; initial-value: 30%; }
@property --sx2 { syntax: '<percentage>'; inherits: false; initial-value: 70%; }
@keyframes sweep { to { --sx: 70%; --sx2: 30%; } }
.finale-bar { justify-self: end; display: flex; gap: 8px; position: relative; }
.finale-line {
  position: relative; margin: 6vh 0 0; text-align: center; font-size: clamp(30px, 5.5vw, 64px); color: #FFFBF2;
  opacity: 0; transform: translateY(14px);
}
.finale-line.show { opacity: 1; transform: none; transition: opacity .45s var(--ease), transform .6s var(--bounce); }
.finale-line.big { font-size: clamp(36px, 7vw, 84px); }
.finale.tense .finale-line { animation: tremble .12s linear infinite; }
@keyframes tremble { 25% { translate: 1px 0; } 75% { translate: -1px 0; } }
.finale-line.name { color: var(--accent); font-size: clamp(40px, 8vw, 96px); }
.finale-rest { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; min-height: 40px; }
.finale-rest span { padding: 6px 14px; border: 2px solid #FFFBF2; border-radius: 999px; font-weight: 700; animation: popIn .5s var(--bounce) both; animation-delay: calc(var(--i) * 300ms); }
.finale-podium { position: relative; align-self: end; display: flex; align-items: flex-end; justify-content: center; gap: clamp(8px, 2vw, 18px); width: min(640px, 100%); }
.fp { flex: 1; max-width: 200px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fp-who { display: grid; justify-items: center; text-align: center; opacity: 0; transform: translateY(20px) scale(.8); }
.fp-who b { font-family: var(--display); font-size: clamp(18px, 2.6vw, 28px); line-height: 1.1; word-break: break-word; }
.fp-who span { opacity: .75; font-weight: 600; }
.fp-crown { font-size: 40px; transform: translateY(-80px) rotate(-20deg); opacity: 0; }
.fp-block {
  width: 100%; height: 0; display: grid; place-items: center; overflow: hidden; color: #141414; font-family: var(--display); font-size: 40px; font-weight: 800;
  border: 2px solid #FFFBF2; border-bottom: 0; border-radius: 14px 14px 0 0; transition: height 1s var(--bounce);
}
.fp1 .fp-block { background: var(--accent); } .fp2 .fp-block { background: #C9D1DD; } .fp3 .fp-block { background: #F2A27E; }
.fp.up .fp-who { opacity: 1; transform: none; transition: opacity .4s .5s, transform .7s var(--bounce) .5s; }
.fp1.up .fp-block { height: min(34vh, 260px); } .fp2.up .fp-block { height: min(25vh, 190px); } .fp3.up .fp-block { height: min(18vh, 140px); }
.fp1.up .fp-crown { opacity: 1; transform: none; transition: transform .9s var(--bounce) 1s, opacity .3s 1s; }
.finale-done { position: relative; margin-top: 22px; }
.finale-done:not([hidden]) { animation: popIn .5s var(--bounce) both; }
.finale .btn:not(.primary) { background: transparent; color: #FFFBF2; border-color: #FFFBF2; box-shadow: none; }
.finale-wait .drum { animation: drum .25s ease-in-out infinite alternate; }
@keyframes drum { to { transform: rotate(-8deg) scale(1.06); } }
@media (prefers-reduced-motion: reduce) {
  .fp-block, .fp-who, .fp-crown { transition: none !important; }
  .finale-spot { animation: none; }
}

/* ============ Long-form pages (About, Privacy, Terms) ============ */
.page.doc { max-width: 1120px; }
.doc-head { max-width: 760px; margin-bottom: 28px; }
.doc-kicker { display: inline-block; margin: 0 0 12px; padding: 4px 12px; border: 2px solid var(--line); border-radius: 999px; background: var(--accent); color: #141414; font-weight: 800; font-size: 13px; box-shadow: 2px 2px 0 var(--shadow-ink); }
.doc-head h1 { font-size: clamp(36px, 5vw, 58px); margin-bottom: 6px; }
.doc-intro { font-size: 18px; line-height: 1.6; }
.doc-intro .row { margin-top: 18px; }
.doc-summary { margin-top: 18px; padding: 16px 20px; border: 2px solid var(--line); border-radius: 18px; background: var(--accent-soft); box-shadow: var(--shadow); font-size: 16px; }
.doc-summary ul { margin: 8px 0 0; padding-left: 20px; }
.doc-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; align-items: start; }
.doc-toc { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow: auto; border: 2px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); padding: 14px 10px 14px 14px; }
.doc-toc summary { font-family: var(--display); font-weight: 800; font-size: 16px; cursor: pointer; list-style: none; padding: 2px 4px 8px; }
.doc-toc summary::-webkit-details-marker { display: none; }
.doc-toc ol { list-style: none; margin: 0; padding: 0; }
.doc-toc ol ol { margin: 2px 0 6px 26px; }
.doc-toc button { display: flex; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; transition: background .15s; }
.doc-toc ol ol button { font-weight: 500; font-size: 13px; color: var(--muted); padding: 4px 8px; }
.doc-toc button span { flex: none; min-width: 18px; font-variant-numeric: tabular-nums; color: var(--muted); }
.doc-toc button:hover { background: var(--surface-2); }
.doc-toc button.on { background: var(--accent-soft); color: var(--text); }
.doc-body { max-width: 760px; line-height: 1.7; font-size: 16.5px; }
.doc-sec { scroll-margin-top: 90px; padding-bottom: 12px; margin-bottom: 30px; border-bottom: 2px dashed var(--border); }
.doc-sec h2 { display: flex; align-items: center; gap: 12px; font-size: clamp(24px, 3vw, 32px); margin: 0 0 10px; }
.doc-num { flex: none; display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 8px; border: 2px solid var(--line); border-radius: 12px; background: var(--primary); color: #141414; font-size: 18px; box-shadow: 2px 2px 0 var(--shadow-ink); }
.doc-sec:nth-child(3n+2) .doc-num:not(.sm) { background: var(--accent); }
.doc-sec:nth-child(3n) .doc-num:not(.sm) { background: var(--mint); }
.doc-num.sm { min-width: 0; height: auto; padding: 0; border: 0; background: none; box-shadow: none; color: var(--muted); font-size: 14px; margin-right: 2px; }
.doc-lead { font-size: 18px; color: var(--muted); margin: 0 0 8px; }
.doc-sub { scroll-margin-top: 90px; margin: 18px 0 0; }
.doc-sub h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 4px; font-size: 19px; }
.doc-sub p { margin: 0 0 10px; }
.doc-sub ul { margin: 6px 0 10px; padding-left: 22px; }
.doc-sub li { margin: 4px 0; }
.doc-qa dt { font-weight: 800; margin-top: 14px; }
.doc-qa dd { margin: 4px 0 0; color: var(--muted); }
.doc-keys { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.doc-keys kbd, .doc-body kbd { display: inline-block; min-width: 24px; padding: 1px 7px; border: 2px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 2px 2px 0 var(--shadow-ink); font: 700 13px/1.4 "Figtree", sans-serif; text-align: center; }
.doc-body .data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc-body .data-table th, .doc-body .data-table td { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--border); vertical-align: top; }
.doc-body .table-wrap { overflow-x: auto; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); }
.doc-foot { margin-top: 10px; }
@media (max-width: 900px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .doc-toc { position: static; max-height: none; }
}

/* ============ Contact us ============ */
.contact-fab { position: fixed; right: 20px; bottom: 20px; z-index: 65; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.contact-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px; border: 2px solid var(--line); border-radius: 999px;
  background: var(--accent); color: #141414; font: 800 15px/1 "Figtree", sans-serif; box-shadow: 3px 3px 0 var(--shadow-ink); cursor: pointer;
  transition: transform .18s var(--bounce), box-shadow .18s var(--bounce);
}
.contact-btn .ic { width: 19px; height: 19px; }
.contact-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow-ink); }
.contact-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-ink); }
.contact-fab.open .contact-btn { background: var(--surface); color: var(--text); }
.contact-panel {
  order: -1; width: min(380px, calc(100vw - 32px)); max-height: min(78vh, 640px); overflow: auto; border: 2px solid var(--line); border-radius: 20px;
  background: var(--surface); box-shadow: 6px 6px 0 var(--shadow-ink); animation: popIn .3s var(--bounce) both; transform-origin: bottom right;
}
.contact-panel-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 10px 18px; border-bottom: 2px solid var(--border); background: var(--surface); font-family: var(--display); font-size: 18px; }
.contact-panel-body { padding: 14px 18px 18px; }
.contact-form { display: grid; gap: 4px; }
.contact-form label.f { gap: 6px; }
.contact-form .field { margin-bottom: 8px; }
.contact-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.contact-panel .contact-two { grid-template-columns: 1fr; }
.contact-note { margin: 0 0 8px; }
.contact-form .btn.primary { justify-self: start; }
.contact-sent { text-align: center; padding: 18px 6px; }
.contact-sent h3 { margin: 6px 0 2px; }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.contact-layout .panel { margin: 0; }
.contact-side { display: grid; gap: 16px; }
.contact-side ul { padding-left: 18px; margin: 8px 0 0; }
.contact-side li { margin: 6px 0; }
.msg-item { margin: 0 0 14px; }
.msg-text { white-space: pre-wrap; font-size: 16px; }
@media (max-width: 760px) {
  .contact-fab { right: 12px; bottom: 12px; }
  .contact-btn span { display: none; }
  .contact-btn { width: 48px; padding: 0; justify-content: center; }
  .contact-layout, .contact-two { grid-template-columns: 1fr; }
}

/* ============ Account sections ============ */
.acct-block { margin: 22px 0 0; padding: 22px 24px; border: 2px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.acct-block > h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 24px; }
.acct-block > h2 .ic { width: 24px; height: 24px; padding: 6px; box-sizing: content-box; border: 2px solid var(--line); border-radius: 10px; background: var(--accent); color: #141414; }
.acct-sub { padding: 16px 0 0; margin-top: 14px; border-top: 2px dashed var(--border); }
.acct-sub h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 17px; }
.acct-sub h3 .ic { width: 18px; height: 18px; }
.acct-sub p { margin: 0 0 10px; }
.acct-list { margin: 6px 0 0; padding-left: 20px; }
.acct-list li { margin: 3px 0; }
.acct-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.acct-stat { padding: 12px; border: 2px solid var(--line); border-radius: 14px; text-align: center; background: var(--surface-2); }
.acct-stat b { display: block; font-family: var(--display); font-size: 26px; line-height: 1.1; }
.acct-stat span { font-size: 13px; color: var(--muted); font-weight: 600; }
.acct-pref { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.acct-pref p { margin: 0; }
.danger-zone h3 { color: var(--bad); }
.del-form { display: grid; gap: 10px; margin-top: 8px; max-width: 420px; }
.acct-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
@media (max-width: 560px) { .acct-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .acct-block { padding: 18px 16px; } }
#acct > .account-card:has(+ .acct-block) { max-width: none; margin: 0; }
.contact-email { display: grid; gap: 6px; justify-items: start; }
.contact-email p { margin: 0; }
.contact-addr { font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--text); text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--primary); text-underline-offset: 5px; word-break: break-all; }
.contact-email .row { margin-top: 6px; }
.contact-alt { margin: 14px 0 0; padding-top: 12px; border-top: 2px dashed var(--border); }
.contact-alt .link { font-size: inherit; padding: 0; }

/* ============ Full screen for games ============ */
.fs-btn {
  position: fixed; right: 20px; bottom: 20px; z-index: 66; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px;
  border: 2px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: 800 14px/1 "Figtree", sans-serif;
  box-shadow: 3px 3px 0 var(--shadow-ink); cursor: pointer; transition: transform .18s var(--bounce), box-shadow .18s var(--bounce), opacity .2s;
}
.fs-btn .ic { width: 18px; height: 18px; }
.fs-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow-ink); background: var(--accent); color: #141414; }
.fs-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-ink); }
html.is-fs .fs-btn { opacity: .55; width: 46px; padding: 0; justify-content: center; }
html.is-fs .fs-btn span { display: none; }
html.is-fs .fs-btn:hover, html.is-fs .fs-btn:focus-visible { opacity: 1; }
html.is-fs .topbar, html.is-fs .site-footer, html.is-fs .contact-fab, html.is-fs .install-banner, html.is-fs #app .back { display: none !important; }
html.is-fs .page { max-width: min(1280px, 100%); padding-top: 16px; padding-bottom: 24px; }
html.is-fs .page.study .study-head { margin-bottom: 12px; }
html.is-fs body { min-height: 100vh; }
@media (max-width: 760px) {
  .fs-btn { right: 12px; bottom: 12px; width: 46px; padding: 0; justify-content: center; }
  .fs-btn span { display: none; }
  html.is-fs .page { padding: 10px 10px 16px; }
}
.bk-combo { background: var(--accent); color: #141414; border: 2px solid var(--line); box-shadow: 2px 2px 0 var(--shadow-ink); transition: opacity .3s; }
.bk-combo.fading { opacity: .5; }

/* Study mode bar: every mode and game always visible, wrapping onto a second line instead of scrolling off */
.mode-switch { display: flex; flex-wrap: wrap; overflow: visible; max-width: 100%; gap: 4px; }
.mode-switch a { flex: 0 0 auto; }
@media (max-width: 760px) {
  .mode-switch { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .mode-switch a { justify-content: center; padding: 8px 6px; font-size: 13px; }
}

/* ============ Memory ============ */
.memory-panel .mem-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.memory-panel h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.mem-bar { display: flex; height: 16px; margin: 14px 0 8px; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.mem-bar i { display: block; height: 100%; transition: width .8s var(--ease); }
.mem-bar i + i { border-left: 2px solid var(--line); }
.mem-bar i[style="width:0%"] { border: 0; }
.mem-bar .strong, .mem-legend .strong { background: var(--mint); }
.mem-bar .learning, .mem-legend .learning { background: var(--accent); }
.mem-bar .new, .mem-legend .new { background: var(--surface-2); }
.mem-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-weight: 600; }
.mem-legend i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border: 2px solid var(--line); border-radius: 4px; vertical-align: -1px; }
.mem-tip { margin: 10px 0 0; }
.srs-chip { align-self: center; margin-right: 4px; padding: 1px 8px; border: 2px solid var(--border); border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.srs-chip.due { border-color: var(--line); background: var(--accent); color: #141414; }
.srs-chip.strong { color: var(--good); }
.term-row .tools { align-items: center; }
.mem-nudge { display: flex; align-items: center; gap: 12px; margin: 16px auto 0; max-width: 560px; padding: 12px 16px; border: 2px dashed var(--line); border-radius: 16px; background: var(--surface); text-align: left; font-size: 15px; }
.mem-nudge > .ic { flex: none; width: 24px; height: 24px; color: var(--primary-ink); }
.mem-nudge span { flex: 1; }
.fix-it { display: grid; gap: 6px; margin-top: 12px; font-weight: 700; font-size: 14px; }
.fix-it .field { margin: 0; }
.fix-it .field.fixed { border-color: var(--line); background: var(--good-soft); }
.fix-it .field.nope { animation: shake .4s; }

/* ============ Share sheet ============ */
.share-sheet { width: min(520px, calc(100vw - 32px)); padding: 22px; border: 2px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: 8px 8px 0 var(--shadow-ink); }
.share-sheet[open] { animation: popIn .3s var(--bounce) both; }
.share-sheet::backdrop { background: rgba(14, 13, 18, .55); }
.share-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.share-head h2 { margin: 0 0 4px; font-size: 24px; }
.share-head p { margin: 0; }
.share-link { display: flex; gap: 8px; margin: 18px 0 14px; }
.share-link .field { margin: 0; flex: 1; min-width: 0; font-size: 14px; }
.share-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.share-way { display: grid; justify-items: center; gap: 6px; padding: 14px 8px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); font: 700 14px/1.2 "Figtree", sans-serif; text-decoration: none; cursor: pointer; box-shadow: 3px 3px 0 var(--shadow-ink); transition: transform .18s var(--bounce), box-shadow .18s var(--bounce), background .2s; }
.share-way .ic { width: 24px; height: 24px; }
.share-way:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow-ink); background: var(--accent-soft); }
.share-way:disabled, .share-way[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.share-qr { margin-top: 16px; text-align: center; }
.share-qr svg { width: min(240px, 70vw); height: auto; padding: 10px; background: #fff; border: 2px solid var(--line); border-radius: 14px; }
.share-more { margin: 16px 0 0; }
