/* 案4「青いハルシネ座」 (design-preview.html, theme-theater-blue): a small-town cinema's hand-painted signboard on blue.
   Only the page around the player follows it; inside the player (subtitles, badges, pause, thinking) stays as before. */
:root {
  --page: #17468a;
  --panel: #225ca6;
  --text: #fffef0;
  --muted: #d2edff;
  --accent: #ffda57;
  --accent-hover: #ffe47a;
  --accent-text: #25365a;
  --detail: #ffd85a;
  --line: #8edcf0;
  --me: #8ef1ff;
  --shadow: #102c5e;
  --live: #ff4d5e;
  --stage-top: #2a3550;
  --stage-bottom: #141824;
  /* Body text: the device's own gothic, for reading. Rounded (Zen Maru Gothic, a web font loaded in 700/900) only for
     the signboard parts: headings, labels, tags and buttons. Apple devices fall back to their own rounded gothic. */
  --font-body: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", "Noto Sans JP", system-ui, sans-serif;
  --font-round: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", var(--font-body);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 216, 90, .12), transparent 45%),
    linear-gradient(150deg, #1c55a0, #143570);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
}
/* Polka dots over the whole page, like the dots on a cinema signboard. */
body::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .16;
  background-image: radial-gradient(#d6f4ff 1.5px, transparent 1.5px); background-size: 26px 26px;
}
body > * { position: relative; z-index: 1; }

.topbar {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  max-width: 1280px; margin: 0 auto; padding: 22px 32px 19px;
  border-bottom: 4px double var(--detail);
}
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand-mark {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 2px solid var(--line); border-radius: 14px; background: var(--detail); color: var(--page); transform: rotate(-4deg);
}
.brand-mark svg { width: 27px; height: 27px; }
.logo { margin: 0; font-size: 1.45rem; font-weight: 900; line-height: 1.2; letter-spacing: .03em; text-shadow: 2px 2px 0 var(--shadow); }
.brand-sub { margin: 3px 0 0; color: var(--detail); font-size: .61rem; font-weight: 700; }
.note { max-width: 360px; margin: 0 0 0 auto; color: var(--muted); font-size: .72rem; }
.mode { flex: none; font-size: .8rem; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.mode.live { color: #7fe0a0; border-color: #2f6b45; }

.page-main { max-width: 1280px; margin: 0 auto; padding: 28px 32px 24px; }
.screening-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.eyebrow {
  display: inline-block; margin: 0 0 9px; padding: 2px 9px; border-radius: 6px;
  background: var(--detail); color: var(--page); font-size: .68rem; font-weight: 800; transform: rotate(-1deg);
}
.intro-title { margin: 0; font-size: clamp(1.4rem, 2.5vw, 2rem); font-weight: 900; line-height: 1.45; letter-spacing: .015em; }
.mobile-break { display: none; }
.intro-copy { margin: 7px 0 0; color: var(--muted); font-size: .82rem; }
.show-badge {
  flex: none; max-width: 250px; padding: 10px 14px; border: 2px dashed var(--line); border-radius: 12px;
  background: var(--panel); color: var(--muted); font-size: .68rem; transform: rotate(2deg);
}
.show-badge strong { display: block; margin-bottom: 3px; color: var(--detail); font-size: .76rem; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
/* Stacked (phones held upright): the chat comes right under the player, then the title, request panel, board and
   about box. The player column dissolves (display: contents) so its parts and the chat can be ordered as one list;
   the gaps are their own margins, as in the column. (2026-11-07 the request panel was tried right under the player;
   the user preferred the chat there, with a jump button in the player's dock instead: .request-jump.) */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .player-col { display: contents; }
  .player-col > * { order: 3; }
  .player-col > .screen-frame { order: 1; }
  .chat { order: 2; margin-top: 16px; }
}

/* The marquee frame around the player: cyan border, yellow dashed outline. */
.screen-frame {
  padding: 7px; border: 3px solid var(--line); border-radius: 16px; background: var(--panel);
  box-shadow: 0 6px 0 rgba(35, 18, 25, .35);
  outline: 2px dashed rgba(255, 216, 90, .65); outline-offset: 4px;
}
.player {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 9px;
  /* Cinema lobby backdrop, pre-blurred (bg-lobby.webp is the sharp variant); the gradient shows while it loads. */
  background: url("/bg-lobby-blur.webp") center / cover no-repeat,
    radial-gradient(ellipse at 50% 30%, var(--stage-top), var(--stage-bottom));
  user-select: none;
}
.hud { position: absolute; top: 12px; left: 12px; display: flex; gap: 8px; z-index: 4; } /* above the overlay */
/* Before the first play only; once the stream starts, the LIVE / replay badges and pause take this spot. */
.premiere-label {
  padding: 3px 9px; border-radius: 6px; background: var(--accent); color: var(--accent-text);
  font-size: .65rem; font-weight: 800; transform: rotate(-2deg);
}
.player:not([data-state="idle"]) .premiere-label { display: none; }
/* Paused: every animation in the player holds its frame (mouth, hop, sway, the thinking pulse). */
.player.paused, .player.paused * { animation-play-state: paused !important; }
.live { background: var(--live); color: #fff; font-weight: 700; font-size: .8rem; padding: 2px 8px; border-radius: 4px; }
.live.pick { background: var(--accent); color: var(--accent-text); } /* demo: a work chosen on the board, not the random stream */
.live.rerun { background: rgba(255, 255, 255, .2); color: #fff; } /* demo: a recorded one played at random (再放送) */
.mock-badge { background: #ffd34d; color: #2a2100; font-weight: 700; font-size: .8rem; padding: 2px 8px; border-radius: 4px; }

/* Two copies of the mascot: the original (open mouth) and a closed-mouth edit, swapped while speaking. */
/* top: room above her head for the HUD buttons, which a hop or pop would otherwise reach. */
.manju { position: absolute; left: 50%; top: 7%; height: 74%; aspect-ratio: 1; transform: translateX(-50%); perspective: 900px; }
.manju .roam, .manju .bounce, .manju .emote, .manju .hop, .manju .wobble, .manju .card, .manju .face { position: absolute; inset: 0; }
/* Expression moves (app.js emote()), each by chance on its face's line. */
.manju .emote { transform-origin: 50% 100%; }
/* びっくり: a little jump, and she freezes for a moment at the top (everything inside stops, mouth included). */
.manju .emote.startle { animation: startle .95s both; }
.manju .emote.startle * { animation-play-state: paused !important; }
@keyframes startle {
  0% { translate: 0 0; animation-timing-function: cubic-bezier(.2, .8, .3, 1); }
  14%, 62% { translate: 0 -9%; animation-timing-function: cubic-bezier(.6, 0, .9, .5); }
  80% { translate: 0 0; animation-timing-function: ease-out; }
  88% { translate: 0 -1.5%; }
  100% { translate: 0 0; }
}
/* Horror films, crying: she slowly shrinks over the line (--shrink-ms), stays small, and comes back "ぽよよ～ん":
   she swells past her size and wobbles like jelly (wide and tall by turns), settling down bit by bit. */
.manju .emote.shrink { animation: shrink var(--shrink-ms, 3s) cubic-bezier(.3, 0, .6, 1) forwards; }
.manju .emote.poyon { animation: poyon 1.3s both; }
@keyframes shrink { from { scale: 1; } to { scale: .55; } }
@keyframes poyon {
  0% { scale: .55 .55; animation-timing-function: cubic-bezier(.2, .8, .4, 1); }
  24% { scale: 1.12 1.2; animation-timing-function: ease-in-out; }
  40% { scale: 1.16 .9; animation-timing-function: ease-in-out; }
  55% { scale: .93 1.09; animation-timing-function: ease-in-out; }
  70% { scale: 1.06 .95; animation-timing-function: ease-in-out; }
  84% { scale: .98 1.03; animation-timing-function: ease-in-out; }
  100% { scale: 1 1; }
}
/* Roaming (app.js roam()): --x is where she stands, in % of her own width (0 = center). Skips and rolls are CSS
   animations, so the player's pause stops them too; app.js waits for roam-x to end, then stores --to as --x. */
.manju .roam { translate: var(--x, 0%) 0; }
.manju .roam.skipping { animation: roam-x var(--ms) linear both; }
/* While the request choices are up, she hops about waiting (.waiting, below). A skip overrides it. */
/* She sinks well down (partly below the frame), then pops up from there, "にょきーっ" (no squash or stretch: the user
   didn't want it springy). */
/* Waiting for a request (app.js nextWaitHop): one hop per run, restarted by JS with new spots. She sinks where she
   stands (--hx0), jumps, and flies in free fall to where she lands (--hx1): sideways at a steady speed, up slowing
   down and down speeding up (quadratic curves), so the path is a parabola. Lands a little left or right of the middle
   by turns, never far from it. Three animations so each motion keeps its own timing. */
.manju .bounce.waiting { animation: wait-hop-y 1.4s both, wait-hop-x 1.4s both, wait-hop-lean 1.4s both; transform-origin: 50% 100%; }
@keyframes wait-hop-y {
  0% { translate: 0 0; animation-timing-function: ease-in-out; }
  18% { translate: 0 24%; animation-timing-function: cubic-bezier(.33, .67, .67, 1); } /* rising: slows to the top */
  45% { translate: 0 -10%; animation-timing-function: cubic-bezier(.33, 0, .67, .33); } /* falling: speeds up */
  60%, 100% { translate: 0 0; }
}
@keyframes wait-hop-x {
  0%, 18% { transform: translateX(var(--hx0)); animation-timing-function: linear; }
  60%, 100% { transform: translateX(var(--hx1)); }
}
@keyframes wait-hop-lean {
  0%, 18% { rotate: 0deg; animation-timing-function: ease-out; }
  36% { rotate: var(--hlean); animation-timing-function: ease-in-out; }
  60%, 100% { rotate: 0deg; }
}
.manju .roam.skipping .bounce { animation: skip-hop calc(var(--ms) / var(--hops)) var(--hops); }
.manju .roam.rolling { animation: roam-x var(--ms) cubic-bezier(.35, .1, .3, 1) both, roll var(--ms) cubic-bezier(.35, .1, .3, 1) both; }
@keyframes roam-x { from { translate: var(--from) 0; } to { translate: var(--to) 0; } }
/* ゴロゴロ (action films): from the middle she rolls out past one edge of the screen (--off), comes back in from the
   other edge and rolls on to the middle — one long move, no side stop. The player's overflow hides the wrap. */
.manju .roam.across { animation: roll-across var(--ms) both; }
@keyframes roll-across {
  0% { translate: 0 0; rotate: 0deg; animation-timing-function: cubic-bezier(.45, 0, .9, .6); }
  46% { translate: var(--off) 0; rotate: calc(var(--turn) * .46); animation-timing-function: steps(1, end); }
  46.01% { translate: calc(var(--off) * -1) 0; rotate: calc(var(--turn) * .46); animation-timing-function: cubic-bezier(.1, .4, .4, 1); }
  100% { translate: 0 0; rotate: var(--turn); }
}
@keyframes roll { from { rotate: 0deg; } to { rotate: var(--turn); } }
@keyframes skip-hop {
  0% { translate: 0 0; animation-timing-function: cubic-bezier(.2, .6, .4, 1); }
  50% { translate: 0 -11%; animation-timing-function: cubic-bezier(.6, 0, .8, .4); }
  100% { translate: 0 0; }
}
.manju .wobble { transform-origin: 50% 140%; animation: sway 2.4s ease-in-out infinite; }
.manju .card { transform-style: preserve-3d; transition: transform .38s cubic-bezier(.5, -0.4, .5, 1.4); }
.manju .card.flipped { transform: rotateY(180deg); }
.manju .face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.manju .back { transform: rotateY(180deg); }
.manju .back img { transform: scaleX(-1); } /* the picture on the back is the mirror image */
.manju img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; }
.manju .mouth-closed { opacity: 0; }
.manju.talking .mouth-closed { animation: mouth-closed .24s steps(1, end) infinite; }
.manju.talking .hop { animation: hop .3s cubic-bezier(.3, 0, .6, 1) infinite alternate; }
.manju.talking .wobble { animation: wiggle .62s ease-in-out infinite; }
.manju.pop .hop { animation: pop .32s cubic-bezier(.2, 1.6, .5, 1); }
/* Crying: the whole picture trembles (uses `translate`, so the flip transform is kept). */
.manju[data-face="crying"].talking .card { animation: tremble .09s steps(2, end) infinite; }
@keyframes tremble { 0% { translate: -0.3% 0; } 50% { translate: 0.3% 0.15%; } }
@keyframes hop { from { transform: translateY(0); } to { transform: translateY(-6%); } }
@keyframes wiggle { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes pop { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-14%) scale(1.06); } 100% { transform: translateY(0) scale(1); } }
@keyframes mouth-closed { 0% { opacity: 1; } 50% { opacity: 0; } }

.subtitle {
  position: absolute; left: 6%; right: 6%; bottom: 5%; margin: 0;
  min-height: 2.6em; padding: 8px 14px; border-radius: 8px;
  background: rgba(0, 0, 0, .62); color: #fff; text-align: center;
  font-size: clamp(.95rem, 2.1vw, 1.35rem); font-weight: 700;
  white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer;
}
.subtitle:empty { visibility: hidden; }
.thinking {
  position: absolute; right: 12px; top: 12px; margin: 0; z-index: 2;
  padding: 4px 14px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fff; font-size: .9rem;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .45; } }

.overlay {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(8, 8, 12, .62);
}
.overlay[hidden] { display: none; }
.play {
  display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 10px 24px;
  border: 3px solid rgba(255, 255, 255, .85); border-radius: 16px; background: var(--accent); color: var(--accent-text);
  font: inherit; font-size: 1rem; font-weight: 900; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); transform: rotate(-1deg); cursor: pointer;
}
.play:hover:not(:disabled, [aria-disabled="true"]) { background: var(--accent-hover); }
.play:disabled, .play[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.play-icon { font-size: 1.2rem; }
.overlay-note { margin: 0; max-width: 80%; text-align: center; color: #e4e4ea; font-size: .9rem; white-space: pre-wrap; }
/* Demo: LIVE配信 and 再放送 side by side (stacked when the picture is narrow). */
.overlay-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 92%; }
.live-play { background: var(--live); color: #fff; }
.live-play:hover:not(:disabled, [aria-disabled="true"]) { background: var(--live); filter: brightness(1.1); }
.live-play-note { font-size: .78rem; }
.overlay-note:empty, .live-play-note[hidden] { display: none; }
.overlay-note.error { color: #ffb3ba; }

/* 案5: the control dock under the picture, the frame's bottom edge. Signboard colours, since it is outside the
   picture. Pause and skip on the left (only while there is something to pause or skip), BGM volume on the right. */
.player-dock {
  display: flex; align-items: center; gap: 12px; min-height: 58px; margin: 7px -7px -7px; padding: 9px 11px;
  border-top: 1px dashed var(--line); border-radius: 0 0 13px 13px; background: var(--page);
}
.playback-controls { display: flex; gap: 8px; }
.transport, .volume-toggle, .mute {
  border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; cursor: pointer;
}
.transport:hover, .volume-toggle:hover, .mute:hover { border-color: var(--detail); }
.transport {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 7px 13px;
  border-radius: 9px; font-size: .78rem; font-weight: 700;
}
.transport[hidden] { display: none; }
.transport svg { width: 15px; height: 15px; flex: none; }
.transport[aria-pressed="true"] { border-color: var(--detail); color: var(--detail); }
.volume { position: relative; flex: none; margin-left: auto; }
/* The jump to the request panel: narrow screens only, next to the volume, the current setting in two short lines. */
.request-jump { display: none; }
.jump-state { display: grid; line-height: 1.15; text-align: left; }
.jump-state > span:first-child { color: var(--detail); }
.jump-state > span:last-child { font-size: .62rem; color: var(--muted); }
.request.flash { border-color: var(--detail); box-shadow: 0 0 0 3px var(--detail); transition: box-shadow .2s ease; }
@media (max-width: 860px) {
  .request-jump { display: inline-flex; flex: none; margin-left: auto; gap: 6px; padding: 5px 10px; }
  .request-jump + .volume { margin-left: 0; }
  .transport { white-space: nowrap; }
}
@media (max-width: 420px) {
  /* Four controls in one row on a phone: tighter, still 40px tall to tap. */
  .player-dock { gap: 6px; }
  .playback-controls { gap: 6px; }
  .player-dock .transport { gap: 5px; padding: 6px 8px; }
  .request-jump { padding: 4px 8px; }
}
.volume-toggle { display: grid; place-items: center; width: 40px; height: 40px; padding: 8px; border-radius: 50%; }
.volume-toggle svg { width: 23px; height: 23px; }
.volume-toggle[aria-expanded="true"] { border-color: var(--detail); background: var(--detail); color: var(--page); }
.volume-popover {
  position: absolute; z-index: 20; right: 0; bottom: calc(100% + 12px); width: 230px; padding: 13px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--page); box-shadow: 0 8px 24px rgba(16, 44, 94, .45);
}
.volume-popover[hidden] { display: none; }
.volume-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; font-size: .78rem; font-weight: 700; }
.volume-heading output { color: var(--detail); font-variant-numeric: tabular-nums; }
.volume-slider { width: 100%; margin: 0; accent-color: var(--accent); cursor: pointer; }
.mute { width: 100%; min-height: 36px; margin-top: 9px; border-radius: 8px; font-size: .75rem; }
.transport:focus-visible, .volume-toggle:focus-visible, .mute:focus-visible, .volume-slider:focus-visible,
.tone-slider:focus-visible, .blood-switch:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.stream-title { margin: 12px 2px 0; font-size: .94rem; font-weight: 700; }
.raw { margin-top: 10px; color: var(--muted); font-size: .85rem; }
.about summary { cursor: pointer; font-size: .78rem; }
.about .star { color: var(--detail); }
.replay-badge { background: #7fc8ff; color: #04223a; font-weight: 700; font-size: .8rem; padding: 2px 8px; border-radius: 4px; }
.replay-note { margin: 8px 0; }
.replay textarea {
  width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text);
  font: .85rem/1.5 ui-monospace, "Cascadia Code", Consolas, monospace; resize: vertical;
}
.replay-play {
  margin-top: 8px; padding: 6px 16px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 700; cursor: pointer;
}
.replay-play:hover:not(:disabled) { background: var(--accent-hover); }
.replay-play:disabled { opacity: .5; cursor: not-allowed; }
.saved-list { margin: 0; padding: 0; list-style: none; max-height: 260px; overflow-y: auto; }
.saved-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); color: var(--text); overflow-wrap: anywhere; }
.saved-play { flex: none; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text); font: inherit; font-size: .8rem; cursor: pointer; }
.saved-play:hover { border-color: var(--detail); }
.replay-error { margin: 6px 0 0; color: #ffb3ba; }
.raw pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel); padding: 10px; border-radius: 6px; color: var(--text); }

