/* Shiori default theme. All sizes are in game pixels (the stage is scaled
   to fit the window). Restyle with a game's `theme:` CSS file by overriding
   these variables or any .sh-* class. */

:root {
  --sh-accent: #f2a7c3;
  --sh-accent-2: #a9b8ff;
  --sh-text: #f4f2fb;
  --sh-dim: rgba(244, 242, 251, 0.62);
  --sh-panel: rgba(12, 15, 34, 0.9);
  --sh-panel-2: rgba(26, 30, 62, 0.92);
  --sh-line: rgba(255, 255, 255, 0.14);
  --sh-font: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Segoe UI", system-ui, sans-serif;
  --sh-font-title: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", Georgia, "Times New Roman", serif;
  --sh-text-scale: 1;
  --sh-box-alpha: 0.86;
}

html, body { margin: 0; height: 100%; background: #05060c; color: var(--sh-text); overflow: hidden; }
.sh-mount { position: fixed; inset: 0; background: #05060c; }
.shiori {
  position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden;
  font-family: var(--sh-font); color: var(--sh-text); outline: none; user-select: none; -webkit-user-select: none;
  background: #000; cursor: default;
}
.shiori button { font-family: inherit; }
.sh-stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- ADV textbox ---------- */
.sh-adv { position: absolute; left: 0; right: 0; bottom: 0; height: 360px; pointer-events: none; transition: opacity .25s; }
.sh-textbox {
  position: absolute; left: 150px; right: 150px; bottom: 34px; min-height: 236px; box-sizing: border-box;
  padding: 40px 64px 58px; border-radius: 26px; pointer-events: auto;
  background: linear-gradient(180deg, rgba(20, 24, 54, calc(var(--sh-box-alpha) * 0.82)), rgba(9, 11, 28, var(--sh-box-alpha)));
  border: 1px solid var(--sh-line);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.sh-has-face .sh-textbox { padding-left: 336px; }
.sh-text { font-size: calc(35px * var(--sh-text-scale)); line-height: 1.62; letter-spacing: 0.01em; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45); min-height: 2em; }
.sh-narration .sh-text { color: #eceaf6; }
.sh-ch { opacity: 0; transition: opacity 70ms linear; }
.sh-ch.on { opacity: 1; }
.sh-text ruby rt, .sh-nvl ruby rt, .sh-choices ruby rt { font-size: 0.5em; opacity: 0.85; }
.sh-namebox {
  position: absolute; left: 196px; bottom: 252px; padding: 9px 30px 10px; border-radius: 16px 16px 4px 4px;
  font-size: calc(30px * var(--sh-text-scale)); font-weight: 700; letter-spacing: 0.06em;
  background: linear-gradient(180deg, rgba(30, 34, 70, 0.95), rgba(14, 16, 36, 0.95));
  border: 1px solid var(--sh-line); border-bottom: none; color: var(--name-color, var(--sh-accent));
  box-shadow: inset 0 -3px 0 var(--name-color, var(--sh-accent)); opacity: 0; transform: translateY(8px); transition: opacity .18s, transform .18s;
}
.sh-has-face .sh-namebox { left: 486px; }
.sh-namebox.on { opacity: 1; transform: none; }
.sh-pov {
  position: absolute; left: 196px; bottom: 256px; padding: 6px 20px; border-radius: 999px; font-size: 22px; font-style: italic; letter-spacing: 0.08em;
  color: var(--pov); background: rgba(10, 12, 28, 0.82); border: 1px solid var(--pov); opacity: 0; transition: opacity .2s;
}
.sh-pov::before, .sh-nvl-povname::before { content: "◇ "; content: "◇ " / ""; }
.sh-pov.on { opacity: 0.95; }
.sh-face {
  position: absolute; left: 150px; bottom: 34px; width: 300px; height: 300px; box-sizing: border-box;
  z-index: 1; overflow: hidden; border-radius: 24px; visibility: hidden;
  background: linear-gradient(160deg, rgba(37, 40, 68, .96), rgba(7, 9, 23, .98));
  border: 2px solid var(--name-color, var(--sh-accent));
  box-shadow: 0 10px 28px rgba(0, 0, 0, .4);
}
.sh-face.on { visibility: visible; }
.sh-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; opacity: 0; }
.sh-face::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 22px color-mix(in srgb, var(--name-color, var(--sh-accent)) 22%, transparent), inset 0 0 4px rgba(255,255,255,.2);
}
.sh-ctc { display: inline-block; margin-left: 0.45em; font-size: 0.6em; vertical-align: 0.15em; color: var(--sh-accent); opacity: 0; }
.sh-ctc.on { opacity: 1; animation: sh-bob 1.1s ease-in-out infinite; }
@keyframes sh-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* quick menu */
.sh-qm { position: absolute; right: 190px; bottom: 44px; display: flex; gap: 6px; pointer-events: auto; }
.sh-qm-btn {
  background: none; border: none; color: rgba(244, 242, 251, 0.5); font-size: 19px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
}
.sh-qm-btn:hover, .sh-qm-btn:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.08); outline: none; }
.sh-qm-btn.on { color: var(--sh-accent); }

