:root {
  --ink: #f4ecdf;
  --muted: #d9cbb6;
  --brass: #e4d0a4;
  --paper: #f3e6c8;
  --paper-ink: #24180f;
  --ui: "Josefin Sans", "Gill Sans", "Trebuchet MS", sans-serif;
  --serif: "Cormorant Garamond", Palatino, Georgia, serif;
  --script: "Pinyon Script", "Segoe Script", cursive;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #100e0c; color: var(--ink); overflow: hidden; }
body { font: 500 17px/1.45 var(--serif); touch-action: none; }
button { font: inherit; color: inherit; }
#app, #app * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
#app input, #app textarea {
  -webkit-user-select: text;
  user-select: text;
}
#app { position: fixed; inset: 0; touch-action: none; }
#view, #actions, #cmd, #stick, #settings, #settings-btn, #help, #tutor, #rotate-hint, #party, #hud, button, canvas {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#view { width: 100%; height: 100%; display: block; }
#grain, #vignette {
  position: absolute; inset: 0; pointer-events: none;
}
#grain {
  z-index: 4; opacity: .14; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#vignette {
  z-index: 3;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(40, 18, 8, .28) 78%, rgba(8, 4, 2, .55) 100%);
}
body[data-world="oldman"] #vignette {
  background: radial-gradient(ellipse at center, transparent 42%, rgba(12, 22, 42, .34) 76%, rgba(4, 8, 16, .62) 100%);
}
body[data-world="pulse"] #vignette {
  background: radial-gradient(ellipse at center, transparent 46%, rgba(10, 16, 36, .3) 78%, rgba(4, 6, 14, .58) 100%);
}
body[data-world="thorne"] #vignette {
  background: radial-gradient(ellipse at center, transparent 40%, rgba(6, 18, 16, .38) 74%, rgba(2, 6, 8, .68) 100%);
}
#flash, #hurt { position: absolute; inset: 0; pointer-events: none; z-index: 4; opacity: 0; }
#flash { background: rgba(255, 236, 200, .55); transition: opacity .12s linear; }
#flash.on { opacity: .75; }
#hurt { background: rgba(168, 16, 12, .72); }
#hurt.on { opacity: .66; }
.track b, #hp-ring { transition: width .22s linear, stroke-dashoffset .22s linear; }
#hp-ring.is-hit { filter: drop-shadow(0 0 6px #ff6a58); }

#hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5;
  padding: calc(10px + env(safe-area-inset-top)) 16px 0;
  display: none; pointer-events: none;
}
#hud.on { display: block; }
.bars { display: flex; flex-direction: column; gap: 4px; max-width: 240px; }
.bar-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--ui); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--brass);
}
.track { height: 8px; background: rgba(16, 12, 8, .65); border: 1px solid rgba(228, 208, 164, .55); }
.track b { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #8a3a28, #e7c48a); }
#lantern-fill { background: linear-gradient(90deg, #6a4a20, #fff1c4); width: 0%; }
.meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px;
  font-family: var(--ui); letter-spacing: .06em; text-transform: uppercase; font-size: 16px; color: var(--paper);
  text-shadow: 0 1px 2px #000;
}
.pips { display: flex; gap: 4px; margin-top: 6px; }
.pips i { width: 18px; height: 4px; background: rgba(228, 208, 164, .25); display: block; }
.pips i.on { background: var(--brass); }
#obj {
  margin-top: 6px; max-width: 22rem;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--ui); letter-spacing: .05em; text-transform: uppercase;
  font-size: 22px; font-weight: 650; color: #fff8ea; text-shadow: 0 2px 0 #000;
}
#obj i {
  width: 12px; height: 15px; flex: none; border: 1.5px solid var(--brass); border-radius: 1px;
  box-shadow: 3px 0 0 rgba(228, 208, 164, .55);
}
#bossbar {
  position: absolute; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translateX(-50%);
  width: min(420px, 70vw); text-align: center;
}
#bossbar span {
  font-family: var(--ui); letter-spacing: .12em; font-size: 15px; text-transform: uppercase; color: var(--paper);
  text-shadow: 0 1px 2px #000;
}
#bossbar .track { margin-top: 4px; }
#boss-fill { background: linear-gradient(90deg, #3a2848, #d7c4a0); }
#prompt {
  position: absolute; left: 50%; bottom: calc(168px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 5; pointer-events: none;
  background: var(--paper); color: var(--paper-ink);
  font-family: var(--serif); font-style: italic; padding: .35rem .8rem;
  box-shadow: inset 0 0 0 1px rgba(70, 46, 22, .35);
}
#prompt:not(.is-react) {
  left: auto; right: calc(10px + env(safe-area-inset-right));
  bottom: calc(428px + env(safe-area-inset-bottom));
  transform: none; text-align: center;
  width: min(188px, calc(50vw - 18px));
  max-width: min(188px, calc(50vw - 18px));
  box-sizing: border-box;
  pointer-events: none;
}
#interact {
  position: absolute; left: auto; right: calc(10px + env(safe-area-inset-right));
  bottom: calc(348px + env(safe-area-inset-bottom));
  transform: none; z-index: 8;
  width: min(188px, calc(50vw - 18px));
  min-width: 0; min-height: 64px; max-height: 88px;
  padding: 8px 14px; box-sizing: border-box;
  display: grid; place-items: center; text-align: center;
  white-space: normal; line-height: 1.05;
  border: 2px solid #f3e6c8; border-radius: 999px; cursor: pointer;
  background: #f3e6c8; color: #24180f;
  font-family: var(--ui); font-size: 17px; letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
  pointer-events: auto; touch-action: manipulation;
}
#interact[hidden] { display: none; }
body.touch #interact {
  width: min(196px, calc(50vw - 14px));
  min-height: 72px; font-size: 18px;
}
#reticle {
  position: absolute; left: 0; top: 0; z-index: 5; width: 36px; height: 36px; margin: -18px 0 0 -18px;
  pointer-events: none;
}
#reticle::before, #reticle::after {
  content: ""; position: absolute; inset: 0; border: 1px solid var(--brass);
}
#reticle::before { clip-path: polygon(0 0, 40% 0, 40% 8%, 8% 8%, 8% 40%, 0 40%); }
#reticle::after { transform: rotate(180deg); clip-path: polygon(0 0, 40% 0, 40% 8%, 8% 8%, 8% 40%, 0 40%); }
#tag {
  position: absolute; left: 0; top: 0; z-index: 6; margin: 0;
  pointer-events: none; background: transparent; color: var(--paper);
  font-family: var(--ui); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  text-shadow: 0 1px 2px #000;
  opacity: .8;
}
#tag[hidden] { display: none; }
#subtitle {
  position: absolute; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 6; width: min(28rem, calc(100% - 28px));
  margin: 0; padding: 4px 10px; pointer-events: none; text-align: center;
  background: rgba(16, 12, 8, .42); color: var(--paper); border-radius: 8px;
  font-family: var(--serif); font-style: italic; font-size: 16px; line-height: 1.3;
  text-shadow: 0 1px 2px #000;
}
#subtitle[hidden] { display: none; }
.floater {
  position: absolute; left: 0; top: 0; z-index: 6; margin: -10px 0 0 -12px;
  pointer-events: none; font-family: var(--ui); letter-spacing: .08em; color: #fff6e4;
  text-shadow: 0 1px 2px #000; font-size: 14px;
}
.floater.coin { color: #f0d48a; }

#stick {
  display: none; position: absolute; width: 88px; height: 88px; border-radius: 50%; z-index: 6;
  border: 1px solid rgba(228, 208, 164, .4); background: rgba(16, 12, 8, .22);
  pointer-events: none;
}
#stick.on { display: block; }
#knob {
  position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255,246,228,.9), rgba(198,163,106,.75) 45%, rgba(90,58,32,.7));
}
#actions {
  display: none; position: absolute; right: calc(8px + env(safe-area-inset-right)); bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 6; width: 210px; height: 176px;
}
body.playing #actions { display: block; }
body.playing:not(.touch) #actions { pointer-events: none; }
body.playing:not(.touch) #actions button.magic { pointer-events: auto; }
body.playing:not(.touch) #actions button:not(.magic) { display: none; }
#actions button {
  position: absolute; width: 48px; height: 48px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(228, 208, 164, .55);
  background: rgba(16, 12, 8, .34); color: var(--paper);
  font-family: var(--ui); font-size: 8px; letter-spacing: .08em; text-transform: uppercase;
  opacity: .88;
}
#actions button.big {
  width: 64px; height: 64px; right: 0; bottom: 8px; font-size: 10px;
  background: rgba(243, 230, 200, .62); color: #24180f; border-color: rgba(243, 230, 200, .8);
}
#actions button.magic {
  width: 64px; height: 64px; right: 72px; bottom: 8px;
  display: grid; place-items: center; line-height: 1;
  background: rgba(36, 28, 64, .72); color: #fff6e4; border-color: rgba(255, 226, 168, .85);
}
#actions button.magic svg {
  position: absolute; inset: 3px; width: auto; height: auto; transform: rotate(-90deg);
}
#actions button.magic circle {
  fill: none; stroke: #ffe2a8; stroke-width: 3; stroke-linecap: round;
}
#actions button.magic span { position: relative; font-size: 9px; letter-spacing: .08em; }
#actions button.magic b {
  position: relative; font-size: 13px; letter-spacing: .04em; font-weight: 600;
}
#actions button.magic.is-dry { opacity: .45; }
#actions button[data-act="jump"] { right: 72px; bottom: 82px; }
#actions button[data-act="dodge"] { right: 140px; bottom: 20px; }
#actions button[data-act="guard"] { right: 8px; bottom: 82px; }
#actions button.mini { width: 36px; height: 36px; right: 142px; bottom: 78px; font-size: 8px; opacity: .8; }
#keys { display: none; }
#help {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 9;
  width: min(32rem, calc(100% - 28px)); padding: 18px 18px 16px; pointer-events: auto;
  background: rgba(16, 12, 8, .9); color: var(--paper);
  border: 1px solid rgba(228, 208, 164, .55); border-radius: 14px;
}
#help[hidden] { display: none; }
#help .set-kicker {
  font-family: var(--ui); font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass);
}
#help p:not(.set-kicker) {
  margin-top: 10px; font-family: var(--ui); font-size: 18px; line-height: 1.45; letter-spacing: .02em; color: var(--paper);
}
#help-touch { display: none; }
#help-touch p { margin-top: 8px; }
body.touch #help-touch { display: block; }
body.touch #help-keys { display: none; }
body.touch #help {
  width: min(24rem, calc(100% - 24px)); padding: 22px 20px 18px;
}
body.touch #help .set-kicker { font-size: 18px; }
body.touch #help-touch p {
  font-size: 26px; line-height: 1.22; font-weight: 600; letter-spacing: .03em;
}
body.shot #help,
body.shot #bulletin,
body.shot #subtitle,
body.shot #rotate-hint,
body.shot #tutor { display: none !important; }
body[data-world="thorne"].shot #hud,
body[data-world="thorne"].shot #cmd,
body[data-world="thorne"].shot #abilities,
body[data-world="thorne"].shot #stick,
body[data-world="thorne"].shot #actions,
body[data-world="thorne"].shot #party,
body[data-world="thorne"].shot #gauges,
body[data-world="thorne"].shot #prompt,
body[data-world="thorne"].shot #interact,
body[data-world="thorne"].shot #settings-btn { display: none !important; }
body[data-world="thorne"] #bulletin-line,
body[data-world="thorne"] #subtitle {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
}
body[data-world="thorne"] #tag { font-size: 18px; }
body[data-world="thorne"].playing #obj { font-size: 26px; }
body[data-world="thorne"] .story-card h1 { font-size: clamp(2rem, 7vw, 3.2rem); }
body[data-world="thorne"] .story-card .paper { font-size: 1.35rem; line-height: 1.35; }
body[data-world="thorne"] .story-card button { min-height: 64px; font-size: 1.2rem; }
body[data-world="thorne"] .story-card .kicker { font-size: .95rem; }
body[data-world="thorne"] #bossbar span { font-size: 22px; }
body.flyby #hud,
body.flyby #cmd,
body.flyby #party,
body.flyby #gauges,
body.flyby #actions,
body.flyby #stick,
body.flyby #settings,
body.flyby #settings-btn,
body.flyby #bossbar,
body.flyby #reticle,
body.flyby #interact,
body.flyby #abilities,
body.flyby #floats { display: none !important; }
#abilities {
  display: none;
  position: absolute;
  right: calc(8px + env(safe-area-inset-right));
  bottom: calc(156px + env(safe-area-inset-bottom));
  z-index: 7;
  width: 72px;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
