/* Dark first, like a music app: flat surfaces, one accent, content does the decorating. */
:root, :root[data-theme="dark"] {
  --bg: #151a3c; --sur: #1e2450; --rise: #2a3166; --line: #39417c; --fg: #f1f2ff; --mut: #a7addb; --acc: #c2adff; --on: #170f38;
  --c-song: #c08bff; --c-talk: #5fb4ff; --c-game: #5fd6a0; --c-collab: #ffab5e; --c-draw: #ffd95e; --c-other: #7d83ad;
}
:root[data-theme="light"] {
  --bg: #f6f6fa; --sur: #ffffff; --rise: #eeeff7; --line: #dfe1ee; --fg: #14162b; --mut: #636887; --acc: #6546d8; --on: #ffffff;
  --c-song: #9a5cf0; --c-talk: #2f8fe6; --c-game: #23a86c; --c-collab: #e9862a; --c-draw: #d1a400; --c-other: #8b90b3;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--fg); background: var(--bg); font: 15px/1.6 system-ui, "Noto Sans TC", "Noto Sans CJK TC", sans-serif; }
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.25; margin: 26px 0 16px; }
h2 { font-size: 1.3rem; margin: 0; }
.count, footer, .sub { color: var(--mut); font-size: .85rem; }

/* Top bar */
#top { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 18px; padding: 10px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.brand .star { color: var(--acc); }
.brand b { font-size: 1.1rem; }
.brand small { color: var(--mut); font-size: .72rem; }
#top nav { display: flex; gap: 2px; }
#top nav a { padding: 6px 12px; border-radius: 6px; color: var(--mut); font-weight: 600; }
#top nav a:hover { color: var(--fg); }
#top nav a.on { color: var(--fg); background: var(--rise); }
#sf { flex: 1; display: flex; justify-content: flex-end; }
#sq { width: 100%; max-width: 420px; border: 1px solid transparent; outline: 0; border-radius: 8px; padding: 8px 14px; background: var(--rise); }
#sq:focus { border-color: var(--acc); }
#theme, #dockx { border: 0; background: none; color: var(--mut); font-size: 1.1rem; }
main { max-width: 1320px; margin: 0 auto; padding: 0 28px 140px; }