/* Demo: 次の一本のリクエスト, the mood slider and the blood switch for the random streams. */
/* Compact (2026-11-07, user: "やることシンプルなのに謎にスペース占領しててモサくみえる"): on a wide screen the
   title, the mood and the blood switch share one row; narrower, the title sits on its own short line above them. */
.request {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 22px;
  margin-top: 12px; padding: 9px 16px; border: 2px solid var(--line); border-radius: 14px; background: var(--panel);
}
.request-heading { display: flex; flex-direction: column; gap: 1px; }
.request-heading h2 { margin: 0; font-size: .9rem; font-weight: 900; white-space: nowrap; }
.request-heading p { margin: 0; color: var(--muted); font-size: .66rem; white-space: nowrap; }
.request-dev-note { grid-column: 1 / -1; order: 9; margin: 0; padding: 5px 10px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: .7rem; }
.request-settings { display: contents; }
.setting-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 1px; font-size: .76rem; font-weight: 700; }
.setting-heading output { color: var(--detail); font-size: .74rem; }
/* The strip takes every pointer (app.js): tap or drag sideways anywhere on it, labels included. pan-y keeps vertical
   swipes for scrolling the page. The input itself only shows the state and takes the keyboard. */
.tone-touch { position: relative; padding: 2px 0; touch-action: pan-y; cursor: pointer; user-select: none; -webkit-user-select: none; }
.tone-touch .tone-slider { pointer-events: none; }
.tone-slider { width: 100%; height: 28px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
/* The three stops as dots on the track, so it reads as three places to pick. */
.tone-slider::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: radial-gradient(circle, var(--text) 3px, transparent 3.5px) 7px 50% / 12px 12px no-repeat,
    radial-gradient(circle, var(--text) 3px, transparent 3.5px) 50% 50% / 12px 12px no-repeat,
    radial-gradient(circle, var(--text) 3px, transparent 3.5px) calc(100% - 7px) 50% / 12px 12px no-repeat, var(--line);
}
.tone-slider::-moz-range-track { height: 6px; border-radius: 999px; background: var(--line); }
.tone-slider::-webkit-slider-thumb {
  width: 26px; height: 26px; margin-top: -10px; appearance: none; -webkit-appearance: none;
  border: 3px solid var(--text); border-radius: 50%; background: var(--accent); box-shadow: 0 2px 0 var(--shadow);
}
.tone-slider::-moz-range-thumb { width: 20px; height: 20px; border: 3px solid var(--text); border-radius: 50%; background: var(--accent); box-shadow: 0 2px 0 var(--shadow); }
.tone-touch.dragging .tone-slider::-webkit-slider-thumb { transform: scale(1.12); }
.tone-labels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; color: var(--muted); font-size: .64rem; font-weight: 700; line-height: 1.2; }
.tone-labels span:nth-child(2) { text-align: center; }
.tone-labels span:last-child { text-align: right; }
/* Label, ? and switch on one line. */
.blood-setting { display: flex; align-items: center; gap: 12px; padding-left: 20px; border-left: 1px dashed var(--line); }
.blood-setting .setting-heading { margin: 0; }
.blood-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 104px; min-height: 36px; padding: 5px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--page); color: var(--text); font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer;
}
.blood-switch:hover { border-color: var(--detail); }
.switch-track { position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--shadow); box-shadow: inset 0 0 0 1px var(--line); }
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s ease;
}
.blood-switch[aria-checked="true"] .switch-track { background: var(--accent); box-shadow: none; }
.blood-switch[aria-checked="true"] .switch-track::after { background: var(--accent-text); transform: translateX(16px); }
.switch-state { min-width: 24px; color: var(--muted); }
.blood-switch[aria-checked="true"] .switch-state { color: var(--detail); }
/* The ? next to 流血表現 and its bubble: opens on click/tap, closes on another tap, outside, or Esc (app.js).
   The button is small to look at but has a 32px hit area for fingers. */