body.playing:not(.touch) #abilities { bottom: calc(86px + env(safe-area-inset-bottom)); }
body.playing #abilities:not([hidden]) { display: flex; }
body.touch.playing #abilities {
  width: 108px;
  bottom: calc(188px + env(safe-area-inset-bottom));
}
#abilities button {
  position: relative;
  width: 72px;
  height: 72px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(228, 208, 164, .75);
  background: rgba(16, 12, 8, .55);
  color: #f6edd8;
  font-family: var(--ui);
  letter-spacing: .04em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1;
  pointer-events: auto;
}
body.touch #abilities button { width: 88px; height: 88px; }
#abilities button svg {
  position: absolute; inset: 3px; width: auto; height: auto; transform: rotate(-90deg);
}
#abilities button circle {
  fill: none; stroke: #ffe2a8; stroke-width: 2.4; stroke-linecap: round;
}
#abilities button span { position: relative; font-size: 12px; font-weight: 650; max-width: 64px; text-align: center; line-height: 1.05; }
#abilities button[data-ability="firelight"] span,
#abilities button[data-ability="steam"] span { font-size: 11px; letter-spacing: 0; }
body.touch #abilities button span { font-size: 14px; max-width: 76px; }
body.touch #abilities button[data-ability="firelight"] span,
body.touch #abilities button[data-ability="steam"] span { font-size: 12px; }
#abilities button b {
  display: block;
  position: relative;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: #ffe2a8;
}
body.touch #abilities button b { font-size: 15px; }
#abilities button.is-dry { opacity: .45; }
#abilities.is-wheel { width: 108px; }
#abilities.is-wheel button.cast { width: 96px; height: 96px; }
body.touch #abilities.is-wheel button.cast { width: 104px; height: 104px; }
#abilities button.next {
  width: 96px;
  height: 48px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: .14em;
}
body.touch #abilities button.next { width: 104px; height: 56px; font-size: 18px; }
#letterbox { display: none; pointer-events: none; }
body.flyby #letterbox { display: block; }
#letterbox span {
  position: fixed; left: 0; right: 0; height: 12vh; background: #000; z-index: 20; pointer-events: none;
}
#letterbox span:first-child { top: 0; }
#letterbox span:last-child { bottom: 0; }
body.flyby #prompt { bottom: calc(12vh + 18px); z-index: 31; }
#help button, #settings #help-reopen {
  display: block; width: 100%; margin-top: 14px; min-height: 48px; cursor: pointer; border-radius: 10px;
  border: 1px solid rgba(228, 208, 164, .55); background: rgba(243, 230, 200, .82); color: #24180f;
  font-family: var(--ui); font-size: 18px; letter-spacing: .08em; text-transform: uppercase;
}
#rotate-hint {
  position: relative; z-index: 7; width: fit-content; max-width: 100%; pointer-events: auto;
  margin: 8px 0 0; padding: 6px 8px 6px 12px;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--ui); font-size: 16px; letter-spacing: .06em; text-transform: uppercase; color: var(--paper);
  background: rgba(16, 12, 8, .45); border: 1px solid rgba(228, 208, 164, .4); border-radius: 999px;
}
#rotate-hint[hidden] { display: none; }
#rotate-dismiss {
  min-height: 36px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(228, 208, 164, .55); background: rgba(243, 230, 200, .75); color: #24180f;
  font-family: var(--ui); font-size: 16px; letter-spacing: .06em; text-transform: uppercase;
}