/* Home: a featured stream, then shelves */
#hero { position: relative; overflow: hidden; margin: 24px 0 10px; border-radius: 14px; background: var(--sur); }
#hero .back { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(36px) saturate(1.3); opacity: .5; }
#hero .in { position: relative; display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 28px; align-items: end; padding: 28px; background: linear-gradient(0deg, color-mix(in srgb, var(--bg) 78%, transparent), transparent); }
#hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; display: block; box-shadow: 0 16px 48px rgba(0, 0, 0, .45); }
#hero h1 { margin: 6px 0 10px; font-size: clamp(1.3rem, 2.6vw, 2rem); }
.kicker { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .1em; color: var(--acc); }
.acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.btn, .field { border: 1px solid var(--line); background: var(--sur); border-radius: 8px; padding: 7px 14px; }
.btn:hover { background: var(--rise); }
.btn.go { border: 0; background: var(--acc); color: var(--on); font-weight: 700; padding: 9px 22px; border-radius: 999px; }
.statline { margin: 0 0 4px; color: var(--mut); font-size: .88rem; }
.statline b { color: var(--fg); font-variant-numeric: tabular-nums; }
.shelfhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 34px 0 12px; }
.shelfhead > a { color: var(--mut); font-size: .85rem; font-weight: 600; }
.shelfhead > a:hover { color: var(--fg); }
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 250px); gap: 16px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.grid { display: grid; gap: 22px 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* A stream card: picture, then two lines. No box around it. */
.card { display: block; min-width: 0; }
.thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--rise); display: grid; place-items: center; color: var(--mut); font-size: .8rem; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.card:hover img { transform: scale(1.04); }
.badge { position: absolute; right: 6px; bottom: 6px; padding: 0 6px; border-radius: 4px; background: rgba(0, 0, 0, .78); color: #fff; font-size: .74rem; font-variant-numeric: tabular-nums; }
.badge.n { right: auto; left: 6px; }
.ctitle { margin-top: 8px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cline { color: var(--mut); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--c-other); }
.k-歌 { background: var(--c-song) !important; } .k-雜談 { background: var(--c-talk) !important; } .k-遊戲 { background: var(--c-game) !important; } .k-企劃連動 { background: var(--c-collab) !important; } .k-畫圖 { background: var(--c-draw) !important; }

/* Calendar of streams, one square a day */
.calwrap { overflow-x: auto; padding: 14px 16px; border-radius: 12px; background: var(--sur); scrollbar-width: thin; }
#cal { display: grid; grid-auto-flow: column; grid-template-rows: 16px repeat(7, 12px); grid-auto-columns: 12px; gap: 3px; width: max-content; }
#cal i { border-radius: 3px; background: var(--rise); }
#cal a { border-radius: 3px; background: var(--c-other); }
#cal a:hover { outline: 2px solid var(--fg); }
#cal span { font-size: .68rem; color: var(--mut); white-space: nowrap; width: 12px; }
.legend { color: var(--mut); font-size: .78rem; display: flex; gap: 12px; flex-wrap: wrap; }

/* Browse */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips a { padding: 6px 14px; border-radius: 8px; background: var(--rise); font-weight: 600; font-size: .9rem; }
.chips a i { font-style: normal; font-weight: 400; color: var(--mut); margin-left: 4px; }
.chips a.on { background: var(--fg); color: var(--bg); }
.chips a.on i { color: inherit; opacity: .6; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 8px; }
.bar > span { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bar input.field { flex: 1; max-width: 380px; }
.chk { color: var(--mut); font-size: .9rem; }
.more { text-align: center; margin: 26px 0; }

/* One stream */
.shead { position: relative; overflow: hidden; margin: 24px 0 0; border-radius: 14px; background: var(--sur); }
.shead .back { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) saturate(1.3); opacity: .42; }
.shead .in { position: relative; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 26px; padding: 22px; background: linear-gradient(0deg, color-mix(in srgb, var(--bg) 80%, transparent), transparent); }
#stage { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
#stage img, #stage iframe, #dockframe iframe { width: 100%; height: 100%; border: 0; object-fit: cover; display: block; }
#stage .big { position: absolute; inset: 0; margin: auto; width: 68px; height: 68px; border: 0; border-radius: 50%; background: var(--acc); color: var(--on); font-size: 1.5rem; padding-left: 6px; }
#stage .none { position: absolute; inset: 0; display: grid; place-items: center; color: var(--mut); background: var(--rise); }
.tl { position: relative; height: 10px; margin: 14px 0 2px; border-radius: 5px; background: color-mix(in srgb, var(--fg) 14%, transparent); }
.tl button { position: absolute; top: 0; bottom: 0; min-width: 4px; padding: 0; border: 0; border-radius: 5px; background: var(--c-song); }
.tl button.hot { top: -4px; bottom: -4px; min-width: 3px; width: 3px; background: var(--c-collab); }
.tl button:hover { filter: brightness(1.3); }
.tlab { display: flex; justify-content: space-between; color: var(--mut); font-size: .72rem; font-variant-numeric: tabular-nums; }
.info { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.info h1 { font-size: clamp(1.15rem, 2vw, 1.6rem); margin: 0; }
.tabs { display: flex; gap: 22px; margin: 26px 0 0; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 0; color: var(--mut); font-weight: 700; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--fg); border-color: var(--acc); }
h3 { font-size: 1.15rem; margin: 30px 0 6px; scroll-margin-top: 70px; }

/* Track list: rows, not boxes */
.tracks { display: grid; }
.tracks.cols { grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); column-gap: 24px; }
.trow, .tracks summary { display: grid; grid-template-columns: 2.2em 34px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 8px; }
.trow:hover, .tracks summary:hover { background: var(--rise); }
.tracks summary { cursor: pointer; list-style: none; grid-template-columns: 2.2em 34px minmax(0, 1fr) 5.5em 6.5em 1.2em; }
.tracks summary::-webkit-details-marker { display: none; }
.tracks summary::after { content: "▾"; color: var(--mut); }
.tracks details[open] > summary::after { content: "▴"; }
.tracks details[open] { background: var(--sur); border-radius: 8px; margin: 2px 0; }
.no { color: var(--mut); font-size: .82rem; text-align: right; font-variant-numeric: tabular-nums; }
.tt b, .tt span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt b { font-weight: 600; }
.tt span, .tm { color: var(--mut); font-size: .8rem; }
.tm { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pb { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--rise); color: var(--fg); font-size: .72rem; padding-left: 3px; }
.trow:hover .pb, .tracks summary:hover .pb, .pb:hover { background: var(--acc); color: var(--on); }
.perfs { padding: 2px 10px 10px calc(2.2em + 34px + 34px); }
.perf { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: .88rem; }
.perf time { color: var(--mut); font-variant-numeric: tabular-nums; flex: 1; }
.pill { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 2px 12px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pill:hover { background: var(--rise); }
/* Single-song videos are on the fan channel: dashed and grey, so they never look like Ruri's own links. */
.pill.fan { border: 1px dashed color-mix(in srgb, var(--mut) 60%, transparent); color: var(--mut); font-weight: 400; }
.pill.fan small { margin-left: 5px; font-size: .66rem; }
.fanchip { display: inline-block; padding: 0 8px; border-radius: 999px; border: 1px dashed color-mix(in srgb, var(--mut) 60%, transparent); color: var(--mut); font-size: .74rem; }
/* (the note about fan-channel clips is plain text on a line of its own: a drawn sample of the button looked like a layout fault) */

/* Transcript lines and search hits */
.box { margin: 10px 0; padding: 14px 16px; border-radius: 10px; background: var(--sur); }
.box > a { font-weight: 700; }
.seg { display: flex; gap: 12px; padding: 4px 0; align-items: baseline; }
.t { flex: none; min-width: 4.2em; text-align: right; border: 0; background: none; padding: 0; color: var(--acc); font-variant-numeric: tabular-nums; font-size: .85rem; }
.t:hover { text-decoration: underline; }
#tr .seg { font-size: 1.02rem; }
#trq { width: 100%; max-width: 360px; margin: 6px 0; }
mark { background: color-mix(in srgb, var(--c-draw) 70%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
footer { margin: 56px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }

/* Small player that follows the page */
#dock { position: fixed; right: 18px; bottom: 18px; width: min(420px, calc(100vw - 36px)); border-radius: 10px; overflow: hidden; background: var(--rise); box-shadow: 0 16px 48px rgba(0, 0, 0, .55); z-index: 5; }
.dockbar { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; font-size: .82rem; }
#now { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#now a { color: var(--acc); margin-left: 8px; }
#dockframe { aspect-ratio: 16 / 9; background: #000; }

@media (max-width: 860px) {
  #top { flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; }
  .brand small { display: none; }
  #sf { order: 3; flex-basis: 100%; }
  #sq { max-width: none; }
  #top nav { order: 2; margin-left: auto; }
  #top nav a { padding: 6px 8px; }
  #theme { order: 1; }
  main { padding: 0 14px 140px; }
  #hero .in, .shead .in { grid-template-columns: 1fr; padding: 16px; }
  .tracks.cols { grid-template-columns: 1fr; }
  .tracks summary { grid-template-columns: 2em 34px minmax(0, 1fr) auto 1.2em; }
  .tracks summary .last { display: none; }
  .perfs { padding-left: 10px; }
}

/* Night sky. Behind everything, never in the way of a click. */
#sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(55% 42% at 80% -4%, rgba(170, 130, 255, .42), transparent 70%), radial-gradient(45% 38% at 6% 14%, rgba(80, 160, 255, .26), transparent 70%), radial-gradient(60% 45% at 30% 104%, rgba(190, 120, 240, .24), transparent 70%), radial-gradient(40% 35% at 96% 78%, rgba(70, 130, 255, .18), transparent 70%),
    linear-gradient(170deg, #1b2152 0%, #1a1a4a 38%, #221a52 68%, #141a40 100%); }
#sky i { position: absolute; top: 0; left: 0; border-radius: 50%; animation: twinkle 7s ease-in-out infinite alternate; }
#sky i:nth-child(1) { width: 1px; height: 1px; }
#sky i:nth-child(2) { width: 1.5px; height: 1.5px; animation-duration: 4.5s; animation-delay: -2s; }
#sky i:nth-child(3) { width: 2.5px; height: 2.5px; animation-duration: 3s; animation-delay: -1s; filter: drop-shadow(0 0 3px rgba(190, 170, 255, .9)); }
@keyframes twinkle { from { opacity: .45; } to { opacity: 1; } }
#sky b { position: absolute; width: 150px; height: 1.5px; border-radius: 2px; opacity: 0; transform: rotate(-32deg);
  background: linear-gradient(90deg, #fff, rgba(190, 170, 255, .7) 18%, transparent); filter: drop-shadow(0 0 4px rgba(200, 185, 255, .9)); animation: meteor 11s linear infinite; }
#sky b:nth-of-type(1) { top: 6%; left: 72%; animation-delay: -10.45s; }
#sky b:nth-of-type(2) { top: 22%; left: 104%; animation-duration: 17s; animation-delay: 4s; width: 110px; }
#sky b:nth-of-type(3) { top: 48%; left: 58%; animation-duration: 23s; animation-delay: 9s; width: 190px; }
/* A shooting star is on screen for the last tenth of its cycle only, so the sky is mostly still. */
@keyframes meteor { 0%, 90% { opacity: 0; translate: 0 0; } 92% { opacity: 1; } 100% { opacity: 0; translate: -520px 325px; } }
/* In the light theme the sky is there but not seen, so that it can fade in when the snail is pointed at (see app.js). */
#sky { transition: opacity .7s ease; }
:root[data-theme="light"] #sky { opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility 0s .7s; }
:root[data-theme="light"] #sky i, :root[data-theme="light"] #sky b { animation-play-state: paused; }
html.fade, html.fade body, html.fade body * { transition: background-color var(--fd, 2s) ease, color var(--fd, 2s) ease, border-color var(--fd, 2s) ease !important; }
/* the sky is one of "body *": it needs its own line, or the rule above takes its fade away and it comes all at once */
html.fade #sky { transition: opacity var(--fd, 2s) ease !important; }
html.fade[data-theme="light"] #sky { transition: opacity var(--fd, 2s) ease, visibility 0s var(--fd, 2s) !important; }
@media (prefers-reduced-motion: reduce) { #sky i { animation: none; } #sky b { display: none; } }
#top, main, #dock { position: relative; }
#top { position: sticky; }
#dock { position: fixed; }
main { z-index: 1; }

/* The plain version of a page, written by build.py for search engines. The script removes it as soon as it has the data. */
#static { padding: 20px 0; line-height: 1.9; }
#static a { color: var(--acc); }
#static h1 { font-size: 1.5rem; }
#static h2 { margin-top: 22px; }
.tt a:hover { text-decoration: underline; }
#top nav a.out { color: var(--acc); }
footer a { color: var(--acc); }

/* Pictures: the head beside the name, the song art across the front page, the outfits page */
.ava { width: 32px; height: 32px; border-radius: 50%; align-self: center; background: var(--rise); object-fit: cover; }
#banner { position: relative; overflow: hidden; margin: 24px 0 6px; border-radius: 14px; aspect-ratio: 16 / 6.4; min-height: 300px; background: var(--sur); }
#banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
#banner .btxt { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 28px 32px; background: linear-gradient(90deg, rgba(10, 12, 40, .86) 0%, rgba(10, 12, 40, .55) 34%, transparent 62%), linear-gradient(0deg, rgba(10, 12, 40, .55), transparent 45%); color: #f1f2ff; }
#banner h1 { margin: 0; font-size: clamp(1.5rem, 3.4vw, 2.5rem); text-shadow: 0 2px 14px rgba(0, 0, 0, .5); }
#banner .kicker { color: #d9ccff; }
#banner .lead { margin: 0; max-width: 26em; color: #dfe1f7; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
#banner .btn { background: rgba(20, 24, 60, .72); border-color: rgba(255, 255, 255, .25); color: #fff; backdrop-filter: blur(6px); }
#banner .btn.go { background: #c2adff; color: #170f38; border: 0; }
#hero { margin-top: 0; }
.thumb .noarc { position: relative; padding: 2px 10px; border-radius: 4px; background: rgba(0, 0, 0, .6); color: #fff; }
.thumb:has(.noarc) { background: url(img/hero-640.webp) center / cover; }
.thumb:has(.noarc)::before { content: ""; position: absolute; inset: 0; background: rgba(15, 18, 50, .6); }
.outfits { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin: 18px 0; }
figure { margin: 0; }
.outfits figure { padding: 18px; border-radius: 14px; background: var(--sur); text-align: center; }
.outfits img { width: auto; max-width: 100%; height: auto; max-height: 70vh; }
figcaption { margin-top: 10px; color: var(--mut); font-size: .88rem; }
figcaption b { display: block; color: var(--fg); font-size: 1.05rem; }
.sheet img { width: 100%; height: auto; border-radius: 10px; display: block; }
.chhead { margin: 1.6em 0 .6em; }
.lu { display: flex; gap: 24px; align-items: center; margin-top: 14px; }
.lubox button { border: 0; padding: 0; background: radial-gradient(closest-side, var(--rise), transparent); cursor: pointer; display: block; }
.lubox img { height: min(70vh, 640px); width: auto; max-width: 100%; object-fit: contain; display: block; }
.luside { max-width: 360px; }
.mini { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: center; }
.minifig img { width: 100%; height: auto; display: block; }
.studio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.studio figure { margin: 0; text-align: center; }
.studio img { width: 100%; height: auto; display: block; border-radius: 10px; }
.studio figcaption { margin-top: 8px; font-weight: 600; }
@media (max-width: 700px) { .lu { flex-direction: column; } .lubox img { height: 56vh; } .mini { grid-template-columns: 1fr; } .minifig { max-width: 70%; margin: 0 auto; } .studio { gap: 8px; } .studio figcaption { font-size: .85rem; } }
@media (max-width: 860px) { #banner { aspect-ratio: auto; min-height: 380px; } #banner > img { object-position: 62% 40%; } #banner .btxt { padding: 18px; background: linear-gradient(0deg, rgba(10, 12, 40, .9) 0%, rgba(10, 12, 40, .5) 55%, transparent 80%); } }

/* The logo: one drawing for a dark page, one for a light page */
.logo { height: 40px; width: auto; align-self: center; }
.logo.l, :root[data-theme="light"] .logo.d { display: none; }
:root[data-theme="light"] .logo.l { display: block; }
.brand { align-items: center; }
.credit { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 40px; margin: 14px 0; padding: 18px 22px; border-radius: 14px; background: var(--sur); }
.credit .logo { height: auto; width: min(420px, 100%); }
.credit dl { display: grid; grid-template-columns: auto auto; gap: 4px 18px; margin: 0; }
.credit dt { color: var(--mut); font-size: .85rem; }
.credit dd { margin: 0; }
.credit a, figcaption a, #v-about .count a { color: var(--acc); }
@media (max-width: 860px) { .logo { height: 32px; } }
.blogo { width: min(300px, 62%); height: auto; filter: drop-shadow(0 2px 10px rgba(10, 12, 40, .9)) brightness(1.25); }

/* Two languages. The letter shapes follow the language of each piece of text, so a Chinese title on a Japanese page
   keeps its Chinese shapes and the other way round. */
:lang(ja) { font-family: "Noto Sans JP", "Noto Sans CJK JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif; }
:lang(zh-Hant) { font-family: system-ui, "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", sans-serif; }
#langhint { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 8px 14px; border-radius: 8px; background: var(--rise); font-size: .9rem; }
#langhint a { color: var(--acc); font-weight: 700; }
#langhint button { margin-left: auto; border: 0; background: none; color: var(--mut); }

/* Narrow screens: the menu stays on one line and scrolls sideways, and the words of the front picture go under it
   instead of over the character. */
#top nav a { white-space: nowrap; }
@media (max-width: 860px) {
  #top nav { order: 2; flex-basis: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; }
  #top nav::-webkit-scrollbar { display: none; }
  #theme { order: 1; margin-left: auto; }
  #banner { aspect-ratio: auto; min-height: 0; }
  #banner > img { position: static; display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-position: 50% 40%; }
  #banner .btxt { position: static; padding: 16px 18px 18px; background: var(--sur); color: var(--fg); }
  #banner h1, #banner .lead { text-shadow: none; }
  #banner .kicker { color: var(--acc); }
  #banner .lead { color: var(--mut); }
  #banner .btn { background: var(--rise); border-color: var(--line); color: var(--fg); backdrop-filter: none; }
  #banner .btn.go { background: var(--acc); color: var(--on); }
}

/* Shorts are upright */
.grid.shorts { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid.shorts .thumb { aspect-ratio: 9 / 16; }
.shelf .card[data-id] .thumb { aspect-ratio: 16 / 9; }

/* The front picture is the video cover, which has the song title written across it, so nothing is laid over it:
   words on the left, the picture whole on the right, and on a narrow screen the picture first. */
#banner { display: grid; grid-template-columns: minmax(300px, .78fr) 1.6fr; aspect-ratio: auto; min-height: 0; align-items: stretch; }
#banner > img { position: static; order: 2; width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 50%; display: block; }
#banner .btxt { position: static; order: 1; justify-content: center; gap: 10px; padding: 28px 30px; background: var(--sur); color: var(--fg); }
#banner h1, #banner .lead { text-shadow: none; }
#banner h1 { font-size: clamp(1.4rem, 2.5vw, 2.1rem); }
#banner .kicker { color: var(--acc); }
#banner .lead { color: var(--mut); }
#banner .btn { background: var(--rise); border-color: var(--line); color: var(--fg); backdrop-filter: none; }
#banner .btn.go { background: var(--acc); color: var(--on); }
@media (max-width: 860px) {
  #banner { grid-template-columns: 1fr; }
  #banner > img { order: 1; height: auto; }
  #banner .btxt { order: 2; padding: 16px 18px 18px; }
}

/* The other language: always in view beside the dark and light switch, never inside the menu that scrolls */
#langsw { flex: none; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--sur); color: var(--acc); font-size: .85rem; font-weight: 700; white-space: nowrap; }
#langsw:hover { background: var(--rise); }
@media (max-width: 860px) { #langsw { order: 1; margin-left: auto; } #theme { order: 1; margin-left: 0; } }

.fannote { display: block; margin-top: 4px; }

/* One performance of a song: the columns are the same on every row, so the streams, the clips and the links line up
   under each other, and an empty place stays empty instead of pulling the next one across. */
.perf { display: grid; grid-template-columns: 6.6rem 7.2rem 8rem auto; gap: 6px 8px; align-items: center; justify-content: start; padding: 4px 0; }
.perf > * { justify-self: start; }
.perf time { flex: none; white-space: nowrap; line-height: 1.3; }
.pnote { display: block; font-size: .72rem; color: var(--acc); }
/* Four columns on one line, also on a phone: date, time in the stream, clip, the stream. */
.perfhead { font-size: .72rem; color: var(--mut); padding: 2px 0 0; }
.perfhead span { padding-left: 2px; }
@media (max-width: 520px) {
  /* the time column is wide enough for the muted one too (🔇 and the time), the last column takes what is left */
  .perf { grid-template-columns: 5rem 6.6rem 3.6rem 1fr; gap: 4px 6px; font-size: .84rem; }
  html[lang="ja"] .perf { grid-template-columns: 5rem 6.6rem 5rem 1fr; }
  .perf .pill { padding: 2px 9px; }
  .perf .pill small { display: none; }
}

.grid .card .badge.n { left: 6px; }

/* A row of choices of which only one is on, such as the order of the picked moments */
.segs { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--rise); }
.segs button { border: 0; background: none; border-radius: 999px; padding: 5px 16px; color: var(--mut); font-weight: 600; font-size: .88rem; }
.segs button:hover { color: var(--fg); }
.segs button.on { background: var(--acc); color: var(--on); }

/* A performance that YouTube muted in the original stream (copyright): orange, and a speaker with a line through it */
.pill.muted, .pb.muted { border-color: var(--c-collab); color: var(--c-collab); }
.pb.muted { background: color-mix(in srgb, var(--c-collab) 22%, transparent); }
.tl button.muted { background: repeating-linear-gradient(45deg, var(--c-collab) 0 3px, color-mix(in srgb, var(--c-collab) 25%, transparent) 3px 6px); }

/* The small player can always be closed: a big round cross on the picture itself, and Escape (user, 2026-10-12) */
#dock { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
#dockx { position: absolute; top: 8px; right: 8px; z-index: 3; width: 42px; height: 42px; border-radius: 50%; background: rgba(8, 10, 30, .8); color: #fff; font-size: 1.3rem; line-height: 1; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .4); padding: 0; }
#dockx:hover { background: #000; }
@media (max-width: 390px) {
  .perf { grid-template-columns: 4.6rem 6.2rem 3.4rem 1fr; gap: 4px 5px; }
  html[lang="ja"] .perf { grid-template-columns: 4.6rem 6.2rem 4.8rem 1fr; }
}

/* The front picture is the art of the original song, so it sits with the button that plays that song: under the
   words and right above the button (user, 2026-10-12). On a wide screen the words are on the left and the picture
   with the buttons under it on the right; on a phone it is words, picture, buttons. The picture plays the video too. */
#banner { display: grid; grid-template-columns: minmax(280px, .8fr) 1.5fr; grid-template-areas: "txt img" "txt acts"; align-items: center; aspect-ratio: auto; min-height: 0; }
#banner .btxt { grid-area: txt; order: 0; padding: 28px 30px; }
#banner .bimg { grid-area: img; display: block; margin: 18px 18px 0 0; border-radius: 10px; overflow: hidden; }
#banner .bimg img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .2s; }
#banner .bimg:hover img { transform: scale(1.02); }
#banner > .acts { grid-area: acts; margin: 12px 18px 18px 0; }
@media (max-width: 860px) {
  #banner { grid-template-columns: 1fr; grid-template-areas: "txt" "img" "acts"; }
  #banner .btxt { padding: 16px 18px 4px; }
  #banner .bimg { margin: 10px 18px 0; }
  #banner > .acts { margin: 12px 18px 18px; }
  /* on a phone the four buttons sit two by two under the button for someone new, which has a row of its own (user 2026-10-28) */
  #banner > .acts { display: grid; grid-template-columns: 1fr 1fr; }
  #banner > .acts .btn { text-align: center; }
  #banner > .acts .go { grid-column: 1 / -1; }
}

/* The series and kinds that have a category of their own (user, 2026-10-12) */
:root, :root[data-theme="dark"] { --c-ghost: #4fd1c5; --c-rescue: #ff7eb6; --c-debut: #f3efff; }
:root[data-theme="light"] { --c-ghost: #1f9e94; --c-rescue: #e0508f; --c-debut: #7d6bd6; }
.k-納涼特輯 { background: var(--c-ghost) !important; } .k-搶救直男大作戰 { background: var(--c-rescue) !important; } .k-初配信 { background: var(--c-debut) !important; }

:root, :root[data-theme="dark"] { --c-collab2: #ff8f8f; }
:root[data-theme="light"] { --c-collab2: #d9534f; }
.k-企劃 { background: var(--c-collab) !important; } .k-連動 { background: var(--c-collab2) !important; }

:root, :root[data-theme="dark"] { --c-fest: #ffd6a5; --c-news: #9be7ff; }
:root[data-theme="light"] { --c-fest: #c98a3a; --c-news: #2a8fb3; }
.k-慶祝 { background: var(--c-fest) !important; } .k-發表 { background: var(--c-news) !important; }

/* No half-built page: with scripts on, the page stays invisible until app.js has drawn the first screen and the typeface is in
   (app.js adds .ready; the head script adds it after 4 s in any case). Without scripts the plain pages show at once. */
html.js:not(.ready) main { opacity: 0; }
html.js main { transition: opacity .25s ease; }
html.js #static { display: none; }

/* Fan art: pictures of all shapes side by side, like a wall */
.famason { columns: 220px; column-gap: 14px; margin-bottom: 20px; }
.fa { break-inside: avoid; margin: 0 0 14px; background: var(--rise); border-radius: 12px; overflow: hidden; }
.fa a { display: block; }
.fa img { display: block; width: 100%; height: auto; }
.fa figcaption { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; padding: 8px 12px 10px; font-size: .88rem; }
/* a picture nobody has the name of still gets the same bar under it, so that every tile has its frame */
.fa figcaption:empty::before { content: '\00a0'; }
.fa figcaption b { font-weight: 600; }
.fa figcaption span { color: var(--mut); }
.fa .faalt { margin-left: auto; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--mut); background: transparent; color: inherit; font: inherit; font-size: .78rem; cursor: pointer; }
.fa .faalt:hover { background: rgba(255, 255, 255, .08); }
@media (max-width: 600px) { .famason { columns: 2; column-gap: 10px; } .fa { margin-bottom: 10px; } .fa figcaption { padding: 6px 9px 8px; font-size: .82rem; } }

/* On a phone the menu wraps onto a second line instead of scrolling sideways, where nobody sees what is past the edge (user, 2026-10-12).
   The bar is then taller, so it scrolls away with the page instead of staying on top. */
@media (max-width: 860px) {
  #top nav { flex-wrap: wrap; overflow-x: visible; gap: 4px 2px; }
  #top { position: relative; }
}

/* The picked moments on the home page */
.hlgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 8px; }
.hlgrid .box { margin: 0; }

/* On a phone the fan-channel button of a song row goes on a line of its own, under the play button, so that it does not squeeze the title (user, 2026-10-12) */
@media (max-width: 600px) {
  .trow:has(> .pill.fan) { grid-template-columns: 2.2em 34px minmax(0, 1fr) auto; row-gap: 6px; }
  .trow > .pill.fan { grid-column: 2 / -1; grid-row: 2; justify-self: start; }
}

/* One row for each time a song was sung (only in the order of time): the date takes the place of the count */
.tracks summary.single { grid-template-columns: 2.2em 34px minmax(0, 1fr) 6.5em 1.2em; }
@media (max-width: 860px) { .tracks summary.single { grid-template-columns: 2em 34px minmax(0, 1fr) auto 1.2em; } }

/* The most sung songs on the home page: with two columns the numbers run down the left column and then down the right one (1-5, 6-10), not across (user, 2026-10-13) */
@media (min-width: 1000px) {
  #topsongs { display: block; column-count: 2; column-gap: 24px; }
  #topsongs .trow { break-inside: avoid; }
}

/* The button to report a mistake, under the totals on the home page */
.report { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 0 0; }
.report .btn { padding: 5px 14px; font-size: .88rem; }
.report .count { margin: 0; }

/* The songs of one stream: with two columns the numbers also run down the columns, like the most sung songs on the home page (user, 2026-10-13) */
@media (min-width: 1000px) {
  #v-stream .tracks.cols { display: block; column-count: 2; column-gap: 24px; }
  #v-stream .tracks.cols .trow { break-inside: avoid; }
}

/* The snail at the very bottom of every page leads to the little game */
#snail { display: block; width: 54px; margin: 22px 0 0 auto; opacity: .8; transition: transform .6s ease, opacity .2s; }
#snail img { display: block; image-rendering: pixelated; }
#snail:hover { opacity: 1; transform: translateX(-14px); }

/* The picture at the top left can be changed by whoever has a badge of the game: a ring to show it can be pressed, and the choice under it */
.ava.pick { cursor: pointer; box-shadow: 0 0 0 2px var(--acc); }
#facepick { position: absolute; top: 100%; left: 8px; z-index: 30; display: flex; gap: 6px; padding: 8px; border-radius: 12px; background: var(--sur); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
#facepick button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 8px; border: 0; border-radius: 10px; background: transparent; font-size: .75rem; color: var(--fg); }
#facepick button:hover { background: var(--rise); }
#facepick img { border-radius: 50%; background: var(--rise); object-fit: cover; }

details.fold > summary { cursor: pointer; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h3 { display: inline-block; }
details.fold > summary h3::before { content: '▸ '; color: var(--mut); }
details.fold[open] > summary h3::before { content: '▾ '; }
#gbosses h4 { font-size: 1rem; margin: 18px 0 6px; }

.covtag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; font-style: normal; font-size: .68rem; font-weight: 600; color: var(--acc); border: 1px solid var(--acc); vertical-align: 2px; }
.coverrow .covs { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.coverrow time { color: var(--acc); }
#songcovers .shelfhead { margin-top: 8px; }
#songcovers h2 { font-size: 1.15rem; margin: 0; }
.coverrow { padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }

/* The home banner as a carousel of news (user 2026-10-21): the picture frame slides between a few items, each with its own
   caption bottom left; only two slides move at a time. A YouTube thumbnail is kept whole (.fit) over a blurred copy. */
#banner .news { position: relative; touch-action: pan-y; background: var(--sur); aspect-ratio: 16 / 9; overflow: clip; isolation: isolate; }
#banner .news .slide { position: absolute; inset: 0; display: block; overflow: hidden; transform: translateX(102%); transition: transform .6s cubic-bezier(.3, .7, .2, 1); }
#banner .news .slide.on { transform: none; }
#banner .news .slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#banner .news .slide.on img { animation: newsdrift 9s ease-out both; }
#banner .news:hover .slide img { transform: none; }
@keyframes newsdrift { from { transform: scale(1); } to { transform: scale(1.06) translate(-1%, -1%); } }
#banner .news .slide.fit .back { position: absolute; inset: -24px; background-size: cover; background-position: center; filter: blur(26px) saturate(1.2) brightness(.7); }
#banner .news .slide.fit img { margin: auto; width: auto; max-width: 100%; object-fit: contain; box-shadow: 0 0 50px rgba(0, 0, 0, .5); }
#banner .news .slide.fit.on img { animation: none; }
#banner .news .slide.fit.on .back { animation: newsdrift 9s ease-out both; }
#banner .news .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 44px 16px 26px; background: linear-gradient(0deg, rgba(10, 12, 40, .88), rgba(10, 12, 40, .45) 60%, transparent); color: #f1f2ff; pointer-events: none; display: block; }
#banner .news .cap b { display: block; line-height: 1.35; font-size: clamp(.95rem, 1.7vw, 1.2rem); text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
#banner .news .cap .tag { display: table; font-style: normal; font-size: .72rem; font-weight: 700; padding: 2px 8px; margin-bottom: 4px; border-radius: 999px; background: #c2adff; color: #170f38; }
#banner .news .ndots { position: absolute; left: 16px; bottom: 9px; display: flex; gap: 6px; z-index: 3; }
#banner .news .ndots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .45); cursor: pointer; transition: width .3s, background .3s; padding: 0; }
#banner .news .ndots i.on { width: 18px; border-radius: 4px; background: #fff; }
#banner .news .ndots i::after { content: ''; position: absolute; inset: -9px -3px; }
#banner .news .narr { position: absolute; right: 12px; bottom: 8px; display: flex; gap: 6px; z-index: 3; }
#banner .news .narr button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); background: rgba(20, 24, 60, .6); color: #fff; cursor: pointer; backdrop-filter: blur(4px); display: grid; place-items: center; padding: 0; }
#banner .news .narr button svg { display: block; }
/* the caption keeps clear of the arrows on its right and the dots below it; on a phone it may take two lines */
#banner .news .cap { padding-right: 84px; padding-bottom: 30px; }
@media (max-width: 860px) { #banner .news .cap { padding: 36px 84px 30px 14px; } }
@media (prefers-reduced-motion: reduce) { #banner .news .slide { transition: none; } #banner .news .slide.on img, #banner .news .slide.fit.on .back { animation: none; } }

/* The mini games of the site on the games page (user 2026-10-21): a card each, the picture left */
.count a { color: var(--acc); }
.gnote { margin: .3em 0 .8em; font-size: .92rem; }
.gnote .t { margin-right: .3em; }
.minigames { display: grid; gap: 14px; margin: 6px 0 26px; }
.minigame { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 18px; align-items: center; padding: 14px; border-radius: 14px; background: var(--sur); color: inherit; text-decoration: none; }
.minigame:hover { background: var(--rise); }
.minigame img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; display: block; }
.minigame h3 { margin: 0 0 6px; }
.minigame p { margin: 4px 0 8px; color: var(--mut); }
@media (max-width: 700px) { .minigame { grid-template-columns: 1fr; gap: 10px; } }

/* The page of one of her own songs (user 2026-10-21) */
#v-orig h3 { margin: 30px 0 10px; }
#v-orig .perfs { padding-left: 0; }
#v-orig .lyrics { max-width: 40em; padding: 18px 22px; border-radius: 12px; background: var(--sur); line-height: 1.95; font-size: 1.02rem; }
#v-orig .lyrics p { margin: 0 0 1.1em; }
#v-orig .lyrics p:last-child { margin-bottom: 0; }
/* her own notes on the words (user 2026-10-28): under the verse, smaller, with the moment of the stream in front */
.lynote { font-size: .9rem; line-height: 1.75; margin: -.5em 0 1.4em; padding: 8px 12px; border-left: 3px solid var(--acc); border-radius: 0 8px 8px 0; background: var(--rise); }
.lynote .t { margin-right: .3em; }
#v-orig .lyrics p + .lynote { margin-top: -.5em; }
#v-orig .lyrics .lynote:last-child { margin-bottom: 0; }
.lytalk .lynote { margin: .4em 0 .8em; }
.lytalk h4 { margin: 1em 0 .2em; font-size: .95rem; }
#v-orig .lyhead { margin: 1.6em 0 .6em; font-size: 1rem; }
/* the source of each sentence: a small time after it, like a footnote, that plays the stream from there */
.ref button { font: inherit; font-size: .72rem; color: var(--acc); background: none; border: 0; padding: 0 .35em 0 .15em; cursor: pointer; vertical-align: super; line-height: 0; }
.ref button::before { content: '['; } .ref button::after { content: ']'; }
.ref button:hover { text-decoration: underline; }
#v-orig .credits { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; max-width: 40em; margin: 0; font-size: .95rem; }
#v-orig .credits dt { color: var(--mut); }
#v-orig .credits dd { margin: 0; }
@media (max-width: 600px) { #v-orig .lyrics { padding: 14px 16px; font-size: .98rem; } #v-orig .credits { gap: 4px 12px; } }
#v-orig .tabs { overflow-x: auto; scrollbar-width: none; }
#v-orig .tabs a { white-space: nowrap; }
@media (max-width: 600px) { #v-orig .tabs { gap: 16px; } }
/* Rhythm Heaven: one line a minigame, its milestones wrap under the name */
.rhrow { padding: 6px 0; border-bottom: 1px solid var(--line); }
.rhrow:last-child { border-bottom: 0; }
.rhm { display: inline-flex; align-items: baseline; gap: 4px; margin-right: 14px; white-space: nowrap; }
.rhm .covtag { margin-left: 0; }
.rhm .t { min-width: 0; }

/* the rounded heading typeface, written by build.py */
@font-face { font-family: "GenSenTC"; src: url(fonts/gensen-tc-59e78f87f2.woff2) format("woff2"); font-weight: 100 900; font-display: block; }
@font-face { font-family: "GenSenJP"; src: url(fonts/gensen-jp-b32193a676.woff2) format("woff2"); font-weight: 100 900; font-display: block; }
:is(h1,h2,h3,.ctitle,.tt b,.brand b,#top nav a,.btn,.pill:not(.fan),.kicker,.tabs a,.chips a,#langsw,.segs button,.crumb,.shelfhead>a):lang(zh-Hant) { font-family: "GenSenTC", "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif; }
:is(h1,h2,h3,.ctitle,.tt b,.brand b,#top nav a,.btn,.pill:not(.fan),.kicker,.tabs a,.chips a,#langsw,.segs button,.crumb,.shelfhead>a):lang(ja) { font-family: "GenSenJP", "Noto Sans JP", "Noto Sans CJK JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif; }
