:root {
  color-scheme: dark;
  --outer: #14111e;
  --ink: #f8f1e6;
  --muted: #b4c0be;
  --copper: #f5c27d;
  --line: #ffffff29;
  --plate: #101c20;
  --shelf-accent: #9676ff;
  --shelf-white: #fefeff;
  --shelf-base: #f0f0fa;
  --shelf-ink: #221e29;
  --shelf-accent-text: #6742bd;
  --viewport-height: 100dvh;
  --frame-width: min(402px, 100vw, calc((100dvh - 44px) * 1206 / 2622));
  --top-inset: max(14px, env(safe-area-inset-top));
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--outer);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { min-height: var(--viewport-height); margin: 0; display: grid; place-items: center; }
button, input, textarea { font: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .67; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
.icon { flex: none; vertical-align: middle; }
.coin-icon { flex: none; vertical-align: middle; filter: drop-shadow(0 2px 1px #28173346); }
.game-icon {
  --gem-light: #bd9cff;
  --gem-face: #8061cf;
  --gem-edge: #493082;
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: calc(var(--glyph-size) + 8px); height: calc(var(--glyph-size) + 8px);
  border-radius: 50%; border: 1px solid #ffffff7d; color: #fff8eb; vertical-align: middle;
  background:
    radial-gradient(ellipse at 29% 16%, #ffffff9c, transparent 48%),
    linear-gradient(155deg, var(--gem-light), var(--gem-face) 52%, var(--gem-edge));
  box-shadow: inset 0 1px 1px #fff9, inset 0 -2px 2px #24113556,
    0 1.5px 0 var(--gem-edge), 0 3px 4px #110e242f;
}
.game-icon::before {
  content: ""; position: absolute; inset: 2px; border: 1px solid #ffffff41;
  border-bottom-color: #24113540; border-radius: inherit; pointer-events: none;
}
.game-icon .icon {
  position: relative; stroke-width: 2.2;
  filter: drop-shadow(0 1px 0 #20113280) drop-shadow(0 -1px 0 #ffffff39);
}
.game-icon:is([data-glyph="play"], [data-glyph="bolt"]) svg { fill: currentColor; stroke-width: 1.5; }
.game-icon:is([data-glyph="clock"], [data-glyph="bolt"], [data-glyph="play"], [data-glyph="star"], [data-glyph="bag"]) {
  --gem-light: #ffdb86; --gem-face: #bf732e; --gem-edge: #753d28;
}
.game-icon:is([data-glyph="radio"], [data-glyph="book"], [data-glyph="compass"], [data-glyph="drop"]) {
  --gem-light: #9be6ee; --gem-face: #357f9c; --gem-edge: #21485e;
}
.game-icon:is([data-glyph="check"], [data-glyph="plus"]) {
  --gem-light: #a5ead5; --gem-face: #3d947f; --gem-edge: #23554d;
}
.game-icon:is([data-glyph="heart"], [data-glyph="close"]) {
  --gem-light: #ffb1ae; --gem-face: #d15e79; --gem-edge: #873457;
}
.game-icon[data-glyph="custom"] {
  --gem-light: #fff9f0; --gem-face: #dfd6f5; --gem-edge: #9276a9;
}
.game-icon[data-glyph="custom"] .icon { filter: none; }

:is(.primary, .secondary) {
  --control-light: #60757b;
  --control-face: #334d54;
  --control-deep: #263b43;
  --control-rim: #8c9d9e;
  --control-edge: #111f29;
  --control-depth: 3px;
  color: var(--control-ink, var(--ink));
  border: 1px solid var(--control-rim);
  background: linear-gradient(180deg, var(--control-light), var(--control-face) 48%, var(--control-deep));
  box-shadow: inset 0 1px 0 #ffffff59, inset 0 -1px 0 #0003,
    0 var(--control-depth) 0 var(--control-edge), 0 5px 8px #0a101b40;
  transition: translate .13s ease, filter .15s ease, box-shadow .13s ease;
}
:is(.primary, .secondary):hover:not(:disabled) {
  filter: brightness(1.11);
}
:is(.primary, .secondary):active:not(:disabled) {
  --control-depth: 1px;
  translate: 0 2px;
  filter: brightness(.95);
}
#surround {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden; pointer-events: none; isolation: isolate;
  --atmosphere-veil: #d7c3ff;
  --atmosphere-light: #f4eaff;
  --atmosphere-mote: #eee2ff;
  --atmosphere-line: #cbb3f61c;
  background:
    radial-gradient(ellipse at 13% 4%, #65517552, transparent 48%),
    radial-gradient(ellipse at 94% 89%, #46365e52, transparent 55%),
    linear-gradient(145deg, #1b1627, #12101c 62%, #211a2c);
}
#surround-art { position: absolute; inset: -40px; opacity: .09; transition: opacity .7s ease; }
#surround-art img {
  width: 100%; height: 100%; object-fit: cover; filter: blur(40px) saturate(.4);
}
.atmosphere {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none; isolation: isolate;
  background: radial-gradient(circle at 1px 1px, var(--atmosphere-line) .5px, transparent .8px);
  background-size: 7px 7px;
}
.atmosphere::before, .atmosphere::after {
  content: ''; position: absolute; inset: -15%; pointer-events: none;
  background: radial-gradient(ellipse 48% 26% at 22% 35%, var(--atmosphere-veil), transparent 85%);
  opacity: .2; animation: atmosphere-light 23s ease-in-out infinite alternate;
}
.atmosphere::after {
  background: radial-gradient(ellipse 35% 38% at 78% 66%, var(--atmosphere-light), transparent 85%);
  opacity: .1; animation-direction: alternate-reverse; animation-duration: 31s;
}
.atmosphere-mote {
  position: absolute; left: var(--mote-x); top: var(--mote-y);
  width: var(--mote-size); height: var(--mote-size); border-radius: 50%;
  background: var(--atmosphere-mote); opacity: .28;
  animation: atmosphere-drift var(--mote-duration) ease-in-out var(--mote-delay) infinite alternate;
}
.atmosphere-mote:nth-child(5n + 1) {
  border-radius: 0; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}
@keyframes atmosphere-light {
  from { transform: translate(-3%, -2%) rotate(-5deg); }
  to { transform: translate(5%, 4%) rotate(7deg); }
}
@keyframes atmosphere-drift {
  0% { transform: translate(0, 10px); opacity: .12; }
  55% { opacity: .55; }
  100% { transform: translate(12px, -24px); opacity: .2; }
}
.is-backgrounded .atmosphere::before, .is-backgrounded .atmosphere::after, .is-backgrounded .atmosphere-mote {
  animation-play-state: paused;
}
#lobby-atmosphere {
  display: none; z-index: -1;
  --atmosphere-veil: #c4abea;
  --atmosphere-light: #fff;
  --atmosphere-mote: #9c7dca;
  --atmosphere-line: #a78ccf16;
}
.device {
  width: var(--frame-width);
  height: calc(var(--frame-width) * 2622 / 1206);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d5c4ef38;
  border-radius: 25px;
  background: #102226;
  box-shadow: 0 28px 70px #08050f80, 0 0 55px #c7acf511;
}
.art, .scrim { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.art img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 43%;
  display: block; animation: reveal .42s ease both;
}
.scrim {
  background: linear-gradient(180deg, #081318d9, #0813182b 23%, transparent 46%, #091216a3 77%, #091216 100%);
}
.device[data-view="home"] .scrim {
  background: linear-gradient(180deg, #110d1ab3, transparent 29%, #17101e12 40%, #15101fb3 75%, #110c1ce6);
}
.device[data-view="home"] .panel { flex-shrink: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.top {
  padding: var(--top-inset) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  flex: none; z-index: 2;
}
.top-row { display: flex; gap: 9px; align-items: center; min-height: 46px; }
.play-status {
  display: flex; flex: 1; flex-wrap: wrap; align-items: center; min-width: 0;
  color: #fff; font-size: clamp(11px, 3.4vw, 14px); font-weight: 400;
  font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 1px 4px #000b;
}
.cast-stats {
  display: grid; gap: 6px; width: min(164px, 55%); margin-top: 9px; padding: 8px 10px;
  border: 1px solid #ffffff40; border-radius: 11px; background: #101010b8;
  backdrop-filter: blur(6px); color: #f6f6f6;
}
.cast-stats-name { margin: 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.cast-stat-row {
  display: grid; grid-template-columns: 15px minmax(0, 1fr) auto; align-items: center; gap: 6px;
}
.story-stats { width: min(180px, 62%); }
.story-stats .cast-stat-row { grid-template-columns: 15px minmax(0, 1fr) minmax(18px, 1fr) auto; }
.story-stat-name { font-size: 10px; overflow-wrap: anywhere; }
.cast-stat-row .icon { color: #e4e4e4; }
.cast-stat-row img.icon { object-fit: contain; filter: grayscale(1); }
.cast-stat-meter {
  position: relative; display: block; height: 6px; border-radius: 999px;
  overflow: hidden; background: #ffffff32;
}
.cast-stat-fill, .cast-stat-trail {
  position: absolute; inset: 0; border-radius: inherit; transform-origin: left center;
}
.cast-stat-fill { transform: scaleX(var(--level)); background: #e9e4f6; }
.cast-stat-trail { background: #e88d97; opacity: 0; }
.cast-stat-value { font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ending-collection {
  position: absolute; right: max(16px, env(safe-area-inset-right)); top: calc(var(--top-inset) + 51px);
}
.ending-trigger {
  display: grid; justify-items: center; gap: 4px; padding: 3px 4px 0;
  border: 0; border-radius: 9px; background: none; color: #fff;
}
.ending-stack { position: relative; width: 48px; height: 47px; perspective: 140px; }
.ending-sheet {
  position: absolute; top: 4px; left: 8px; display: grid; place-items: center;
  overflow: hidden;
  width: 29px; height: 40px; border: 1px solid #ffffff87; border-radius: 5px;
  background: linear-gradient(145deg, #a4a0b9, #4d4c62 53%, #262633);
  box-shadow: inset 0 1px 1px #ffffff50, 0 2px 5px #0007;
  transform: translateX(-7px) rotate(-18deg) rotateY(-12deg); transition: transform .2s ease;
}
.ending-sheet-art {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: blur(2.2px); transform: scale(1.22);
}
.ending-sheet:has(.ending-sheet-art)::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(145deg, #e2dafa40, #1e1b3480 76%);
}
.ending-sheet-mark { position: relative; z-index: 1; }
.ending-sheet:nth-child(2) { transform: translateX(-2px) rotate(-5deg); }
.ending-sheet:last-child {
  background: radial-gradient(ellipse at 28% 16%, #ffffff47, transparent 54%), linear-gradient(145deg, #716e85, #343448);
  color: #fff; font: 750 24px/1 system-ui, sans-serif; text-shadow: 0 1px 4px #25213d;
  transform: translateX(6px) rotate(14deg) rotateY(-12deg);
}
.ending-trigger[aria-expanded="true"] { visibility: hidden; }
.ending-trigger:hover .ending-sheet:last-child {
  transform: translate(8px, -2px) rotate(18deg) rotateY(-10deg);
}
.ending-count {
  min-width: 36px; padding: 2px 6px; border: 1px solid #ffffff4c; border-radius: 999px;
  background: #181622c9; color: #fff; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.ending-popover {
  position: absolute; top: 0; right: 0; display: flex; flex-direction: column;
  width: min(334px, calc(var(--frame-width) - 32px)); max-height: min(415px, 57dvh);
  border: 1px solid #ffffff4f; border-radius: 13px; background: #17171af2; color: #f7f5fa;
  box-shadow: inset 0 1px 0 #ffffff12, 0 12px 28px #0007; backdrop-filter: blur(15px);
  animation: ending-open .26s cubic-bezier(.2,.75,.26,1) both;
}
.ending-popover[hidden] { display: none; }
@keyframes ending-open {
  from { opacity: .45; clip-path: inset(0 0 calc(100% - 45px) calc(100% - 48px) round 8px); }
  to { opacity: 1; clip-path: inset(0 round 13px); }
}
.ending-popover-head {
  display: flex; align-items: center; gap: 8px; min-height: 43px; padding: 3px 8px 3px 12px;
  border-bottom: 1px solid #ffffff25;
}
.ending-popover-head h2 { margin: 0 auto 0 0; font-size: 15px; }
.ending-popover-head > span { color: #d7ccea; font-size: 11px; white-space: nowrap; }
.ending-close { display: grid; place-items: center; width: 33px; height: 33px; border: 0; border-radius: 8px; background: transparent; color: #fff; }
.ending-close:hover, .ending-card summary:hover { background: #ffffff19; }
.ending-list { display: grid; gap: 6px; overflow: auto; overscroll-behavior: contain; padding: 8px; }
.ending-card { border: 1px solid #ffffff2b; border-radius: 8px; background: #ffffff09; overflow: clip; }
.ending-card summary {
  display: grid; grid-template-columns: 37px minmax(0, 1fr) auto 14px; align-items: center;
  gap: 8px; padding: 6px; list-style: none; cursor: pointer; border-radius: inherit;
}
.ending-card summary::-webkit-details-marker { display: none; }
.ending-card[open] summary > .icon { rotate: 180deg; }
.ending-thumb { display: block; aspect-ratio: 2/3; overflow: hidden; border-radius: 4px; background: #353143; }
.ending-thumb img, .ending-discovery img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ending-card[data-unlocked="false"] .ending-thumb img { filter: blur(5px) brightness(.85); transform: scale(1.3); }
.ending-card-label { min-width: 0; display: grid; gap: 3px; }
.ending-card-label strong { font-size: 13px; overflow-wrap: anywhere; }
.ending-card-progress, .ending-empty { color: #c8c5cf; font-size: 11px; }
.ending-empty { margin: 5px 4px 8px; }
.ending-rarity { padding: 2px 4px; border-radius: 4px; background: #ffffff12; color: #d5d3dc; font-size: 9px; font-weight: 750; }
.ending-rarity:is([data-rarity="SR"], [data-rarity="SSR"]) { background: #b79bea26; color: #ebd9ff; }
.ending-conditions { list-style: none; display: grid; gap: 5px; margin: 0; padding: 5px 7px 8px; }
.ending-conditions > li { display: grid; gap: 3px; padding: 4px 6px; border-radius: 6px; background: #0003; }
.ending-condition-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; font-size: 11px; }
.ending-condition-title small { color: #c4bdce; margin-inline-start: auto; }
.ending-check { color: #aaa5b3; }
.ending-check[data-met="true"] { color: #e2cbff; }
.ending-join { font-size: 9px; font-weight: 750; color: #cfc0e3; }
.ending-condition-group > .ending-conditions { padding: 1px 0; }
.ending-discovery { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 10px; padding: 4px 7px 8px; align-items: center; }
.ending-discovery img { aspect-ratio: 2/3; border-radius: 5px; background: #353143; }
.ending-discovery p { margin: 0 0 9px; font-size: 13px; line-height: 1.45; }
.nav-button {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  padding: 0; border: 0; border-radius: 50%; background: transparent;
}
.nav-button:disabled { opacity: .6; cursor: wait; }
.nav-button img { display: block; width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 1px 2px #67508526); }
.intro-head, .shelf-head { justify-content: space-between; }
.points-badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
  min-height: 34px; padding: 4px 9px; border-radius: 999px; background: #101e22e8;
  border: 1px solid #f5c27d52; color: #f8e0b4; font-size: 13px; font-variant-numeric: tabular-nums;
}
.stage { position: relative; flex: 1 1 auto; min-height: 35px; }
.device[data-view="play"] .stage { position: static; }
.portrait {
  position: absolute; bottom: 128px; left: 50%; transform: translateX(-50%);
  height: clamp(220px, 59vh, 525px); max-width: 95%; width: auto; object-fit: contain;
  object-position: center bottom; filter: drop-shadow(0 8px 25px #0007);
  animation: portrait-in .28s ease both; pointer-events: none;
}
@keyframes portrait-in { from { opacity: 0; transform: translate(-48%, 5px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes reveal { from { opacity: .52; } to { opacity: 1; } }
.panel {
  flex: none; position: relative; z-index: 1;
  padding: 8px max(15px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(15px, env(safe-area-inset-left));
}
.home {
  padding: 12px 5px 3px; color: #f8f5fc;
}
.home h1 {
  font-weight: 650; font-size: clamp(25px, 7.2vw, 32px); line-height: 1.1;
  letter-spacing: -.022em; margin: 0 0 11px; text-shadow: 0 1px 4px #100b1a40;
  overflow-wrap: anywhere; text-wrap: balance;
}
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 10px; }
.tag {
  padding: 4px 10px; border-radius: 999px; color: #e4d5f3;
  background: #f1e6ff14; border: 1px solid #e4d3f533;
  font-size: 11px; font-weight: 500; line-height: 1.4;
}
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 0 0 11px; color: #c9bfd5; font-size: 12px; }
.meta-row .fact { display: inline-flex; align-items: center; gap: 5px; }
.meta-row .icon { opacity: .8; }
.home .desc {
  margin: 0; color: #ded6e7; font-size: 13.5px; line-height: 1.56;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.desc-toggle {
  display: inline; margin: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; color: #e4d3f5; font: inherit; font-weight: 500;
}
.desc-toggle[hidden] { display: none; }
.desc-toggle:focus-visible { outline: 1px solid #e5cfff; outline-offset: 3px; }
.home .intro-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 9px; margin-top: 15px; }
.home .intro-actions .action-button { flex: 1; min-width: min(128px, 100%); }
.action-button {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0;
  min-height: 54px; padding: 8px 9px; border-radius: 16px;
  color: #f3edf9; border: 1px solid var(--performance-edge); border-top-color: #f6efff6b;
  background: var(--performance-surface);
  box-shadow: var(--performance-light), 0 5px 12px #100b1a20;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: filter .15s ease;
}
.action-button.is-primary { border-color: #f1e3ff80; }
.action-button:hover:not(:disabled) { filter: brightness(1.06); }
.action-button:active:not(:disabled) { filter: brightness(.97); }
.action-icon {
  display: block; flex: none; width: 36px; height: 36px; object-fit: contain;
}
.action-copy { min-width: 0; text-align: left; font-size: 13px; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.action-button:only-child .action-copy { font-size: 15px; }
.action-button:focus-visible { outline: 1px solid #e5cfff; outline-offset: 3px; }
.primary, .secondary {
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  gap: 8px; min-height: 46px; font-size: 14px; font-weight: 750;
}
.primary {
  --control-light: #fff1c7;
  --control-face: #efbe6d;
  --control-deep: #d89946;
  --control-rim: #ffe5a9;
  --control-edge: #865023;
  --control-ink: #26170e;
}
.primary { width: 100%; min-height: 51px; text-shadow: 0 1px #ffe2a5; }
.secondary { width: 100%; margin-top: 10px; }
.beat, .choice, .choice-edit, .command {
  border: 1px solid #ffffff75; border-radius: 18px;
  background: #090e12a8; backdrop-filter: blur(6px); box-shadow: 0 12px 25px #0003;
}
.beat { position: relative; padding: 27px 14px 4px; cursor: pointer; }
.beat-head {
  position: absolute; bottom: calc(100% - 16px); left: -1px; right: 9px;
  display: flex; align-items: flex-end; gap: 8px;
}
.beat .speaker {
  flex: none; margin: 0; max-width: 100%;
  padding: 7px 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid #f8e9d9dc; border-radius: 16px 18px 18px 0;
  background: linear-gradient(180deg, #a3917af5, #796958f5 52%, #53473bf7);
  box-shadow: inset 0 1px 2px #fff7, inset 0 -1px 2px #372b2460, 0 2px 6px #0005;
  color: #fff; text-shadow: 0 1px 3px #372b24c9; font-size: 14px; font-weight: 750;
}
.beat-head:has(.changes) .speaker { max-width: 46%; }
.beat-viewport { overflow: clip; margin-bottom: 5px; }
.beat-body { overflow: auto; min-height: 26px; max-height: clamp(90px, 28svh, 225px); scrollbar-width: thin; }
.beat-copy.is-collapsed { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.beat-fold:not([hidden]) {
  position: absolute; top: 0; right: 1px; z-index: 1;
  display: grid; place-items: center; width: 42px; height: 32px; padding: 0;
  border: 0; border-radius: 10px; background: none; color: #c9c9c9;
}
.beat-fold:hover { color: #fff; }
.beat-fold:focus-visible { outline: 1px solid #ffffffaa; outline-offset: -4px; }
.beat-fold .icon { transition: transform .28s cubic-bezier(.3,.05,.2,1); }
.beat-fold[aria-expanded="false"] .icon { transform: rotate(180deg); }
.beat-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 44px; }
.steps { grid-column: 2; grid-row: 1; display: flex; gap: 6px; align-items: center; }
.steps span { width: 6px; height: 6px; border-radius: 50%; background: #ffffff70; }
.steps span.current { background: #fff; }
.beat-previous, .beat-continue {
  grid-row: 1; display: grid; place-items: center; min-height: 44px;
  padding: 0 4px; border: 0; background: none; color: #fff; cursor: pointer;
}
.beat-previous { grid-column: 1; justify-self: start; min-width: 36px; margin-left: -7px; }
.beat-continue {
  grid-column: 3; justify-self: end; color: #d5dce0; font-size: 14px; font-weight: 400;
  animation: continue-breathe 2s ease-in-out infinite;
}
.beat-continue:focus-visible, .beat-continue:hover { animation: none; }
@keyframes continue-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .58; } }
.beat :is(.speech, .narration, .action) { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.beat :is(.speech, .narration) { font-size: 15px; line-height: 1.55; }
.beat .speech { color: #fff; }
.beat :is(.narration, .action, .performance-action) { color: #b6b6b6; font-style: italic; }
.beat .action { font-size: 13px; margin-bottom: 7px; }
.changes {
  display: flex; flex: 1; flex-wrap: wrap; gap: 4px;
  min-width: 0; margin: 0 0 20px; padding: 0; list-style: none;
}
.changes[hidden] { display: none; }
.change {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 6px;
  border: 1px solid #ffffff47; border-radius: 6px; background: #151515d9; color: #f5f5f5;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.decision { display: grid; gap: 12px; }
.action-progress {
  display: grid; justify-items: center; gap: clamp(20px, 3.7dvh, 32px);
  padding: clamp(22px, 4dvh, 32px) 12px clamp(18px, 3.2dvh, 26px);
  color: #f1f1f1; text-align: center; border: 1px solid #ffffff50; border-radius: 18px;
  background: #222222f5; backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 #ffffff12, 0 12px 25px #0003;
}
.action-progress-title { margin: 0; font-size: clamp(14px, 4.5cqi, 18px); font-weight: 400; }
.action-progress-spinner {
  width: 25px; height: 25px; border: 2px solid #ffffff24; border-right-color: #f1f1f1;
  border-radius: 50%; animation: action-progress-spin .85s linear infinite;
}
@keyframes action-progress-spin { to { rotate: 1turn; } }
.action-progress-steps {
  width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0; padding: 0; list-style: none; container-type: inline-size;
}
.action-progress-step {
  position: relative; display: grid; justify-items: center; align-content: start; gap: 12px;
  font-size: clamp(10px, 3.9cqi, 14px); color: #a2a2a2;
}
.action-progress-dot {
  width: 14px; height: 14px; border: 2px solid #858585; border-radius: 50%;
  transition: background-color .2s, border-color .2s;
}
.action-progress-step:not(:last-child)::after {
  content: ''; position: absolute; top: 6px; left: calc(50% + 12px); width: calc(100% - 24px);
  height: 2px; border-radius: 2px; background: #5c5c5c; transition: background-color .2s;
}
.action-progress-step:is([data-state="current"], [data-state="done"]) { color: inherit; }
.action-progress-step[data-state="done"] .action-progress-dot,
.action-progress-step[data-state="done"]::after { background: #dedede; border-color: #dedede; }
.action-progress-step[data-state="current"] .action-progress-dot {
  background: #ccc; border-color: #ccc; box-shadow: 0 0 12px #ffffff62;
}
.choices {
  display: grid; gap: 7px; max-height: calc(var(--viewport-height) * .42);
  overflow: auto; padding: 3px; margin: -3px; scrollbar-width: thin;
}
.choice-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 6px; }
.choice {
  min-height: 48px; padding: 10px 13px; text-align: left; overflow-wrap: anywhere;
  color: var(--ink); font-size: 15px; font-weight: 400; line-height: 1.42;
}
.choice-edit {
  display: grid; place-items: center; color: #dfceba; background: #242727bf;
}
.choice:hover:not(:disabled), .choice-edit:hover:not(:disabled) {
  background: #323331d9; border-color: #e7c5a0b0;
}
.command {
  display: grid; grid-template-columns: minmax(0, 1fr); padding: 5px 8px;
}
.command:has(textarea:focus) { border-color: #ffffff9e; }
.command textarea {
  width: 100%; min-width: 0; padding: 4px 5px; resize: none;
  border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; line-height: 1.4;
}
.command textarea::placeholder { color: var(--muted); }
.command-actions { display: flex; align-items: center; justify-content: space-between; }
.command-replay {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; background: transparent; border-radius: 8px; color: var(--muted);
}
.command-replay:disabled { opacity: 1; }
.command-send {
  position: relative; isolation: isolate; margin-inline-start: auto;
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: #fff;
}
.command-send::before {
  content: ""; position: absolute; inset: 4px; z-index: -1; border-radius: inherit;
  border: 1px solid #cdbfff;
  background: radial-gradient(ellipse at 32% 16%, #ffffff42, transparent 54%),
    linear-gradient(155deg, var(--shelf-accent), #6440c9);
  box-shadow: inset 0 1px 1px #fff6, inset 0 -1px 2px #35157870;
}
.command-send svg { fill: currentColor; }
.command-send:hover:not(:disabled) { filter: brightness(1.12); }
.command-send:active:not(:disabled) { transform: scale(.95); }
.notice { position: relative; z-index: 2; margin: 0 16px; color: #ffe0b6; font-size: 12px; }
.notice:empty { display: none; }
.notice:not(:empty) { border: 1px solid #ffd8a44d; border-radius: 7px; padding: 8px; background: #182126ed; }
.loading { color: var(--muted); font-size: 13px; }
dialog {
  background: #132125; color: var(--ink); width: calc(var(--frame-width) - 24px);
  border: 1px solid #8dadae70; border-radius: 16px; padding: 17px; max-height: min(72svh, 660px);
}
dialog::backdrop { background: #041113aa; backdrop-filter: blur(4px); }
#ending-reveal {
  width: min(280px, calc(var(--frame-width) - 32px)); max-height: none; padding: 0;
  border: 0; background: transparent; overflow: visible; color: #fff;
}
#ending-reveal::backdrop {
  background: #08070bc2; backdrop-filter: none;
  animation: ending-backdrop-in .25s ease-out; transition: background-color .54s ease;
}
@keyframes ending-backdrop-in { from { background-color: transparent; } }
#ending-reveal[data-collecting]::backdrop { background-color: transparent; }
.ending-reveal-card {
  position: relative; width: min(100%, 234px, 36dvh); aspect-ratio: 2/3;
  margin-inline: auto; overflow: hidden; border-radius: 13px; background: #2a2630;
}
.ending-reveal-art { display: block; width: 100%; height: 100%; object-fit: cover; }
.ending-reveal-card h2 {
  position: absolute; inset: auto 0 0; margin: 0; padding: 12px 11px 13px;
  background: linear-gradient(180deg, #dfd6ed1a, #d2c5e469);
  backdrop-filter: blur(8px) brightness(.58);
  color: #fff; text-align: center; text-shadow: 0 1px 4px #151019;
  font: 650 clamp(17px, 4.8vw, 22px)/1.16 Georgia, serif; overflow-wrap: anywhere;
}
.ending-reveal-details {
  display: grid; justify-items: center; gap: 9px; margin-top: 12px;
  text-align: center; transition: opacity .18s ease;
}
#ending-reveal[data-collecting] .ending-reveal-details { opacity: 0; }
.ending-reveal-text, .ending-reveal-error { margin: 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.ending-reveal-text { color: #dad6df; max-height: 26dvh; overflow: auto; }
.ending-reveal-error { color: #ffd0d8; }
.ending-reveal-close {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: #ffffff17; color: #f2eff5;
  transition: background-color .15s ease;
}
.ending-reveal-close:hover:not(:disabled) { background: #ffffff2b; }
.ending-reveal-close:focus-visible { outline: 1px solid #ffffff9c; outline-offset: 2px; }
@media (max-height: 430px) {
  .ending-reveal-card { width: min(100%, 30dvh); }
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.drawer-head h2 { margin: 0; font-family: Georgia, serif; font-size: 24px; }
.drawer-close {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 5px;
  border: 0; border-radius: 50%; color: var(--drawer-control-ink, var(--ink));
  background: var(--drawer-control-bg, #ffffff12); background-clip: content-box;
  transition: background-color .15s ease;
}
.drawer-close:hover, .drawer-close:active { background-color: var(--drawer-control-hover, #ffffff24); }
body:has(.device[data-view="shelf"]) #surround-art { opacity: 0; }
.device[data-view="shelf"] {
  --copper: var(--shelf-accent-text);
  color: var(--shelf-ink);
  background:
    radial-gradient(ellipse at 0% 50%, #e4d9f577, transparent 65%),
    radial-gradient(ellipse at 100% 100%, #d6ccf15c, transparent 58%),
    linear-gradient(180deg, #fdfcff, #f2edf9 43%, #eeebf7);
  border-color: #dad5ed;
  color-scheme: light;
}
.device[data-view="shelf"] .scrim, .device[data-view="shelf"] .panel { display: none; }
.device[data-view="shelf"] #lobby-atmosphere { display: block; }
.device[data-view="shelf"] #lobby-atmosphere::before { opacity: .32; }
.device[data-view="shelf"] #lobby-atmosphere::after { opacity: .65; }
.device[data-view="shelf"] .stage { overflow-y: auto; scrollbar-width: thin; }
.device[data-view="shelf"] .notice { margin-bottom: 14px; }
.avatar-button {
  display: grid; place-items: center; width: 45px; height: 45px; border-radius: 50%;
  border: 2px solid var(--shelf-white); outline: 1px solid #c2b0f4; color: var(--shelf-white);
  background: radial-gradient(circle at 24% 12%, #aa90ff, #7550d7 82%);
  box-shadow: 0 2px 6px #4b307333;
}
.avatar-button { padding: 0; overflow: hidden; }
.avatar-button > img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.shelf-controls { display: flex; align-items: center; gap: 6px; }
.settings-button {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: transparent;
}
.settings-button img {
  display: block; width: 35px; height: 35px; object-fit: contain;
  filter: drop-shadow(0 1px 2px #67508526);
}
.settings-button:focus-visible, .gift-button:focus-visible { outline: none; }
.header-points {
  position: relative; min-height: 26px; min-width: 78px; padding: 2px 12px 2px 30px;
  border: 0; color: #48415f; background: var(--shelf-base);
  box-shadow: inset 0 1px 0 #ffffffc4;
  font-size: 15px; font-style: italic; letter-spacing: -.035em;
}
.header-points strong { font-weight: 850; }
.header-points .points-token {
  position: absolute; z-index: 1; left: -5px; top: 50%; transform: translateY(-50%);
  object-fit: contain; filter: drop-shadow(0 2px 1px #58446f3b);
}
.shelf { padding: 16px max(19px, env(safe-area-inset-right)) max(25px, env(safe-area-inset-bottom)) max(19px, env(safe-area-inset-left)); }
.shelf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 13px; }
.shelf-card { min-width: 0; display: block; color: inherit; }
.shelf-cover {
  position: relative; aspect-ratio: 2 / 3; overflow: hidden; background: #dcd4ed; border-radius: 13px;
  box-shadow: 0 5px 14px #39245628; outline: 1px solid #45336221; outline-offset: -1px;
}
.shelf-cover > img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .25s ease; }
.shelf-card:hover .shelf-cover > img { transform: scale(1.035); }
.shelf-cover-title {
  position: absolute; inset: auto 0 0; padding: 22px 8px 13px; text-align: center;
  background: linear-gradient(transparent, #081319eb); color: #ffe1a9;
  font: 750 clamp(17px, 5vw, 24px)/1.22 "Songti SC", "Noto Serif CJK SC", serif;
  letter-spacing: .06em; text-shadow: 0 2px 4px #000; overflow-wrap: anywhere;
}
.shelf-ending-badge {
  position: absolute; right: 7px; top: 6px; display: grid; justify-items: center;
  text-align: center;
}
.shelf-ending-badge .ending-stack { height: 35px; transform: scale(.74); transform-origin: top center; }
.shelf-ending-badge .ending-count { min-width: 32px; padding: 2px 5px; font-size: 10px; line-height: 1.15; }
.shelf-title {
  display: block; min-width: 0; margin-top: 8px; overflow: hidden;
  color: var(--shelf-accent-text); font-size: 16px; font-weight: 500; line-height: 1.4;
  white-space: nowrap; text-overflow: ellipsis;
}
.shelf-empty { padding: 14px; border: 1px solid #d6cbed; border-radius: 10px; font-size: 14px; }
.shelf-empty p { margin: 0 0 8px; }
.rewards { position: absolute; right: max(12px, env(safe-area-inset-right)); top: 45%; z-index: 3; }
.rewards:empty { display: none; }
.gift-button {
  display: block; padding: 0;
  color: #fff0ca; background: transparent; border: 0; border-radius: 14px;
}
.gift-floating {
  position: relative; display: grid; justify-items: center; isolation: isolate;
  animation: gift-hover 2.8s ease-in-out infinite;
}
.gift-floating::before {
  content: ''; position: absolute; z-index: -1; bottom: -7px; left: -11px; right: -11px; height: 54px;
  background: radial-gradient(ellipse, #fffcffb3 5%, #f0e1ff66 42%, #efddff00 74%);
  pointer-events: none;
}
.gift-art {
  display: block; width: 59px; height: 61px; object-fit: contain;
  filter: drop-shadow(0 2px 3px #67508526);
}
.gift-label {
  display: block; color: var(--shelf-accent-text);
  font-size: 13px; line-height: 1.35; font-weight: 400; white-space: nowrap;
}
:is(#reward, #settings, body:has(.device[data-view="shelf"]) #drawer) {
  --ink: var(--shelf-ink);
  --muted: #5e566e;
  --copper: var(--shelf-accent-text);
  --line: #dcd2ef;
  --drawer-control-ink: #51397c;
  --drawer-control-bg: #efe8fa;
  --drawer-control-hover: #e5d9f7;
  background: #fbf9ff; color: var(--ink); border-color: #d2bff6; color-scheme: light;
}
:is(#reward, #settings, body:has(.device[data-view="shelf"]) #drawer)::backdrop { background: #25163870; }
:is(#reward, body:has(.device[data-view="shelf"]) #drawer) .points-badge {
  background: var(--shelf-base); color: var(--shelf-accent-text); border-color: var(--line);
}
.device[data-view="shelf"] .secondary {
  --control-light: #f8f0ff; --control-face: #e6d8ff; --control-deep: #cdb7f5;
  --control-rim: #d7c5f7; --control-edge: #9c7dc9; --control-ink: #50357a;
}
body:has(.device[data-view="shelf"]) #drawer .primary {
  --control-light: #ab83f5; --control-face: #8054d9; --control-deep: #6b41bc;
  --control-rim: #c4a7f8; --control-edge: #51338c; --control-ink: #fff;
  text-shadow: 0 1px #4c287d;
}
.player-details, .reward-details { display: grid; gap: 12px; }
.player-details > .points-badge, .reward-details > .points-badge { justify-self: start; }
.dialog-action {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 44px; margin-top: 6px; padding: 0 13px; border: 0; border-radius: 10px;
  background: var(--drawer-control-bg); color: var(--drawer-control-ink);
  font-size: 14px; font-weight: 650; transition: background-color .15s ease;
}
.dialog-action:hover, .dialog-action:active { background: var(--drawer-control-hover); }
.reward-done { justify-content: center; }
.point-rules { display: grid; grid-template-columns: 1fr auto; gap: 8px 15px; margin: 0; font-size: 14px; }
.point-rules dd { margin: 0; color: var(--copper); }
.reward-details p { margin: 0; color: var(--muted); font-size: 14px; }
#settings {
  width: min(340px, calc(var(--frame-width) - 32px)); padding: 18px;
  max-height: min(86dvh, 580px); border-color: #d4c5ec;
  background: linear-gradient(155deg, #fefcff, #f5effb);
  box-shadow: inset 0 1px 0 #fff, 0 18px 48px #21142b38;
}
#settings[open] { animation: settings-in .3s cubic-bezier(.2,.75,.3,1) both; }
#settings::backdrop { animation: settings-backdrop-in .22s ease both; }
#settings .drawer-head { margin-bottom: 18px; }
.settings-content { display: grid; gap: 22px; }
.settings-avatars { min-width: 0; margin: 0; padding: 0; border: 0; }
.settings-avatars legend { margin-bottom: 13px; padding: 0; color: var(--muted); font-size: 13px; }
.avatar-options { display: flex; justify-content: center; gap: 28px; }
.avatar-choice {
  display: grid; justify-items: center; gap: 8px; padding: 4px; border: 0;
  border-radius: 12px; color: #766b83; background: transparent; font-size: 12px;
}
.avatar-choice-image {
  position: relative; display: block; width: 68px; height: 68px;
  border-radius: 50%; box-shadow: 0 0 0 2px #e5dced; transition: box-shadow .2s ease;
}
.avatar-choice img { display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatar-check {
  position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center;
  width: 19px; height: 19px; border: 2px solid #fbf8ff; border-radius: 50%;
  color: #fff; background: #9072ce; opacity: 0; transition: opacity .2s ease;
}
.avatar-choice[aria-checked="true"] { color: #6742a4; }
.avatar-choice[aria-checked="true"] .avatar-choice-image { box-shadow: 0 0 0 2px #9d7cdd, 0 0 0 5px #e9dff8; }
.avatar-choice[aria-checked="true"] .avatar-check { opacity: 1; }
.settings-audio { border-top: 1px solid #e3d9ed; padding-top: 6px; }
.settings-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; min-height: 58px; font-size: 14px; color: #4f435f;
}
.settings-switch {
  flex: none; position: relative; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 12px; background: transparent;
}
.settings-switch::before {
  content: ''; position: absolute; left: 0; top: 10px; width: 44px; height: 25px;
  border-radius: 999px; background: #d7cede; box-shadow: inset 0 1px 2px #6250721c;
  transition: background-color .2s ease;
}
.settings-switch > span {
  position: absolute; top: 13px; left: 3px; width: 19px; height: 19px; border-radius: 50%;
  background: linear-gradient(#fff, #f3eef8); box-shadow: 0 1px 3px #63517338;
  transition: transform .2s ease;
}
.settings-switch[aria-checked="true"]::before { background: #9a7ad4; }
.settings-switch[aria-checked="true"] > span { transform: translateX(19px); }
#settings :is(.avatar-choice, .settings-switch):focus-visible { outline: 1px solid #9676ce; outline-offset: 3px; }
@keyframes settings-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
@keyframes settings-backdrop-in { from { background-color: transparent; } to { background-color: #25163870; } }
@keyframes gift-hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (max-width: 350px) {
  .top-row { gap: 5px; }
  .shelf { padding-inline: 14px; }
}
@media (max-height: 680px) {
  .portrait { height: 63svh; }
  .home .intro-actions { margin-top: 11px; }
  .panel { padding-bottom: max(11px, env(safe-area-inset-bottom)); }
}
@media (max-width: 520px), (max-width: 1024px) and (hover: none) and (pointer: coarse) {
  :root {
    --viewport-height: var(--visual-viewport-height, 100dvh);
    --frame-width: 100vw;
    --top-inset: max(10px, env(safe-area-inset-top));
    overflow: hidden;
    overscroll-behavior: none;
  }
  body { overflow: hidden; }
  #surround { display: none; }
  .device {
    position: fixed; inset: var(--visual-viewport-top, 0px) 0 auto;
    height: var(--viewport-height); border: 0; border-radius: 0; box-shadow: none;
  }
  .stage { min-height: 0; }
  .portrait { height: min(525px, calc(var(--viewport-height) * .59)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.flight { position: absolute; inset: 0; z-index: 7; overflow: hidden; pointer-events: none; }
.fly-coin {
  position: absolute; width: 26px; height: 26px; object-fit: contain; will-change: transform, opacity;
  filter: drop-shadow(0 3px 5px #2b175233);
}
.gain-float {
  position: absolute; padding: 2px 9px; border-radius: 999px; border: 1px solid #f5c27d6b;
  background: #0f2026eb; color: #ffe0ad; font-size: 13px; font-weight: 800;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: 0 6px 14px #00000047;
}
.points-badge.is-gaining { border-color: #f5c27da6; box-shadow: 0 0 0 2px #f5c27d59, 0 0 15px #f5c27d80; }
.header-points.is-gaining {
  box-shadow: inset 0 1px 0 #ffffffc4, 0 0 0 2px #bda6ff5c, 0 0 15px #a98bf08a;
}
body:has(.device[data-view="play"]) {
  --play-accent: color-mix(in srgb, var(--shelf-accent) 55%, white);
  --ink: #f6f6f6;
  --muted: #bebebe;
  --copper: var(--play-accent);
}
body:has(.device[data-view="play"]) #surround {
  --atmosphere-veil: #ad9ac6;
  --atmosphere-light: #dad5e2;
  background: radial-gradient(ellipse at 50% 30%, #211e29, #100e15 78%);
}
body:has(.device[data-view="play"]) #surround-art img { filter: blur(40px) grayscale(1); }
body:has(.device[data-view="play"]) #surround .atmosphere { opacity: .3; }
body:has(.device[data-view="play"]) #surround .atmosphere-mote { animation-play-state: paused; }

.device:is([data-view="home"], [data-view="play"]) {
  --performance-surface: linear-gradient(160deg, #cdb3f012, transparent 44%), #17131d9e;
  --performance-edge: #f0e5ff4d;
  --performance-light: inset 0 1px 0 #ffffff29, inset 0 -1px 0 #110a1b40;
  background: #16131b; border-color: #ffffff35;
}
.device[data-view="play"] .scrim {
  background: linear-gradient(180deg, #000b, #0002 23%, transparent 46%, #0007 77%, #000c 100%);
}
.device[data-view="play"] .game-icon { filter: grayscale(1); }
.device[data-view="play"] :is(.beat, .choice, .choice-edit, .command, .cast-stats, .action-progress) {
  border-color: var(--performance-edge); border-top-color: #f6efff6b;
  background: var(--performance-surface);
  box-shadow: var(--performance-light), 0 6px 18px #100b1a29;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.device[data-view="play"] .beat { border-radius: 20px; }
.device[data-view="play"] .choice-edit { color: #e3dce9; }
.device[data-view="play"] :is(.choice, .choice-edit):is(:hover:not(:disabled), :focus-visible) {
  background: linear-gradient(160deg, #ffffff12, transparent 60%), #322e38bf;
  border-color: #f5efffa1;
}
.device[data-view="play"] :is(.choice, .choice-edit):focus-visible { outline-color: #ffffffaa; }
.device[data-view="play"] .command:has(textarea:focus) { border-color: #f5efffa1; }
.device[data-view="play"] .command-send::before {
  border-color: #e7d6ffba;
  background: radial-gradient(ellipse at 30% 14%, #ffffff73, transparent 58%),
    linear-gradient(165deg, #c6a6ed, #9e79ce 58%, #825caf);
  box-shadow: inset 0 1px 1px #fff9, inset 0 -1px 2px #533a7270;
}
.device[data-view="play"] .beat .speaker {
  border-color: #fff9; color: #483456; font-weight: 650; text-shadow: 0 1px 0 #ffffff73;
  background: radial-gradient(ellipse at 30% 0%, #fff9, transparent 62%),
    linear-gradient(180deg, #fcf8ff, #e6d8f5 55%, #c4addd);
  box-shadow: inset 0 1px 1px #fff, inset 0 -1px 1px #8b67af4d, 0 2px 5px #110b1a26;
}
.device[data-view="play"] :is(.beat-continue, .beat-fold, .command-replay) { color: #ded7e7; }
.device[data-view="play"] .beat :is(.narration, .action, .performance-action) { color: #c5bfcc; }
.device[data-view="play"] .cast-stats { border-radius: 12px; color: #f5f0fa; }
.device[data-view="play"] .cast-stats-name { font-size: 12px; font-weight: 600; color: #e9dff2; }
.device[data-view="play"] .cast-stat-row .icon { color: #e2d6ee; }
.device[data-view="play"] .cast-stat-meter {
  background: #0e091941; box-shadow: inset 0 1px 2px #0d071f5c, 0 1px 0 #ffffff12;
}
.device[data-view="play"] .cast-stat-fill {
  background: linear-gradient(180deg, #f5edff, #d0b6ec 48%, #a784d1);
  box-shadow: inset 0 1px 0 #fff9;
}
.device[data-view="play"] .cast-stat-value { color: #f5f0fa; font-weight: 500; }
.device[data-view="play"] .change {
  border-color: #e6d5f833; border-radius: 7px; color: #ece4f5; font-weight: 500;
  background: linear-gradient(180deg, #ffffff0a, transparent), #251d2ea3;
  box-shadow: inset 0 1px 0 #ffffff12;
}
.device[data-view="play"] .notice {
  color: var(--ink); border-color: #ffffff40; background: #171717df;
}
body:has(.device[data-view="play"]) #drawer {
  background: #181818; border-color: #ffffff40;
}
body:has(.device[data-view="play"]) #drawer::backdrop { background: #000a; }
:is(.device[data-view="play"], body:has(.device[data-view="play"]) #drawer) :is(.primary, .secondary) {
  --control-light: #5a5a5a; --control-face: #363636; --control-deep: #262626;
  --control-rim: #ffffff5c; --control-edge: #151515; --control-ink: #f6f6f6;
  text-shadow: none;
}

#drawer:has(.points-shortage) {
  --ink: #f7f7f7;
  --muted: #c6c3ca;
  --copper: #c9b5f7;
  width: min(360px, calc(var(--frame-width) - 24px));
  padding: 14px 17px 17px;
  border-color: #ffffff38;
  background: linear-gradient(150deg, #28262bee, #171719f5 68%);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 #ffffff12;
}
#drawer:has(.points-shortage) .drawer-head { gap: 4px; margin: 0 -5px 8px 0; }
#drawer:has(.points-shortage) .drawer-head h2 { font-family: inherit; font-size: 18px; font-weight: 650; line-height: 1.25; }
#drawer:has(.points-shortage) .drawer-close:focus-visible { outline: 1px solid #ffffff94; outline-offset: -4px; }
.points-shortage { display: grid; gap: 13px; }
.points-shortage-summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: 8px 10px; margin: 0; padding: 10px 12px;
  border: 1px solid #ffffff1f; border-radius: 11px; background: #0d0d104d;
  color: var(--muted); font-size: 14px;
}
.points-shortage-summary dd {
  display: flex; align-items: center; justify-content: flex-end; gap: 5px;
  margin: 0; color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums;
}
.points-shortage-action {
  --drawer-control-bg: #ffffff12;
  --drawer-control-hover: #ffffff23;
  --drawer-control-ink: var(--ink);
  justify-content: center; gap: 7px; margin-top: 0;
}
.points-shortage-action:has(.icon) {
  --drawer-control-bg: #c9b5f72b;
  --drawer-control-hover: #c9b5f745;
  --drawer-control-ink: #f0e8ff;
}
.points-shortage-action .icon { order: 1; }