.story {
  position: absolute; inset: 0; z-index: 8; display: grid; place-items: center;
  padding: 16px; background: radial-gradient(ellipse at center, rgba(8, 6, 4, .12), rgba(8, 6, 4, .55) 72%);
}
.story[hidden] { display: none; }
.story-card {
  position: relative; width: min(42rem, 100%); max-height: min(92dvh, 46rem); overflow: hidden;
  display: flex; flex-direction: column;
  text-align: center; padding: 1.4rem 1.2rem 1.15rem; background: #100e0c;
  border: 1px solid rgba(228, 208, 164, .45);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.story-card::before {
  content: ""; position: absolute; left: 50%; top: 0; width: 160%; height: 14rem;
  transform: translateX(-50%); pointer-events: none;
  background: repeating-conic-gradient(rgba(243, 230, 206, .2) 0deg 1.2deg, rgba(243, 230, 206, 0) 1.2deg 8deg);
  -webkit-mask-image: linear-gradient(#000, transparent 80%);
  mask-image: linear-gradient(#000, transparent 80%);
}
.story-card::after {
  content: ""; position: absolute; inset: 10px; pointer-events: none;
  border: 1px solid rgba(228, 208, 164, .28);
}
.story-card > * { position: relative; z-index: 1; }
.story-card .script { font-family: var(--script); font-size: clamp(1.8rem, 4vw, 2.5rem); color: #f7f0e4; }
.story-card .kicker {
  margin-top: .2rem; font-family: var(--ui); letter-spacing: .28em; text-transform: uppercase;
  font-size: .72rem; color: var(--brass);
}
.story-card h1 {
  margin: .35rem 0 .15rem; font-family: var(--ui); font-weight: 400; text-transform: uppercase;
  letter-spacing: .08em; font-size: clamp(1.7rem, 5vw, 3rem); color: #fbf6ee;
}
.story-card h1::after {
  content: ""; display: block; width: min(12rem, 60%); height: 1px; margin: .7rem auto 0;
  background: linear-gradient(90deg, transparent, rgba(244, 236, 223, .85), transparent);
}
.story-card .paper {
  margin: .9rem auto 0; max-width: 36rem; text-align: left;
  background: var(--paper); color: var(--paper-ink); padding: .9rem 1rem;
  font-style: italic; font-size: 1.12rem; line-height: 1.4;
  overflow: auto; min-height: 0; max-height: 32vh;
}
.story-card .card-result {
  margin: .7rem auto 0; width: fit-content; max-width: 100%;
  padding: .55rem .9rem;
  background: #24180f; color: #fff8ea;
  border: 2px solid #f3e6c8;
  font-family: var(--ui); font-style: normal; font-weight: 650;
  font-size: 1.35rem; letter-spacing: .04em; text-transform: uppercase;
}
.story-card .card-result[hidden] { display: none; }
.story-card button {
  margin-top: 1rem; min-height: 56px; padding: .75rem 1.4rem; cursor: pointer;
  background: #f3e6c8; color: #24180f; border: 1px solid #f3e6c8;
  font-family: var(--ui); letter-spacing: .12em; text-transform: uppercase; font-size: 1.05rem;
}
.story-card .hint {
  margin-top: .75rem; color: var(--muted); font-family: var(--ui);
  font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
}
#boot {
  position: absolute; inset: 0; z-index: 9; display: grid; place-items: center;
  background: #100e0c; color: var(--brass); font-family: var(--ui); letter-spacing: .22em;
  text-transform: uppercase; transition: opacity .4s ease;
}
#boot.gone { opacity: 0; pointer-events: none; }

#bulletin {
  position: absolute; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 12; width: min(28rem, calc(100% - 28px));
  padding: 4px 10px; pointer-events: none; text-align: center;
  background: rgba(16, 12, 8, .42); color: var(--paper); border-radius: 8px;
  box-shadow: none;
}
body:has(#card:not([hidden])) #bulletin,
body:has(#hub:not([hidden])) #bulletin {
  bottom: auto; top: calc(12px + env(safe-area-inset-top));
}
#bulletin[hidden] { display: none; }
#bulletin-kicker { display: none; }
#bulletin-line {
  margin: 0; min-height: 0;
  font-family: var(--serif); font-style: italic;
  font-size: 16px; line-height: 1.3; text-shadow: 0 1px 2px #000;
}
#bulletin-line::after { display: none; }
body.touch.playing #bulletin,
body.touch.playing #subtitle { bottom: calc(168px + env(safe-area-inset-bottom)); }
@keyframes bw-blink { 50% { opacity: 0; } }
@media (max-width: 640px) {
  .story { padding: 10px; }
  .story-card { padding: .85rem .7rem .75rem; }
  .story-card .script { font-size: 1.55rem; }
  .story-card h1 { font-size: 1.55rem; }
  .story-card .paper { font-size: 1rem; max-height: 28vh; padding: .7rem .75rem; }
  .story-card button { margin-top: .7rem; }
  #obj { font-size: 20px; }
  .story-card.is-spoken .paper { display: none; }
}

#hub {
  position: absolute; inset: 0; z-index: 7;
  display: flex; justify-content: center; align-items: stretch;
  padding: 8px 10px 10px; overflow: hidden;
  background: #0c0a08;
}
#hub[hidden] { display: none; }
#hub .bw-parlor {
  position: absolute; inset: 0; pointer-events: none;
  background-color: #100e0c;
  background-image:
    radial-gradient(1.1px 1.1px at 12% 16%, rgba(255,244,220,.45), transparent),
    radial-gradient(1px 1px at 78% 10%, rgba(255,244,220,.35), transparent),
    radial-gradient(1.3px 1.3px at 64% 22%, rgba(255,244,220,.4), transparent),
    radial-gradient(ellipse at 50% 0%, rgba(90, 62, 36, .35), transparent 55%),
    repeating-linear-gradient(90deg, rgba(255, 220, 170, .035) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, #1a140f, #0c0a08 46%, #14110d);
}
#hub .bw-set {
  position: relative; z-index: 1; width: min(880px, 100%); height: 100%;
  display: flex; flex-direction: column; min-height: 0;
}
#hub .bw-antenna { position: relative; height: 1rem; flex: none; }
#hub .mast {
  position: absolute; left: 50%; bottom: 0; width: 3px; height: 1rem;
  background: linear-gradient(#d9d2c6, #6a645c); transform: translateX(-50%);
}
#hub .rod {
  position: absolute; bottom: .1rem; width: 2px; height: 1.45rem; border-radius: 1px;
  background: linear-gradient(#f0ebe3, #8a847c); transform-origin: bottom center;
}
#hub .rod-l { left: calc(50% - 1px); transform: rotate(-32deg); }
#hub .rod-r { left: calc(50% - 1px); transform: rotate(32deg); }
#hub .bw-cabinet {
  position: relative; flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: .55rem .6rem .7rem; border-radius: 1.05rem 1.05rem 1.25rem 1.25rem;
  background-color: #5a341c;
  background-image:
    linear-gradient(180deg, rgba(255, 226, 180, .16), transparent 22%),
    repeating-linear-gradient(88deg, rgba(255, 214, 160, .06) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(92deg, rgba(28, 10, 4, .22) 0 2px, transparent 3px 8px),
    radial-gradient(ellipse at 18% 0%, rgba(255, 196, 130, .22), transparent 46%),
    radial-gradient(ellipse at 90% 110%, rgba(0, 0, 0, .38), transparent 52%),
    linear-gradient(168deg, #8b5a32 0%, #6b3e20 42%, #4a2b16 78%, #2c1a0e 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 224, 176, .32),
    inset 0 0 0 6px rgba(36, 18, 8, .62),
    inset 0 0 0 7px rgba(201, 163, 96, .34),
    0 26px 48px -22px #000;
  transform-origin: 50% 40%;
  transition: transform .92s cubic-bezier(.45, 0, .2, 1);
}
#hub.pull .bw-cabinet { transform: scale(2.65) translateY(-4%); }
#hub.settle .bw-cabinet { animation: bw-shrink .9s cubic-bezier(.2, .7, .2, 1) forwards; }
#hub .bw-plaque {
  display: flex; align-items: center; justify-content: center; gap: .7rem; flex: none;
  color: #f0ddb4; font-family: var(--ui); letter-spacing: .28em; text-transform: uppercase; font-size: .66rem;
}
#hub .bw-plaque b { font-weight: 400; letter-spacing: .2em; font-size: 1rem; }
#hub .bw-plaque span { width: 2.2rem; height: 1px; background: rgba(240, 221, 180, .7); }
#hub .bw-show {
  flex: none; text-align: center; margin: .05rem 0 .35rem;
  font-family: var(--script); font-size: clamp(1.35rem, 3vw, 1.8rem); color: #f7f0e4;
}
#hub .bw-main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .45rem; }
#hub .bw-bezel {
  flex: 1; min-height: 0; display: flex;
  padding: .38rem; border-radius: .9rem;
  background: linear-gradient(165deg, #efe8dc 0%, #b7aea2 7%, #5c564e 16%, #2a261f 48%, #8d867c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 0 2px #161310, 0 10px 16px rgba(0, 0, 0, .28);
}
#hub .bw-glass {
  position: relative; flex: 1; min-height: 0; display: flex;
  border-radius: .65rem; background: #110e0b; overflow: hidden;
  box-shadow: inset 0 0 70px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .05);
}
#hub .bw-screen { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#hub .bw-pic { position: absolute; inset: 0; }
#hub .bw-pic svg { width: 100%; height: 100%; display: block; }
#hub .bw-pic.is-painted { background: #140e0c; }
#hub .bw-wash {
  position: absolute; inset: -14%; z-index: 0; overflow: hidden; pointer-events: none;
}
#hub .bw-wash img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: blur(26px) brightness(.32) saturate(.8);
  transform: scale(1.12);
}
#hub .bw-pic.is-painted::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 38%; z-index: 1;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(8, 6, 4, .72) 46%, rgba(8, 6, 4, .92));
}
#hub .bw-frame {
  position: absolute; left: 0; right: 0; top: 7%; bottom: 11.4rem; z-index: 2;
  display: flex; align-items: flex-start; justify-content: center; pointer-events: none;
}
#hub .bw-frame img {
  width: 100%; height: auto; max-height: 100%; object-fit: contain; object-position: center top;
  display: block;
}
#hub .bw-snow, #roll .bw-snow {
  position: absolute; inset: -30%; pointer-events: none; opacity: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: bw-snow .12s steps(2) infinite;
}
#hub .bw-bars, #roll .bw-bars {
  position: absolute; inset: -20% 0; pointer-events: none; opacity: 0;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.62) 0 8px, rgba(243,230,200,.16) 8px 11px, transparent 11px 18px);
  animation: bw-roll .22s linear infinite;
}
#screen.is-static .bw-snow, #screen.is-tuning .bw-snow { opacity: .82; }
#screen.is-static .bw-bars, #screen.is-tuning .bw-bars { opacity: .9; }
#screen.is-static .bw-pic { filter: grayscale(.35) contrast(1.15) brightness(.55); }
#screen.is-tuning .bw-pic { animation: bw-hold .14s linear infinite; }
#hub .bw-soon {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 2;
  margin: 0; font-family: var(--ui); letter-spacing: .28em; text-transform: uppercase;
  font-size: clamp(.95rem, 2.6vw, 1.45rem); color: #f3e6c8; text-shadow: 0 2px 10px #000;
}
#hub .bw-soon[hidden] { display: none; }
#hub .bw-caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: .55rem .7rem .6rem;
  background: linear-gradient(transparent, rgba(8, 6, 4, .82) 42%);
  text-align: center;
}
#hub .bw-freq {
  font-family: var(--ui); letter-spacing: .22em; font-size: .68rem; color: var(--brass);
}
#hub .bw-script { font-family: var(--script); font-size: clamp(1.2rem, 2.4vw, 1.7rem); color: #f7f0e4; }
#hub .bw-caption h2 {
  font-family: var(--ui); font-weight: 400; letter-spacing: .08em; text-transform: uppercase;
  font-size: clamp(1rem, 2.5vw, 1.55rem); color: #fbf6ee;
}
#hub .bw-sub { font-style: italic; color: var(--paper); font-size: .95rem; }
#hub .bw-note {
  margin: .2rem 0 0; font-family: var(--ui); font-size: 15px; letter-spacing: .04em;
  color: var(--paper); text-shadow: 0 1px 2px #000;
}
#hub .bw-note[hidden] { display: none; }
#hub .bw-badge {
  display: inline-block; margin-top: .25rem; padding: .12rem .45rem;
  border: 1px solid var(--brass); color: var(--brass);
  font-family: var(--ui); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase;
}
#hub .bw-badge[hidden] { display: none; }
#hub .bw-tube { position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit; overflow: hidden; }
#hub .scan {
  position: absolute; inset: 0; opacity: .22;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .28) 0 1px, transparent 1px 4px);
}
#hub .flicker { position: absolute; inset: 0; background: rgba(255, 244, 220, .05); animation: bw-tube 6.8s infinite; }
#hub .grain {
  position: absolute; inset: -20%; opacity: .16; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#hub .sheen {
  position: absolute; left: 6%; top: 0; width: 38%; height: 22%; border-radius: 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), transparent);
  transform: rotate(-8deg);
}
#hub .bw-dial {
  flex: none; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