.blood-setting { position: relative; }
.setting-name { display: inline-flex; align-items: center; gap: 6px; }
.help-button {
  position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 1px solid var(--line); border-radius: 50%;
  background: var(--page); color: var(--detail); font: inherit; font-size: .7rem; font-weight: 900; line-height: 1; cursor: pointer;
}
.help-button::before { content: ""; position: absolute; inset: -6px; }
.help-button:hover, .help-button[aria-expanded="true"] { border-color: var(--detail); background: var(--detail); color: var(--page); }
.help-button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.blood-note { margin: 0; color: var(--text); font-size: .72rem; line-height: 1.5; }
.help-pop {
  position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; width: 260px; max-width: calc(100vw - 32px); padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--page); box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.help-pop[hidden] { display: none; }
@media (max-width: 860px) {
  /* Title (and when it applies) on one short line, then the mood and the blood switch side by side. */
  .request { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; }
  .request-heading { grid-column: 1 / -1; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 10px; }
  .blood-setting { padding-left: 16px; }
  .help-pop { width: 240px; }
}
@media (max-width: 600px) {
  /* Phone: the mood takes the full width; the blood row (label, ?, switch) goes under it. */
  .request { grid-template-columns: minmax(0, 1fr); padding: 9px 12px 10px; border-radius: 12px; }
  .blood-setting { justify-content: space-between; padding: 7px 0 0; border-top: 1px dashed var(--line); border-left: 0; }
  .help-pop { left: 0; right: 0; width: auto; }
}

