/* Study Buddy, volleyball edition: night-court navy, volleyball orange and gold, white court lines.
   Dark workspace, pastel subjects, rounded and a bit bouncy.
   The add-on's stylesheets (web/*.css) read the --sd-* variables below. */
:root {
  color-scheme: dark;
  --sd-font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sd-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sd-radius: 22px;
  --sd-bg: #0a1426;
  --sd-surface: #13213a;
  --sd-surface-2: #1d2f50;
  --sd-text: #f5f5f7;
  --sd-muted: #9fb0cc;
  --sd-border: #263a5e;
  --sd-hover: #1f3256;
  --sd-accent: #ff7a1a;
  --sd-shadow: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 20px 50px -30px rgb(0 0 0 / 0.9);
  --sd-learn: #ff7b72;
  --sd-review: #4fdc7c;
  --sd-light: 255 255 255;
  --sd-lit-max: 0.03;
  --sd-edge-max: 0.05;
  --sd-titanium: linear-gradient(180deg, #ffffff 0%, #d4d4d8 60%, #a1a1aa 100%);
  --sd-tip-bg: rgb(18 18 20 / 0.92);
  --sd-tip-text: #f5f5f7;
  --green: #4fdc7c;
  --gold: #ffd23f;
  --court: rgb(255 255 255 / 0.05);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1.2);
}
* { box-sizing: border-box; }
html { background: var(--sd-bg); }
body { margin: 0; min-height: 100vh;
  /* faint court: sideline, attack line and a net-post glow */
  background: radial-gradient(900px 420px at 85% -80px, rgb(255 122 26 / 0.13), transparent 70%),
    linear-gradient(var(--court), var(--court)) 0 140px / 100% 2px no-repeat,
    linear-gradient(var(--court), var(--court)) 0 460px / 100% 2px no-repeat,
    var(--sd-bg); color: var(--sd-text); font: 16px/1.5 var(--sd-font); }
a { color: inherit; }
h1, h2, h3 { letter-spacing: -0.01em; }
[hidden] { display: none !important; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 12px 28px;
  background: rgb(10 20 38 / 0.85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--sd-border); }
.brand { font-weight: 900; font-size: 19px; text-decoration: none; white-space: nowrap; }
.brand span { display: inline-block; transition: transform 0.5s var(--ease); }
.brand:hover span { transform: rotate(360deg) translateY(-3px); }
.top { border-bottom: 2px solid var(--sd-border); background-image: repeating-linear-gradient(90deg, rgb(255 255 255 / 0.05) 0 2px, transparent 2px 14px); }
.nav { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--sd-border); border-radius: 99px; background: var(--sd-surface); overflow-x: auto; }
.nav a { padding: 6px 14px; border-radius: 99px; color: var(--sd-muted); font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.nav a:hover { color: var(--sd-text); }
.nav a.on { background: var(--sd-accent); color: #fff; }
.chips { display: flex; gap: 8px; margin-left: auto; }
.chip { padding: 5px 12px; border-radius: 99px; background: var(--sd-surface-2); font-weight: 800; font-size: 14px; white-space: nowrap; }
.chip.streak { color: var(--green); }
.chip.xp { color: var(--gold); }

.page { max-width: 1240px; margin: 0 auto; padding: 28px 28px 60px; }
html:not([data-sd-tab="home"]) .page { max-width: none; }
html[data-sd-tab="cards"] .page { max-width: 1240px; }

/* Shared bits */
.sd-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border: 1px solid var(--sd-border); border-radius: 14px;
  background: var(--sd-surface-2); color: var(--sd-text); font: 800 14px var(--sd-font); text-decoration: none; cursor: pointer;
  transition: transform 0.12s var(--ease), border-color 0.15s, background 0.15s; }
.sd-btn:hover { border-color: var(--sd-accent); }
.sd-btn:active { transform: translateY(2px); }
.sd-btn.primary { background: var(--sd-accent); border-color: transparent; color: #fff; box-shadow: 0 4px 0 #b84f00; }
.sd-btn.primary:active { box-shadow: 0 1px 0 #b84f00; }
.sd-btn.big { padding: 12px 22px; font-size: 16px; }
.sd-btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.sd-link { border: 0; background: none; color: var(--sd-accent); font: 700 13px var(--sd-font); cursor: pointer; }
.sd-link.danger { color: var(--sd-learn); }
.sd-mt { margin-top: 14px; }
.grow { flex: 1; }
.center { justify-content: center; }
.sd-input { padding: 9px 12px; border: 1px solid var(--sd-border); border-radius: 12px; background: var(--sd-bg); color: var(--sd-text); font: 15px var(--sd-font); }
.sd-input:focus { outline: none; border-color: var(--sd-accent); box-shadow: 0 0 0 3px rgb(255 122 26 / 0.3); }
:focus-visible { outline: 2px solid var(--sd-accent); outline-offset: 2px; }
.sd-alert { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 12px 16px; border-radius: 14px; background: rgb(255 204 77 / 0.12); color: var(--gold); }
.sd-alert code { font: 13px var(--sd-mono); }
.panel { padding: 20px 22px; border: 1px solid var(--sd-border); border-radius: var(--sd-radius); background: var(--sd-surface); box-shadow: var(--sd-shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 20px; font-weight: 800; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 34px; font-weight: 900; }
.page-head p { margin: 4px 0 0; max-width: 640px; }
.page-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.back { display: inline-block; margin-bottom: 12px; color: var(--sd-muted); font-weight: 700; text-decoration: none; }
.back:hover { color: var(--sd-text); }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 12px; margin: 0 -12px; border-radius: 12px; text-decoration: none; font-weight: 700; }
.row:hover { background: var(--sd-hover); }
.row small { color: var(--sd-muted); font-weight: 600; white-space: nowrap; }

/* Home */
.hello h1 { margin: 6px 0 2px; font-size: 38px; font-weight: 900; }
.hello p { margin: 0 0 22px; color: var(--sd-muted); font-size: 18px; }
.sparkle { display: inline-block; animation: bounce 1.6s infinite; transform-origin: 50% 100%; }
@keyframes bounce { 0%, 100% { transform: translateY(0) rotate(0); } 40% { transform: translateY(-10px) rotate(180deg); } 60% { transform: translateY(0) scaleY(0.85) rotate(220deg); } }
.subjects-panel { background: var(--sd-surface); }
.add-subject { display: flex; gap: 8px; }
.add-subject .sd-input { width: 180px; padding: 7px 12px; }
.subjects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.subject { --i: 0; position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 180px; padding: 22px; border-radius: 20px;
  background: var(--bg); color: var(--ink); text-decoration: none; transition: transform 0.2s var(--ease), box-shadow 0.2s;
  animation: rise 0.45s var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
.subject:hover { transform: translateY(-4px) rotate(-0.4deg); box-shadow: 0 16px 30px -16px var(--bg); }
.subject b { margin-top: auto; font-size: 26px; font-weight: 800; }
.subject-ic { font-size: 26px; }
.subject-ic.big { font-size: 46px; }
.subject-foot { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; opacity: 0.75; }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.mode { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 24px; border: 1px solid var(--sd-border); border-radius: var(--sd-radius);
  background: var(--sd-surface); text-decoration: none; transition: transform 0.2s var(--ease), border-color 0.2s; }
.mode:hover { transform: translateY(-3px); border-color: var(--sd-accent); }
.mode-ic { font-size: 30px; }
.mode b { font-size: 20px; font-weight: 800; }
.mode small { color: var(--sd-muted); font-size: 14px; }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.98); } }

/* Subject page */
.subject-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; padding: 26px 28px; border-radius: var(--sd-radius); background: var(--bg); color: var(--ink); }
.subject-hero h1 { margin: 0; font-size: 36px; font-weight: 900; }
.subject-hero p { margin: 0; font-weight: 700; opacity: 0.75; }
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.cols .sd-btn.primary { margin-bottom: 10px; }

/* Flashcards */
.new-deck { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 22px; padding: 14px 18px; }
.group { margin: 22px 0 10px; font-size: 18px; font-weight: 800; }
.decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.deck { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 18px; background: var(--bg); color: var(--ink); text-decoration: none; transition: transform 0.2s var(--ease); }
.deck:hover { transform: translateY(-3px); }
.deck b { font-size: 18px; font-weight: 800; }
.deck small { font-weight: 700; opacity: 0.7; }
.meter { height: 8px; border-radius: 99px; background: rgb(0 0 0 / 0.1); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--ink); }
.deck-title { width: 100%; max-width: 640px; padding: 2px 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--sd-text); font: 900 34px var(--sd-font); }
.deck-title:focus { outline: none; border-bottom-color: var(--sd-accent); }
.card-rows { display: flex; flex-direction: column; gap: 10px; }
.card-row { display: grid; grid-template-columns: 28px 1fr 1fr 32px; gap: 10px; align-items: start; }
.card-row .num { padding-top: 10px; color: var(--sd-muted); font-weight: 800; text-align: right; }
.card-row textarea { resize: none; overflow: hidden; padding: 10px 12px; border: 1px solid var(--sd-border); border-radius: 12px; background: var(--sd-bg); color: var(--sd-text); font: 15px/1.45 var(--sd-font); }
.card-row textarea:focus { outline: none; border-color: var(--sd-accent); }
.x { width: 32px; height: 38px; border: 0; border-radius: 10px; background: none; color: var(--sd-muted); cursor: pointer; }
.x:hover { background: var(--sd-hover); color: var(--sd-learn); }

/* Study (flip cards) */
.study-top { display: flex; justify-content: space-between; color: var(--sd-muted); font-weight: 800; }
.sd-progress { height: 10px; margin: 8px 0 22px; border-radius: 99px; background: var(--sd-surface-2); overflow: hidden; }
.sd-progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--sd-accent), var(--gold)); transition: width 0.4s var(--ease); }
.flip { position: relative; display: block; width: 100%; max-width: 760px; height: 360px; margin: 0 auto; padding: 0; border: 0; background: none; color: inherit;
  perspective: 1400px; cursor: pointer; font: inherit; }