/* ---------- NVL ---------- */
.sh-nvl { position: absolute; inset: 0; background: rgba(5, 7, 18, calc(var(--sh-box-alpha) * 0.82)); opacity: 0; pointer-events: none; transition: opacity .35s; }
.sh-nvl-page { position: absolute; left: 230px; right: 230px; top: 110px; bottom: 150px; overflow: hidden; font-size: calc(34px * var(--sh-text-scale)); line-height: 1.75; }
.sh-nvl-p { margin: 0 0 0.75em; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.sh-nvl-name { font-weight: 700; margin-right: 0.6em; }
.sh-nvl-name::after { content: ""; }
.sh-nvl-pov { border-left: 4px solid var(--pov); padding-left: 0.8em; }
.sh-nvl-povname { display: block; font-size: 0.65em; font-style: italic; letter-spacing: 0.08em; line-height: 1.5; color: var(--pov); }
.sh-nvl .sh-qm { right: 230px; bottom: 60px; }
.sh-nvl-ctc { }

.sh-mode-adv .sh-nvl { opacity: 0; pointer-events: none; }
.sh-mode-nvl .sh-adv { opacity: 0; pointer-events: none; }
.sh-mode-nvl .sh-nvl { opacity: 1; pointer-events: auto; }
.sh-mode-nvl .sh-adv * { pointer-events: none !important; }
.sh-box-off .sh-adv, .sh-box-off .sh-nvl { opacity: 0 !important; pointer-events: none !important; }
.sh-box-off .sh-adv *, .sh-box-off .sh-nvl * { pointer-events: none !important; }
.sh-ui-hidden .sh-adv, .sh-ui-hidden .sh-nvl, .sh-ui-hidden .sh-choices, .sh-ui-hidden .sh-modebadge { opacity: 0 !important; pointer-events: none !important; }
.sh-ui-hidden .sh-adv *, .sh-ui-hidden .sh-nvl * { pointer-events: none !important; }

/* text effects */
.sh-shake { display: inline-block; animation: sh-shake 0.3s steps(3) infinite; }
@keyframes sh-shake { 0% { transform: translate(0, 0); } 33% { transform: translate(1.5px, -1px); } 66% { transform: translate(-1.5px, 1px); } 100% { transform: translate(0.5px, 1.5px); } }
.sh-wave { display: inline-block; animation: sh-wave 1.6s ease-in-out infinite; }
@keyframes sh-wave { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- choices ---------- */
.sh-choices { position: absolute; left: 0; right: 0; top: 150px; bottom: 360px; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.sh-choices.on { display: flex; }
.sh-choice {
  position: relative; width: 1120px; min-height: 86px; box-sizing: border-box; padding: 20px 80px; border-radius: 20px; cursor: pointer;
  font-size: calc(32px * var(--sh-text-scale)); color: var(--sh-text); text-align: center;
  background: linear-gradient(180deg, rgba(28, 32, 70, 0.9), rgba(12, 14, 34, 0.92));
  border: 1px solid var(--sh-line); box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4);
  transition: transform .14s, border-color .14s, box-shadow .14s, background .14s;
  animation: sh-in .35s both;
}
.sh-choice:nth-child(2) { animation-delay: .05s; } .sh-choice:nth-child(3) { animation-delay: .1s; } .sh-choice:nth-child(4) { animation-delay: .15s; } .sh-choice:nth-child(5) { animation-delay: .2s; }
@keyframes sh-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.sh-choice:hover, .sh-choice:focus-visible { outline: none; transform: translateY(-2px); border-color: var(--sh-accent); box-shadow: 0 0 0 2px rgba(242, 167, 195, 0.25), 0 14px 40px rgba(0, 0, 0, 0.5); background: linear-gradient(180deg, rgba(48, 44, 92, 0.95), rgba(22, 20, 48, 0.95)); }
.sh-choice-n { position: absolute; left: 28px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--sh-dim); }
.sh-choice.seen .sh-choice-t { color: #d9d4ea; }
.sh-choice.seen::after { content: "✓"; position: absolute; right: 30px; top: 50%; transform: translateY(-50%); color: var(--sh-dim); font-size: 22px; }
.sh-choice.locked { cursor: not-allowed; opacity: 0.48; }
.sh-choice.sh-auto-choice { overflow: hidden; isolation: isolate; }
.sh-choice-fill { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg, rgba(242, 167, 195, 0.25), var(--sh-accent)); opacity: 0.4; transform: scaleX(0); transform-origin: left; }
.sh-choice-seconds { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); min-width: 32px; padding: 3px 8px; border-radius: 9px; background: var(--sh-accent); color: #15152a; font-size: 22px; }
.sh-choice.sh-auto-choice.seen::after { display: none; }
.sh-choice.sh-choice-fire { border-color: var(--sh-accent); box-shadow: 0 0 28px var(--sh-accent); }
.sh-choice.sh-choice-fire .sh-choice-fill { opacity: 0.45; }
.sh-reduce-motion .sh-choice.sh-choice-fire { box-shadow: none; }
.sh-choice-hint { display: block; font-size: 0.68em; color: var(--sh-dim); margin-top: 4px; font-style: italic; }
.sh-lock { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); font-size: 24px; }