/* Demo: the lobby board under the player. Cards are the works to choose; 新作 is a placeholder until the demo can
   take requests. Same signboard look as the page: cyan line, dashed yellow, tilted tags. */
.board { margin-top: 18px; padding: 16px 18px 18px; border: 2px solid var(--line); border-radius: 16px; background: var(--panel); }
.board-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 2px dashed var(--detail); }
.board-title { margin: 0; font-size: 1.1rem; font-weight: 900; text-shadow: 2px 2px 0 var(--shadow); }
.board-sub { margin: 0; color: var(--muted); font-size: .75rem; }
.board-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; margin-top: 14px; }
.board-label { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .8rem; color: var(--muted); }
.board-tag {
  flex: none; white-space: nowrap; padding: 2px 8px; border-radius: 6px; background: var(--detail); color: var(--page);
  font-size: .68rem; font-weight: 900; transform: rotate(-2deg);
}
.board-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.board-card {
  display: flex; flex-direction: column; gap: 8px; width: 100%; height: 100%; padding: 12px; text-align: left;
  border: 2px dashed var(--line); border-radius: 12px; background: var(--page); color: var(--text); font: inherit; cursor: pointer;
}
.board-card:hover:not(:disabled) { border-color: var(--detail); border-style: solid; }
.board-card:disabled { opacity: .5; cursor: not-allowed; }
.board-card-title { font-size: .92rem; font-weight: 900; line-height: 1.4; }
.board-genres { display: flex; flex-wrap: wrap; gap: 4px; }
.board-genres span { padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .64rem; }
/* A work with blood (its score's blood tag, not its genre): shown before 上映する, whatever the blood switch says. */
.board-blood {
  align-self: flex-start; padding: 1px 8px; border: 1px solid var(--detail); border-radius: 6px;
  color: var(--detail); font-size: .66rem; font-weight: 700; white-space: nowrap;
}
.board-blood::before { content: "！"; margin-right: 2px; }
.board-go { margin-top: auto; color: var(--detail); font-size: .72rem; font-weight: 800; }
.board-hint { margin: 8px 0 0; color: var(--muted); font-size: .72rem; }
.board-hint[hidden] { display: none; }
.board-new { display: flex; flex-direction: column; }
/* 新作 runs the full width under the picks: a list of what people asked for, not cards, so the two read apart. */
.board-cols { grid-template-columns: 1fr; }
.board-col + .board-col { padding-top: 14px; border-top: 2px dashed var(--line); }
.board-tag-new { background: var(--live); color: #fff; }
.new-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.new-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 4px 12px;
  width: 100%; padding: 8px 12px; text-align: left; border: 0; border-left: 4px solid var(--live); border-radius: 8px;
  background: rgba(255, 255, 255, .06); color: var(--text); font: inherit; cursor: pointer;
}
.new-row:hover:not(:disabled) { background: rgba(255, 255, 255, .12); }
.new-row:disabled { opacity: .5; cursor: not-allowed; }
.new-requests { display: flex; flex-wrap: wrap; gap: 4px; }
.new-requests span { padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: .72rem; }
.new-title { font-size: .85rem; font-weight: 800; overflow-wrap: anywhere; }
.new-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.new-when { color: var(--muted); font-size: .64rem; }
.new-more {
  align-self: center; margin-top: 8px; padding: 6px 18px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--text); font: inherit; font-size: .78rem; cursor: pointer;
}
.new-more[hidden] { display: none; }
@media (max-width: 600px) {
  .new-row { grid-template-columns: minmax(0, 1fr) auto; padding: 7px 9px; }
  .new-requests { grid-column: 1 / -1; }
  .new-requests span { font-size: .66rem; }
  .new-title { font-size: .78rem; }
}
.coming-soon {
  display: grid; place-items: center; flex: 1; min-height: 120px; margin: 0;
  border: 2px dashed var(--line); border-radius: 12px; color: var(--detail);
  font-size: 1.15rem; font-weight: 900; letter-spacing: .12em; text-shadow: 2px 2px 0 var(--shadow);
}
@media (max-width: 860px) { .coming-soon { min-height: 80px; } }
.coming-soon[hidden], .new-list:empty { display: none; }
/* 新作: one column of cards beside the picks (two on phones, like the picks). */



