/* The ranking header uses the same night illustration as the ranking card. */
:root {
  --paper: #f6ecd8;
  --stock: #fff7e7;
  --ink: #211b1c;
  --muted: #685d54;
  --pink: #b81e51;
  --line: #cdbfa9;
  --print-rose: #f02768;
  --print-serif: "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
}
body { background: #e4d9c4; }
.site-header { border-bottom: 2px solid var(--ink); }
.brand-symbol { color: var(--stock); background: var(--ink); width: 34px; height: 34px; text-align: center; font: italic bold 29px/35px Georgia, serif; letter-spacing: -3px; }
.brand-symbol span { color: var(--print-rose); }
.brand-text { font-weight: 800; }
.site-header .header-share { width: 44px; height: 44px; margin: -7px -8px -7px 0; border: 0; border-radius: 0; color: var(--ink); background: transparent; }
.site-header .header-share svg { width: 24px; height: 24px; stroke-width: 1.6; }
.site-header .header-share:hover { color: var(--pink); background: transparent; }
.mobile-preview .bottom-nav { border-color: var(--ink); background: var(--stock); }
.mobile-preview .bottom-nav a { position: relative; color: var(--muted); }
.mobile-preview .bottom-nav a.active { font-weight: 750; color: var(--pink); }
.mobile-preview .bottom-nav a.active::before { content: ""; position: absolute; top: -10px; width: 25px; height: 3px; background: currentColor; }
.home-first .hero { padding-block: 24px; gap: 20px; }
.home-page .hero h1, .alice-ranking .ar-heading h1 {
  font-family: var(--print-serif); font-weight: 900; letter-spacing: -.07em;
}
.home-page .hero h1 { line-height: 1.06; font-size: clamp(48px, 6.4cqw, 84px); margin: 0 0 38px; }
.hero h1 em { color: var(--pink); }
.hero h1 em::after { display: none; }
.home-first .hero-visual {
  isolation: isolate; justify-content: center;
}
.home-first .book-wrap { transform: rotate(-5deg); margin: 0; }
.home-first .book-wrap::before { background: #a59378; }
.home-page .hero-actions .btn-primary { background: var(--print-rose); color: var(--ink); border: 1px solid var(--ink); border-radius: 0; font-weight: 800; }
.home-page .hero-actions .text-link { color: var(--ink); font-weight: 700; }
.home-first .purchase-guide { color: var(--muted); }
.purchase-section { border-color: var(--ink); }
.purchase-channel { border-radius: 0; }
.alice-ranking .ar-heading h1 { font-size: clamp(34px,5cqw,58px); margin: 0; line-height: 1.1; }
.alice-ranking { --ar-paper: var(--paper); --ar-cream: var(--stock); --ar-ink: var(--ink); --ar-rose: var(--pink); --ar-line: var(--line); --ar-muted: var(--muted); }
.alice-ranking .ar-heading {
  flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px;
  min-height: 135px; margin-bottom: 14px;
}
.ar-heading .ar-inline-link { color: var(--stock); }
.ar-board, .ar-scope-all, .ar-scope-select { border-radius: 0; }
.ar-table-head { background: var(--ink); color: var(--stock); }
.play-page .play-toolbar { border-bottom: 2px solid var(--ink); }
.play-page .play-clues { background: #f1e4cd; }
.play-page .play-submit .btn-primary { background: var(--pink); }

@container app (max-width: 600px) {
  .on-home .home-page, .alice-ranking { padding-inline: 18px; }
  .home-first .hero { justify-content: center; gap: clamp(10px, 2dvh, 22px); padding-block: 12px; }
  .home-page .hero h1 { font-size: clamp(36px,min(11.9cqw,7.3dvh),51px); line-height: 1.1; margin: 0; }
  .home-first .hero-visual { height: clamp(124px,calc(100dvh - 367px),395px); margin: 0; }
  .home-first .book-wrap { width: clamp(65px,min(47cqw,calc((100dvh - 372px) * .58)),185px); }
  .home-first .lens { width: 50%; height: auto; aspect-ratio: 1; }
  .home-first .lens-glass { border-width: 4px; }
  .home-first .lens::after { top: 82%; left: 83%; width: 13%; height: 59%; }
  .hero .mobile-hero-actions { margin: 2px 0 0; display: grid; grid-template-columns: 1.45fr 1fr; gap: 12px; align-items: stretch; }
  .hero .mobile-hero-actions a { display: flex; align-items: center; justify-content: center; min-height: 44px; }
  .hero .mobile-hero-actions .text-link { border: 1px solid var(--ink); background: var(--stock); }
  .home-first .purchase-guide { min-height: 35px; padding: 4px 0 9px; }
}
@media (min-width: 761px) {
  body:is([data-view="home"],[data-view="cases"],[data-view="ranking"]) .app-shell {
    max-width: 1080px; min-height: 100dvh; margin: 0 auto; border: 0; border-radius: 0;
  }
  body:is([data-view="home"],[data-view="cases"],[data-view="ranking"]) .bottom-nav { display: none; }
  .on-home .home-first { min-height: 0; }
  .home-first .hero { grid-template-columns: 1fr 1.08fr; padding-block: 40px; }
  .home-first .hero-visual { height: clamp(365px,44vw,485px); }
  .home-first .book-wrap { width: 47%; }
  .home-first .purchase-guide { min-height: 38px; }
  .alice-ranking .ar-heading { min-height: 155px; }
}

.ar-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; margin: 0 0 12px; }
.ar-toolbar .ar-scope-controls { gap: 1px; margin: 0; padding: 2px; border-bottom: 1px solid var(--ar-line); }
.ar-toolbar .ar-scope-all, .ar-toolbar .ar-scope-select { border: 0; border-radius: 2px; min-width: 0; font-size: 12px; }
.ar-toolbar .ar-scope-all { min-height: 36px; padding: 6px 12px; }
.ar-toolbar .ar-scope-select { min-height: 36px; padding: 0; }
.ar-toolbar .ar-scope-select select { min-width: 73px; height: 36px; padding: 4px 20px 4px 8px; font-size: 12px; }
.ar-toolbar .ar-select-arrow { right: 6px; top: 9px; }
.ar-toolbar .ar-danmu-controls { gap: 11px; }
.ar-toolbar .ar-compose-open, .ar-toolbar .ar-danmu-toggle { min-height: 40px; font-size: 11px; }
.ar-personal-row { box-shadow: inset 3px 0 var(--pink); min-height: 56px; padding-block: 7px; background: #f7e1de; }
.ar-personal-end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ar-personal-row .ar-player-meta { font-size: 10px; }
.ar-row-action { display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; background: transparent; color: var(--pink); font-size: 10px; line-height: 1.2; }
.ar-row-action svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; }
@container app (max-width: 350px) { .ar-toolbar { column-gap: 4px; } .ar-toolbar .ar-danmu-controls { gap: 7px; } }


.ar-rows .ar-row { min-height: 36px; padding-block: 3px; }
.ar-rows .ar-medal { width: 24px; height: 28px; }
.ar-rows .ar-medal b { top: 3px; font-size: 14px; }
.ar-rows .ar-player { display: flex; align-items: center; gap: 7px; }
.ar-rows .ar-player-name { max-width: 73%; line-height: 1.35; }
.ar-secondary { flex: 1; min-width: 0; position: relative; height: 14px; }
.ar-secondary .ar-player-meta { margin: 0; line-height: 14px; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }


.purchase-section {padding:24px 0 12px;border-top:2px solid var(--ink)}
.purchase-section .purchase-heading {align-items:center;margin-bottom:12px}
.purchase-heading h2 {font-family:var(--serif);font-size:24px}
.purchase-countdown {text-align:right}
.purchase-countdown small {display:block;font-size:10px;color:var(--muted)}
.purchase-countdown b {font:600 16px var(--mono);font-variant-numeric:tabular-nums;color:var(--pink)}
.purchase-section .purchase-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(260px,100%),1fr));gap:0 24px}
.purchase-section .purchase-channel {min-height:60px;padding:9px 0;gap:11px;border:0;border-top:1px solid var(--line);background:transparent}
.shop-logo {display:block;width:36px;height:36px;object-fit:contain;border-radius:6px}
.purchase-section .channel-name {font-size:14px;line-height:1.45;white-space:normal;font-weight:650}
.purchase-section .channel-name small {font-size:10px;font-weight:500}
.shop-action {margin-left:auto;white-space:nowrap;color:var(--muted);font-size:12px}