.face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 36px;
  border: 1px solid var(--sd-border); border-radius: 26px; background: var(--sd-surface); box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.9);
  backface-visibility: hidden; transition: transform 0.5s var(--ease); text-align: center; }
.face small { position: absolute; top: 18px; left: 24px; color: var(--sd-muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; }
.face em { position: absolute; bottom: 18px; color: var(--sd-muted); font-style: normal; font-size: 13px; }
.face .txt { font-size: clamp(20px, 3vw, 30px); font-weight: 800; line-height: 1.3; white-space: pre-wrap; }
.face .txt small { position: static; display: block; margin-top: 10px; font-size: 16px; text-transform: none; letter-spacing: 0; }
.backface { transform: rotateY(180deg); background: #1a2c4d; }
.flip.flipped .front { transform: rotateY(-180deg); }
.flip.flipped .backface { transform: rotateY(0); }
.blank { display: inline-block; min-width: 64px; border-bottom: 3px solid var(--sd-accent); color: var(--sd-accent); }
mark { padding: 0 4px; border-radius: 6px; background: rgb(255 204 77 / 0.25); color: inherit; }
.answer-btns { display: flex; justify-content: center; gap: 14px; margin-top: 22px; transition: opacity 0.2s; }
.answer-btns.waiting { opacity: 0.35; }
.answer-btns .sd-btn { min-width: 170px; justify-content: center; padding: 14px 20px; font-size: 17px; }
.sd-btn.again { background: rgb(255 123 114 / 0.14); border-color: rgb(255 123 114 / 0.4); color: var(--sd-learn); }
.sd-btn.got { background: var(--gold); border-color: transparent; color: #3a2a00; box-shadow: 0 4px 0 #b08a00; }
kbd { padding: 0 6px; border-radius: 6px; background: rgb(0 0 0 / 0.2); font: 12px var(--sd-mono); }
.done-panel { max-width: 640px; margin: 20px auto; text-align: center; animation: rise 0.4s var(--ease) both; }
.done-panel h1 { margin: 0; font-size: 32px; font-weight: 900; }
.confetti { font-size: 64px; animation: pop 0.6s var(--ease) both; }
@keyframes pop { from { transform: scale(0.2) rotate(-30deg); opacity: 0; } }
.xp-line { color: var(--gold); font-size: 22px; font-weight: 900; }
.missed { margin: 16px 0; padding: 14px 18px; border-radius: 16px; background: var(--sd-bg); text-align: left; }
.missed p { margin: 8px 0 0; }
.missed span { color: var(--sd-muted); }

/* Learn */
.quiz-start { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 14px; }
.field select { min-width: 320px; max-width: 100%; }
.sd-seg { display: inline-flex; padding: 3px; border: 1px solid var(--sd-border); border-radius: 99px; }
.sd-seg button { padding: 6px 16px; border: 0; border-radius: 99px; background: none; color: var(--sd-muted); font: 800 14px var(--sd-font); cursor: pointer; }
.sd-seg button[aria-pressed="true"] { background: var(--sd-accent); color: #fff; }
.sd-quiz { max-width: 820px; margin: 0 auto; }
.qkind { margin: 0; color: var(--sd-accent); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.sd-question { font-size: 24px !important; font-weight: 800; line-height: 1.35; }
.loading-panel { max-width: 520px; margin: 40px auto; text-align: center; }
.sd-score { font-size: 64px; font-weight: 900; }
.sd-score small { font-size: 24px; color: var(--sd-muted); }

/* XP pop and toast */
.xp-pop { position: fixed; top: 70px; right: 40px; z-index: 50; color: var(--gold); font-weight: 900; font-size: 22px; pointer-events: none; animation: float 1.2s ease-out forwards; }
@keyframes float { to { transform: translateY(-40px); opacity: 0; } }
.toast { position: fixed; bottom: 24px; left: 50%; z-index: 50; max-width: 90vw; padding: 12px 18px; border-radius: 14px; background: #263a5e; font-weight: 700;
  transform: translate(-50%, 120px); transition: transform 0.3s var(--ease); }
.toast.show { transform: translate(-50%, 0); }

/* The add-on's pages inside the site */
html[data-sd-tab="notes"] .page { padding: 16px 20px; }
.sd-notes { padding-bottom: 0; }
.sd-notes-shell { height: calc(100vh - 92px); }
.sd-nmake { color: var(--sd-text) !important; border-color: var(--sd-accent) !important; }
.sdc-pick { width: 100%; height: 42px; flex: none; padding: 0 12px; border: 1.5px dashed var(--sd-border); border-radius: 12px;
  background: none; color: var(--sd-text); font: 700 14px var(--sd-font); cursor: pointer; }
.sdc-pick:hover, .sdc-pick:focus { border-color: var(--sd-accent); outline: none; }
.sdc-step { display: flex; align-items: center; gap: 10px; margin: 6px 0 -4px; font-size: 17px; font-weight: 800; }
.sdc-step span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--sd-accent); color: #fff; font-size: 14px; }

@media (max-width: 1100px) {
  .top { flex-wrap: wrap; row-gap: 10px; }
  .nav { order: 1; flex: 1 1 100%; } /* its own row, so all five tabs show */
  .nav a { flex: 1; text-align: center; }
}
@media (max-width: 900px) {
  .cols, .modes { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .chips { margin-left: 0; }
  .page { padding: 20px 16px 48px; }
}
@media (max-width: 600px) {
  .subjects { grid-template-columns: 1fr; }
  .card-row { grid-template-columns: 1fr 32px; }
  .card-row .num { display: none; }
  .flip { height: 300px; }
  .answer-btns .sd-btn { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Theme switch (both themes) */
.theme-btn { padding: 6px 12px; border: 1px solid var(--sd-border); border-radius: 99px; background: var(--sd-surface); color: var(--sd-text);
  font: 800 13px var(--sd-font); white-space: nowrap; cursor: pointer; }
.theme-btn:hover { border-color: var(--sd-accent); }

/* ===== Anime theme (the default): sports-manga energy. Black and fire orange, halftone dots,
   speed lines, comic headings, skewed controls, hard offset shadows instead of soft glows. ===== */
html[data-theme="anime"] {
  --sd-bg: #140a1f; --sd-surface: #21122f; --sd-surface-2: #2f1a44; --sd-text: #ffffff; --sd-muted: #d3bfe8;
  --sd-border: #5a3a7a; --sd-hover: #3a2255; --sd-accent: #ff4fa3; --gold: #ffe14d; --green: #5af0c0;
  --sd-radius: 22px; --sd-shadow: 5px 5px 0 rgb(255 79 163 / 0.9);
  --sd-light: 255 255 255; --sd-lit-max: 0; --sd-edge-max: 0;
  --hard: 5px 5px 0 var(--sd-accent);
  --display: "Fredoka", "Nunito", var(--sd-font);
}
html[data-theme="anime"] body {
  background:
    repeating-conic-gradient(from 0deg at 88% -6%, rgb(255 190 230 / 0.035) 0 0.8deg, transparent 0.8deg 6deg) fixed,
    radial-gradient(rgb(255 120 190 / 0.17) 1.6px, transparent 2px) 0 0 / 15px 15px fixed,
    var(--sd-bg);
}
html[data-theme="anime"] .top { background: rgb(20 10 31 / 0.9); border-bottom: 3px solid var(--sd-accent); background-image: none; }
html[data-theme="anime"] .brand { font: 700 24px/1 var(--display); letter-spacing: 0.01em; text-transform: none; text-shadow: 2px 2px 0 var(--sd-accent); }
html[data-theme="anime"] .nav { border: 2px solid var(--sd-border); border-radius: 16px; background: var(--sd-surface); }
html[data-theme="anime"] .nav a { border-radius: 14px; font: 700 15px var(--display); letter-spacing: 0.01em; text-transform: none; transform: skewX(-5deg); }
html[data-theme="anime"] .nav a.on { background: var(--sd-accent); color: #000; box-shadow: 3px 3px 0 #fff; }
html[data-theme="anime"] .chip { border: 2px solid var(--sd-border); border-radius: 14px; transform: skewX(-5deg); }
html[data-theme="anime"] .theme-btn { border: 2px solid var(--sd-border); border-radius: 14px; }

html[data-theme="anime"] h1, html[data-theme="anime"] .subject b, html[data-theme="anime"] .mode b, html[data-theme="anime"] .deck b,
html[data-theme="anime"] .panel-head h2, html[data-theme="anime"] .sd-score, html[data-theme="anime"] .deck-title, html[data-theme="anime"] .group {
  font-family: var(--display); font-weight: 700; letter-spacing: 0; text-transform: none; }
html[data-theme="anime"] .hello h1 { font-size: 50px; line-height: 1.05; text-shadow: 3px 3px 0 var(--sd-accent); transform: rotate(-1.5deg); transform-origin: left; }
html[data-theme="anime"] .page-head h1, html[data-theme="anime"] .subject-hero h1 { font-size: 40px; line-height: 1.05; text-shadow: 3px 3px 0 var(--sd-accent); }
html[data-theme="anime"] .subject-hero h1 { text-shadow: 3px 3px 0 rgb(255 255 255 / 0.55); }
html[data-theme="anime"] .hello p { font-weight: 800; color: var(--gold); }
html[data-theme="anime"] .sparkle { animation: zap 1.1s steps(2) infinite; }
@keyframes zap { 50% { transform: scale(1.25) rotate(-10deg); filter: drop-shadow(0 0 10px var(--gold)); } }

html[data-theme="anime"] .panel, html[data-theme="anime"] .mode, html[data-theme="anime"] .new-deck {
  border: 3px solid #fff; border-radius: var(--sd-radius); box-shadow: var(--hard); }
html[data-theme="anime"] .subjects-panel { background: var(--sd-surface); }
html[data-theme="anime"] .subject, html[data-theme="anime"] .deck, html[data-theme="anime"] .subject-hero {
  border: 3px solid #000; border-radius: 20px; box-shadow: 5px 5px 0 #000; }
html[data-theme="anime"] .subject:hover, html[data-theme="anime"] .deck:hover { transform: translate(-3px, -3px) rotate(-0.8deg); box-shadow: 8px 8px 0 #000; }
html[data-theme="anime"] .subject b { font-size: 28px; }
html[data-theme="anime"] .mode:hover { transform: translate(-3px, -3px); border-color: var(--sd-accent); box-shadow: 8px 8px 0 #fff; }
html[data-theme="anime"] .mode small { color: var(--gold); font-weight: 800; }

html[data-theme="anime"] .sd-btn { border: 2px solid #fff; border-radius: 14px; background: var(--sd-surface-2); font: 700 15px var(--display); letter-spacing: 0.01em; text-transform: none; box-shadow: 3px 3px 0 rgb(255 255 255 / 0.5); }
html[data-theme="anime"] .sd-btn:hover { border-color: var(--sd-accent); box-shadow: 3px 3px 0 var(--sd-accent); }
html[data-theme="anime"] .sd-btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 #000; }
html[data-theme="anime"] .sd-btn.primary { border-color: #000; background: var(--sd-accent); color: #000; box-shadow: 4px 4px 0 #fff; transform: skewX(-4deg); }
html[data-theme="anime"] .sd-btn.primary:hover { background: var(--gold); }
html[data-theme="anime"] .sd-btn.primary:active { transform: skewX(-4deg) translate(3px, 3px); box-shadow: 0 0 0 #fff; }
html[data-theme="anime"] .sd-btn.got { background: var(--gold); border-color: #000; color: #000; box-shadow: 4px 4px 0 var(--green); }
html[data-theme="anime"] .sd-btn.again { background: #3a1230; border-color: #ff4d5e; color: #ff6b79; box-shadow: 4px 4px 0 #ff4d5e; }
html[data-theme="anime"] .sd-input, html[data-theme="anime"] .card-row textarea { border: 2px solid var(--sd-border); border-radius: 14px; }
html[data-theme="anime"] .sd-input:focus, html[data-theme="anime"] .card-row textarea:focus { border-color: var(--sd-accent); box-shadow: 3px 3px 0 var(--sd-accent); }

/* flip cards: a manga panel */
html[data-theme="anime"] .face { border: 4px solid #fff; border-radius: 16px; box-shadow: 10px 10px 0 var(--sd-accent);
  background: radial-gradient(rgb(255 255 255 / 0.07) 1.5px, transparent 2px) 0 0 / 12px 12px, var(--sd-surface); }
html[data-theme="anime"] .backface { background: radial-gradient(rgb(255 120 190 / 0.2) 1.5px, transparent 2px) 0 0 / 12px 12px, #2a1238; border-color: var(--gold); }
html[data-theme="anime"] .face .txt { font-family: var(--display); font-weight: 700; letter-spacing: 0.03em; font-size: clamp(22px, 3.4vw, 34px); }
html[data-theme="anime"] .face small { font: 700 14px var(--display); letter-spacing: 0.04em; color: var(--sd-accent); }
html[data-theme="anime"] .sd-progress { height: 14px; border: 2px solid #fff; border-radius: 99px; background: #000; transform: skewX(-12deg); overflow: hidden; }
html[data-theme="anime"] .sd-progress i { border-radius: 0; background: repeating-linear-gradient(90deg, var(--sd-accent) 0 12px, var(--gold) 12px 24px); }

/* quiz */
html[data-theme="anime"] .sd-question { font-family: var(--display) !important; font-weight: 700 !important; font-size: 26px !important; letter-spacing: 0; }
html[data-theme="anime"] .qkind { color: var(--gold); font-family: var(--display); font-size: 15px; letter-spacing: 0.04em; }
html[data-theme="anime"] .sd-choice { border: 2px solid var(--sd-border); border-radius: 14px; }
html[data-theme="anime"] .sd-choice:hover:not(:disabled) { border-color: var(--sd-accent); transform: translateX(4px); }
html[data-theme="anime"] .sd-choice.right { border-color: var(--green); box-shadow: 4px 4px 0 var(--green); }
html[data-theme="anime"] .sd-choice.wrong { border-color: #ff4d5e; box-shadow: 4px 4px 0 #ff4d5e; }
html[data-theme="anime"] .sd-verdict b { font: 700 22px var(--display); letter-spacing: 0; text-transform: none; }
html[data-theme="anime"] .done-panel h1 { font-size: 38px; color: var(--gold); text-shadow: 3px 3px 0 var(--sd-accent); }
html[data-theme="anime"] .confetti { animation: pop 0.5s steps(4) both; }
html[data-theme="anime"] .xp-pop { font-family: var(--display); font-size: 28px; text-shadow: 3px 3px 0 #000; }
html[data-theme="anime"] .toast { border: 2px solid #fff; border-radius: 14px; box-shadow: 4px 4px 0 var(--sd-accent); }
html[data-theme="anime"] .sd-notes-shell, html[data-theme="anime"] .sdc-zone, html[data-theme="anime"] .sdc-make { border: 3px solid #fff; border-radius: 20px; box-shadow: var(--hard); }
html[data-theme="anime"] .sdc-head h2 { font-family: var(--display); font-weight: 700; letter-spacing: 0.04em; text-transform: none; font-size: 38px; background: none; color: #fff; text-shadow: 3px 3px 0 var(--sd-accent); -webkit-text-fill-color: #fff; }
html[data-theme="anime"] .sdc-step { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: 0; text-transform: none; }
html[data-theme="anime"] .sdc-step span { border-radius: 6px; background: var(--sd-accent); color: #000; transform: skewX(-5deg); }
@media (max-width: 600px) { html[data-theme="anime"] .hello h1 { font-size: 36px; } }

/* sakura petals drifting down (anime theme only) */
.petals { display: none; }
html[data-theme="anime"] .petals { display: block; position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.page { position: relative; z-index: 1; }
.petals i { position: absolute; top: -40px; left: var(--x); font-style: normal; font-size: var(--s); opacity: 0.7; animation: fall var(--t) linear infinite; animation-delay: var(--d); }
@keyframes fall { to { transform: translate(60px, 105vh) rotate(360deg); } }

/* Anime subject cards: team cards with a jersey number, halftone dots, speed lines and a sticker icon */
html[data-theme="anime"] .subjects { counter-reset: jersey; gap: 18px; }
html[data-theme="anime"] .subject {
  --c1: #7ef0c9; --c2: #3fc7b0; --ink: #063b33;
  counter-increment: jersey; position: relative; overflow: hidden; isolation: isolate; min-height: 190px;
  border: 3px solid #fff; border-radius: 22px; box-shadow: 6px 6px 0 var(--sd-accent);
  background:
    radial-gradient(rgb(255 255 255 / 0.4) 1.5px, transparent 2px) 0 0 / 12px 12px,
    linear-gradient(135deg, var(--c1), var(--c2));
  color: var(--ink);
}
html[data-theme="anime"] .subject:nth-child(6n+2) { --c1: #9fd2ff; --c2: #8a8cff; --ink: #14195a; }
html[data-theme="anime"] .subject:nth-child(6n+3) { --c1: #ffa6d6; --c2: #d68bff; --ink: #4a0a45; }
html[data-theme="anime"] .subject:nth-child(6n+4) { --c1: #ffe08a; --c2: #ff9f8a; --ink: #5a2300; }
html[data-theme="anime"] .subject:nth-child(6n+5) { --c1: #d6b8ff; --c2: #9aa8ff; --ink: #2a1466; }
html[data-theme="anime"] .subject:nth-child(6n+6) { --c1: #ffb89a; --c2: #ff7aa8; --ink: #5a1030; }
/* speed lines bursting from the top-right corner */
html[data-theme="anime"] .subject::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: repeating-conic-gradient(from 200deg at 100% 0, rgb(255 255 255 / 0.32) 0 3deg, transparent 3deg 11deg);
  -webkit-mask: radial-gradient(circle at 100% 0, #000, transparent 75%); mask: radial-gradient(circle at 100% 0, #000, transparent 75%);
  transition: transform 0.3s;
}
/* the jersey number */
html[data-theme="anime"] .subject::after {
  content: counter(jersey, decimal-leading-zero); position: absolute; right: 16px; bottom: 34px; z-index: -1;
  font: 700 92px/1 var(--display); color: transparent; -webkit-text-stroke: 3px rgb(255 255 255 / 0.75); transform: rotate(-6deg); pointer-events: none;
}
html[data-theme="anime"] .subject:hover { transform: translate(-3px, -3px) rotate(-1deg); box-shadow: 9px 9px 0 var(--sd-accent); }
html[data-theme="anime"] .subject:hover::before { transform: scale(1.25); }
html[data-theme="anime"] .subject-ic { display: grid; place-items: center; width: 54px; height: 54px; border: 3px solid #fff; border-radius: 50%; background: #fff;
  box-shadow: 3px 3px 0 var(--ink); font-size: 28px; transform: rotate(-8deg); }
html[data-theme="anime"] .subject b { color: #fff; font-size: 34px; text-shadow: 3px 3px 0 var(--ink); -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; }
html[data-theme="anime"] .subject-foot { align-items: center; opacity: 1; }
html[data-theme="anime"] .subject-foot > span:first-child { padding: 3px 12px; border-radius: 99px; background: #fff; color: var(--ink); font-weight: 800; font-size: 13px; }
html[data-theme="anime"] .subject-foot > span:last-child { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 16px; }
/* decks and the subject banner share the dots */
html[data-theme="anime"] .deck, html[data-theme="anime"] .subject-hero {
  border: 3px solid #fff; border-radius: 20px; box-shadow: 5px 5px 0 var(--sd-accent);
  background-image: radial-gradient(rgb(255 255 255 / 0.4) 1.5px, transparent 2px); background-size: 12px 12px; }
html[data-theme="anime"] .subject-hero {
  background-image: radial-gradient(rgb(255 255 255 / 0.4) 1.5px, transparent 2px),
    repeating-conic-gradient(from 200deg at 100% 0, rgb(255 255 255 / 0.28) 0 3deg, transparent 3deg 11deg),
    linear-gradient(135deg, var(--bg), color-mix(in srgb, var(--bg) 45%, #ff8fcf));
  background-size: 12px 12px, auto, auto; }
html[data-theme="anime"] .subject-hero h1 { color: #fff; text-shadow: 3px 3px 0 var(--ink); -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; }
html[data-theme="anime"] .subject-hero p { color: var(--ink); opacity: 1; }
html[data-theme="anime"] .subject-hero .subject-ic { display: grid; place-items: center; width: 70px; height: 70px; border: 3px solid #fff; border-radius: 50%; background: #fff; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-8deg); font-size: 38px; }

/* The notes toolbar shows everything the add-on has. The folder footer is hidden (it opened Finder). */
.sd-nfoot { display: none; }

/* Card Studio: a short, two-step page */
.sdc-back { display: inline-block; margin-bottom: 4px; color: var(--sd-muted); font-weight: 700; text-decoration: none; }
.sdc-back:hover { color: var(--sd-text); }
.sdc-more { margin-top: -4px; }
.sdc-more-body { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-top: 10px; padding: 16px; border: 1px solid var(--sd-border); border-radius: var(--sd-radius); background: var(--sd-surface); }
.sdc-field.wide { flex: 1 1 100%; }
.sdc-field.wide textarea { min-height: 70px; padding: 10px 12px; border: 1px solid var(--sd-border); border-radius: 12px; background: var(--sd-bg); color: var(--sd-text); font: 14px/1.5 var(--sd-font); resize: vertical; }
.sdc-zone { min-height: 0; }
.sdc-drop { min-height: 80px; }

/* Flashcards: the by-hand form is tucked away */
.new-deck-d { margin-bottom: 16px; }
.new-deck-d summary { display: inline-block; cursor: pointer; padding: 4px 0; list-style: none; }
.new-deck-d summary::-webkit-details-marker { display: none; }
.new-deck-d .new-deck { margin: 8px 0 0; }

/* Study mode: fewer hints on screen */
.answer-btns kbd { display: none; }

.theme-btn { padding: 4px 9px; font-size: 16px; line-height: 1; }
.sdc-go small { display: none; }
.sdc-go { margin-left: auto; }
.sdc-more > .sd-link { padding: 6px 0; font-size: 14px; }

/* ===== Study screen: one centered column, clear states, big captioned buttons ===== */
.study-wrap { max-width: 720px; margin: 0 auto; }
.study-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.study-top b { font-size: 17px; font-weight: 800; }
.pill { padding: 4px 12px; border-radius: 99px; background: var(--sd-surface-2); color: var(--sd-muted); font-weight: 800; font-size: 13px; white-space: nowrap; }
.pill.ok { background: rgb(90 240 192 / 0.15); color: var(--green); }
.study-wrap .sd-progress { margin: 8px 0 20px; }
.study-wrap .flip { max-width: none; height: 340px; }
.face { justify-content: center; padding: 54px 36px 56px; }
.face small { position: absolute; top: 16px; left: 18px; padding: 4px 14px; border-radius: 99px; background: var(--sd-accent); color: #fff;
  font: 800 13px var(--sd-font); letter-spacing: 0.04em; text-transform: none; }
.backface small { background: var(--gold); color: #3a2a00; }
.face em { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); padding: 4px 14px; border-radius: 99px;
  background: rgb(255 255 255 / 0.08); color: var(--sd-muted); font: 700 13px var(--sd-font); white-space: nowrap; }
.flip:hover .front em { background: var(--sd-accent); color: #fff; }
.study-wrap .answer-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.answer-btns .sd-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; padding: 12px 16px; text-align: center; }
.answer-btns .sd-btn b { font-size: 18px; font-weight: 800; }
.answer-btns .sd-btn small { font-size: 12.5px; font-weight: 700; opacity: 0.8; text-transform: none; letter-spacing: 0; font-family: var(--sd-font); }
.answer-btns.waiting { opacity: 0.4; }
.keys { margin: 16px 0 0; color: var(--sd-muted); font-size: 12.5px; text-align: center; }
.keys kbd { display: inline-block; padding: 1px 7px; border: 1px solid var(--sd-border); border-radius: 6px; background: var(--sd-surface); font: 700 12px var(--sd-mono); }
body[data-view="study"] .petals { display: none !important; }

html[data-theme="anime"] .face small { font: 700 14px var(--display); letter-spacing: 0.02em; color: #fff; }
html[data-theme="anime"] .backface small { color: #3a2a00; }
html[data-theme="anime"] .face em { font-family: var(--display); font-weight: 700; }
html[data-theme="anime"] .answer-btns .sd-btn b { font: 700 19px var(--display); text-transform: none; letter-spacing: 0; }
html[data-theme="anime"] .sd-btn.got { color: #3a2a00; }
html[data-theme="anime"] .sd-btn.again { color: #ff8fb0; }

/* deck tiles on the Flashcards page */
.deck { gap: 8px; }
.deck-go { align-self: flex-start; margin-top: 4px; padding: 4px 12px; border-radius: 99px; background: var(--ink); color: #fff; font: 800 13px var(--sd-font); }
.meter { height: 10px; }
@media (max-width: 600px) { .study-wrap .flip { height: 300px; } .study-wrap .answer-btns { grid-template-columns: 1fr; } }

/* ===== Calm mode: the flashcard pages (list, deck, study) drop the decoration so the cards are what you see ===== */
html[data-theme] body:is([data-view="cards"], [data-view="deck"], [data-view="study"]) { background: var(--sd-bg); }
body:is([data-view="cards"], [data-view="deck"], [data-view="study"]) .petals { display: none !important; }
body:is([data-view="cards"], [data-view="deck"], [data-view="study"]) :is(.sparkle, .confetti, .xp-pop) { animation: none; }
html[data-theme] body:is([data-view="cards"], [data-view="deck"], [data-view="study"]) {
  /* flat cards: a quiet border and soft shadow instead of hard offset shadows, dots and speed lines */
  & .face { border: 2px solid var(--sd-border); box-shadow: 0 18px 40px -22px rgb(0 0 0 / 0.8); background: var(--sd-surface); }
  & .backface { border-color: var(--sd-accent); background: var(--sd-surface); }
  & .flip, & .face { transition-duration: 0.35s; }
  & .face .txt { font-family: var(--sd-font); font-weight: 800; }
  & .sd-progress { height: 8px; border: 0; border-radius: 99px; background: var(--sd-surface-2); transform: none; }
  & .sd-progress i { border-radius: 99px; background: var(--sd-accent); }
  & .sd-btn, & .sd-btn.primary, & .sd-btn.got, & .sd-btn.again { box-shadow: none; transform: none; }
  & .sd-btn:active { transform: translateY(1px); }
  & .sd-btn.primary { border-color: transparent; color: #fff; }
  & .sd-btn.got { background: var(--green); border-color: transparent; color: #06281b; }
  & .sd-btn.again { background: transparent; border: 2px solid var(--sd-border); color: var(--sd-text); }
  & .deck { border: 1px solid var(--sd-border); box-shadow: none; background-image: none; }
  & .deck:hover { transform: none; border-color: var(--sd-accent); }
  & .page-head h1, & .deck-title { text-shadow: none; }
  & .panel, & .new-deck { border: 1px solid var(--sd-border); box-shadow: none; }
  & .answer-btns .sd-btn b { font-family: var(--sd-font); }
  & .face small, & .face em { font-family: var(--sd-font); }
}

/* Bigger study card: fills the screen, text scales with it */
.study-wrap { max-width: 1040px; }
.study-wrap .flip { height: clamp(380px, 56vh, 620px); }
.study-wrap .face { padding: 70px 60px 64px; border-radius: 28px; }
.study-wrap .face .txt { font-size: clamp(30px, 4.2vw, 56px) !important; line-height: 1.25; }
.study-wrap .face .txt small { font-size: clamp(18px, 2vw, 24px); }
.study-wrap .face small:not(.txt small) { top: 22px; left: 24px; padding: 6px 18px; font-size: 16px; }
.study-wrap .face em { bottom: 22px; font-size: 15px; padding: 6px 18px; }
.study-top b { font-size: 20px; }
.study-top .pill { font-size: 15px; padding: 6px 16px; }
.study-wrap .answer-btns { gap: 18px; margin-top: 28px; }
.study-wrap .answer-btns .sd-btn { padding: 18px 20px; border-radius: 18px; }
.study-wrap .answer-btns .sd-btn b { font-size: 24px !important; }
.study-wrap .answer-btns .sd-btn small { font-size: 15px; }
.keys { font-size: 14px; }
@media (max-width: 600px) { .study-wrap .flip { height: 360px; } .study-wrap .face { padding: 64px 22px 56px; } }

/* Backup button and panel */
#backup { position: relative; }
#backup.warn::after { content: ""; position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); border: 2px solid var(--sd-bg); }
.backup-dlg { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 24px 26px; border: 1px solid var(--sd-border); border-radius: var(--sd-radius);
  background: var(--sd-surface); color: var(--sd-text); font: 15px/1.5 var(--sd-font); box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.8); overflow: auto; }
.backup-dlg::backdrop { background: rgb(0 0 0 / 0.6); }
.backup-dlg h2 { margin: 0 0 8px; font-size: 24px; }
.backup-dlg h3 { margin: 22px 0 4px; font-size: 16px; }
.backup-dlg .line { margin: 12px 0; }
.backup-dlg .close { position: absolute; top: 12px; right: 12px; }
.backup-dlg code { font: 12.5px var(--sd-mono); word-break: break-all; }
.backup-dlg summary { cursor: pointer; margin-top: 12px; }
.backup-dlg .sd-row { margin: 12px 0; }
html[data-theme="anime"] .backup-dlg { border: 3px solid #fff; box-shadow: 8px 8px 0 var(--sd-accent); }
.backup-dlg .steps { margin: 8px 0 12px; padding-left: 22px; line-height: 1.7; }
.backup-dlg .sd-btn.big { margin: 4px 0 8px; }

/* Backup panel: tabs and the restore list */
.backup-dlg .tabs { display: flex; width: max-content; margin: 8px 0 16px; }
.backup-dlg .tabs button { padding: 7px 22px; font-size: 15px; }
.rb-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.rb-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--sd-border); border-radius: 14px; background: var(--sd-bg); }
.rb-row b { font-size: 16px; }
.rb-row small { display: block; margin-top: 2px; color: var(--sd-muted); font-size: 13px; }
.rb-row.confirm { display: block; border-color: var(--sd-accent); }
.rb-row.confirm p { margin: 0 0 10px; }
.rb-row .tag { margin-left: 6px; padding: 2px 10px; border-radius: 99px; background: var(--sd-surface-2); color: var(--gold); font-size: 12px; font-weight: 800; }
.backup-dlg label.sd-btn { cursor: pointer; }

/* ===== Browser version: first-run setup, "open your folder", save problems, settings ===== */
.overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgb(0 0 0 / 0.7); backdrop-filter: blur(6px); overflow: auto; }
.ov-card { width: min(640px, 100%); padding: 28px 30px; border: 1px solid var(--sd-border); border-radius: var(--sd-radius); background: var(--sd-surface); color: var(--sd-text);
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.8); animation: rise 0.35s var(--ease) both; }
.ov-card h1 { margin: 0 0 8px; font-size: 30px; font-weight: 900; }
.ov-card .lead { margin: 0 0 18px; color: var(--sd-muted); font-size: 17px; }
.ov-card .hint, .settings-dlg .hint { color: var(--sd-muted); font-size: 13px; }
.ov-card details { margin-top: 14px; color: var(--sd-muted); }
.ov-card summary, .settings-dlg summary { cursor: pointer; font-weight: 700; }
.ov-choices { display: grid; gap: 12px; }
.ov-choice { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 2px solid var(--sd-border); border-radius: 18px; background: var(--sd-bg);
  color: var(--sd-text); font: 15px/1.45 var(--sd-font); text-align: left; cursor: pointer; transition: border-color 0.15s, transform 0.15s var(--ease); }
.ov-choice > b { font-size: 18px; }
.ov-choice span { color: var(--sd-muted); }
.ov-choice:hover { border-color: var(--sd-accent); transform: translateY(-2px); }
.ov-choice.best { border-color: var(--sd-accent); }
.ov-choice.off { opacity: 0.55; cursor: default; }
.ov-choice .tag, .ov-card h1 .tag { margin-left: 6px; padding: 2px 10px; border-radius: 99px; background: var(--sd-accent); color: #fff; font-size: 12px; font-weight: 800; vertical-align: middle; }
.ov-msg { min-height: 1.2em; margin: 12px 0 0; color: var(--sd-muted); }
.ov-msg.error { color: var(--sd-learn); }
.ov-card .sd-row.end { justify-content: flex-end; margin-top: 16px; }
.ov-card .steps, .settings-dlg .steps { padding-left: 22px; line-height: 1.7; }
.banner { position: sticky; top: 57px; z-index: 19; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 16px;
  background: rgb(255 123 114 / 0.16); color: var(--sd-learn); font-weight: 700; }
.banner[hidden] { display: none; }
.settings-dlg h3 { margin: 20px 0 6px; }
.settings-dlg .radios { display: grid; gap: 6px; }
.settings-dlg .radio { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.sd-input.grow { flex: 1; min-width: 200px; }
html[data-theme="anime"] .ov-card { border: 3px solid #fff; box-shadow: 8px 8px 0 var(--sd-accent); }
html[data-theme="anime"] .ov-card h1 { font-family: var(--display); font-weight: 700; text-shadow: 3px 3px 0 var(--sd-accent); }
html[data-theme="anime"] .ov-choice { border-radius: 16px; }
html[data-theme="anime"] .ov-choice:hover { box-shadow: 4px 4px 0 var(--sd-accent); }

/* Calendar: a month grid, the chosen day beside it; items wear their subject's pastel */
.coming-up { margin-bottom: 18px; }
.cal-up > span { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cal-up small.soon { color: var(--sd-accent); font-weight: 800; }
.cal-tag { padding: 2px 9px; border-radius: 99px; background: var(--bg, var(--sd-surface-2)); color: var(--ink, var(--sd-muted)); font-size: 12px; font-weight: 800; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.cal-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal-bar h2 { flex: 1; margin: 0; text-align: center; font-size: 22px; font-weight: 900; }
.cal-bar .sd-btn { padding: 6px 14px; font-size: 18px; }
.cal-heads, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-heads span { padding: 0 0 6px; color: var(--sd-muted); font-size: 12px; font-weight: 800; text-align: center; text-transform: uppercase; letter-spacing: 0.04em; }
.cal-cell { display: flex; flex-direction: column; gap: 3px; min-height: 92px; padding: 6px; border: 1px solid var(--sd-border); border-radius: 12px; background: var(--sd-bg);
  color: var(--sd-text); font: inherit; text-align: left; cursor: pointer; transition: transform 0.15s var(--ease), border-color 0.15s; }
.cal-cell:hover { border-color: var(--sd-accent); transform: translateY(-2px); }
.cal-cell.out { opacity: 0.4; }
.cal-cell.sel { border: 2px solid var(--sd-accent); padding: 5px; }
.cal-num { font-weight: 800; font-size: 14px; }
.cal-cell.today .cal-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--sd-accent); color: #fff; }
.cal-pill { overflow: hidden; padding: 2px 6px; border-radius: 7px; background: var(--bg, var(--sd-surface-2)); color: var(--ink, var(--sd-text)); font-size: 12px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.cal-pill.done { opacity: 0.45; text-decoration: line-through; }
.cal-more { color: var(--sd-muted); font-size: 11px; font-weight: 700; }
.cal-day h2 { margin: 0 0 12px; font-size: 20px; font-weight: 900; }
.cal-add { display: grid; gap: 10px; margin-bottom: 16px; }
.cal-add #cal-title { padding: 12px 14px; font-size: 16px; }
.cal-kinds { display: flex; }
.cal-kinds button { flex: 1; padding: 7px 6px; font-size: 13px; white-space: nowrap; }
.cal-list { display: grid; gap: 8px; }
.cal-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--bg, var(--sd-surface-2)); color: var(--ink, var(--sd-text)); }
.cal-item .cal-what { display: grid; flex: 1; min-width: 0; }
.cal-item .cal-what b { overflow-wrap: anywhere; }
.cal-item small { opacity: 0.75; font-weight: 700; }
.cal-item .x { color: inherit; opacity: 0.6; }
.cal-item .sd-btn { padding: 6px 12px; }
.cal-item.done .cal-what { opacity: 0.55; text-decoration: line-through; }
.cal-check { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid currentColor; border-radius: 9px; background: none; color: inherit; font-weight: 900; cursor: pointer; }
.cal-check[aria-pressed="true"] { border-color: var(--ink, var(--sd-accent)); background: var(--ink, var(--sd-accent)); color: var(--bg, #fff); }
@media (max-width: 900px) { .cal-layout { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .cal-heads, .cal-grid { gap: 3px; }
  .cal-cell { min-height: 56px; padding: 4px; align-items: center; }
  .cal-pill { width: 8px; height: 8px; padding: 0; border-radius: 50%; font-size: 0; background: var(--bg, var(--sd-accent)); }
  .nav { gap: 0; }
  .nav a, html[data-theme="anime"] .nav a { padding: 6px 5px; font-size: 13px; }
  .cal-more { display: none; }
}

/* ✨ Helper: a round button bottom-right, and a panel that slides in from the right (not on Notes: it has its own) */
.helper-fab { position: fixed; right: 22px; bottom: 22px; z-index: 30; display: flex; align-items: center; gap: 8px; padding: 12px 18px 12px 14px;
  border: 1px solid var(--sd-border); border-radius: 99px; background: var(--sd-accent); color: #fff; font: 800 15px var(--sd-font); cursor: pointer;
  box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.7); transition: transform 0.2s var(--ease); }
.helper-fab span { font-size: 20px; }
.helper-fab:hover { transform: translateY(-3px) scale(1.03); }
html[data-helper="open"] .helper-fab { transform: scale(0); pointer-events: none; }
.helper { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; display: flex; flex-direction: column; width: min(400px, 100vw);
  border-left: 1px solid var(--sd-border); background: var(--sd-surface); box-shadow: -20px 0 50px -20px rgb(0 0 0 / 0.8);
  transform: translateX(105%); visibility: hidden; transition: transform 0.3s var(--ease), visibility 0.3s; }
html[data-helper="open"] .helper { transform: none; visibility: visible; }
html[data-sd-tab="notes"] .helper-fab, html[data-sd-tab="notes"] .helper { display: none; }
.hb-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--sd-border); }
.hb-head b { flex: 1; font-size: 17px; font-weight: 900; }
.hb-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.hb-msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.hb-msg p, .hb-msg ul { margin: 0 0 6px; }
.hb-msg > :last-child { margin-bottom: 0; }
.hb-msg ul { padding-left: 18px; }
.hb-msg.me { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--sd-accent); color: #fff; font-weight: 700; white-space: pre-wrap; }
.hb-msg.buddy { align-self: flex-start; border-bottom-left-radius: 4px; background: var(--sd-surface-2); }
.hb-changes { list-style: none; margin: 8px 0 0 !important; padding: 8px 0 0 !important; border-top: 1px dashed var(--sd-border); font-size: 13px; }
.hb-changes li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 0; }
.hb-changes li::before { content: "✓"; color: var(--green); font-weight: 900; }
.hb-changes li span { flex: 1; }
.hb-changes li.undone span { text-decoration: line-through; opacity: 0.6; }
.hb-changes small { color: var(--sd-muted); font-weight: 700; }
.hb-hi p { margin: 0 0 12px; line-height: 1.5; }
.hb-suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.hb-chip { padding: 8px 12px; border: 1px solid var(--sd-border); border-radius: 99px; background: var(--sd-bg); color: var(--sd-text); font: 700 13px var(--sd-font); cursor: pointer; text-align: left; }
.hb-chip:hover { border-color: var(--sd-accent); color: var(--sd-accent); }
.helper .sd-alert { margin: 0 16px 10px; }
.hb-form { display: flex; gap: 8px; padding: 12px 14px 16px; border-top: 1px solid var(--sd-border); }
.hb-form textarea { flex: 1; resize: none; font-size: 15px; }
.hb-form .sd-btn { align-self: stretch; padding: 0 16px; font-size: 18px; }
html[data-theme="anime"] .helper-fab { border: 2px solid #fff; box-shadow: 4px 4px 0 #fff; font-family: var(--display); }
html[data-theme="anime"] .helper { border-left: 3px solid var(--sd-accent); }
html[data-theme="anime"] .hb-head b { font: 700 20px var(--display); }
html[data-theme="anime"] .hb-msg.me { box-shadow: 3px 3px 0 #fff; }
html[data-theme="anime"] .hb-msg.buddy { border: 2px solid var(--sd-border); }
@media (max-width: 600px) { .helper-fab b { display: none; } .helper-fab { padding: 14px; } }

/* ===== Game Day (the volleyball look, picked in ⚙ Settings; Anime and Court are untouched): a navy court on an
   orange free zone with white lines and a net, a stadium scoreboard for a header, jersey cards, ball-yellow
   buttons. The serve, spikes and set-won effects live in js/ui/fx.js. ===== */
html[data-theme="volley"] {
  --sd-bg: #0b2b63; --sd-surface: #0f3577; --sd-surface-2: #17468f; --sd-text: #ffffff; --sd-muted: #c3d6f7;
  --sd-border: #3b6bbf; --sd-hover: #1b4f9f; --sd-accent: #ffc928; --gold: #ffd84d; --green: #5be38f; --sd-learn: #ff6b5e;
  --sd-radius: 20px; --sd-shadow: 0 8px 0 #061a3d; --sd-light: 255 255 255; --sd-lit-max: 0; --sd-edge-max: 0;
  --vb-zone: #e0702f; --vb-line: rgb(255 255 255 / 0.8); --vb-navy: #0a2a5e;
  --display: "Fredoka", "Nunito", var(--sd-font);
}
html[data-theme="volley"] body {
  background:
    linear-gradient(90deg, transparent calc(50% - 3px), rgb(255 255 255 / 0.55) calc(50% - 3px) calc(50% + 3px), transparent calc(50% + 3px)) fixed,
    linear-gradient(90deg, transparent calc(33.3% - 1px), rgb(255 255 255 / 0.22) calc(33.3% - 1px) calc(33.3% + 1px), transparent calc(33.3% + 1px),
      transparent calc(66.6% - 1px), rgb(255 255 255 / 0.22) calc(66.6% - 1px) calc(66.6% + 1px), transparent calc(66.6% + 1px)) fixed,
    repeating-linear-gradient(90deg, rgb(255 255 255 / 0.025) 0 2px, transparent 2px 48px) fixed,
    linear-gradient(var(--sd-bg), var(--sd-bg)) center / calc(100% - 56px) calc(100% - 56px) no-repeat fixed,
    var(--vb-zone);
}
html[data-theme="volley"] body::before { content: ""; position: fixed; inset: 28px; z-index: 0; border: 4px solid var(--vb-line); border-radius: 4px; pointer-events: none; }
html[data-theme="volley"] h1, html[data-theme="volley"] .subject b, html[data-theme="volley"] .mode b, html[data-theme="volley"] .deck b,
html[data-theme="volley"] .panel-head h2, html[data-theme="volley"] .sd-score, html[data-theme="volley"] .deck-title, html[data-theme="volley"] .group,
html[data-theme="volley"] .brand, html[data-theme="volley"] .cal-bar h2, html[data-theme="volley"] .cal-day h2 { font-family: var(--display); font-weight: 700; letter-spacing: 0; }

/* the header: a stadium scoreboard */
html[data-theme="volley"] .top { background: #04122b; background-image: none; border-bottom: 4px solid var(--sd-accent); transition: box-shadow 0.4s; }
html[data-theme="volley"] .brand { font-size: 24px; color: var(--sd-accent); }
html[data-theme="volley"] .nav { border: 2px solid #23477f; background: #071d44; }
html[data-theme="volley"] .nav a { font: 700 15px var(--display); }
html[data-theme="volley"] .nav a.on { background: var(--sd-accent); color: var(--vb-navy); }
html[data-theme="volley"] .chip { border: 2px solid var(--sd-accent); border-radius: 10px; background: #000; color: var(--sd-accent) !important;
  font: 800 15px var(--sd-mono); letter-spacing: 0.04em; text-shadow: 0 0 8px rgb(255 201 40 / 0.7); }
html[data-theme="volley"] .theme-btn { border: 2px solid #23477f; background: #071d44; }
html.vb-fire[data-theme="volley"] .top { box-shadow: 0 6px 40px rgb(255 110 30 / 0.85); border-bottom-color: #ff6b1e; }
html.vb-fire[data-theme="volley"] .chip.streak::after { content: " 🔥 ON FIRE"; }

/* headings, panels, buttons */
html[data-theme="volley"] .hello h1 { font-size: 48px; line-height: 1.05; text-shadow: 3px 3px 0 var(--vb-zone); }
html[data-theme="volley"] .hello p { color: var(--sd-accent); font-weight: 800; }
html[data-theme="volley"] .page-head h1, html[data-theme="volley"] .subject-hero h1 { font-size: 40px; text-shadow: 3px 3px 0 var(--vb-zone); }
html[data-theme="volley"] .subject-hero h1 { text-shadow: none; }
html[data-theme="volley"] .sparkle { animation: vb-bounce 0.9s cubic-bezier(0.3, 0, 0.6, 1) infinite alternate; }
@keyframes vb-bounce { from { transform: translateY(-14px) rotate(-20deg); } to { transform: translateY(2px) rotate(25deg) scaleY(0.9); } }
html[data-theme="volley"] .panel, html[data-theme="volley"] .mode, html[data-theme="volley"] .new-deck, html[data-theme="volley"] .sd-notes-shell,
html[data-theme="volley"] .sdc-zone, html[data-theme="volley"] .sdc-make { border: 2px solid var(--vb-line); border-radius: var(--sd-radius); box-shadow: var(--sd-shadow); }
html[data-theme="volley"] .mode:hover { transform: translateY(-5px); border-color: var(--sd-accent); }
html[data-theme="volley"] .mode small { color: var(--sd-accent); font-weight: 800; }
html[data-theme="volley"] .sd-btn { border: 2px solid var(--vb-line); border-radius: 99px; background: var(--sd-surface-2); font: 700 15px var(--display); }
html[data-theme="volley"] .sd-btn:hover { border-color: var(--sd-accent); }
html[data-theme="volley"] .sd-btn.primary { border-color: var(--vb-navy); background: var(--sd-accent); color: var(--vb-navy); box-shadow: 0 5px 0 #b8860b; }
html[data-theme="volley"] .sd-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #b8860b; }
html[data-theme="volley"] .sd-btn.primary:active { transform: translateY(3px); box-shadow: 0 2px 0 #b8860b; }
html[data-theme="volley"] .sd-btn.got { background: var(--green); border-color: var(--vb-navy); color: var(--vb-navy); box-shadow: 0 5px 0 #2a9c5a; }
html[data-theme="volley"] .sd-btn.again { background: #3a1626; border-color: var(--sd-learn); color: #ff8b80; box-shadow: 0 5px 0 #9c2a22; }
html[data-theme="volley"] .sd-input, html[data-theme="volley"] .card-row textarea { border: 2px solid var(--sd-border); background: #071d44; }
html[data-theme="volley"] .sd-input:focus { border-color: var(--sd-accent); }

/* subject cards: team jerseys (stripes, a big number, court lines) */
html[data-theme="volley"] .subjects { counter-reset: jersey; }
html[data-theme="volley"] .subject { counter-increment: jersey; overflow: hidden; isolation: isolate; border: 3px solid #fff; box-shadow: 0 8px 0 #061a3d;
  background: linear-gradient(90deg, transparent 22px, rgb(0 0 0 / 0.13) 22px 32px, transparent 32px 38px, rgb(0 0 0 / 0.13) 38px 43px, transparent 43px), var(--bg); }
html[data-theme="volley"] .subject::before { content: ""; position: absolute; inset: 12px; z-index: -1; border: 2px dashed rgb(255 255 255 / 0.75); border-radius: 12px; }
html[data-theme="volley"] .subject::after { content: counter(jersey, decimal-leading-zero); position: absolute; right: 18px; bottom: -14px; z-index: -1;
  font: 700 110px/1 var(--display); color: rgb(255 255 255 / 0.55); -webkit-text-stroke: 2px var(--ink); }
html[data-theme="volley"] .subject:hover { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 14px 0 #061a3d; }
html[data-theme="volley"] .subject b { font-size: 30px; }
html[data-theme="volley"] .subject-ic { display: grid; place-items: center; width: 50px; height: 50px; border: 3px solid var(--ink); border-radius: 50%; background: #fff; }
html[data-theme="volley"] .deck, html[data-theme="volley"] .subject-hero { border: 3px solid #fff; box-shadow: 0 8px 0 #061a3d; }

/* studying: a net across the card, a ball on the progress bar */
html[data-theme="volley"] .face { border: 3px solid #fff; border-radius: 18px;
  background: linear-gradient(transparent calc(50% - 2px), rgb(255 255 255 / 0.12) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)), var(--sd-surface); }
html[data-theme="volley"] .backface { background: linear-gradient(transparent calc(50% - 2px), rgb(255 201 40 / 0.18) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)), #12407f; border-color: var(--sd-accent); }
html[data-theme="volley"] .face .txt { font-family: var(--display); font-weight: 700; }
html[data-theme="volley"] .face small { color: var(--vb-navy); }
html[data-theme="volley"] .sd-progress { height: 14px; overflow: visible; border: 2px solid #fff; background: #071d44; }
html[data-theme="volley"] .sd-progress i { position: relative; min-width: 14px; background: var(--sd-accent); box-shadow: none; }
html[data-theme="volley"] .sd-progress i::after { content: "🏐"; position: absolute; right: -12px; top: 50%; font-size: 22px; transform: translateY(-50%); }
html[data-theme="volley"] .done-panel h1 { color: var(--sd-accent); text-shadow: 3px 3px 0 var(--vb-zone); }
html[data-theme="volley"] .sd-choice.right { border-color: var(--green); box-shadow: 0 4px 0 var(--green); }
html[data-theme="volley"] .sd-choice.wrong { border-color: var(--sd-learn); box-shadow: 0 4px 0 var(--sd-learn); }
html[data-theme="volley"] .helper-fab { background: var(--sd-accent); color: var(--vb-navy); border: 2px solid var(--vb-navy); box-shadow: 0 5px 0 #b8860b; font-family: var(--display); }
html[data-theme="volley"] .helper { border-left: 4px solid var(--sd-accent); }
html[data-theme="volley"] .hb-msg.me { color: var(--vb-navy); }
html[data-theme="volley"] .cal-cell.today .cal-num, html[data-theme="volley"] .cal-check[aria-pressed="true"] { color: var(--vb-navy); }

/* Home: the serve and the scoreboard (Game Day only) */
.vb-serve { display: none; }
html[data-theme="volley"] .vb-serve { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 22px; margin-bottom: 18px;
  padding: 18px 22px; border: 2px solid var(--vb-line); border-radius: var(--sd-radius); background: var(--sd-surface); box-shadow: var(--sd-shadow); }
.vb-serve-ball { position: relative; width: 116px; height: 116px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  animation: vb-float 2.4s ease-in-out infinite; }
.vb-serve-ball::before { content: ""; position: absolute; inset: -8px; border: 3px solid var(--sd-accent); border-radius: 50%; animation: vb-ring 1.6s ease-out infinite; }
.vb-serve-ball .vb-ball { width: 100%; height: 100%; animation: vb-spin 6s linear infinite; }
.vb-serve-ball:hover .vb-ball { animation-duration: 0.9s; }
.vb-serve-ball.served { animation: vb-served 0.55s cubic-bezier(0.5, 0, 0.9, 0.6) forwards; }
@keyframes vb-float { 50% { transform: translateY(-10px); } }
@keyframes vb-ring { from { transform: scale(0.9); opacity: 0.9; } to { transform: scale(1.35); opacity: 0; } }
@keyframes vb-spin { to { transform: rotate(360deg); } }
@keyframes vb-served { to { transform: translate(55vw, -70vh) rotate(900deg) scale(0.3); } }
.vb-serve-txt { display: grid; gap: 2px; min-width: 0; }
.vb-serve-txt small { color: var(--sd-accent); font: 800 13px var(--sd-font); text-transform: uppercase; letter-spacing: 0.12em; }
.vb-serve-txt b { font: 700 26px/1.15 var(--display); overflow-wrap: anywhere; }
.vb-serve-txt span { color: var(--sd-muted); font-weight: 700; }
.vb-board { display: grid; grid-template-columns: repeat(2, auto); gap: 8px; }
.vb-board div { display: grid; padding: 6px 12px; border: 2px solid var(--sd-accent); border-radius: 10px; background: #000; text-align: center; }
.vb-board .wide { grid-column: span 2; }
.vb-board small { color: #8fa9d6; font: 800 11px var(--sd-font); text-transform: uppercase; letter-spacing: 0.1em; }
.vb-board b { color: var(--sd-accent); font: 800 30px/1.1 var(--sd-mono); text-shadow: 0 0 10px rgb(255 201 40 / 0.75); }
.vb-board b i { margin-left: 4px; font: 700 12px var(--sd-font); font-style: normal; text-shadow: none; }
.vb-board b.txt { max-width: 230px; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  html[data-theme="volley"] .vb-serve { grid-template-columns: auto minmax(0, 1fr); }
  .vb-board { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vb-board .wide { grid-column: auto; }
  .vb-serve-ball { width: 84px; height: 84px; font-size: 70px; }
  .vb-serve-txt b { font-size: 20px; }
  .vb-board div { padding: 6px 6px; }
  .vb-board small { font-size: 10px; letter-spacing: 0.04em; }
  .vb-board b { font-size: 24px; }
  .vb-board b.txt { font-size: 12px; }
}

/* effects (js/ui/fx.js) */
.vb-ball { display: grid; place-items: center; width: 100%; height: 100%; font-size: 1em; line-height: 1; }
.vb-serve-ball { font-size: 96px; }
.vb-spike { font-size: 56px; }
.vb-win-card .vb-ball { font-size: 76px; }
.vb-rain span { font-size: var(--s); }
html[data-theme="volley"] .vb-roll { font-size: 20px; }
.vb-spike { position: fixed; left: 8vw; bottom: 6vh; z-index: 55; width: 64px; height: 64px; pointer-events: none; animation: vb-spike 0.8s cubic-bezier(0.2, 0.7, 0.4, 1) forwards; }
@keyframes vb-spike { 0% { transform: translate(0, 0) rotate(0) scale(0.6); } 45% { transform: translate(38vw, -62vh) rotate(500deg) scale(1.1); }
  100% { transform: translate(78vw, -8vh) rotate(900deg) scale(0.8); opacity: 0; } }
.vb-word { position: fixed; left: 50%; top: 38%; z-index: 56; pointer-events: none; transform: translate(-50%, -50%);
  font: 700 clamp(44px, 9vw, 84px)/1 "Fredoka", "Nunito", sans-serif; color: #ffc928; -webkit-text-stroke: 3px #0a2a5e; paint-order: stroke fill;
  text-shadow: 5px 5px 0 #e0702f; white-space: nowrap; animation: vb-word 1s cubic-bezier(0.2, 1.4, 0.4, 1) forwards; }
.vb-word.block { color: #ff6b5e; text-shadow: 5px 5px 0 #000; }
@keyframes vb-word { 0% { transform: translate(-50%, -50%) scale(0.3) rotate(-12deg); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1.1) rotate(-4deg); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(1) rotate(-4deg); opacity: 1; } 100% { transform: translate(-50%, -80%) scale(0.9) rotate(-4deg); opacity: 0; } }
.vb-shake { animation: vb-shake 0.4s; }
@keyframes vb-shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.vb-win { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; overflow: hidden; background: rgb(4 18 43 / 0.55); animation: vb-fade 2.8s forwards; cursor: pointer; }
.vb-win-card { display: grid; justify-items: center; gap: 6px; padding: 28px 44px; border: 4px solid #fff; border-radius: 24px; background: #0b2b63; box-shadow: 0 12px 0 #061a3d;
  animation: vb-pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.vb-win-card .vb-ball { width: 84px; height: 84px; animation: vb-spin 1.2s linear infinite; }
.vb-win-card b { font: 700 clamp(40px, 8vw, 72px)/1 "Fredoka", sans-serif; color: #ffc928; text-shadow: 4px 4px 0 #e0702f; }
.vb-win-card small { color: #fff; font: 800 17px "Nunito", sans-serif; }
.vb-rain span { position: absolute; top: -60px; left: var(--x); width: var(--s); height: var(--s); animation: vb-rain 1.9s var(--d) ease-in forwards; }
@keyframes vb-rain { to { transform: translateY(115vh) rotate(var(--r)); } }
@keyframes vb-pop { from { transform: scale(0.4) rotate(-8deg); opacity: 0; } }
@keyframes vb-fade { 0%, 82% { opacity: 1; } 100% { opacity: 0; } }
.vb-roll { display: none; }
html[data-theme="volley"] .vb-roll { display: block; position: fixed; left: 0; bottom: 6px; z-index: 0; width: 22px; height: 22px; pointer-events: none; animation: vb-roll 26s linear infinite; }
html[data-theme="volley"] .vb-roll .vb-ball { animation: vb-spin 1.4s linear infinite; }
@keyframes vb-roll { from { transform: translateX(-40px); } 60%, to { transform: translateX(calc(100vw + 40px)); } }
@media (max-width: 600px) { html[data-theme="volley"] .hello h1 { font-size: 34px; } html[data-theme="volley"] body::before { inset: 10px; } }

/* The Look menu (top right): every look with a little swatch */
.look-menu { position: relative; }
.look-menu summary { display: flex; align-items: center; gap: 6px; list-style: none; }
.look-menu summary::-webkit-details-marker { display: none; }
.look-list { position: absolute; right: 0; top: calc(100% + 8px); z-index: 45; display: grid; gap: 4px; min-width: 190px; padding: 6px;
  border: 1px solid var(--sd-border); border-radius: 16px; background: var(--sd-surface); box-shadow: 0 18px 40px -16px rgb(0 0 0 / 0.6); }
html[data-theme="meadow"] .look-list { background: #fff; }
.look-list button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 11px; background: none; color: var(--sd-text);
  font: 700 14px var(--sd-font); text-align: left; cursor: pointer; }
.look-list button:hover { background: var(--sd-hover); }
.look-list button[aria-checked="true"] { outline: 2px solid var(--sd-accent); }
.look-list i { flex: none; width: 22px; height: 22px; border: 2px solid rgb(255 255 255 / 0.8); border-radius: 50%; }

/* ===== Meadow: a calm, light anime scene. Soft sky with a sun and slow clouds, rolling hills with trees,
   swaying grass and flowers, a butterfly and a leaf drifting by; frosted-glass panels over it. ===== */
html[data-theme="meadow"] {
  --sd-bg: #f3fbff; --sd-surface: rgb(255 255 255 / 0.84); --sd-surface-2: #e5f4e8; --sd-text: #1f3b2c; --sd-muted: #587a66;
  --sd-border: #bfdcc9; --sd-hover: #e2f2e5; --sd-accent: #34a464; --gold: #c98a12; --green: #2c9655; --sd-learn: #d9534f;
  --sd-heat-0: #dceee2; --sd-radius: 24px; --sd-shadow: 0 14px 34px -18px rgb(30 80 50 / 0.45); --sd-light: 0 0 0; --sd-lit-max: 0; --sd-edge-max: 0;
  --display: "Fredoka", "Nunito", var(--sd-font); color-scheme: light;
}
html[data-theme="meadow"] body {
  color: var(--sd-text);
  background:
    radial-gradient(circle at 86% 11%, #fffbe0 0 46px, rgb(255 244 180 / 0.55) 47px 92px, rgb(255 244 180 / 0.18) 93px 150px, transparent 151px) fixed,
    radial-gradient(140% 44% at 18% 104%, #6cc36e 0 49.6%, transparent 50%) fixed,
    radial-gradient(120% 40% at 92% 106%, #58b765 0 49.6%, transparent 50%) fixed,
    radial-gradient(170% 52% at 55% 112%, #8fd685 0 49.6%, transparent 50%) fixed,
    radial-gradient(130% 50% at 0% 100%, #a8dda0 0 49.6%, transparent 50%) fixed,
    linear-gradient(#7cc8f5 0%, #b5e2fb 42%, #e8f6ff 68%, #fff6e3 82%) fixed;
}
.meadow { display: none; }
html[data-theme="meadow"] .meadow { display: block; position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.meadow .cloud { position: absolute; top: var(--y); left: 0; width: var(--w); height: calc(var(--w) * 0.32); border-radius: 999px; background: #fff; opacity: 0.92;
  box-shadow: calc(var(--w) * 0.22) calc(var(--w) * -0.12) 0 calc(var(--w) * 0.04) #fff, calc(var(--w) * 0.5) calc(var(--w) * -0.04) 0 0 #fff;
  animation: m-drift var(--t) linear infinite; animation-delay: var(--d); }
@keyframes m-drift { from { transform: translateX(-60vw); } to { transform: translateX(130vw); } }
.meadow .tree { position: absolute; left: var(--x); bottom: var(--b); font-size: var(--s); line-height: 1; filter: drop-shadow(0 8px 6px rgb(20 70 30 / 0.25));
  transform-origin: 50% 100%; animation: m-sway 7s ease-in-out infinite alternate; }
.meadow .tuft { position: absolute; left: var(--x); bottom: 1.5vh; font-size: 30px; transform-origin: 50% 100%; animation: m-sway 3.2s ease-in-out infinite alternate; animation-delay: var(--d); }
@keyframes m-sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
.meadow .flutter { position: absolute; top: var(--y); left: 0; font-size: 24px; animation: m-flutter var(--t) linear infinite; animation-delay: var(--d); }
.meadow .flutter.leaf { font-size: 20px; }
@keyframes m-flutter { 0% { transform: translate(-10vw, 0) rotate(0); } 25% { transform: translate(25vw, -6vh) rotate(20deg); } 50% { transform: translate(55vw, 3vh) rotate(-15deg); }
  75% { transform: translate(85vw, -5vh) rotate(25deg); } 100% { transform: translate(115vw, 2vh) rotate(0); } }

/* frosted glass over the scene, soft greens, rounded type */
html[data-theme="meadow"] .top { background: rgb(255 255 255 / 0.72); background-image: none; border-bottom: 1px solid rgb(255 255 255 / 0.9); backdrop-filter: blur(10px); }
html[data-theme="meadow"] .brand { color: #2a6b45; font: 700 23px var(--display); }
html[data-theme="meadow"] .nav { background: rgb(255 255 255 / 0.7); }
html[data-theme="meadow"] .nav a { font: 700 15px var(--display); color: var(--sd-muted); }
html[data-theme="meadow"] .nav a.on { color: #fff; }
html[data-theme="meadow"] .chip { background: rgb(255 255 255 / 0.85); border: 1px solid var(--sd-border); }
html[data-theme="meadow"] .theme-btn { background: rgb(255 255 255 / 0.85); }
html[data-theme="meadow"] h1, html[data-theme="meadow"] .subject b, html[data-theme="meadow"] .mode b, html[data-theme="meadow"] .deck b,
html[data-theme="meadow"] .panel-head h2, html[data-theme="meadow"] .sd-score, html[data-theme="meadow"] .deck-title, html[data-theme="meadow"] .group,
html[data-theme="meadow"] .cal-bar h2, html[data-theme="meadow"] .cal-day h2, html[data-theme="meadow"] .hb-head b { font-family: var(--display); font-weight: 700; letter-spacing: 0; }
html[data-theme="meadow"] .hello h1 { font-size: 46px; color: #fff; text-shadow: 0 2px 0 #3b8f5c, 0 6px 18px rgb(30 90 60 / 0.35); }
html[data-theme="meadow"] .hello p { color: #1f5a3a; font-weight: 800; text-shadow: 0 1px 0 rgb(255 255 255 / 0.8); }
html[data-theme="meadow"] .page-head h1 { color: #fff; text-shadow: 0 2px 0 #3b8f5c, 0 6px 18px rgb(30 90 60 / 0.35); }
html[data-theme="meadow"] .page-head .sd-muted { color: #1f5a3a; font-weight: 700; }
html[data-theme="meadow"] .back { color: #1f5a3a; }
html[data-theme="meadow"] .sparkle { animation: m-sway 2.4s ease-in-out infinite alternate; }
html[data-theme="meadow"] .panel, html[data-theme="meadow"] .mode, html[data-theme="meadow"] .new-deck, html[data-theme="meadow"] .sd-notes-shell,
html[data-theme="meadow"] .sdc-zone, html[data-theme="meadow"] .sdc-make, html[data-theme="meadow"] .helper, html[data-theme="meadow"] .face {
  border: 1px solid rgb(255 255 255 / 0.95); backdrop-filter: blur(12px); }
html[data-theme="meadow"] .mode:hover { transform: translateY(-4px); }
html[data-theme="meadow"] .sd-btn { border-radius: 99px; font: 700 15px var(--display); background: #fff; }
html[data-theme="meadow"] .sd-btn.primary { background: var(--sd-accent); color: #fff; box-shadow: 0 4px 0 #23794a; }
html[data-theme="meadow"] .sd-btn.got { background: #4fc27c; border-color: transparent; color: #fff; box-shadow: 0 4px 0 #2a8c52; }
html[data-theme="meadow"] .sd-btn.again { background: #fff1ef; border-color: #f0b4ae; color: #b13d36; }
html[data-theme="meadow"] .sd-input, html[data-theme="meadow"] .card-row textarea { background: #fff; color: var(--sd-text); }
html[data-theme="meadow"] .sd-alert { background: rgb(255 248 220 / 0.92); color: #7a5300; }
html[data-theme="meadow"] .sd-alert.error { background: #fff0ee; color: #a3302a; }
html[data-theme="meadow"] .toast { background: #fff; color: var(--sd-text); box-shadow: 0 14px 30px -12px rgb(30 80 50 / 0.5); }
html[data-theme="meadow"] .subject, html[data-theme="meadow"] .deck, html[data-theme="meadow"] .subject-hero { border: 2px solid #fff; box-shadow: 0 14px 30px -16px rgb(30 80 50 / 0.5); }
html[data-theme="meadow"] .subject:hover { transform: translateY(-5px) rotate(-0.5deg); }
html[data-theme="meadow"] .subject-ic { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: rgb(255 255 255 / 0.8); }
html[data-theme="meadow"] .face .txt { font-family: var(--display); font-weight: 600; }
html[data-theme="meadow"] .backface { background: rgb(240 251 243 / 0.92); }
html[data-theme="meadow"] .cal-cell { background: rgb(255 255 255 / 0.7); }
html[data-theme="meadow"] .hb-msg.buddy { background: #eef8f0; }
html[data-theme="meadow"] .helper { background: rgb(255 255 255 / 0.9); }
html[data-theme="meadow"] .xp-pop { color: #c98a12; text-shadow: 0 2px 0 #fff; }
@media (max-width: 600px) { html[data-theme="meadow"] .hello h1 { font-size: 34px; } .meadow .tree { font-size: calc(var(--s) * 0.6); } }