/* Side by side, app.js sets the height to the framed player's so the two line up; stacked (phones) it has a fixed
   height. Either way the list scrolls inside instead of the panel growing. */
.chat {
  display: flex; flex-direction: column; align-self: start; height: 420px; min-height: 0; overflow: hidden;
  background: var(--panel); border: 2px solid var(--line); border-radius: 16px;
}
@media (max-width: 860px) { .chat { height: 360px; } }
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 2px solid var(--line); }
.chat h2 { margin: 0; font-size: .95rem; }
.audience-label { padding: 2px 7px; border-radius: 6px; background: var(--detail); color: var(--page); font-size: .6rem; font-weight: 800; }
/* min-height: 0 lets the list shrink inside the panel and scroll; without it, it grows past the panel and new
   comments land out of sight below it. */
.chat-log { flex: 1; min-height: 0; margin: 0; padding: 10px 14px; list-style: none; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.chat-log li { font-size: .9rem; overflow-wrap: anywhere; animation: appear .25s ease-out; }
.chat-log .name { color: var(--detail); margin-right: 8px; font-weight: 800; }
.chat-log .me .name { color: var(--me); }
.chat-log .system { color: var(--muted); font-size: .8rem; }
@keyframes appear { from { opacity: 0; transform: translateY(-4px); } } /* drops in from above: the newest comment is on top */
.chat-footer { flex: none; margin: 0; padding: 10px 14px; border-top: 1px dashed var(--line); color: var(--muted); font-size: .7rem; }
/* The comment choices over the picture, where the subtitle sits (the subtitle steps aside while they show). */
.comment-panel {
  position: absolute; left: 6%; right: 6%; bottom: 5%; z-index: 2; padding: 10px 12px; border-radius: 10px;
  background: rgba(0, 0, 0, .72); text-align: center;
}
.comment-panel[hidden] { display: none; }
.player.asking .subtitle { visibility: hidden; }
.chat-hint { margin: 0 0 8px; color: #fff; font-size: .85rem; font-weight: 700; }
.comment-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.comment-buttons button {
  padding: 6px 12px; border: 2px solid rgba(255, 255, 255, .85); border-radius: 999px; background: var(--accent); color: var(--accent-text);
  font: inherit; font-size: .85rem; font-weight: 800; cursor: pointer;
}
.comment-buttons button:hover:not(:disabled) { background: var(--accent-hover); }
.comment-buttons button:disabled { opacity: .4; cursor: not-allowed; }
/* The requester's name (2026-11-08): in the picture during the wait, where the comment choices were; under one's own
   row in 新作. The subtitle steps aside while the form is open. */
.name-panel {
  position: absolute; left: 6%; right: 6%; bottom: 5%; z-index: 2; padding: 8px 12px; border-radius: 10px;
  background: rgba(0, 0, 0, .72); color: #fff; text-align: center;
}
.name-panel[hidden], .name-line[hidden] { display: none; }
.player.naming .subtitle { visibility: hidden; }
.name-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; margin: 0; font-size: .85rem; }
.name-line strong { color: var(--me); }
.name-edit {
  min-height: 32px; padding: 4px 14px; border: 1px solid rgba(255, 255, 255, .85); border-radius: 999px;
  background: transparent; color: #fff; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer;
}
.name-edit:hover { background: rgba(255, 255, 255, .14); }
.name-form { margin: 0; }
.name-row { display: flex; justify-content: center; gap: 6px; }
.name-row input {
  width: 9em; min-width: 0; min-height: 36px; padding: 4px 10px; border: 2px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--accent-text); font: inherit; font-size: 16px; /* 16px: iPhone does not zoom in */
}
.name-ok, .name-cancel {
  min-height: 36px; padding: 4px 14px; border-radius: 999px; font: inherit; font-size: .82rem; font-weight: 800; cursor: pointer; white-space: nowrap;
}
.name-ok { border: 0; background: var(--accent); color: var(--accent-text); }
.name-cancel { border: 1px solid rgba(255, 255, 255, .7); background: transparent; color: #fff; }
.name-ok:disabled, .name-cancel:disabled { opacity: .5; cursor: wait; }
.name-msg { margin: 4px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.4; }
.name-msg:empty { display: none; }
.name-msg:focus { outline: none; } /* focused by app.js only, so the result is read out */
.new-meta { display: flex; gap: 8px; align-items: baseline; }
.new-who { color: var(--detail); font-size: .7rem; font-weight: 800; }
.new-who.me { color: var(--me); }
.new-own { display: flex; flex-direction: column; align-items: flex-end; padding: 4px 0 2px; }
.new-own .name-form { width: 100%; }
.new-own .name-row { justify-content: flex-end; }
.new-own .name-msg { text-align: right; }
.new-notice { text-align: right; }

/* The newest update, one line above the footer (demo only; build-demo.mjs adds it from scripts/demo-updates.json):
   small and quiet, for visitors who want to know what changed lately. */
.updates {
  display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: 1216px; margin: 0 auto; padding: 4px 0 16px;
  color: var(--muted); font-size: .7rem; font-variant-numeric: tabular-nums;
}
.updates-title { color: var(--detail); font-weight: 700; }

/* Same side gutter as the page (32px) until the window is wide enough for the 1216px column to centre. */
.updates, .page-footer { margin-left: max(32px, calc((100% - 1216px) / 2)); margin-right: max(32px, calc((100% - 1216px) / 2)); }
.page-footer {
  max-width: 1216px; padding: 20px 0 26px;
  border-top: 1px dashed var(--line); color: var(--muted); font-size: .64rem;
}

/* Narrower: the header note goes (the about box, ★ 作品紹介・このチャンネルについて・BGM, keeps the same notice) and the player and chat stack. */
@media (max-width: 860px) {
  .topbar { gap: 14px; padding: 19px 24px 17px; }
  .note { display: none; }
  .mode { margin-left: auto; }
  .page-main { padding: 24px; }
  .page-footer, .updates { margin: 0 24px; }
}
/* Phones: the player is ~190px tall, so a long line in the normal size would cover her mouth. Smaller text and
   padding, and the picture a little smaller. The HUD buttons take a bigger share of the height here, so they shrink
   and the picture sits lower to keep her head clear of them. The page chrome shrinks to match. */
@media (max-width: 600px) {
  .subtitle { left: 3%; right: 3%; bottom: 3%; min-height: 0; padding: 4px 8px; font-size: .78rem; line-height: 1.35; }
  .comment-panel { left: 3%; right: 3%; bottom: 3%; max-height: 94%; overflow-y: auto; padding: 6px 6px; } /* many long choices scroll inside the picture */
  .name-panel { left: 3%; right: 3%; bottom: 3%; padding: 5px 6px; }
  /* Finger-sized targets (40px+) and text of about 12px or more (2026-11-08, 6.93): ease of use over a small panel. */
  .name-line { font-size: .78rem; }
  .name-edit { min-height: 40px; }
  .name-row input { width: 7.5em; min-height: 40px; }
  .name-ok, .name-cancel { min-height: 40px; padding: 2px 12px; font-size: .8rem; }
  .name-panel .name-msg, .new-own .name-msg { font-size: .75rem; line-height: 1.35; }
  .chat-hint { margin-bottom: 5px; font-size: .75rem; }

  .comment-buttons { gap: 6px; }
  .comment-buttons button { min-height: 40px; padding: 4px 12px; border-width: 1px; font-size: .8rem; }
  .manju { top: 10%; height: 64%; }
  .hud { gap: 5px; }
  .live, .mock-badge, .replay-badge { padding: 1px 6px; font-size: .62rem; }
  .player-dock { min-height: 54px; margin: 4px -4px -4px; padding: 7px 8px; border-radius: 0 0 10px 10px; }
  .transport { padding: 6px 11px; font-size: .72rem; }
  .topbar { padding: 16px; gap: 10px; }
  .brand { gap: 9px; }
  .brand-mark { width: 35px; height: 35px; border-radius: 11px; }
  .brand-mark svg { width: 22px; height: 22px; }
  .logo { font-size: 1.05rem; }
  .brand-sub { font-size: .5rem; }
  .page-main { padding: 20px 14px; }
  .screening-intro { display: block; margin-bottom: 20px; }
  .eyebrow { font-size: .58rem; }
  .intro-title { font-size: 1.2rem; }
  .mobile-break { display: block; }
  .intro-copy { font-size: .72rem; }
  .show-badge { display: none; }
  .screen-frame { padding: 4px; border-width: 2px; border-radius: 12px; outline-offset: 2px; }
  .player { border-radius: 7px; }
  .hud { top: 7px; left: 7px; }
  .premiere-label { padding: 2px 6px; font-size: .52rem; }
  .overlay { gap: 4px; padding-top: 22px; } /* clear of the HUD badges at the top */
  .play { min-height: 40px; padding: 5px 13px; border-width: 2px; border-radius: 12px; font-size: .76rem; }
  .play-icon { font-size: .9rem; }
  .overlay-actions { gap: 8px; }
  .overlay-note { max-width: 94%; font-size: .72rem; line-height: 1.35; }
  .live-play-note { font-size: .72rem; }
  .chat { border-radius: 12px; }
  .stream-title { font-size: .78rem; }
  .board { padding: 12px; border-radius: 12px; }
  .board-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .board-card { padding: 10px; }
  .board-card-title { font-size: .8rem; }
  .page-footer { margin: 0 16px; padding: 17px 0 22px; }
  .updates { margin: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .manju .roam, .manju .bounce, .manju .emote, .manju .hop, .manju .wobble, .manju .card, .thinking, .chat-log li { animation: none !important; }
}

/* Demo build (data-demo on <html>): random replays only, so the development panels and the comment input are hidden. */
.demo-only { display: none; }
[data-demo] .demo-only { display: block; }
[data-demo] .dev-only { display: none; }
.about p { margin: 6px 2px; line-height: 1.7; }

/* The signboard parts in the rounded face. Inside the player only the play button and the 本日の一本 label: subtitles,
   badges and the pause/skip buttons stay in the body gothic, to read at a glance over the picture. Last in the file
   so it wins over the buttons' `font: inherit`. */
.logo, .brand-sub, .eyebrow, .intro-title, .show-badge strong, .premiere-label, .play, .stream-title,
.chat h2, .audience-label, .board-title, .board-label, .board-tag, .board-card-title, .board-go, .coming-soon,
.updates-title, .transport, .volume-heading, .mute, .request-heading h2, .setting-heading, .tone-labels strong,
.blood-switch, .board-blood {
  font-family: var(--font-round);
}