#ability-board {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 2px 2px 0;
}
#ability-board .ab-kicker {
  margin: 0;
  font-family: var(--ui);
  letter-spacing: .2em;
  text-transform: uppercase;
  font-size: 15px;
  color: #f7f0e4;
}
#ability-board .ab-need {
  margin: 0;
  font-family: var(--ui);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
  color: #e4c56a;
}
#ability-board ol {
  list-style: none;
  display: flex;
  gap: 4px;
  width: 100%;
  margin: 2px 0 0;
  padding: 0;
  justify-content: space-between;
}
#ability-board li {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
#ability-board i {
  position: relative;
  width: 34px;
  height: 42px;
}
#ability-board i::before,
#ability-board i::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #1a120c;
  box-shadow: 0 0 0 1px rgba(240, 221, 180, .28);
}
#ability-board i::before {
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}
#ability-board i::after {
  top: 15px;
  width: 26px;
  height: 24px;
  border-radius: 12px 12px 5px 5px;
}
#ability-board li.is-earned i::before,
#ability-board li.is-earned i::after {
  background: #f3e6c8;
  box-shadow: 0 0 10px rgba(243, 230, 200, .75);
}
#ability-board b {
  min-height: 2.15em;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.05;
  color: #f7f0e4;
}
#ability-board li.is-locked b { color: transparent; }
#ability-board span {
  min-height: 1em;
  font-family: var(--ui);
  font-size: 13px;
  letter-spacing: .08em;
  color: #e4c56a;
}
@media (max-width: 640px) {
  #ability-board .ab-kicker { font-size: 16px; }
  #ability-board .ab-need { font-size: 13px; }
  #ability-board i { width: 36px; height: 46px; }
  #ability-board b { font-size: 12px; }
}
#hub .bw-cluster { display: flex; align-items: center; justify-content: center; gap: 8px; }
#tune-in { width: min(100%, 28rem); }
#dial-prev, #dial-next, #tune-in {
  min-width: 44px; min-height: 44px; padding: 0 .7rem; cursor: pointer;
  border: 1px solid rgba(240, 221, 180, .55); background: rgba(36, 18, 8, .35); color: #f0ddb4;
  font-family: var(--ui); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
}
#tune-in { background: #f3e6c8; color: #24180f; border-color: #f3e6c8; }
#tune-in:disabled { background: rgba(36, 18, 8, .35); color: rgba(240, 221, 180, .55); border-color: rgba(240, 221, 180, .28); cursor: default; }
#dial-knob {
  position: relative;
  width: 64px; height: 64px; min-width: 44px; min-height: 44px; padding: 0; border: 0; cursor: pointer; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff6e6 0 8%, #e7d0a4 22%, #a67c48 48%, #5a3a20 74%, #24160c 100%);
  box-shadow: 0 1px 0 rgba(255, 236, 200, .45), 0 3px 4px rgba(0, 0, 0, .55), inset 0 -3px 4px rgba(0, 0, 0, .4);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
