:root {
  --bronze: #c8873a; --bronze-hi: #f0c27a; --bronze-dk: #6a4220;
  --marble: #efe6d6; --marble-dim: #cfc4b0; --glaze: #120c09; --terra: #c8703e;
  --ink: #1a120c; --blood: #b0402a; --wrath: #3f8fb8; --cunning: #d8b860;
  --danger: #d8502e; --safe: #8ab878;
  --serif: 'Cormorant Garamond', Georgia, serif; --title: 'Cinzel', 'Trajan Pro', serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--marble); font-family: var(--serif); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-kerning: normal; font-variant-ligatures: common-ligatures; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 2; user-select: none; }
#ui button, #ui input, #ui select { pointer-events: auto; }
.hidden { display: none !important; }

/* ---------- boot ---------- */
#boot { position: fixed; inset: 0; z-index: 10; background: radial-gradient(ellipse at 50% 60%, #2a1a10, #000 70%); display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity 1.2s; }
#boot.gone { opacity: 0; pointer-events: none; }
.boot-title { font-family: var(--title); font-weight: 800; font-size: clamp(48px, 9vw, 120px); letter-spacing: 0.25em; color: var(--bronze-hi); text-shadow: 0 0 40px rgba(240, 160, 80, 0.35); padding-left: 0.25em; }
.boot-meander, .meander, .logo-rule, .cc-rule { height: 14px; width: min(520px, 70vw); margin: 10px auto; opacity: 0.9;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M0 13 H24 V1 H4 V9 H16 V5 H10' fill='none' stroke='%23c8873a' stroke-width='1.6'/%3E%3C/svg%3E") repeat-x center; }
.boot-status { margin-top: 18px; font-style: italic; color: var(--marble-dim); font-size: 18px; letter-spacing: 0.05em; animation: breathe 2.4s ease-in-out infinite; }
.press-any { position: fixed; bottom: 12vh; left: 0; right: 0; text-align: center; font-family: var(--title); letter-spacing: 0.35em; font-size: 15px; color: var(--marble); opacity: 0; animation: breathe 2.6s ease-in-out infinite 0.5s; z-index: 3; pointer-events: none; text-shadow: 0 2px 8px #000; }
@keyframes breathe { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ---------- fades & bars ---------- */
.fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 50; }
.loading-text { position: fixed; left: 0; right: 0; bottom: 8vh; text-align: center; z-index: 55; font-style: italic; font-size: 18px; color: var(--marble-dim); opacity: 0; transition: opacity 0.4s; }
.loading-text.show { opacity: 1; animation: breathe 2s ease-in-out infinite; }
.letterbox { position: fixed; left: 0; right: 0; height: 0; background: #000; transition: height 1.2s cubic-bezier(.6, 0, .2, 1); z-index: 5; }
.letterbox.top { top: 0; } .letterbox.bottom { bottom: 0; }
.letterbox.on { height: 11vh; }

/* ---------- HUD ---------- */
#hud > *, .bigprompt, .cling, .subtitle, .chapter-card { transition: opacity 0.6s ease, transform 0.6s ease; }
.objective { position: fixed; top: 4.5vh; left: 3.5vw; max-width: 34vw; opacity: 0; transform: translateX(-12px); }
.objective.show { opacity: 1; transform: none; }
.obj-label { font-family: var(--title); font-size: 11px; letter-spacing: 0.35em; color: var(--bronze); text-transform: uppercase; }
.obj-text { font-size: 21px; line-height: 1.25; margin-top: 4px; text-shadow: 0 1px 6px rgba(0,0,0,0.9); }
.objective.pulse .obj-text { animation: objpulse 1.6s ease; }
@keyframes objpulse { 0% { color: var(--bronze-hi); text-shadow: 0 0 18px rgba(240,190,110,0.8); } 100% { } }

.vitals { position: fixed; left: 3.5vw; bottom: 5vh; width: 260px; opacity: 0; transform: translateY(8px); }
.vitals.show { opacity: 1; transform: none; }
.bar { position: relative; height: 8px; margin: 7px 0; background: rgba(10, 6, 4, 0.65); border: 1px solid rgba(200, 135, 58, 0.55); border-radius: 1px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,0.4); }
.bar .fill { position: absolute; inset: 0; width: 100%; z-index: 2; transition: width 0.15s; }
.bar .ghost { position: absolute; inset: 0; width: 100%; background: rgba(255, 230, 190, 0.55); z-index: 1; }
.bar.hp .fill { background: linear-gradient(90deg, #7a2a18, #c8502e 70%, #e88a50); }
.bar.st { height: 5px; width: 78%; }
.bar.st .fill { background: linear-gradient(90deg, #8a7a40, #e0c878); }
.bar.st.low .fill { background: #a84a2a; animation: breathe 0.6s infinite; }
.weapon { font-family: var(--title); font-size: 18px; color: var(--bronze-hi); margin-top: 6px; }
.weapon .arrows { margin-left: 8px; font-size: 15px; color: var(--marble); }

.meters { position: fixed; right: 3.5vw; bottom: 5vh; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; opacity: 0; transform: translateY(8px); font-family: var(--title); }
.meters.show { opacity: 1; transform: none; }
.meters > div { display: flex; align-items: center; gap: 8px; font-size: 17px; text-shadow: 0 1px 4px #000; }
.meters .ic { font-size: 16px; filter: sepia(1) saturate(2) hue-rotate(-10deg); }
.cunning .v { color: var(--cunning); }
.wrath .pips { display: flex; gap: 3px; }
.wrath .pips i { width: 7px; height: 14px; border: 1px solid rgba(63, 143, 184, 0.6); transform: skewX(-12deg); }
.wrath .pips i.on { background: var(--wrath); box-shadow: 0 0 8px var(--wrath); }

.compass { position: fixed; top: 3vh; left: 50%; width: 460px; max-width: 60vw; height: 42px; transform: translateX(-50%); opacity: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent); mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent); border-top: 1px solid rgba(200,135,58,0.5); }
.compass.show { opacity: 1; }
.compass .cm { position: absolute; top: 4px; transform: translateX(-50%); font-family: var(--title); font-size: 13px; white-space: nowrap; color: var(--marble-dim); text-shadow: 0 1px 3px #000; }
.compass .cm.card { color: var(--bronze-hi); font-weight: 600; }
.compass .cm.goal { color: var(--marble); }
.compass .cm.goal::before { content: '◆ '; color: var(--bronze); }
.compass .cm.lock { color: rgba(220,210,200,0.4); }
.compass .cm.tick { top: 2px; width: 1px; height: 6px; background: currentColor; opacity: 0.7; }
.compass .needle { position: absolute; left: 50%; top: 0; width: 1px; height: 8px; background: var(--bronze-hi); }

.stealth { position: fixed; top: 9vh; left: 50%; transform: translateX(-50%); width: 64px; opacity: 0; text-align: center; }
.stealth.show { opacity: 1; }
.stealth svg { width: 64px; height: 32px; overflow: visible; }
.stealth .lid { fill: rgba(239, 230, 214, calc(0.15 + var(--vis) * 0.6)); stroke: var(--marble); stroke-width: 2.5; transform-origin: 50px 25px; transform: scaleY(calc(0.15 + var(--vis) * 0.85)); transition: transform 0.25s; }
.stealth .pupil { fill: color-mix(in srgb, var(--danger) calc(var(--alert) * 100%), #1a120c); transform-origin: 50px 25px; transform: scale(calc(0.5 + var(--alert) * 0.7)); }
.stealth.alert svg { animation: shake 0.25s infinite; filter: drop-shadow(0 0 8px var(--danger)); }
.stealth.masked .lid { stroke-dasharray: 6 4; }
.stealth-label { font-family: var(--title); font-size: 11px; letter-spacing: 0.2em; margin-top: 2px; text-shadow: 0 1px 4px #000; text-transform: uppercase; color: var(--marble-dim); white-space: nowrap; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(2px); } }

.crosshair { position: fixed; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px; border: 1.5px solid rgba(240, 230, 210, 0.85); border-radius: 50%; opacity: 0; transition: opacity 0.2s, transform 0.2s; transform: scale(1.6); }
.crosshair::after { content: ''; position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; margin: -1.5px; background: var(--marble); border-radius: 50%; }
.crosshair.show { opacity: 1; transform: none; }

.prompt { position: fixed; left: 50%; bottom: 17vh; transform: translate(-50%, 10px); opacity: 0; display: flex; align-items: center; gap: 12px; font-size: 21px; text-shadow: 0 1px 6px #000; white-space: nowrap; }
.prompt.show { opacity: 1; transform: translate(-50%, 0); }
.key { display: inline-block; min-width: 30px; padding: 3px 8px; border: 1.5px solid var(--bronze); background: rgba(16, 10, 6, 0.8); font-family: var(--title); font-size: 13px; text-align: center; color: var(--bronze-hi); border-radius: 3px; box-shadow: inset 0 0 8px rgba(200,135,58,0.3); }
.pring { position: absolute; left: 0; right: 0; bottom: -10px; height: 3px; background: rgba(0,0,0,0.5); }
.pfill { height: 100%; background: var(--bronze-hi); box-shadow: 0 0 8px var(--bronze-hi); }

.bigprompt { position: fixed; left: 0; right: 0; top: 62%; text-align: center; opacity: 0; transform: scale(1.06); }
.bigprompt.show { opacity: 1; transform: none; }
.bp-text { font-family: var(--title); font-size: clamp(22px, 3vw, 38px); letter-spacing: 0.3em; color: var(--marble); text-shadow: 0 0 22px rgba(255, 140, 60, 0.6), 0 2px 6px #000; }
.bp-text .key { font-size: 0.55em; vertical-align: middle; margin-right: 12px; letter-spacing: 0.05em; }
.bp-sub { margin-top: 8px; font-style: italic; font-size: 20px; color: var(--marble-dim); text-shadow: 0 1px 6px #000; }

.cling { position: fixed; left: 50%; bottom: 14vh; width: 380px; transform: translateX(-50%); opacity: 0; text-align: center; }
.cling.show { opacity: 1; }
.cl-label { font-family: var(--title); letter-spacing: 0.3em; font-size: 14px; margin-bottom: 10px; text-shadow: 0 1px 6px #000; }
.cl-track { position: relative; height: 14px; border: 1.5px solid var(--bronze); background: rgba(10, 6, 4, 0.7); }
.cl-zone { position: absolute; top: 0; bottom: 0; background: rgba(138, 184, 120, 0.35); border-left: 1px solid var(--safe); border-right: 1px solid var(--safe); }
.cl-mark { position: absolute; top: -5px; width: 4px; height: 22px; margin-left: -2px; background: var(--marble); box-shadow: 0 0 10px #fff; }
.cling.danger .cl-track { border-color: var(--danger); box-shadow: 0 0 16px rgba(216, 80, 46, 0.6); }
.cl-grip { margin: 10px auto 0; width: 60%; height: 4px; background: rgba(0,0,0,0.5); }
.cl-gfill { height: 100%; background: var(--bronze-hi); }
.cl-help { margin-top: 8px; font-size: 17px; font-style: italic; color: var(--marble-dim); text-shadow: 0 1px 6px #000; }

.toasts { position: fixed; right: 3.5vw; top: 5vh; max-width: 42vw; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.toast { padding: 8px 18px; background: linear-gradient(90deg, transparent, rgba(16, 10, 6, 0.85) 25%); font-size: 19px; opacity: 0; transform: translateX(16px); transition: all 0.7s ease; border-right: 2px solid var(--bronze); text-shadow: 0 1px 4px #000; }
.toast.show { opacity: 1; transform: none; }
.toast.cunning { border-color: var(--cunning); color: #f6e6b0; }
.toast.wrath { border-color: var(--wrath); color: #bfe2f4; }
.toast.favor { border-color: #e8dca0; color: #fff4d0; }
.toast.loss { border-color: var(--blood); font-family: var(--title); letter-spacing: 0.08em; font-size: 20px; color: #f0c0b0; padding: 12px 22px; }
.toast.save { font-size: 15px; font-style: italic; color: var(--marble-dim); border-color: transparent; }
.toast.warn { border-color: #e0a040; }
.toast.discover { border-color: var(--bronze-hi); color: var(--bronze-hi); font-family: var(--title); letter-spacing: 0.06em; }

.subtitle { position: fixed; left: 50%; bottom: 7vh; transform: translateX(-50%); max-width: min(900px, 80vw); text-align: center; opacity: 0; font-size: clamp(19px, 1.6vw, 25px); line-height: 1.35; text-shadow: 0 1px 3px #000, 0 0 14px rgba(0,0,0,0.9); z-index: 6; }
.subtitle.show { opacity: 1; }
.subtitle .who { font-family: var(--title); font-size: 0.72em; letter-spacing: 0.18em; color: var(--bronze-hi); margin-right: 10px; text-transform: uppercase; }
.subtitle.narration .line { font-style: italic; color: #e8dcc8; }

.chapter-card { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; z-index: 7; background: radial-gradient(ellipse at center, rgba(0,0,0,0.55), transparent 65%); }
.chapter-card.show { opacity: 1; }
.cc-num { font-family: var(--title); letter-spacing: 0.5em; font-size: 15px; color: var(--bronze); text-transform: uppercase; padding-left: 0.5em; }
.cc-title { font-family: var(--title); font-size: clamp(30px, 4.5vw, 64px); letter-spacing: 0.12em; text-align: center; text-shadow: 0 0 30px rgba(0,0,0,0.9); }
.cc-sub { font-style: italic; font-size: 22px; color: var(--marble-dim); margin-top: 8px; }
.chapter-card.show .cc-title { animation: rise 2.4s cubic-bezier(.2,.7,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); letter-spacing: 0.3em; } to { opacity: 1; transform: none; } }

/* ---------- dialogue ---------- */
#dialogue { position: fixed; left: 50%; bottom: 5vh; transform: translate(-50%, 20px); width: min(920px, 90vw); display: flex; gap: 22px; padding: 18px 24px; opacity: 0; transition: all 0.35s ease; z-index: 8;
  background: linear-gradient(180deg, rgba(20, 13, 9, 0.92), rgba(10, 6, 4, 0.95)); border: 1px solid rgba(200, 135, 58, 0.6); box-shadow: 0 10px 40px rgba(0,0,0,0.7), inset 0 0 30px rgba(200,135,58,0.08); }
#dialogue.show { opacity: 1; transform: translate(-50%, 0); }
#dialogue::before { content: ''; position: absolute; left: 12px; right: 12px; top: -8px; height: 14px; background: inherit; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M0 13 H24 V1 H4 V9 H16 V5 H10' fill='none' stroke='%23c8873a' stroke-width='1.6'/%3E%3C/svg%3E") repeat-x; }
#dialogue .portrait { width: 120px; height: 120px; flex: none; border: 2px solid var(--bronze-dk); box-shadow: 0 0 0 1px var(--bronze); }
#dialogue.giant .portrait { border-color: #6a1a10; box-shadow: 0 0 22px rgba(160, 50, 20, 0.6); }
.dbody { flex: 1; position: relative; min-height: 120px; }
.dname { font-family: var(--title); letter-spacing: 0.2em; color: var(--bronze-hi); font-size: 15px; text-transform: uppercase; margin-bottom: 6px; }
#dialogue.giant .dname { color: #e07a50; letter-spacing: 0.35em; }
.dtext { font-size: clamp(20px, 1.7vw, 25px); line-height: 1.35; min-height: 2.7em; }
#dialogue.giant .dtext { font-size: clamp(22px, 1.9vw, 28px); }
.dchoices { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.choice { text-align: left; font-family: var(--serif); font-size: 20px; color: var(--marble); background: rgba(200, 135, 58, 0.08); border: 1px solid rgba(200, 135, 58, 0.4); padding: 8px 14px; cursor: pointer; transition: all 0.2s; }
.choice:hover, .choice:focus { background: rgba(200, 135, 58, 0.25); border-color: var(--bronze-hi); outline: none; transform: translateX(6px); }
.choice .num { font-family: var(--title); color: var(--bronze); margin-right: 12px; font-size: 14px; }
.dtimer { height: 3px; background: rgba(0,0,0,0.5); margin-top: 12px; }
.dtfill { height: 100%; background: linear-gradient(90deg, var(--danger), var(--bronze-hi)); width: 100%; }
.dnext { position: absolute; right: 0; bottom: 0; color: var(--bronze); animation: breathe 1.2s infinite; transition: opacity 0.2s; }

/* ---------- menus ---------- */
#menus { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.menu { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.45s ease; pointer-events: auto; }
.menu.show { opacity: 1; }
.menu button { font-family: var(--title); letter-spacing: 0.18em; font-size: 15px; color: var(--marble); background: transparent; border: 1px solid transparent; padding: 10px 26px; cursor: pointer; text-transform: uppercase; transition: all 0.25s; position: relative; }
.menu button:hover:not([disabled]), .menu button:focus:not([disabled]) { color: var(--bronze-hi); border-color: rgba(200, 135, 58, 0.5); background: rgba(200, 135, 58, 0.08); outline: none; letter-spacing: 0.24em; }
.menu button[disabled] { opacity: 0.35; cursor: default; }
.title-menu { flex-direction: column; justify-content: space-between; padding: 12vh 0 5vh; background: linear-gradient(180deg, rgba(0,0,0,0.35), transparent 35%, transparent 60%, rgba(0,0,0,0.55)); }
.logo { text-align: center; }
.logo-main { font-family: var(--title); font-weight: 800; font-size: clamp(64px, 12vw, 168px); letter-spacing: 0.22em; padding-left: 0.22em; color: #f8e2b8;
  background: linear-gradient(180deg, #fff2d6 0%, #f0c27a 45%, #a8682a 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 4px 18px rgba(0,0,0,0.55)) drop-shadow(0 0 40px rgba(255,170,90,0.25)); animation: logoIn 3s cubic-bezier(.2,.7,.2,1); }
.logo-sub { font-family: var(--title); letter-spacing: 0.6em; padding-left: 0.6em; font-size: clamp(13px, 1.5vw, 20px); color: var(--marble); text-shadow: 0 2px 10px #000; animation: logoIn 3.6s cubic-bezier(.2,.7,.2,1); }
@keyframes logoIn { from { opacity: 0; letter-spacing: 0.5em; filter: blur(6px); } to { opacity: 1; } }
.title-buttons { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: auto; align-self: flex-start; margin-left: 6vw; margin-bottom: 2vh; }
.title-buttons button { padding-left: 14px; }
.title-buttons button { text-shadow: 0 2px 8px #000; }
.title-foot { font-style: italic; color: var(--marble-dim); font-size: 16px; text-shadow: 0 1px 6px #000; }

.panel { position: relative; min-width: 380px; max-width: 92vw; max-height: 88vh; overflow: auto; padding: 32px 42px; display: flex; flex-direction: column; align-items: stretch; gap: 4px; text-align: center;
  background: linear-gradient(180deg, rgba(22, 14, 10, 0.96), rgba(10, 6, 4, 0.97)); border: 1px solid rgba(200, 135, 58, 0.55); box-shadow: 0 20px 80px rgba(0,0,0,0.8), inset 0 0 60px rgba(200,135,58,0.06); }
.panel.wide { width: min(900px, 92vw); }
.panel.tall { height: 84vh; }
.ptitle { font-family: var(--title); font-size: 30px; letter-spacing: 0.25em; color: var(--bronze-hi); }
.pause-menu, .settings-menu, .journal-menu, .chapters-menu, .credits-menu, .summary-menu { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(3px); }
.tabs { display: flex; justify-content: center; gap: 6px; margin: 8px 0 14px; border-bottom: 1px solid rgba(200,135,58,0.3); }
.tabs button { font-size: 13px; padding: 8px 16px; }
.tabs button.on { color: var(--bronze-hi); border-bottom: 2px solid var(--bronze-hi); }
.tab { display: none; text-align: left; } .tab.on { display: block; }
.tab label { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 9px 4px; font-size: 19px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.tab select, .tab input[type=range] { width: 46%; accent-color: var(--bronze); background: #1a110c; color: var(--marble); border: 1px solid var(--bronze-dk); padding: 4px; font-family: var(--serif); font-size: 16px; }
.tab input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--bronze); }
.hint { font-style: italic; color: var(--marble-dim); font-size: 16px; }
.binds { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 20px; margin: 10px 0; }
.bind { display: flex; justify-content: space-between; align-items: center; font-size: 17px; }
.bind button { font-size: 12px; padding: 4px 12px; border-color: rgba(200,135,58,0.3); min-width: 90px; }
.bind button.wait { color: var(--danger); }
button.small { font-size: 12px; padding: 6px 14px; align-self: flex-start; }
.jgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; }
.jcrew { display: flex; gap: 14px; padding: 10px; border: 1px solid rgba(200,135,58,0.2); background: rgba(255,255,255,0.02); }
.jcrew.party { border-color: rgba(200,135,58,0.45); }
.jcrew canvas { width: 80px; height: 80px; flex: none; }
.jcrew.lost canvas { filter: grayscale(1) brightness(0.5); }
.jcrew.lost .jname { text-decoration: line-through; text-decoration-color: var(--blood); }
.jname { font-family: var(--title); letter-spacing: 0.12em; color: var(--bronze-hi); }
.jrole { font-size: 14px; color: var(--marble-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.jline { font-style: italic; font-size: 17px; margin-top: 4px; }
.jstatus { font-size: 14px; margin-top: 4px; color: var(--marble-dim); }
.jcrew.lost .jstatus { color: #e09a88; }
.jlore { padding: 12px 6px; border-bottom: 1px solid rgba(200,135,58,0.2); }
.jlore .lt { font-family: var(--title); color: var(--bronze-hi); letter-spacing: 0.1em; }
.jlore .lb { font-size: 18px; margin-top: 4px; }
.jlore.locked { opacity: 0.35; }
.jstats { display: flex; justify-content: center; gap: 34px; margin: 18px 0; flex-wrap: wrap; }
.jstats div { display: flex; flex-direction: column; align-items: center; }
.jstats b { font-family: var(--title); font-size: 28px; color: var(--bronze-hi); }
.jstats span { font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--marble-dim); }
.chlist { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.chlist .ch { display: grid; grid-template-columns: 54px 1fr 70px 130px; align-items: center; text-align: left; border: 1px solid rgba(200,135,58,0.2) !important; text-transform: none; letter-spacing: 0.05em; }
.ch .chn { font-size: 20px; color: var(--bronze); }
.ch .cht { font-size: 17px; } .ch .cht em { display: block; font-family: var(--serif); font-size: 15px; color: var(--marble-dim); text-transform: none; letter-spacing: 0; }
.ch .chp { display: flex; gap: 3px; } .ch .chp i { width: 14px; height: 14px; border: 1px solid rgba(0,0,0,0.5); }
.ch .chs { font-size: 12px; text-align: right; color: var(--bronze-hi); }
.ch.locked .chs { color: var(--marble-dim); }
.credits { font-size: 19px; line-height: 1.5; }
.choice-menu { flex-direction: column; background: radial-gradient(ellipse at center, rgba(0,0,0,0.5), rgba(0,0,0,0.2) 70%); }
.choice-title { font-family: var(--title); font-size: clamp(24px, 3vw, 40px); letter-spacing: 0.2em; text-shadow: 0 2px 14px #000; text-align: center; }
.choice-sub { font-style: italic; font-size: 21px; color: var(--marble-dim); margin: 6px 0 26px; text-shadow: 0 1px 8px #000; text-align: center; }
.choice-opts { display: flex; gap: 30px; flex-wrap: wrap; justify-content: center; }
.big-choice { display: flex !important; flex-direction: column; align-items: center; gap: 6px; width: 300px; padding: 20px !important; border: 1px solid rgba(200,135,58,0.5) !important; background: rgba(12, 8, 6, 0.75) !important; }
.big-choice .bk { font-size: 12px; border: 1px solid var(--bronze); padding: 2px 8px; color: var(--bronze-hi); }
.big-choice .bl { font-size: 19px; }
.big-choice .bd { font-family: var(--serif); text-transform: none; letter-spacing: 0; font-style: italic; font-size: 17px; color: var(--marble-dim); }
.choice-timer { width: 300px; height: 3px; background: rgba(0,0,0,0.5); margin-top: 26px; }
.ctf { height: 100%; background: var(--bronze-hi); }
.sum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; text-align: left; margin-top: 12px; }
.sum-h { font-family: var(--title); letter-spacing: 0.18em; color: var(--bronze); font-size: 14px; text-transform: uppercase; margin-bottom: 8px; }
.names { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 19px; }
.sum-col.lost .names span { color: #e8b0a0; }
.sum-epitaph { font-style: italic; font-size: 20px; color: var(--marble-dim); max-width: 640px; margin: 8px auto 14px; }

/* ---------- debug ---------- */
#debug-overlay { position: fixed; left: 8px; top: 8px; z-index: 30; font: 12px/1.4 ui-monospace, Consolas, monospace; color: #9f9; background: rgba(0,0,0,0.65); padding: 6px 10px; pointer-events: none; white-space: pre; }
#debug-menu { position: fixed; right: 8px; top: 8px; z-index: 30; width: 260px; max-height: 90vh; overflow: auto; font: 12px ui-monospace, Consolas, monospace; color: #ddd; background: rgba(10,10,10,0.9); border: 1px solid #555; padding: 10px; pointer-events: auto; }
#debug-menu button { display: block; width: 100%; margin: 3px 0; font: inherit; background: #222; color: #ddd; border: 1px solid #444; padding: 5px; cursor: pointer; text-align: left; }
#debug-menu button:hover { background: #333; }
#debug-menu h4 { margin: 8px 0 4px; color: #fc6; font-weight: normal; }
#debug-menu label { display: flex; justify-content: space-between; align-items: center; margin: 3px 0; }

/* ---------- touch controls (phones and tablets) ---------- */
#touch { position: fixed; inset: 0; z-index: 30; pointer-events: none; opacity: 0; transition: opacity 0.25s; touch-action: none; user-select: none; -webkit-user-select: none; }
#touch.show { opacity: 1; }
#touch.show .t-pad, #touch.show .tbtn { pointer-events: auto; }
#touch .t-pad { position: absolute; inset: 0; touch-action: none; }
#touch .t-stick { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(232,220,196,0.35); background: rgba(20,14,10,0.25); display: none; pointer-events: none; }
#touch .t-stick.on { display: block; }
#touch .t-knob { position: absolute; left: 34px; top: 34px; width: 52px; height: 52px; border-radius: 50%; background: rgba(232,220,196,0.55); box-shadow: 0 2px 8px rgba(0,0,0,0.5); }
#touch .tbtn { position: absolute; width: 58px; height: 58px; border-radius: 50%; border: 2px solid rgba(232,220,196,0.4); background: rgba(24,16,10,0.45); color: #efe4cc; font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center; touch-action: none; padding: 0; backdrop-filter: blur(2px); }
#touch .tbtn.on { background: rgba(200,135,58,0.7); border-color: rgba(255,220,170,0.8); }
#touch .tb-attack { right: max(22px, env(safe-area-inset-right)); bottom: max(26px, env(safe-area-inset-bottom)); width: 82px; height: 82px; font-size: 32px; }
#touch .tb-dodge { right: 118px; bottom: 22px; }
#touch .tb-alt { right: 30px; bottom: 124px; }
#touch .tb-interact { right: 104px; bottom: 96px; font-family: var(--title); font-weight: 700; }
#touch .tb-crouch { right: 186px; bottom: 30px; width: 50px; height: 50px; font-size: 20px; }
#touch .tb-sprint { right: 176px; bottom: 96px; width: 50px; height: 50px; }
#touch .tb-weapon { right: 34px; bottom: 202px; width: 46px; height: 46px; font-size: 18px; }
#touch .tb-lock { right: 96px; bottom: 170px; width: 46px; height: 46px; font-size: 18px; }
#touch .tb-pause { right: max(14px, env(safe-area-inset-right)); top: max(14px, env(safe-area-inset-top)); width: 44px; height: 44px; font-size: 14px; }
body.is-touch .hud .help, body.is-touch .key-hint { display: none; }
