/* Scene album in the in-game menu. All component styling is scoped to its mount. */
#dialog[data-kind="storyboard"],
dialog:has(.mys-sb) {
  width: min(930px, calc(100vw - 34px));
  max-height: min(88dvh, 890px);
  overscroll-behavior: contain;
  overflow: auto;
}
#dialog[data-kind="storyboard"] .modal-header,
dialog:has(.mys-sb) > .modal-header {
  padding-bottom: 14px;
}

.mys-sb {
  --sb-ink: #382e43;
  --sb-muted: #6d6277;
  --sb-border: #ddd5df;
  --sb-accent: #72567f;
  --sb-card: #fffdfb;
  color: var(--sb-ink);
  background: #faf8f6;
  padding: 16px clamp(16px, 3vw, 30px) 24px;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 14px;
  line-height: 1.45;
}
.mys-sb *, .mys-sb *::before, .mys-sb *::after {box-sizing: border-box}
.mys-sb button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.mys-sb button:focus-visible {
  position: relative;
  z-index: 2;
  outline: 3px solid #9472a6;
  outline-offset: 2px;
}
.mys-sb .sb-icon {display: inline-flex; flex: none; align-items: center; justify-content: center}
.mys-sb .sb-icon svg {display:block; width: 16px; height: 16px}
.mys-sb [hidden] {display: none !important}
.sb-live {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

.mys-sb .sb-pref,
.mys-sb .sb-controls,
.mys-sb .sb-views,
.mys-sb .sb-total,
.mys-sb .sb-disclosure,
.mys-sb .sb-view,
.mys-sb .sb-tab,
.mys-sb .sb-ep-head,
.mys-sb .sb-annotation,
.mys-sb .sb-card-action,
.mys-sb .sb-card-state,
.mys-sb .sb-small-link {display:flex; align-items:center}
.mys-sb .sb-pref {justify-content:space-between; gap:16px; flex-wrap:wrap}
.mys-sb .sb-total {gap:7px; white-space:nowrap; font-size:13px; color:var(--sb-muted)}
.mys-sb .sb-total strong {
  color:var(--sb-ink); font:600 13px/1.25 ui-monospace,monospace; letter-spacing:-.02em;
}
.mys-sb .sb-track {height:3px; margin-top:6px; background:#e5dfe6; border-radius:4px; overflow:hidden}
.mys-sb .sb-track span {display:block; height:100%; background:#9d7c9f}
.mys-sb .sb-controls {gap:14px; margin-left:auto}
.mys-sb .sb-views {
  border:1px solid var(--sb-border); background:#eee9ee; border-radius:5px; padding:2px; gap:2px;
}
.mys-sb .sb-view,.mys-sb .sb-disclosure {gap:6px;font-size:12px;font-weight:650;border-radius:3px;white-space:nowrap}
.mys-sb .sb-view {padding:5px 8px; color:var(--sb-muted)}
.mys-sb .sb-view[aria-pressed="true"] {background:white; color:var(--sb-ink);box-shadow:0 1px 3px #37223d18}
.mys-sb .sb-disclosure {padding:5px 0;color:#6b5c70}
.mys-sb .sb-disclosure::after {
  content:"";width:24px;height:14px;border-radius:20px;
  background: radial-gradient(circle at 7px center,#fff 4px,transparent 4.5px),#aaa1ab;
}
.mys-sb .sb-disclosure[aria-checked="true"]::after {
  background: radial-gradient(circle at 17px center,#fff 4px,transparent 4.5px),var(--sb-accent);
}
.mys-sb .sb-tabs {
  display:grid;grid-template-columns:repeat(7,minmax(0,1fr));
  margin-top:16px; border-block:1px solid var(--sb-border);
}
.mys-sb .sb-tab {
  justify-content:center;gap:6px;position:relative; min-height:42px;
  border-bottom:3px solid transparent; padding:8px 3px 5px;color:#756b7a;
}
.mys-sb .sb-tab-number {font:600 12px/1.2 ui-monospace,monospace;letter-spacing:.03em;white-space:nowrap}
.mys-sb .sb-tab[aria-selected="true"] {background:#eee8ef;color:#4d3758;border-color:var(--sb-accent)}
.mys-sb .sb-tab:hover:not([aria-selected="true"]) {background:#f2edf1}
.mys-sb .sb-tab-pip {flex:none; width:5px;height:5px;border-radius:50%;border:1px solid #a99bad}
.mys-sb .sb-tab[data-progress="some"] .sb-tab-pip {background:#bca1ba;border-color:#a58da7}
.mys-sb .sb-tab[data-progress="all"] .sb-tab-pip {background:#7b6587;border-color:#7b6587}

.mys-sb .sb-ep-head {gap:10px; margin:18px 0 12px;flex-wrap:wrap}
.mys-sb .sb-ep-code {
  color:#775d79;font:700 10px/1.4 Arial,sans-serif;letter-spacing:.13em;
  border-right:1px solid #c8bbc9;padding-right:10px;
}
.mys-sb .sb-ep-title {font-size:clamp(18px,2.4vw,24px); line-height:1.25; letter-spacing:-.07em;margin:0; color:inherit}
.mys-sb .sb-ep-title.sb-muted {color:var(--sb-muted);font-weight:600}
.mys-sb .sb-ep-count {margin-left:auto;color:var(--sb-muted);font-size:12px;white-space:nowrap}
.mys-sb .sb-cards {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start}
.mys-sb .sb-card {
  min-width:0; position:relative;border:1px solid var(--sb-border);background:var(--sb-card);
  border-radius:5px;overflow:hidden; transition:border-color .15s, box-shadow .15s;
}
.mys-sb .sb-card.sb-current {border-color:#967c9e;box-shadow:0 0 0 1px #ab95b057}
.mys-sb .sb-card:hover {border-color:#a08aaa}
.mys-sb .sb-card-main {
  display:grid;grid-template-columns:minmax(0,1fr); align-items:stretch;
  width:100%;min-height:106px;padding:0;text-align:left;
}
.mys-sb .sb-card-main:focus-visible {outline-offset:-3px}
.mys-sb .sb-photo {
  position:relative;isolation:isolate;height:clamp(93px,12.3vw,140px);min-height:0;overflow:hidden;background:#31293b;
}
.mys-sb .sb-photo-bg {position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.mys-sb .sb-photo-actor {
  position:absolute;bottom:-58%;left:var(--sb-x,50%);height:141%;width:auto;max-width:none;
  object-fit:contain;transform:translateX(-50%);pointer-events:none;
}
.mys-sb .sb-photo-actor[data-depth="far"] {height:107%;bottom:-38%}
.mys-sb .sb-photo::after {
  content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(135deg,#24162e44,transparent 45%), linear-gradient(0deg,#281b3042,transparent 25%);
}
.mys-sb .sb-covered {
  background-color:#ece4eb;
  background-image:repeating-linear-gradient(135deg,transparent 0 8px,#c6b7ca34 8px 9px),
                   linear-gradient(150deg,#e3d8e5,#f6f0ed);
}
.mys-sb .sb-covered::after {background:linear-gradient(140deg,#c9b7cf1c,transparent 80%)}
.mys-sb .sb-cover-mark {
  display:grid;place-items:center;position:absolute;inset:0;color:#9684a0;
}
.mys-sb .sb-cover-mark svg {width:24px;height:24px;stroke-width:1.15}
.mys-sb .sb-frame-no,.mys-sb .sb-card-state {
  position:absolute;z-index:1;border-radius:2px;line-height:1.2;
}
.mys-sb .sb-frame-no {
  top:6px;left:6px;padding:3px 5px;color:#fff9f4;
  background:#30243cb0;font:600 10px/1.1 ui-monospace,monospace;letter-spacing:.065em;
}
.mys-sb .sb-covered .sb-frame-no {color:#6f627b;background:#fcf8f8bf}
.mys-sb .sb-card-state {
  left:6px;bottom:6px;gap:4px;padding:3px 6px;font-size:10px;font-weight:700;color:#fff9f5;background:#2b223add;
}
.mys-sb .sb-card-state .sb-icon svg {width:11px;height:11px}
.mys-sb .sb-current .sb-card-state {color:#392942;background:#ffe3cfe8}
.mys-sb .sb-card-text {
  display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;min-width:0;
  gap:3px 9px;padding:9px 12px 12px;
}
.mys-sb .sb-card-title {font-size:16px;line-height:1.43;letter-spacing:-.05em;overflow-wrap:break-word}
.mys-sb [data-cover="closed"] .sb-card-title {font-weight:600;color:#6c6070}
.mys-sb .sb-annotation {grid-row:2;grid-column:1;gap:3px;font-size:12px;line-height:1.4;color:var(--sb-muted);word-break:keep-all}
.mys-sb .sb-annotation svg {width:12px;height:12px}
.mys-sb .sb-card-action {
  grid-column:2;grid-row:1/3;gap:4px; font-size:12px;font-weight:700;color:#674976;
}
.mys-sb .sb-card-action svg {width:12px;height:12px}
.mys-sb [data-cover="open"] .sb-card-action svg {fill:#67497626}
.mys-sb .sb-small-link {
  width:100%;justify-content:flex-end;gap:4px; border-top:1px solid var(--sb-border);
  padding:5px 11px;font-size:12px;color:#6d5b73;background:#f8f4f6;
}
.mys-sb .sb-moment-links {
  display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px;
  padding: 2px 9px; border-top: 1px solid var(--sb-border); background: #f7f1f5;
}
.mys-sb .sb-moment-link {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px;
  padding: 3px 5px; border-radius: 3px; font-size: 12px; font-weight: 650; color: #674976;
}
.mys-sb .sb-moment-link:hover {background: #ebe3ed}
.mys-sb .sb-moment-link svg {width: 13px; height: 13px}
.mys-sb .sb-return-hint {
  flex-basis: 100%; margin: 0 5px 7px; color: var(--sb-muted);
  font-size: 13px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere;
}
@media (pointer: coarse) {
  .mys-sb .sb-moment-link {min-height: 44px}
}
.mys-sb .sb-small-link:hover {background:#efe8ef}
.mys-sb .sb-small-link svg {width:12px;height:12px}
.mys-sb .sb-standalone-close {margin:16px 0 0;color:var(--sb-muted);text-decoration:underline}

.mys-sb[data-view="list"] .sb-cards {display:flex;flex-direction:column;gap:5px}
.mys-sb[data-view="list"] .sb-card {width:100%;border-radius:3px}
.mys-sb[data-view="list"] .sb-card-main {grid-template-columns:78px 1fr;min-height:43px}
.mys-sb[data-view="list"] .sb-photo {height:auto;min-height:43px}
.mys-sb[data-view="list"] .sb-photo::after {background:#2e203b66}
.mys-sb[data-view="list"] .sb-covered::after {background:#e8deeb77}
.mys-sb[data-view="list"] .sb-cover-mark,.mys-sb[data-view="list"] .sb-card-state {display:none}
.mys-sb[data-view="list"] .sb-frame-no {top:50%;left:50%;transform:translate(-50%,-50%);white-space:nowrap}
.mys-sb[data-view="list"] .sb-card-text {display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) auto;align-items:center;gap:10px;padding:8px 12px}
.mys-sb[data-view="list"] .sb-card-title {font-size:14px}
.mys-sb[data-view="list"] .sb-card-action {margin:0;grid-row:1;grid-column:auto}
.mys-sb[data-view="list"] .sb-annotation {grid-row:1;grid-column:auto}
.mys-sb[data-view="list"] .sb-small-link {padding-block:3px}
body.high-contrast .mys-sb {--sb-muted:#4b4054;--sb-border:#9d91a3}
@media (max-width:600px) {
  #dialog[data-kind="storyboard"], dialog:has(.mys-sb) {width:calc(100vw - 18px);max-height:92dvh}
  .mys-sb {padding:12px 12px 15px}
  .mys-sb .sb-pref {gap:10px}
  .mys-sb .sb-total {font-size:12px}
  .mys-sb .sb-controls {gap:8px}
  .mys-sb .sb-view {font-size:12px;padding:5px}
  .mys-sb .sb-view .sb-icon,.mys-sb .sb-disclosure>.sb-icon {display:none}
  .mys-sb .sb-tabs {margin-top:13px}
  .mys-sb .sb-tab {min-height:38px;gap:3px}
  .mys-sb .sb-tab-number {font-size:10px;letter-spacing:0}
  .mys-sb .sb-tab-pip {width:4px;height:4px}
  .mys-sb .sb-ep-head {margin:14px 0 9px;gap:7px}
  .mys-sb .sb-ep-code {font-size:9px;padding-right:7px}
  .mys-sb .sb-ep-title {font-size:17px}
  .mys-sb .sb-ep-count {font-size:11px}
  .mys-sb .sb-cards {grid-template-columns:1fr;gap:7px}
  .mys-sb .sb-card-main {grid-template-columns:34% minmax(0,1fr);min-height:77px}
  .mys-sb .sb-photo {height:auto;min-height:77px}
  .mys-sb .sb-card-text {display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding:8px 10px;gap:2px}
  .mys-sb .sb-card-title {font-size:15px}
  .mys-sb .sb-card-action {margin-top:3px}
  .mys-sb[data-view="list"] .sb-card-main {grid-template-columns:62px minmax(0,1fr)}
  .mys-sb[data-view="list"] .sb-card-text {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 8px}
  .mys-sb[data-view="list"] .sb-annotation {grid-column:1;grid-row:2;font-size:11px}
  .mys-sb[data-view="list"] .sb-card-action {grid-column:2;grid-row:1/3;font-size:11px}
}
@media(max-width:355px) {
  .mys-sb .sb-pref {align-items:flex-start}
  .mys-sb .sb-controls {margin-left:0;justify-content:space-between;width:100%}
}
@media(prefers-reduced-motion:reduce) {
  .mys-sb *, .mys-sb *::after {scroll-behavior:auto;transition:none!important}
}

.mys-sb .sb-sections {
  display: flex;
  gap: clamp(9px, 2vw, 24px);
  margin: -2px 0 16px;
  border-bottom: 1px solid var(--sb-border);
}
.mys-sb .sb-section {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 2px 7px;
  color: var(--sb-muted);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
.mys-sb .sb-section[aria-pressed="true"] {color: var(--sb-ink)}
.mys-sb .sb-section[aria-pressed="true"]::after {
  position: absolute;
  inset: auto 0 -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--sb-accent);
  content: "";
}
.mys-sb .sb-section-count, .mys-sb .sb-art-caption > span {
  color: var(--sb-muted);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mys-sb .sb-section-count {
  padding: 2px 6px;
  border-radius: 3px;
  background: #eee8ef;
}
.mys-sb .sb-art-note {margin: 0 0 12px; color: var(--sb-muted); font-size: 13px}
.mys-sb .sb-event-grid {display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px}
.mys-sb .sb-art-tile {
  display: block;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--sb-border);
  border-radius: 5px;
  overflow: hidden;
  background: var(--sb-card);
  text-align: left;
}
.mys-sb button.sb-art-tile:hover {border-color: var(--sb-accent)}
.mys-sb .sb-art-thumb {width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #28242d}
.mys-sb .sb-art-thumb img {display: block; width: 100%; height: 100%; object-fit: contain}
.mys-sb .sb-art-locked .sb-art-thumb {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e8e2e8, #f5f0ec);
  color: #9a8b9e;
}
.mys-sb .sb-art-locked .sb-art-thumb svg {width: 23px; height: 23px; stroke-width: 1.35}
.mys-sb .sb-art-label, .mys-sb .sb-art-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mys-sb .sb-art-label {min-height: 41px; padding: 8px 12px; color: var(--sb-ink); line-height: 1.4}
.mys-sb .sb-art-label > .sb-icon, .mys-sb .sb-art-locked .sb-art-label {color: var(--sb-muted)}
.mys-sb .sb-art-label > .sb-icon svg {width: 14px; height: 14px}
.mys-sb .sb-viewer-bar, .mys-sb .sb-art-arrows, .mys-sb .sb-art-back, .mys-sb .sb-art-arrow {
  display: flex;
  align-items: center;
}
.mys-sb .sb-viewer-bar {justify-content: space-between; gap: 10px; margin: -6px 0 8px}
.mys-sb .sb-art-arrows {gap: 4px}
.mys-sb .sb-art-back, .mys-sb .sb-art-arrow {
  justify-content: center;
  gap: 4px;
  min-height: 42px;
  min-width: 42px;
  border-radius: 3px;
  color: var(--sb-muted);
  font-weight: 650;
}
.mys-sb .sb-art-back {padding: 0 8px 0 2px}
.mys-sb .sb-art-back:hover, .mys-sb .sb-art-arrow:hover {background: #eee8ef; color: var(--sb-ink)}
.mys-sb .sb-art-figure {margin: 0}
.mys-sb .sb-art-full {
  display: block;
  width: 100%;
  height: auto;
  max-height: 64vh;
  max-height: max(85px, min(70dvh, calc(90dvh - 175px)));
  object-fit: contain;
  background: #27232a;
}
.mys-sb .sb-art-caption {padding: 10px 0 0}
.mys-sb .sb-art-caption h3 {margin: 0; color: var(--sb-ink); font-size: clamp(15px, 2.1vw, 20px)}
@media (max-width: 480px) {
  .mys-sb .sb-section {gap: 5px; font-size: 13px}
  .mys-sb .sb-event-grid {gap: 7px}
  .mys-sb .sb-art-label {min-height: 40px; padding: 6px; font-size: 12px}
  .mys-sb .sb-art-label > .sb-icon {display: none}
  .mys-sb .sb-art-note {font-size: 12px}
}
@media (max-height: 480px) and (orientation: landscape) {
  #dialog[data-kind="storyboard"]:has(.sb-art-viewer:not([hidden])) .modal-header {padding-block: 5px}
  dialog:has(.sb-art-viewer:not([hidden])) #dialog-kicker {display: none}
  .mys-sb:has(.sb-art-viewer:not([hidden])) {padding-block: 7px}
  .mys-sb .sb-art-viewer {display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px}
  .mys-sb .sb-viewer-bar {align-self: start; flex-direction: column; align-items: flex-start; margin: 0; gap: 3px}
  .mys-sb .sb-art-full {max-height: max(76px, calc(88dvh - 107px))}
  .mys-sb .sb-art-caption {padding-top: 4px}
}