#dial-knob::before {
  content: ""; position: absolute; left: 50%; top: 14%; width: 3px; height: 26%; border-radius: 1px;
  background: #1a1008; transform: translateX(-50%);
}
#hub .bw-read {
  margin: 0; font-family: var(--ui); letter-spacing: .16em; text-transform: uppercase;
  font-size: .68rem; color: #f0ddb4;
}
#hub .bw-side { flex: none; display: flex; align-items: center; gap: .65rem; }
#hub .lamp {
  width: .5rem; height: .5rem; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 35%, #ffe7b0, #e07020 55%, #6a2408);
  box-shadow: 0 0 6px rgba(255, 140, 40, .9);
}
#hub .knob-deco {
  position: relative; width: 1.7rem; height: 1.7rem; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 32% 28%, #fff6e6 0 8%, #e7d0a4 22%, #a67c48 48%, #5a3a20 74%, #24160c 100%);
  box-shadow: 0 1px 0 rgba(255, 236, 200, .45), 0 3px 4px rgba(0, 0, 0, .55);
}
#hub .knob-deco::before {
  content: ""; position: absolute; left: 50%; top: 14%; width: 2px; height: 28%; border-radius: 1px;
  background: #1a1008; transform: translateX(-50%) rotate(-18deg); transform-origin: 50% 160%;
}
#hub .speaker {
  display: block; flex: 1; height: 1.55rem; border-radius: .35rem;
  background-color: #3a2718;
  background-image: radial-gradient(circle, #120c08 1.05px, transparent 1.25px);
  background-size: 5px 5px;
  box-shadow: inset 0 0 0 2px rgba(16, 8, 4, .75), inset 0 0 0 3px rgba(201, 163, 96, .32);
}
#roll {
  position: absolute; inset: 0; z-index: 11; pointer-events: none; background: #100e0c; opacity: 0;
}
#roll[hidden] { display: none; }
#roll .bw-snow, #roll .bw-bars { opacity: .9; }
#roll.hold { opacity: 1; }
#roll.in { animation: bw-suck .95s linear forwards; }
#roll.out { animation: bw-unsuck .95s linear forwards; }
.blank-shade {
  position: absolute; inset: 0; z-index: 11; pointer-events: none;
  display: grid; place-items: end center;
  background: radial-gradient(ellipse at 50% 42%, rgba(180, 180, 180, .18), rgba(8, 8, 8, .55) 70%);
}
.blank-shade[hidden] { display: none; }
.blank-shade svg { width: min(78vh, 440px); height: 94%; }
.blank-shade.is-on { animation: blank-glimpse 1.05s ease forwards; }
.blank-face {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  display: grid; place-items: center;
  background: rgba(10, 10, 10, .45);
}
.blank-face[hidden] { display: none; }
.blank-face svg { width: 78%; height: 78%; }
.blank-face.is-on { animation: blank-flicker 5.2s linear forwards; }
.blank-voice {
  position: absolute; left: 6%; right: 6%; bottom: 38%;
  margin: 0; text-align: center; color: #ececec;
  font-family: var(--ui); letter-spacing: .12em; text-transform: uppercase;
  font-size: clamp(.62rem, 1.5vw, .88rem);
  text-shadow: 0 0 10px #000, 0 1px 0 #000;
}
@keyframes bw-snow { 50% { transform: translate(3%, -2%); } }
@keyframes bw-roll { to { transform: translateY(18px); } }
@keyframes bw-hold { 50% { transform: translateY(5%); } }
@keyframes bw-tube { 0%, 92%, 100% { opacity: .25; } 94% { opacity: .7; } 96% { opacity: .2; } }
@keyframes bw-suck { 0% { opacity: 0; } 35% { opacity: .28; } 100% { opacity: 1; } }
@keyframes bw-unsuck { 0% { opacity: 1; } 55% { opacity: .35; } 100% { opacity: 0; } }
@keyframes bw-shrink { from { transform: scale(2.55) translateY(-6%); } to { transform: none; } }
@keyframes blank-glimpse { 0% { opacity: 0; } 30% { opacity: 1; } 68% { opacity: .8; } 100% { opacity: 0; } }
@keyframes blank-flicker {
  0% { opacity: 0; } 8% { opacity: .95; } 16% { opacity: .12; } 28% { opacity: .88; }
  46% { opacity: .2; } 62% { opacity: .8; } 84% { opacity: .35; } 100% { opacity: 0; }
}
@media (max-width: 640px) {
  #hub { padding: 6px 8px 8px; }
  #hub .bw-show { font-size: 1.25rem; margin-bottom: .2rem; }
  #hub .bw-sub { font-size: .85rem; }
  #hub .bw-dial { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  #hub .bw-cabinet, #dial-knob, #hub .flicker, #hub .bw-snow, #hub .bw-bars, #roll .bw-snow, #roll .bw-bars, #screen.is-tuning .bw-pic {
    animation: none; transition: none;
  }
}

