/* かえでゲームズ ミニ — next-Nicommons: warm paper light + warm dark
   Hierarchy rule used throughout: exactly one loud thing per screen (the play row you
   are on, or the section you are reading). Everything else steps down in weight, not
   in colour — a wall of equally-bright rows is what made the old build tiring. */
:root {
  --bg: #f7f1e4;
  --bg2: #efe7d5;
  --surface: #fffdf8;
  --surface2: #f4ecdc;
  --border: #e3d7bd;
  --border-soft: #ece3d1;
  --text: #2f2a22;
  --text2: #6b6353;
  --muted: #9a917d;
  --accent: #d93a26;
  --accent2: #f59300;
  --accent-ink: #8c2417;
  --accent-soft: rgba(217, 58, 38, 0.07);
  --gold-soft: rgba(245, 147, 0, 0.13);
  --shadow: rgba(120, 90, 30, 0.09);
  --shadow-lift: rgba(120, 90, 30, 0.16);
  --radius: 12px;
  --topbar-h: 56px;
}
:root[data-theme="dark"] {
  --bg: #14110c;
  --bg2: #1a1610;
  --surface: #201b14;
  --surface2: #2b2418;
  --border: #3b3223;
  --border-soft: #2f2819;
  --text: #efe9db;
  --text2: #b9ad94;
  --muted: #8d836c;
  --accent: #ff6a4d;
  --accent2: #ffb739;
  --accent-ink: #ffd9a0;
  --accent-soft: rgba(255, 106, 77, 0.13);
  --gold-soft: rgba(255, 183, 57, 0.12);
  --shadow: rgba(0, 0, 0, 0.42);
  --shadow-lift: rgba(0, 0, 0, 0.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14110c;
    --bg2: #1a1610;
    --surface: #201b14;
    --surface2: #2b2418;
    --border: #3b3223;
    --border-soft: #2f2819;
    --text: #efe9db;
    --text2: #b9ad94;
    --muted: #8d836c;
    --accent: #ff6a4d;
    --accent2: #ffb739;
    --accent-ink: #ffd9a0;
    --accent-soft: rgba(255, 106, 77, 0.13);
    --gold-soft: rgba(255, 183, 57, 0.12);
    --shadow: rgba(0, 0, 0, 0.42);
    --shadow-lift: rgba(0, 0, 0, 0.6);
  }
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { line-height: 1.35; letter-spacing: 0.005em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* one icon system: Lucide strokes at a consistent optical size */
.ic { width: 18px; height: 18px; flex-shrink: 0; display: block; }

/* ---------- topbar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 50;
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--border-soft);
}
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-img { width: 30px; height: 30px; }
.logo-t { font-weight: 800; font-size: 15px; letter-spacing: .01em; white-space: nowrap; }
.logo-t b { color: var(--accent); }
.searchbox { position: relative; flex: 1; max-width: 440px; margin-left: auto; }
.search-ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
#q {
  width: 100%; height: 38px; padding: 0 12px 0 34px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 14px; outline: none; appearance: none; -webkit-appearance: none;
}
#q:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#q::placeholder { color: var(--muted); font-size: 13px; }
.search-results {
  position: absolute; top: 44px; left: 0; right: 0; max-height: min(62vh, 480px); overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 18px 44px var(--shadow-lift); z-index: 60;
}
.sr-row { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.sr-row:last-child { border-bottom: 0; }
.sr-row:hover { background: var(--surface2); }
.sr-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.sr-cat { flex-shrink: 0; font-size: 11px; color: var(--text2); background: var(--bg2); border: 1px solid var(--border-soft); border-radius: 99px; padding: 2px 8px; }
.sr-more { padding: 9px 12px; text-align: center; color: var(--muted); font-size: 12px; }
.tb-btn { flex-shrink: 0; width: 36px; height: 36px; display: grid; place-items: center; color: var(--text2); border-radius: 9px; }
.tb-btn:hover { color: var(--text); background: var(--surface2); }
:root[data-theme="dark"] .i-moon, .i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-moon { display: none; }
  :root:not([data-theme="light"]) .i-sun { display: block; }
}

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); max-width: 1180px; margin: 0 auto; padding-top: var(--topbar-h); }
main { padding: 18px 22px 120px; min-width: 0; }

.side {
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h));
  overflow-y: auto; padding: 10px 8px 40px; border-right: 1px solid var(--border-soft);
  scrollbar-width: thin;
}
.side-h { font-size: 10.5px; font-weight: 800; color: var(--muted); letter-spacing: .1em; padding: 14px 10px 5px; display: flex; align-items: center; }
.side-h:first-child { padding-top: 4px; }
.side a { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; font-size: 13px; color: var(--text2); }
.side a:hover { background: var(--surface2); color: var(--text); }
.side a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; box-shadow: inset 2px 0 0 var(--accent); }
.sb-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-n { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sb-done { font-size: 10px; color: var(--accent2); display: none; }
.sb-done.on { display: inline; }
.gdot { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 6px; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }

.chips { display: none; gap: 7px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; font-size: 12.5px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text2); white-space: nowrap; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

/* ---------- headings: the step-down ---------- */
section > h2, .qhead h2 {
  font-size: 17px; font-weight: 800; margin: 30px 0 12px;
  display: flex; align-items: center; gap: 8px;
}
section > h2 .ic { color: var(--accent2); width: 19px; height: 19px; }
.h-sub { font-size: 11.5px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.grp-h {
  font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .1em;
  display: flex; align-items: center; margin: 18px 0 8px;
}

/* ---------- category head ---------- */
.cat-head {
  position: relative; padding: 20px 20px 16px; margin-bottom: 14px;
  background:
    radial-gradient(460px 150px at 92% -30%, var(--gold-soft), transparent 70%),
    radial-gradient(380px 160px at 4% 130%, var(--accent-soft), transparent 70%),
    var(--surface);
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
}
.cat-head::after {
  content: ""; position: absolute; right: -18px; bottom: -26px; width: 128px; height: 128px;
  background: url('/static/kaede-icon.png') no-repeat center / contain;
  opacity: 0.07; transform: rotate(-8deg); pointer-events: none;
}
.cat-catch { font-size: 13px; color: var(--accent); font-weight: 700; margin-bottom: 3px; }
.cat-catch span { display: inline-block; }
.cat-head h1 { font-size: 23px; font-weight: 900; margin-bottom: 12px; }
.cat-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { font-size: 11.5px; font-weight: 800; color: #40260a; background: linear-gradient(135deg, var(--accent2), #ffd88c); border-radius: 99px; padding: 4px 11px; }
.badge-prog { display: none; background: var(--surface2); color: var(--accent-ink); border: 1px solid var(--border); }
.badge-prog.on { display: inline-block; }
.spacer { flex: 1; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; padding: 6px 13px; border-radius: 9px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text2);
}
.share-btn .ic { width: 15px; height: 15px; }
.share-btn:hover { color: var(--accent); border-color: var(--accent); }
.share-btn.done { color: var(--accent); border-color: var(--accent); }

/* ---------- 語録 explainer (sits above the board) ---------- */
.origin { margin-bottom: 14px; }
.origin summary {
  display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none;
  padding: 13px 15px; border-radius: 12px;
  background: linear-gradient(100deg, var(--gold-soft), transparent 62%), var(--surface);
  border: 1.5px solid var(--accent2);
}
.origin summary::-webkit-details-marker { display: none; }
.origin summary:hover { box-shadow: 0 3px 14px var(--shadow); }
.origin-ic { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; background: var(--accent2); color: #fff; }
.origin-ic .ic { width: 19px; height: 19px; }
.origin-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.origin-txt b { font-size: 14.5px; font-weight: 800; }
.origin-txt span { font-size: 11.5px; color: var(--muted); }
.origin-go { color: var(--accent2); transition: transform .18s; }
.origin[open] .origin-go { transform: rotate(90deg); }
.origin[open] summary { border-radius: 12px 12px 0 0; border-bottom-color: var(--border); }
.origin-body { padding: 14px 16px 16px; border: 1.5px solid var(--accent2); border-top: 0; border-radius: 0 0 12px 12px; background: var(--surface); }
.origin-lede { font-size: 13.5px; color: var(--text2); margin-bottom: 12px; }
.origin-body h3 { font-size: 13px; font-weight: 800; color: var(--accent-ink); margin: 14px 0 4px; }
.origin-body h3:first-of-type { margin-top: 0; }
.origin-body p { font-size: 13.5px; color: var(--text2); line-height: 1.8; }
.origin-src { font-size: 11.5px !important; color: var(--muted) !important; margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--border); }
.origin-src a { text-decoration: underline; }

/* ---------- soundboard ---------- */
.board { list-style: none; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: 0 1px 3px var(--shadow); }
.s { display: flex; align-items: stretch; border-bottom: 1px solid var(--border-soft); position: relative; }
.s:last-child { border-bottom: 0; }
.s-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; padding: 11px 6px 11px 13px; text-align: left; position: relative; }
.s-main:hover { background: var(--surface2); }
.s-name { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-ico {
  width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface2); color: var(--accent);
  border: 1px solid var(--border); position: relative; transition: transform .12s, background .12s;
}
.s-ico .ic { width: 13px; height: 13px; margin-left: 1px; }
.s-main:hover .s-ico { transform: scale(1.07); }
.s-main:active .s-ico { transform: scale(0.92); }
.eq { display: none; align-items: flex-end; gap: 2px; height: 13px; }
.eq i { width: 3px; background: currentColor; border-radius: 1px; animation: eq .68s ease-in-out infinite; height: 40%; }
.eq i:nth-child(2) { animation-delay: .22s; height: 92%; }
.eq i:nth-child(3) { animation-delay: .44s; height: 60%; }
@keyframes eq { 50% { transform: scaleY(.32); } }

/* the one loud thing on screen */
.playing .s-ico, .qs.playing .s-ico {
  background: linear-gradient(140deg, var(--accent), var(--accent2)); color: #fff;
  border-color: transparent; box-shadow: 0 0 0 4px var(--accent-soft), 0 4px 14px var(--shadow-lift);
  animation: pop .3s ease;
}
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.18); } 100% { transform: scale(1); } }
.playing .i-play, .qs.playing .i-play { display: none; }
.playing .eq, .qs.playing .eq { display: flex; }
.s.playing { background: var(--accent-soft); }
.s.playing .s-name { color: var(--text); font-weight: 700; }
.s.paused .s-ico { background: var(--accent-soft); }
.s.heard .s-ico::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--accent2); border: 2px solid var(--surface);
}
.s-hot { flex-shrink: 0; color: var(--accent2); display: grid; place-items: center; }
.s-hot .ic { width: 14px; height: 14px; }
.s-n { flex-shrink: 0; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.s-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transform-origin: left; transform: scaleX(0); pointer-events: none; }
.s-act { flex-shrink: 0; width: 44px; display: grid; place-items: center; color: var(--muted); }
.s-act .ic { width: 17px; height: 17px; }
.s-act:hover { color: var(--accent); background: var(--surface2); }
.s-act.done { color: var(--accent2); }
.s.hl { box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- top page ---------- */
.hero { display: flex; align-items: center; gap: 18px; padding: 18px 0 4px; }
.hero-chara { width: 86px; height: 86px; flex-shrink: 0; filter: drop-shadow(0 6px 14px var(--shadow-lift)); }
.hero-t { min-width: 0; }
.hero-catch { font-size: 14px; color: var(--accent); font-weight: 700; }
.hero-catch b { font-size: 16px; }
.hero h1 { font-size: 27px; font-weight: 900; margin: 3px 0 5px; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-sub { color: var(--muted); font-size: 13px; }
.hero-sub a { color: var(--accent); text-decoration: underline; }

.qhead { display: flex; align-items: center; gap: 12px; }
.qhead h2 { margin-bottom: 12px; }
.gacha {
  display: inline-flex; align-items: center; gap: 7px; margin-left: auto;
  font-size: 12.5px; font-weight: 800; padding: 8px 15px; border-radius: 99px;
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 3px 12px var(--shadow-lift); transition: transform .1s, filter .1s;
}
.gacha .ic { width: 16px; height: 16px; }
.gacha:hover { filter: brightness(1.06); }
.gacha:active { transform: scale(.95); }

.quick-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.qs {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 7px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 99px; font-size: 13px;
  color: var(--text2); transition: transform .08s, border-color .1s;
}
.qs:hover { border-color: var(--accent); color: var(--text); }
.qs:active { transform: scale(.95); }
.qs .s-ico { width: 27px; height: 27px; }
.qs-more { color: var(--accent); font-weight: 700; padding: 7px 14px; }
.qs-more .ic { width: 15px; height: 15px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.grp-cards { margin-bottom: 4px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 3px; padding: 13px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  transition: border-color .12s, transform .08s, box-shadow .12s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 16px var(--shadow); }
.card-rank { position: absolute; top: 10px; right: 12px; font-size: 12px; font-weight: 900; color: var(--accent2); font-variant-numeric: tabular-nums; }
.card-t { font-weight: 800; font-size: 14px; padding-right: 20px; }
.card-c { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.card-c span { display: inline-block; }
.card-n { font-size: 11px; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 3px; }
.about p { color: var(--text2); font-size: 13.5px; max-width: 680px; }

/* ranking */
.rank { list-style: none; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.rk { display: flex; align-items: center; border-bottom: 1px solid var(--border-soft); }
.rk:last-child { border-bottom: 0; }
.rk-n { width: 38px; flex-shrink: 0; text-align: center; font-weight: 900; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rk:nth-child(1) .rk-n, .rk:nth-child(2) .rk-n, .rk:nth-child(3) .rk-n { color: var(--accent2); font-size: 15px; }
.rk .s-main { padding-left: 2px; }
.rk-cat { flex-shrink: 0; margin-right: 12px; font-size: 11px; color: var(--text2); background: var(--bg2); border: 1px solid var(--border-soft); border-radius: 99px; padding: 2px 9px; }

/* 図鑑 */
.zukan {
  display: none; align-items: center; gap: 11px; margin-top: 24px; padding: 12px 16px;
  background: var(--surface); border: 1.5px dashed var(--accent2); border-radius: 12px; font-size: 12.5px;
}
.zukan.on { display: flex; }
.zukan-ic { color: var(--accent2); display: grid; place-items: center; }
.zukan-bar { flex: 1; min-width: 60px; height: 8px; border-radius: 5px; background: var(--surface2); overflow: hidden; }
.zukan-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .5s cubic-bezier(.2,.9,.3,1); }
.zukan-label { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.zukan-rank { color: var(--accent); font-weight: 800; white-space: nowrap; font-size: 11.5px; }

/* reviews */
.revs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.rev { flex: 0 0 240px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; }
.rev-t { font-weight: 800; font-size: 13px; margin-bottom: 2px; }
.rev-b { font-size: 12px; color: var(--text2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.rev-m { font-size: 11px; color: var(--muted); margin-top: 6px; }
.rev-stars { color: var(--accent2); font-size: 11px; letter-spacing: 1px; }

/* ads + adblock fallback */
.adbox { margin: 22px 0; min-height: 1px; }
.noad { margin: 22px 0; padding: 15px 16px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px; }
.noad-h { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.noad-h .ic { width: 22px; height: 22px; color: var(--accent2); }
.noad-h b { display: block; font-size: 13.5px; font-weight: 800; }
.noad-h span { font-size: 12px; color: var(--muted); }
.noad-embeds iframe { max-width: 560px; }
.noad-alt { display: flex; gap: 12px; margin-top: 8px; font-size: 12px; }
.noad-alt a { color: var(--accent); text-decoration: underline; }

/* next up / recirculation */
.nextup { margin-top: 26px; }
.nextup-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.nextup-btn {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700;
  padding: 8px 15px; border-radius: 99px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text2);
}
.nextup-btn:hover { border-color: var(--accent); color: var(--accent); }
.nextup-btn .ic { width: 16px; height: 16px; }
.nextup-sug { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.nextup-lead { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.nextup-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  padding: 5px 12px; border-radius: 99px; background: var(--gold-soft); border: 1px solid var(--accent2); color: var(--text);
}
.nextup-pill b { font-size: 10.5px; color: var(--accent); font-variant-numeric: tabular-nums; }
.nextup-pill:hover { background: var(--accent2); color: #fff; }
.nextup-pill:hover b { color: #fff; }

.related { margin-top: 26px; }
.related h2 { font-size: 15px; }
.cat-pn { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; font-size: 13px; }
.cat-pn a { display: inline-flex; align-items: center; gap: 6px; color: var(--text2); padding: 8px 4px; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-pn a:hover { color: var(--accent); }
.cat-pn .ic { width: 15px; height: 15px; flex-shrink: 0; }

/* ---------- footer ---------- */
.foot { margin-top: 44px; border-top: 1px solid var(--border); padding-top: 24px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.foot-brand { display: flex; align-items: center; gap: 7px; font-weight: 800; margin-bottom: 7px; }
.foot-brand b { color: var(--accent); }
.foot p { font-size: 12.5px; color: var(--text2); margin-bottom: 6px; }
.foot-note { font-size: 11.5px !important; color: var(--muted) !important; }
.foot-h { font-size: 10.5px; font-weight: 800; color: var(--muted); letter-spacing: .09em; margin-bottom: 6px; }
.foot-grid a { display: block; font-size: 13px; color: var(--text2); padding: 3px 0; }
.foot-grid a:hover { color: var(--accent); }
.foot-social { display: flex; gap: 8px; margin-top: 12px; }
.foot-social a { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text2); }
.foot-social a:hover { border-color: var(--accent); color: var(--accent); }
.foot-theme { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 13px; color: var(--text2); padding: 3px 0; }
.foot-theme:hover { color: var(--accent); }
.foot-c { text-align: center; font-size: 11px; color: var(--muted); padding: 24px 0 10px; }

/* ---------- now playing bar ---------- */
.nowbar {
  position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 60; display: flex; align-items: center; gap: 10px;
  width: min(560px, calc(100vw - 20px)); padding: 8px 10px 8px 8px;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 15px; box-shadow: 0 12px 34px var(--shadow-lift);
}
.nowbar[hidden] { display: none; }
.nb-toggle { width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(140deg, var(--accent), var(--accent2)); color: #fff; }
.nb-toggle .ic { width: 15px; height: 15px; }
.nowbar .i-pause { display: none; }
.nowbar.playing .i-pause { display: block; }
.nowbar.playing .i-play { display: none; }
.nb-info { flex: 1; min-width: 0; }
.nb-name { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-prog { height: 3px; background: var(--surface2); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.nb-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.nb-act { flex-shrink: 0; width: 36px; height: 36px; display: grid; place-items: center; color: var(--text2); border-radius: 9px; }
.nb-act:hover { color: var(--accent); background: var(--surface2); }

/* ---------- toast (the reward surface) ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(72px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px);
  z-index: 70; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  width: max-content; max-width: min(440px, calc(100vw - 20px));
  padding: 11px 15px; font-size: 13px; line-height: 1.5;
  background: var(--surface); color: var(--text);
  border: 1.5px solid var(--accent2); border-radius: 13px;
  box-shadow: 0 12px 32px var(--shadow-lift);
  opacity: 0; transition: opacity .22s, transform .22s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast[hidden] { display: none; }
.toast b { font-weight: 800; }
.toast-sub { display: block; font-size: 11.5px; color: var(--muted); }
.toast-sub a { color: var(--accent); text-decoration: underline; }
.toast-x { flex-shrink: 0; font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); border-radius: 8px; padding: 6px 12px; }
.toast-pwa { display: flex; align-items: center; gap: 10px; }
.toast-pwa img { flex-shrink: 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .chips { display: flex; }
  main { padding: 12px 12px 100px; }
  .topbar { padding: 0 10px; gap: 8px; }
  /* mobile is ~57% of traffic and search is the main tool — give it the room.
     The theme switch lives in the footer here so the bar stays two items wide. */
  .tb-theme { display: none; }
  .searchbox { max-width: none; }
  .logo-t { display: none; }
  .hero { gap: 14px; padding: 10px 0 2px; }
  .hero-chara { width: 64px; height: 64px; }
  .hero h1 { font-size: 21px; }
  .cat-head { padding: 16px 16px 14px; }
  .cat-head h1 { font-size: 19px; }
  section > h2, .qhead h2 { margin: 24px 0 10px; font-size: 16px; }
  .foot-grid { grid-template-columns: 1fr; gap: 18px; }
  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .card-c { display: none; }
  .qhead { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