/* ---------- cards, toasts, badges ---------- */
.sh-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; opacity: 0; transition: opacity .6s; background: radial-gradient(ellipse at center, rgba(8, 10, 24, 0.78), rgba(4, 5, 12, 0.92)); }
.sh-card.on { opacity: 1; }
.sh-card-title { font-family: var(--sh-font-title); font-size: 84px; letter-spacing: 0.08em; text-align: center; padding: 0 160px; text-shadow: 0 0 30px rgba(169, 184, 255, 0.35); }
.sh-card-title::before, .sh-card-title::after { content: ""; display: block; width: 420px; height: 1px; margin: 28px auto; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent); }
.sh-card-sub { font-size: 32px; color: var(--sh-dim); letter-spacing: 0.2em; margin-top: 6px; }
.sh-card-kicker { font-size: 26px; letter-spacing: 0.5em; text-transform: uppercase; color: var(--sh-accent); }
.sh-card-ending .sh-card-title { color: #fff6e8; }
.sh-toast { z-index: 60; position: absolute; top: 46px; left: 50%; transform: translate(-50%, -20px); padding: 14px 30px; border-radius: 14px; font-size: 26px; background: var(--sh-panel); border: 1px solid var(--sh-line); opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; max-width: 1400px; text-align: center; }
.sh-toast.on { opacity: 1; transform: translate(-50%, 0); }
.sh-modebadge { position: absolute; top: 34px; right: 46px; padding: 8px 20px; border-radius: 999px; font-size: 22px; letter-spacing: 0.12em; color: var(--sh-accent); background: rgba(8, 10, 24, 0.7); border: 1px solid var(--sh-line); opacity: 0; transition: opacity .2s; pointer-events: none; }
.sh-modebadge.on { opacity: 1; }
.sh-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sh-gate { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 30px 70px; font-size: 40px; letter-spacing: 0.12em; color: #fff; background: rgba(14, 16, 38, 0.9); border: 1px solid var(--sh-accent); border-radius: 24px; cursor: pointer; z-index: 50; box-shadow: 0 0 60px rgba(242, 167, 195, 0.25); }
.sh-gate:hover, .sh-gate:focus-visible { background: rgba(40, 34, 80, 0.95); outline: none; }

/* input */
.sh-input { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(4, 5, 14, 0.55); z-index: 30; }
.sh-input-form { display: flex; flex-direction: column; gap: 22px; padding: 50px 70px; border-radius: 26px; background: var(--sh-panel); border: 1px solid var(--sh-line); min-width: 900px; }
.sh-input-label { font-size: 34px; }
.sh-input-field { font: inherit; font-size: 36px; padding: 16px 22px; border-radius: 14px; border: 1px solid var(--sh-line); background: rgba(255, 255, 255, 0.06); color: #fff; outline: none; }
.sh-input-field:focus { border-color: var(--sh-accent); }

/* game & video layers */
.sh-game, .sh-video { position: absolute; inset: 0; display: none; z-index: 20; background: #000; }
.sh-game.on, .sh-video.on { display: block; }
.sh-game-inner { position: absolute; inset: 0; }
.sh-video-el { width: 100%; height: 100%; object-fit: contain; background: #000; }

/* ---------- screens ---------- */
.sh-screens { position: absolute; inset: 0; z-index: 40; display: none; }
.sh-screens.on { display: block; }
.sh-screen-open .sh-adv, .sh-screen-open .sh-nvl, .sh-screen-open .sh-choices, .sh-screen-open .sh-modebadge { visibility: hidden; }
.sh-screen { position: absolute; inset: 0; box-sizing: border-box; padding: 70px 120px; background: linear-gradient(180deg, #0a0c1e, #05060f); overflow: hidden; animation: sh-fade .25s both; }
.sh-overlay { background: rgba(3, 4, 12, 0.6); display: flex; align-items: center; justify-content: center; }
@keyframes sh-fade { from { opacity: 0; } to { opacity: 1; } }
.sh-screen-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 36px; }
.sh-heading { font-family: var(--sh-font-title); font-weight: 400; font-size: 64px; letter-spacing: 0.08em; margin: 0; }
.sh-btn { font-size: 26px; padding: 12px 30px; border-radius: 14px; color: var(--sh-text); background: rgba(255, 255, 255, 0.07); border: 1px solid var(--sh-line); cursor: pointer; }
.sh-btn:hover, .sh-btn:focus-visible { border-color: var(--sh-accent); outline: none; background: rgba(255, 255, 255, 0.12); }
.sh-primary { background: rgba(242, 167, 195, 0.22); border-color: var(--sh-accent); }
.sh-row { display: flex; gap: 20px; justify-content: center; }
.sh-confirm { padding: 50px 70px; border-radius: 26px; background: var(--sh-panel); border: 1px solid var(--sh-line); font-size: 32px; text-align: center; max-width: 1100px; }
.sh-muted { color: var(--sh-dim); }
.sh-empty { color: var(--sh-dim); font-size: 28px; }

/* title */
.sh-screen.sh-screen-title { background: none; padding: 0; }
.sh-title-veil { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4, 6, 16, 0.78) 0%, rgba(4, 6, 16, 0.35) 45%, rgba(4, 6, 16, 0) 70%); }
.sh-title-box { position: absolute; left: 150px; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; max-width: 1100px; }
.sh-title-orig { font-family: var(--sh-font-title); font-size: 40px; letter-spacing: 0.3em; color: var(--sh-accent); margin-bottom: 6px; }
.sh-title-name { font-family: var(--sh-font-title); font-weight: 400; font-size: 118px; line-height: 1.08; margin: 0 0 70px; letter-spacing: 0.04em; text-shadow: 0 0 40px rgba(169, 184, 255, 0.35), 0 4px 18px rgba(0, 0, 0, 0.6); }
.sh-title-menu { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.sh-title-btn { font-size: 40px; letter-spacing: 0.12em; padding: 10px 6px; color: rgba(244, 242, 251, 0.82); background: none; border: none; cursor: pointer; position: relative; text-align: left; }
.sh-title-btn::before { content: ""; position: absolute; left: -36px; top: 50%; width: 18px; height: 2px; background: var(--sh-accent); opacity: 0; transition: opacity .15s, left .15s; }
.sh-title-btn:hover, .sh-title-btn:focus-visible { color: #fff; outline: none; }
.sh-title-btn:hover::before, .sh-title-btn:focus-visible::before { opacity: 1; left: -30px; }
.sh-title-btn:disabled { opacity: 0.3; cursor: default; }
.sh-title-foot { position: absolute; left: 150px; bottom: 56px; font-size: 22px; color: var(--sh-dim); letter-spacing: 0.08em; }
.sh-game-menu { display: flex; flex-direction: column; gap: 8px; padding-left: 40px; }

/* tabs & slots */
.sh-tabs { display: flex; gap: 10px; margin-bottom: 28px; }
.sh-tab { font-size: 24px; padding: 10px 24px; border-radius: 12px; color: var(--sh-dim); background: none; border: 1px solid transparent; cursor: pointer; }
.sh-tab.on { color: #fff; border-color: var(--sh-line); background: rgba(255, 255, 255, 0.07); }
.sh-tab:hover { color: #fff; }
.sh-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.sh-slot { position: relative; display: flex; gap: 20px; padding: 16px; border-radius: 18px; text-align: left; color: var(--sh-text); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--sh-line); cursor: pointer; height: 190px; box-sizing: border-box; }
.sh-slot:hover:not(:disabled), .sh-slot:focus-visible { border-color: var(--sh-accent); outline: none; background: rgba(255, 255, 255, 0.09); }
.sh-slot:disabled { cursor: default; opacity: 0.6; }
.sh-slot-thumb { flex: 0 0 280px; height: 158px; border-radius: 10px; background: rgba(0, 0, 0, 0.4) center/cover no-repeat; }
.sh-slot-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 20px; }
.sh-slot-id { font-size: 18px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sh-accent); }
.sh-slot-date { color: var(--sh-dim); }
.sh-slot-chapter { font-weight: 700; }
.sh-slot-preview { color: #dcd8ea; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.sh-slot-del { position: absolute; right: 12px; top: 8px; font-size: 20px; color: var(--sh-dim); padding: 4px 8px; }
.sh-slot-del:hover { color: #ff9aa8; }

/* settings */
.sh-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 70px; overflow-y: auto; max-height: 830px; padding-right: 20px; }
.sh-set-section h3 { font-size: 26px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sh-accent); margin: 0 0 12px; font-weight: 600; }
.sh-set-row { display: flex; align-items: center; gap: 20px; padding: 10px 0; font-size: 24px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.sh-set-label { flex: 1; }
.sh-set-val { width: 120px; text-align: right; color: var(--sh-dim); }
.sh-range { width: 300px; accent-color: var(--sh-accent); }
.sh-toggle input { width: 28px; height: 28px; accent-color: var(--sh-accent); }
.sh-select { font: inherit; font-size: 22px; padding: 6px 12px; border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; border: 1px solid var(--sh-line); }
.sh-keys { font-size: 21px; color: var(--sh-dim); line-height: 1.7; }

/* backlog */
.sh-log { position: absolute; left: 120px; right: 120px; top: 190px; bottom: 60px; overflow-y: auto; padding-right: 20px; outline: none; }
.sh-log-row { padding: 16px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: calc(28px * var(--sh-text-scale)); line-height: 1.55; display: flex; gap: 22px; align-items: baseline; }
.sh-log-name { flex: 0 0 200px; font-weight: 700; text-align: right; color: var(--sh-accent); }
.sh-log-text { flex: 1; }
.sh-log-row:not(:has(.sh-log-name)) .sh-log-text { padding-left: 222px; color: #e2dff0; }
.sh-log-choice .sh-log-text { color: var(--sh-accent-2); font-style: italic; }
.sh-log-voice { font-size: 20px; padding: 4px 12px; }
.sh-log-select { font: inherit; line-height: inherit; color: inherit; text-align: left; padding: 0; border: 0; background: none; cursor: pointer; min-width: 0; }
.sh-log-select:focus-visible { outline: 3px solid var(--sh-accent); outline-offset: 4px; }
.sh-log-selected { background: rgba(255, 255, 255, 0.06); }
.sh-log-return { flex-shrink: 0; align-self: center; font-size: 24px; padding: 6px 18px; border-color: var(--sh-accent); }

/* extras */
.sh-extras { position: absolute; left: 120px; right: 120px; top: 260px; bottom: 60px; overflow-y: auto; }
.sh-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.sh-cg { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; border: 1px solid var(--sh-line); background: rgba(255, 255, 255, 0.05) center/cover no-repeat; cursor: pointer; color: #fff; }
.sh-cg.locked { cursor: default; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 14px, transparent 14px 28px); }
.sh-cg-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 16px; font-size: 20px; background: linear-gradient(transparent, rgba(0,0,0,.7)); border-radius: 0 0 16px 16px; text-align: left; }
.sh-endings { display: flex; flex-direction: column; gap: 12px; }
.sh-ending { display: flex; gap: 24px; align-items: center; padding: 18px 26px; border-radius: 16px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--sh-line); font-size: 28px; }
.sh-ending.locked { color: var(--sh-dim); }
.sh-ending-kind { width: 110px; font-size: 18px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sh-accent); }
.sh-kind-true .sh-ending-kind { color: #ffd98a; }
.sh-kind-bad .sh-ending-kind { color: #ff8f9f; }
.sh-ending-title { flex: 1; }
.sh-ending-date { font-size: 20px; color: var(--sh-dim); }
.sh-ending-count { font-size: 24px; color: var(--sh-dim); }
.sh-music { display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }
.sh-track { text-align: left; font-size: 28px; padding: 16px 26px; border-radius: 14px; color: var(--sh-text); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--sh-line); cursor: pointer; }
.sh-track.playing { border-color: var(--sh-accent); }
.sh-track.playing::before { content: "♪ "; color: var(--sh-accent); }
.sh-track.locked { color: var(--sh-dim); cursor: default; }
.sh-about { font-size: 26px; line-height: 1.6; max-width: 1300px; }
.sh-about h3 { font-family: var(--sh-font-title); font-weight: 400; font-size: 46px; margin: 0 0 18px; }
.sh-ai-note { color: var(--sh-accent-2); }
.sh-viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-out; }
.sh-screen-viewer { padding: 0; }
.sh-screen-errors { overflow: auto; }

/* Story flowchart uses ordinary scroll coordinates, including on touch. */
.sh-screen-flowchart { display: flex; flex-direction: column; }
.sh-screen-flowchart .sh-screen-head { margin-bottom: 12px; }
.sh-flow-help { font-size: 22px; margin: 0 0 20px; }
.sh-flow-viewport { flex: 1; min-height: 0; overflow: auto; touch-action: none; overscroll-behavior: contain; cursor: grab; border: 1px solid var(--sh-line); border-radius: 18px; background: var(--sh-panel); }
.sh-flow-viewport:focus-visible { outline: 3px solid var(--sh-accent); outline-offset: 3px; }
.sh-flow-viewport.dragging { cursor: grabbing; user-select: none; }
.sh-flow-canvas { position: relative; }
.sh-flow-canvas > svg { position: absolute; inset: 0; pointer-events: none; }
.sh-flow-edge { fill: none; stroke: var(--sh-dim); stroke-width: 2; opacity: .6; }
.sh-flow-edge.on { stroke: var(--sh-accent); stroke-width: 4; opacity: 1; }
.sh-flow-arrow { fill: var(--sh-dim); }
.sh-flow-arrow.on { fill: var(--sh-accent); }
.sh-flow-node { position: absolute; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 18px; border: 2px solid var(--sh-line); border-radius: 14px; background: var(--sh-panel-2); color: var(--sh-text); font: inherit; cursor: pointer; }
.sh-flow-node.on-route { border-color: var(--sh-accent); background: color-mix(in srgb, var(--sh-accent) 18%, var(--sh-panel-2)); }
.sh-flow-node.unseen { opacity: .4; cursor: default; }
.sh-flow-node:hover:enabled, .sh-flow-node:focus-visible { outline: 3px solid var(--sh-accent-2); outline-offset: 4px; }
.sh-flow-node.current { box-shadow: 0 0 0 4px var(--sh-panel), 0 0 0 6px var(--sh-accent); }
.sh-flow-title { font-size: 24px; line-height: 1.15; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.sh-flow-chapter, .sh-flow-here { font-size: 17px; line-height: 1.2; color: var(--sh-dim); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-flow-here { color: var(--sh-accent); }
.sh-flow-label { position: absolute; box-sizing: border-box; padding: 2px 8px; border-radius: 6px; background: var(--sh-panel); color: var(--sh-dim); font-size: 19px; line-height: 22px; text-align: center; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; pointer-events: none; }
.sh-flow-label.on { color: var(--sh-accent); }
.sh-diag { font-family: ui-monospace, Menlo, monospace; font-size: 20px; line-height: 1.5; white-space: pre-wrap; color: #ffd0d0; user-select: text; -webkit-user-select: text; }

/* accessibility modes */
.sh-contrast .sh-textbox { background: rgba(0, 0, 0, 0.97); border-color: #fff; }
.sh-contrast .sh-text { color: #fff; font-weight: 600; text-shadow: none; }
.sh-contrast .sh-nvl { background: rgba(0, 0, 0, 0.95); }
.sh-reduce-motion .sh-shake, .sh-reduce-motion .sh-wave, .sh-reduce-motion .sh-ctc.on { animation: none; }
@media (prefers-reduced-motion: reduce) { .sh-shake, .sh-wave, .sh-ctc.on, .sh-choice { animation: none !important; } }

/* boot errors (outside the scaled stage) */
.sh-boot-error { position: fixed; inset: 0; overflow: auto; padding: 40px 56px; box-sizing: border-box; background: #0b0d18; color: #f4f2fb; font-family: system-ui, sans-serif; }
.sh-boot-error h1 { font-weight: 600; margin: 0 0 8px; }
.sh-boot-error pre { font-family: ui-monospace, Menlo, monospace; font-size: 14px; line-height: 1.5; white-space: pre-wrap; color: #ffd0d0; background: #141726; padding: 20px; border-radius: 10px; }

/* developer overlay (window pixels); the game shrinks to make room */
.sh-dev-docked .sh-mount { right: 372px; }
@media (max-width: 900px) { .sh-dev-docked .sh-mount { right: 0; } }
.sh-dev { position: fixed; top: 0; right: 0; bottom: 0; width: 348px; box-sizing: border-box; border-radius: 0; overflow: auto; z-index: 1000; padding: 10px 12px; border-radius: 10px; background: rgba(10, 12, 24, 0.93); border: 1px solid rgba(255, 255, 255, 0.15); color: #e8e6f2; font: 12px/1.45 ui-monospace, Menlo, monospace; }
.sh-dev-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sh-dev-fps { margin-left: auto; color: #9aa; }
.sh-dev-btn { font: inherit; padding: 2px 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; }
.sh-dev-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.sh-dev-select { font: inherit; max-width: 100%; background: #1a1d30; color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; }
.sh-dev-where { color: #f2a7c3; margin-bottom: 6px; word-break: break-all; }
.sh-dev-errors { display: none; color: #ffb4b4; white-space: pre-wrap; background: #2a1016; padding: 6px; border-radius: 6px; }
.sh-dev-h { margin-top: 8px; color: #a9b8ff; text-transform: uppercase; letter-spacing: .1em; font-size: 10px; }
.sh-dev-var { display: flex; justify-content: space-between; gap: 8px; }
.sh-dev-var code { color: #ffe08a; }
.sh-dev-stage { margin: 0; white-space: pre-wrap; color: #cfd6ff; }
.sh-dev-log { max-height: 180px; overflow: auto; }
.sh-dev-logrow { border-bottom: 1px solid rgba(255,255,255,.06); padding: 2px 0; }
.sh-dev-warning { color: #ffd38a; }
.sh-dev-error { color: #ff9aa8; }

/* Sound controls and character profiles. */
.sh-sound-level { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.sh-sound-level .sh-range { width: 180px; min-width: 80px; flex: 1; }
.sh-sound-level .sh-set-label { flex: 0 1 190px; }
.sh-sound-level .sh-set-val { width: 65px; }
.sh-mute { display: flex; align-items: center; gap: 8px; }
.sh-mute input { width: 24px; height: 24px; accent-color: var(--sh-accent); }
.sh-char-voices { font-size: 24px; color: var(--sh-dim); margin: 26px 0 8px; }
.sh-reset { grid-column: 1 / -1; justify-self: start; }
.sh-face { padding: 0; cursor: default; }
.sh-face:not(:disabled) { cursor: pointer; pointer-events: auto; }
.sh-face:disabled { pointer-events: none; }
.sh-face:focus-visible, .sh-settings input:focus-visible, .sh-settings select:focus-visible,
button.sh-log-name:focus-visible { outline: 3px solid var(--sh-accent); outline-offset: 4px; }
button.sh-log-name { font: inherit; font-weight: 700; padding: 0; background: none; border: 0; cursor: pointer; }
button.sh-log-name:hover { text-decoration: underline; }
.sh-profile { width: 1200px; max-height: 850px; padding: 36px; box-sizing: border-box; border: 1px solid var(--sh-line); border-radius: 24px; background: var(--sh-panel); overflow-y: auto; }
.sh-profile-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.sh-profile-body { display: flex; align-items: flex-start; gap: 40px; }
.sh-profile-image { width: 420px; height: 600px; object-fit: contain; object-position: center top; }
.sh-profile-text { flex: 1; font-size: calc(28px * var(--sh-text-scale)); line-height: 1.7; white-space: pre-wrap; }
/* Music controls sit above the game menu, while announcements pass clicks through. */
.sh-now-playing, .sh-mini-player {
  position: absolute; left: 34px; top: 30px; z-index: 45; box-sizing: border-box;
  max-width: 500px; padding: 18px 24px; border-radius: 16px;
  color: var(--sh-text); background: var(--sh-panel); border: 1px solid var(--sh-line);
  font-size: 24px;
}
.sh-now-playing { opacity: 0; pointer-events: none; transition: opacity 1s; }
.sh-now-playing.on { opacity: 1; transition-duration: .3s; }
.sh-mini-player { width: 500px; }
.sh-mini-player[hidden], .sh-music-controls [hidden] { display: none; }
.sh-music-title { font-size: 26px; overflow-wrap: anywhere; margin-bottom: 12px; }
/* Track names are titles: set them in the game's title face. */
.sh-now-playing, .sh-music-title, .sh-track-title { font-family: var(--sh-font-title); }
.sh-music-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.sh-music-buttons .sh-btn { font-size: 22px; padding: 8px 18px; }
.sh-music-buttons [aria-pressed="true"] { border-color: var(--sh-accent); background: var(--sh-panel-2); }
.sh-music-progress, .sh-music-volume { display: flex; gap: 18px; align-items: center; margin: 12px 0; }
.sh-music-seek { flex: 1; min-width: 0; accent-color: var(--sh-accent); }
.sh-music-time { font-size: 20px; color: var(--sh-dim); font-variant-numeric: tabular-nums; }
.sh-music-volume { font-size: 20px; }
.sh-music-volume .sh-range { flex: 1; min-width: 0; }
.sh-music-controls input:focus-visible, .sh-track:focus-visible {
  outline: 2px solid var(--sh-accent); outline-offset: 4px;
}
.sh-music-controls button:disabled { opacity: .45; cursor: default; }
.shiori:has(> .sh-mini-player:not([hidden])) .sh-screen-menu .sh-screen-head,
.shiori:has(> .sh-mini-player:not([hidden])) .sh-screen-menu .sh-game-menu { padding-left: 450px; }
.sh-extras:has(.sh-music) { display: flex; flex-direction: column; }
.sh-extras .sh-music { overflow: auto; flex: 1; min-height: 100px; }
.sh-extras .sh-music-controls { flex-shrink: 0; padding: 16px 24px; border: 1px solid var(--sh-line); border-radius: 16px; background: var(--sh-panel); }
.sh-title-box, .sh-title-foot { opacity: 1; transition: opacity 1.2s; }
.sh-attract-fade .sh-title-box, .sh-attract-fade .sh-title-foot { opacity: 0; pointer-events: none; }
.sh-attract-video { z-index: 50; }