#hud .bars .bar-label, #hud .bars .track { display: none; }
#keys { display: none; }

#party, #cmd, #gauges { display: none; }
body.playing #party, body.playing #cmd, body.playing #gauges { display: block; }

#party {
  position: absolute; top: calc(8px + env(safe-area-inset-top)); right: 10px; z-index: 6;
  width: min(200px, 46vw); pointer-events: none;
}
#party p { display: grid; grid-template-columns: 6.2rem 1fr; gap: 6px; align-items: center; margin-top: 4px; }
#party p[hidden] { display: none; }
#party span {
  font-family: var(--ui); font-size: 16px; letter-spacing: .04em; text-transform: uppercase; color: var(--paper);
  text-shadow: 0 1px 2px #000; white-space: nowrap;
}
#party i { display: block; height: 8px; background: rgba(16, 12, 8, .45); border: 1px solid rgba(228, 208, 164, .4); }
#party b { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #6a4328, #e7c48a); }
#party .team b { background: linear-gradient(90deg, #8a3a28, #f3e6c8); }

#cmd {
  position: absolute; left: calc(8px + env(safe-area-inset-left)); bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 6;
  width: min(16rem, 46vw); padding: .15rem; pointer-events: auto;
  background: rgba(243, 230, 200, .42); color: #24180f;
  border: 1px solid rgba(70, 46, 22, .28);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .16);
}
#cmd.is-collapsed { width: auto; background: rgba(16, 12, 8, .32); color: var(--paper); border-color: rgba(228, 208, 164, .4); }
#cmd .cmd-tab, #cmd button {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%;
  min-height: 48px; margin: 0; padding: .2rem .7rem; cursor: pointer; text-align: left;
  background: transparent; color: inherit; border: 0;
  font-family: var(--ui); font-style: normal; font-size: 16px; line-height: 1.15; letter-spacing: .04em;
}
#cmd .cmd-tab { font-family: var(--ui); font-style: normal; font-size: 16px; letter-spacing: .12em; text-transform: uppercase; }
#cmd button small { font-family: var(--ui); font-style: normal; font-size: 14px; letter-spacing: .06em; color: #6a4320; }
#cmd button.is-on { background: rgba(36, 24, 15, .78); color: #f3e6c8; }
#cmd button.is-on small { color: #e7c48a; }
#cmd button:disabled { opacity: .4; }
#cmd.is-collapsed .cmd-tab { color: var(--paper); min-height: 48px; min-width: 48px; }
#prompt.is-react {
  animation: bw-blink 0.7s steps(1) infinite;
  letter-spacing: .04em;
}
#tutor {
  position: absolute; left: 50%; top: var(--hud-clear, 168px);
  transform: translateX(-50%); z-index: 6; width: min(18rem, 72vw);
  padding: .35rem .7rem .45rem; pointer-events: none; text-align: center;
  background: rgba(16, 12, 8, .34); color: var(--paper);
  border: 1px solid rgba(228, 208, 164, .35); border-radius: 12px;
}
#tutor[hidden] { display: none; }
#tutor-kicker, #tutor-text { display: none; }
#tutor-hint {
  font-family: var(--ui); font-size: 16px; letter-spacing: .08em; text-transform: uppercase; color: var(--paper);
  text-shadow: 0 1px 2px #000;
}
#tutor-actions { display: flex; justify-content: center; gap: 8px; margin-top: 6px; }
#tutor-actions button {
  pointer-events: auto; min-height: 44px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(228, 208, 164, .55); background: rgba(243, 230, 200, .72); color: #24180f;
  font-family: var(--ui); font-size: 14px; letter-spacing: .1em; text-transform: uppercase;
}
#tutor-actions #tutor-skip { background: transparent; color: var(--paper); }
body.touch.tutor-lock #actions button[data-act="lock"] {
  display: block; left: -4px; top: -6px;
}

#gauges {
  position: absolute; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 6;
  width: 112px; height: 112px; pointer-events: none; opacity: .9;
}
#gauges svg { width: 100%; height: 100%; overflow: visible; }
#gauges .ring { fill: none; stroke-width: 8; stroke-linecap: round; }
#gauges .track { stroke: rgba(20, 14, 10, .55); }
#gauges .hp, #gauges .mp { transform-box: fill-box; transform-origin: center; transform: rotate(-90deg); }
#gauges .hp { stroke: #8eae6a; }
#gauges .mp { stroke: #7aa0c4; }
#g-hp, #g-mp, #g-lv {
  position: absolute; font-family: var(--ui); letter-spacing: .08em; color: #f6edd8;
  text-shadow: 0 1px 2px #000;
}
#g-hp { left: 22px; top: 52px; font-size: 16px; }
#g-mp { left: 62px; top: 42px; font-size: 15px; }
#g-lv { left: 22px; top: 82px; font-size: 15px; letter-spacing: .08em; }

