:root {
  color-scheme: dark;
  font-family: Inter, "Noto Sans JP", system-ui, sans-serif;
  --ink: #fff8fc;
  --muted: #d6c8d3;
  --pink: #ff4f93;
  --pink-hot: #ff2f7d;
  --violet: #9c6cff;
  --panel: rgba(12, 8, 15, .86);
  --line: rgba(255, 255, 255, .14);
  background: #09070c;
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: #09070c; }
body { min-height: 100dvh; overflow: hidden; }
button, input, textarea { font: inherit; }
button { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.live-app {
  position: relative;
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  background: #08060a;
  box-shadow: 0 0 80px rgba(0, 0, 0, .7);
}

/* Keeps headless visual evidence honest when Chromium enforces a wider
   minimum layout viewport than the requested 390px screenshot. */
body.fixture-mobile-390 { width: 390px; min-width: 390px; }
body.fixture-mobile-390 .live-app { width: 390px; margin: 0; }
body.fixture-mobile-390 .comment-composer { left: 195px; width: 390px; }

.stage {
  position: absolute;
  inset: 0 0 calc(74px + env(safe-area-inset-bottom));
  overflow: hidden;
  background: #070508;
  isolation: isolate;
}

#player, .fixture-portrait { position: absolute; inset: 0; width: 100%; height: 100%; }
#player { z-index: 0; object-fit: cover; background: #050406; }
.fixture-portrait { display: none; z-index: 0; place-items: end center; overflow: hidden; background:
  radial-gradient(circle at 50% 30%, rgba(255, 225, 239, .82) 0 8%, transparent 8.5%),
  radial-gradient(ellipse at 50% 43%, rgba(29, 17, 36, .96) 0 18%, transparent 18.5%),
  radial-gradient(ellipse at 50% 85%, rgba(63, 27, 68, .95) 0 38%, transparent 38.5%),
  linear-gradient(155deg, #4d174e 0%, #1a1028 43%, #08070c 100%); }
.fixture-portrait::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(circle at 20% 18%, rgba(255, 69, 151, .34), transparent 25%),
  radial-gradient(circle at 86% 58%, rgba(156, 108, 255, .3), transparent 28%); }
.fixture-portrait span { position: relative; margin-bottom: 29vh; font-size: clamp(3rem, 18vw, 6rem); font-weight: 950; letter-spacing: .12em; color: rgba(255, 255, 255, .07); transform: translateX(.06em); }
body.fixture-mode .fixture-portrait { display: grid; }
body.fixture-mode #player { opacity: 0; }
.fixture-portrait.fixture-real-portrait { background-position: center; background-size: cover; }
.fixture-portrait.fixture-real-portrait::before, .fixture-portrait.fixture-real-portrait span { display: none; }

.stage-shade { position: absolute; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(5, 3, 7, .72) 0%, transparent 18%, transparent 54%, rgba(5, 3, 7, .25) 66%, rgba(5, 3, 7, .82) 100%); }

.live-bar { position: absolute; z-index: 5; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: calc(12px + env(safe-area-inset-top)) 14px 12px; }
.bar-group { display: flex; align-items: center; min-width: 0; }
.bar-left { flex: 0 1 auto; gap: 9px; }
.bar-right { flex: 0 0 auto; justify-content: flex-end; gap: 9px; }
.brand { color: white; text-decoration: none; font-weight: 950; font-size: 14px; letter-spacing: .18em; text-shadow: 0 2px 12px #000; }
#live-badge { padding: 5px 8px; border-radius: 999px; background: rgba(92, 83, 91, .8); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
#live-badge[data-state="live"] { background: linear-gradient(135deg, var(--pink-hot), #ff5b6f); box-shadow: 0 0 0 3px rgba(255, 47, 125, .15); }
#viewers { color: rgba(255, 255, 255, .88); font-size: 12px; font-weight: 700; white-space: nowrap; text-shadow: 0 2px 8px #000; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: rgba(12, 8, 15, .54); backdrop-filter: blur(14px); cursor: pointer; }
.icon-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.offline { position: absolute; z-index: 2; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; background: radial-gradient(circle at 50% 34%, #43203c 0, #17101c 34%, #08070b 72%); text-align: center; }
.offline::before { content: "S"; display: grid; place-items: center; width: 74px; height: 74px; margin-bottom: 8px; border-radius: 50%; background: linear-gradient(145deg, var(--pink), var(--violet)); font-size: 36px; font-weight: 950; box-shadow: 0 14px 44px rgba(255, 79, 147, .28); }
.offline strong { font-size: 25px; letter-spacing: -.02em; }
.offline span { color: var(--muted); font-size: 14px; }
.offline[hidden] { display: none; }

.viewer-comment { position: absolute; z-index: 4; left: 14px; bottom: 18%; max-width: min(78%, 320px); padding: 8px 11px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px 12px 12px 4px; background: rgba(20, 19, 22, .72); backdrop-filter: blur(12px); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); animation: toast-in .24s ease-out; transition: opacity .28s ease, transform .28s ease; }
.viewer-comment[hidden] { display: none; }
#viewer-comment-name { display: block; margin-bottom: 2px; color: #bdb4bc; font-size: 10px; font-weight: 800; }
#viewer-comment-name::before { content: "@"; opacity: .75; }
#viewer-comment-text { margin: 0; font-size: clamp(13px, 3.5vw, 15px); font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.viewer-comment.is-replied { opacity: 0; transform: translateY(6px) scale(.97); }

.reply-overlay { position: absolute; z-index: 4; left: 50%; bottom: 12px; width: fit-content; max-width: calc(100% - 28px); max-height: min(25dvh, 210px); overflow: hidden; transform: translateX(-50%); padding: 9px 14px 10px; border: 0; border-bottom: 2px solid rgba(255, 79, 147, .72); border-radius: 13px; background: linear-gradient(135deg, rgba(9, 6, 12, .7), rgba(35, 15, 37, .62)); backdrop-filter: blur(13px); box-shadow: 0 10px 34px rgba(0, 0, 0, .3); text-align: center; }
.reply-overlay[data-size="short"] { min-width: min(180px, calc(100% - 28px)); }
.reply-overlay[data-size="medium"] { width: min(84%, 340px); }
.reply-overlay[data-size="long"] { width: calc(100% - 28px); }
.reply-overlay[hidden] { display: none; }
.reply-to { display: block; margin-bottom: 4px; color: #ff80b2; font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.reply-to:empty { display: none; }
.subtitle { margin: 0; color: white; font-size: clamp(17px, 4.8vw, 23px); font-weight: 850; line-height: 1.45; letter-spacing: -.01em; text-shadow: 0 2px 10px #000; overflow-wrap: anywhere; }
.subtitle-secondary { margin: 4px 0 0; color: rgba(255, 238, 247, .82); font-size: clamp(11px, 3.1vw, 14px); font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }

.player-actions { position: absolute; z-index: 5; left: 14px; bottom: 14px; display: flex; gap: 7px; }
.pill-button, .quiet-button { min-height: 36px; border-radius: 999px; padding: 8px 13px; border: 1px solid var(--line); font-size: 12px; font-weight: 850; cursor: pointer; }
.pill-button { background: rgba(255, 255, 255, .92); color: #171018; }
.quiet-button { background: rgba(12, 8, 15, .52); color: white; backdrop-filter: blur(12px); }
.pill-button:disabled { opacity: .45; }
.pill-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.pill-button:not(.is-enabled) svg { display: none; }
.pill-button.is-enabled { display: grid; place-items: center; width: 36px; min-width: 36px; padding: 0; background: rgba(12, 8, 15, .58); color: white; backdrop-filter: blur(12px); }
.pill-button.is-enabled #audio-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

#notice { position: absolute; z-index: 6; left: 50%; bottom: 62px; width: max-content; max-width: calc(100% - 28px); transform: translateX(-50%); margin: 0; padding: 8px 12px; border-radius: 999px; background: rgba(8, 6, 10, .8); color: #ffd2e2; font-size: 12px; text-align: center; backdrop-filter: blur(12px); }
#notice:empty { display: none; }

.comment-composer { position: fixed; z-index: 20; left: 50%; bottom: var(--keyboard-offset, 0px); width: min(100%, 520px); min-height: calc(74px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; grid-template-columns: auto minmax(0, 1fr) 44px; grid-template-rows: 44px 14px; gap: 2px 7px; align-items: center; padding: 8px 12px max(7px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(10, 7, 12, .92); backdrop-filter: blur(22px); }
.name-field, .comment-field { min-width: 0; }
input, textarea { display: block; width: 100%; height: 42px; margin: 0; border: 1px solid rgba(255, 255, 255, .13); border-radius: 14px; outline: 0; background: rgba(255, 255, 255, .07); color: white; }
input { padding: 0 10px; font-size: 12px; }
textarea { padding: 10px 12px; resize: none; line-height: 20px; overflow: hidden; }
input:focus, textarea:focus { border-color: rgba(255, 79, 147, .75); box-shadow: 0 0 0 3px rgba(255, 79, 147, .12); }
input::placeholder, textarea::placeholder { color: #a89ba5; }
#name-chip { display: block; max-width: 88px; height: 36px; padding: 0 11px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .13); border-radius: 999px; background: rgba(255, 255, 255, .08); color: #f8eaf2; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.name-field.is-editing { width: 82px; }
#send { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: linear-gradient(145deg, var(--pink), #c34fff); box-shadow: 0 7px 24px rgba(255, 79, 147, .25); cursor: pointer; }
#send svg { width: 20px; fill: none; stroke: white; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#send:disabled { opacity: .4; box-shadow: none; }
.magic-hint { grid-column: 2 / 3; align-self: start; padding-left: 4px; color: #978a94; font-size: 9px; letter-spacing: .04em; }
.magic-hint strong { color: #d7b5ff; }

.history-sheet { position: fixed; z-index: 50; inset: auto 0 0; width: min(100%, 520px); max-height: min(72dvh, 620px); margin: 0 auto; padding: 8px 14px calc(16px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; background: rgba(19, 13, 22, .97); color: white; box-shadow: 0 -22px 70px rgba(0, 0, 0, .55); }
.history-sheet::backdrop { background: rgba(2, 1, 3, .58); backdrop-filter: blur(3px); }
.history-sheet:not([open]) { display: none; }
.sheet-handle { width: 42px; height: 4px; margin: 0 auto 10px; border-radius: 99px; background: rgba(255, 255, 255, .24); }
.history-sheet header { display: flex; align-items: center; justify-content: space-between; padding: 3px 0 10px; }
.history-sheet h2 { margin: 1px 0 0; font-size: 20px; }
.eyebrow { color: #ff8fbd; font-size: 9px; font-weight: 900; letter-spacing: .16em; }
#messages { max-height: calc(min(72dvh, 620px) - 90px); margin: 0; padding: 0 0 4px; overflow-y: auto; list-style: none; }
#messages li { margin: 0 0 7px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .055); color: #ece3e9; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
#messages .name { margin-right: 7px; color: #ff92be; font-weight: 850; }
#messages .shuri-reply { border-left: 3px solid var(--violet); background: rgba(156, 108, 255, .09); }
#messages .shuri-reply .name { color: #cbb6ff; }
#messages .magic-message { color: #f5e8ff; background: linear-gradient(110deg, rgba(255, 79, 147, .14), rgba(156, 108, 255, .14)); }

.developer-panel { position: fixed; z-index: 100; top: 74px; right: 8px; display: flex; gap: 8px; padding: 6px 9px; border: 1px solid #ffca54; border-radius: 8px; background: #17120e; color: #ffe2a1; font: 11px ui-monospace, monospace; }
.developer-panel[hidden] { display: none; }

@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 761px) {
  body { background: radial-gradient(circle at 50% 10%, #31172c 0, #0b080e 48%, #050406 100%); }
  .live-app { width: min(100%, 520px); }
  .stage { border-left: 1px solid rgba(255, 255, 255, .08); border-right: 1px solid rgba(255, 255, 255, .08); }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; } }