body.touch.playing #cmd { width: auto; }
body.touch.playing #cmd:not(.is-collapsed) { width: min(15rem, 62vw); }
body.touch.playing #cmd button,
body.touch.playing #cmd .cmd-tab { min-height: 48px; font-size: 16px; }
body.playing #g-lv-mini { display: none; }
body.playing #gauges {
  top: calc(6px + env(safe-area-inset-top));
  left: calc(4px + env(safe-area-inset-left));
  right: auto; bottom: auto;
  width: 112px; height: 112px;
  transform: none;
}
body.playing #party {
  top: calc(8px + env(safe-area-inset-top));
  left: calc(122px + env(safe-area-inset-left));
  right: calc(108px + env(safe-area-inset-right));
  width: auto;
}
body.playing #hud.on {
  padding: calc(124px + env(safe-area-inset-top)) 12px 0 12px;
}
body.playing .bars { margin-left: 0; max-width: none; }
body.playing .meta {
  flex-wrap: nowrap; gap: 10px;
  font-size: 16px; letter-spacing: .03em;
  white-space: nowrap;
}
body.playing #obj {
  max-width: none; margin-top: 8px; width: fit-content;
  font-size: 22px;
  padding: 8px 12px;
  background: rgba(8, 10, 16, .78);
  border: 2px solid rgba(243, 230, 200, .9);
  box-shadow: 0 2px 0 #000;
}
body.playing #bossbar {
  position: static;
  left: auto;
  top: auto;
  bottom: auto;
  transform: none;
  width: min(440px, 100%);
  margin: 8px 0 0;
  text-align: left;
}
body.playing #bossbar span { font-size: 20px; font-weight: 650; }
body.touch .meta { font-size: 16px; letter-spacing: .03em; }
@media (max-height: 520px) {
  body.playing #gauges { width: 96px; height: 96px; }
  body.playing #g-hp { font-size: 16px; top: 44px; left: 16px; }
  body.playing #g-mp { font-size: 15px; top: 34px; left: 52px; }
  body.playing #g-lv { font-size: 15px; top: 68px; left: 16px; }
  body.playing #party {
    display: flex; flex-wrap: wrap; gap: 2px 14px;
    left: calc(108px + env(safe-area-inset-left));
  }
  body.playing #party p { margin-top: 0; min-width: 9.2rem; }
  body.playing #hud.on {
    padding: calc(8px + env(safe-area-inset-top)) 12px 0 calc(112px + env(safe-area-inset-left));
  }
  body.playing .bars { padding-top: 34px; }
}
body.touch #actions button { font-size: 13px; font-weight: 650; }
body.touch #actions button.big { font-size: 15px; }
body.touch #actions button[data-act="lock"],
body.touch #actions button[data-act="flash"],
body.touch #actions button[data-act="potion"],
body.touch #actions button[data-act="use"] { display: none; }
#keys { display: none; }
body.portrait #rotate-hint:not([hidden]) { display: flex; }
.story-card.is-spoken .paper { display: none; }
#card[data-card="award"] { z-index: 14; }
#card[data-card="award"] .story-card h1 {
  font-size: clamp(2.8rem, 12vw, 4.6rem);
  letter-spacing: .06em;
}
#card[data-card="award"] .story-card .script { font-size: clamp(2rem, 6vw, 2.8rem); }
#card[data-card="award"] .story-card .kicker { font-size: 1rem; letter-spacing: .18em; }
#card[data-card="award"] .paper {
  font-size: clamp(1.45rem, 5.4vw, 2rem);
  line-height: 1.3;
  text-align: center;
  max-height: none;
}
#card[data-card="award"] .card-result { font-size: clamp(1.5rem, 6vw, 2.1rem); }
#card[data-card="award"] .story-card button { min-height: 72px; font-size: 1.35rem; }
body.is-award #subtitle {
  z-index: 15;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
}

#settings-btn {
  position: absolute; right: calc(58px + env(safe-area-inset-right));
  top: calc(6px + env(safe-area-inset-top)); z-index: 7;
  width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(16, 12, 8, .45); color: var(--paper);
  border: 1px solid rgba(228, 208, 164, .45); border-radius: 50%;
}
#settings-btn svg { display: block; }
#settings-btn[hidden] { display: none; }
#settings {
  position: absolute; right: calc(58px + env(safe-area-inset-right));
  top: calc(52px + env(safe-area-inset-top)); z-index: 8;
  width: min(240px, 78vw); padding: 10px 10px 12px;
  background: rgba(16, 12, 8, .5); color: var(--paper);
  border: 1px solid rgba(228, 208, 164, .4); border-radius: 12px;
}
#settings[hidden] { display: none; }
#settings .set-kicker {
  font-family: var(--ui); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass);
}
#settings .seg { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: 8px; }
#settings .seg button {
  min-height: 48px; cursor: pointer; border-radius: 8px;
  border: 1px solid rgba(228, 208, 164, .45); background: rgba(243, 230, 200, .16); color: var(--paper);
  font-family: var(--ui); font-size: 15px; letter-spacing: .06em; text-transform: uppercase;
}
#settings .seg button.is-on { background: rgba(243, 230, 200, .78); color: #24180f; }
#settings .set-sub {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
  min-height: 48px; font-family: var(--ui); font-size: 16px; letter-spacing: .08em; text-transform: uppercase;
}
#settings .set-sub input { width: 22px; height: 22px; }

#home-pin {
  position: absolute; right: calc(8px + env(safe-area-inset-right));
  top: calc(6px + env(safe-area-inset-top)); z-index: 11;
  width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(16, 12, 8, .78); color: var(--paper);
  border: 1px solid rgba(228, 208, 164, .7); border-radius: 50%;
  touch-action: manipulation;
}
#home-pin svg { display: block; }
#leave {
  position: absolute; inset: 0; z-index: 20; display: grid; place-items: center;
  padding: 20px; background: rgba(8, 6, 4, .78);
}
#leave[hidden] { display: none; }
.leave-card {
  width: min(22rem, 100%); padding: 28px 22px 22px; text-align: center;
  background: #100e0c; border: 1px solid rgba(228, 208, 164, .55); border-radius: 16px;
}
#leave-q {
  margin: 0 0 18px; font-family: var(--ui); font-size: 32px; letter-spacing: .04em; color: var(--paper);
}
.leave-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#leave button {
  min-height: 72px; cursor: pointer; border-radius: 12px; touch-action: manipulation;
  font-family: var(--ui); font-size: 28px; letter-spacing: .12em; text-transform: uppercase;
}
#leave-yes { background: #f3e6c8; color: #24180f; border: 2px solid #f3e6c8; }
#leave-no { background: transparent; color: var(--paper); border: 2px solid rgba(228, 208, 164, .7); }
