:root {
  --ink: #07080c;
  --parch: #efe6d6;
  --dim: #9a93a6;
  --amber: #ffab52;
  --warm: #ffcf8a;
  --hollow: #a88cff;
  --hurt: #ff6a5a;
  --panel: rgba(12, 12, 18, 0.72);
  --edge: rgba(239, 230, 214, 0.14);
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); overflow: hidden; color: var(--parch); font-family: var(--sans); }
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: crosshair; }
#ui { position: fixed; inset: 0; pointer-events: none; }
kbd { font-family: var(--sans); font-size: 11px; padding: 1px 6px; border-radius: 5px; background: rgba(239, 230, 214, 0.1); border: 1px solid rgba(239, 230, 214, 0.22); color: var(--parch); }
.amb { color: var(--amber); } .wrm { color: var(--warm); } .hol { color: var(--hollow); }

/* ---------------- HUD */
.hud { position: absolute; inset: 0; transition: opacity 0.4s; }
.hud.dimmed { opacity: 0.25; }
.hud.off { opacity: 0; }





/* hit chain: right side, big italic numerals that heat with the count */
.chain { position: absolute; right: 42px; top: 34%; text-align: right; opacity: 0; transition: opacity 0.25s; --left: 1; }
.chain.show { opacity: 1; }
.chain-n { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 76px; line-height: 0.9; color: #f4efe6; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.8); }
.chain-l { font-family: var(--sans); font-size: 12px; letter-spacing: 0.4em; text-transform: uppercase; color: var(--dim); margin-top: 2px; }
.chain-l::after { content: ''; display: block; height: 2px; margin: 6px 0 0 auto; width: calc(var(--left) * 90px); background: currentColor; }
.chain.pop .chain-n { animation: pop 0.22s ease-out; }
@keyframes pop { 0% { transform: scale(1.45) rotate(-4deg); } 100% { transform: scale(1) rotate(0); } }
.chain[data-tier='2'] .chain-n { color: #ffd9a0; text-shadow: 0 0 22px rgba(255, 170, 80, 0.55), 0 4px 24px rgba(0, 0, 0, 0.8); }
.chain[data-tier='3'] .chain-n { color: #ffb45e; font-size: 92px; text-shadow: 0 0 30px rgba(255, 140, 40, 0.8), 0 4px 24px rgba(0, 0, 0, 0.8); }
.chain[data-tier='4'] .chain-n { color: #fff2c8; font-size: 108px; text-shadow: 0 0 20px #ff9a3a, 0 0 50px rgba(255, 90, 30, 0.9); }
.chain[data-tier='2'] .chain-l, .chain[data-tier='3'] .chain-l, .chain[data-tier='4'] .chain-l { color: var(--warm); }

/* signature move callout */
.callout { position: absolute; left: 50%; top: 21%; transform: translateX(-50%); font-family: var(--serif); font-style: italic; font-weight: 700; font-size: clamp(28px, 3.6vw, 46px); letter-spacing: 0.06em; color: var(--c, #ffe6c0); text-shadow: 0 0 24px var(--c, #ffb060), 0 4px 18px rgba(0, 0, 0, 0.9); opacity: 0; white-space: nowrap; }
.callout.show { animation: callout 1.1s ease-out forwards; }
@keyframes callout { 0% { opacity: 0; transform: translateX(-50%) scale(1.5) skewX(-8deg); letter-spacing: 0.3em; } 12% { opacity: 1; transform: translateX(-50%) scale(1) skewX(-8deg); letter-spacing: 0.06em; } 70% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-14px) skewX(-8deg); } }

/* tutorial card: top-centre, out of the fight's way */
.tut { position: absolute; left: 24px; top: 150px; transform: translate(-8px, 0); width: min(400px, 44vw); padding: 14px 18px 16px; border-radius: 14px; background: rgba(10, 10, 16, 0.86); box-shadow: 0 0 0 1px rgba(255, 200, 140, 0.25), 0 18px 40px rgba(0, 0, 0, 0.5); backdrop-filter: blur(6px); pointer-events: auto; opacity: 0; transition: opacity 0.25s, transform 0.25s, box-shadow 0.25s; }
.tut.show { opacity: 1; transform: translate(0, 0); }
@media (max-width: 720px) { .tut { left: 50%; top: auto; bottom: 90px; width: 92vw; transform: translate(-50%, 8px); } .tut.show { transform: translate(-50%, 0); } }
.tut.done { box-shadow: 0 0 0 1px rgba(255, 207, 138, 0.8), 0 0 30px rgba(255, 170, 80, 0.35); }
.tut-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.tut-count { font-size: 11px; letter-spacing: 0.12em; color: var(--dim); }
.tut-skip { pointer-events: auto; cursor: pointer; background: none; border: 1px solid rgba(255, 255, 255, 0.14); color: var(--dim); font: 500 12px var(--sans); padding: 4px 10px; border-radius: 8px; }
.tut-skip:hover { color: var(--parch); border-color: rgba(255, 255, 255, 0.35); }
.tut-title { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--warm); }
.tut-body { font-size: 14.5px; line-height: 1.55; color: #e8dfcf; margin-top: 4px; }
.tut-body .li { display: block; padding-left: 0.9em; text-indent: -0.9em; }
.tut-hint { font-size: 13px; color: #ffb0a0; margin-top: 8px; max-height: 0; overflow: hidden; transition: max-height 0.25s; }
.tut-hint.show { max-height: 40px; }
.tut-wait { margin-top: 10px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber); }
.tut.done .tut-wait { color: var(--warm); }
.tut-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.tut-foot .tut-wait { margin-top: 0; }
.tut-next { padding: 9px 18px; }
.tut-next kbd { margin-left: 6px; font-size: 10px; opacity: 0.7; }
.tut-next:disabled { opacity: 0.35; cursor: default; filter: saturate(0); box-shadow: none; }
.tut-next:disabled:hover { background: rgba(255, 255, 255, 0.06); transform: none; }
.tut-next.lit { animation: tutlit 1.6s ease-in-out infinite; }
@keyframes tutlit { 50% { filter: brightness(1.18); box-shadow: 0 0 0 2px rgba(255, 214, 150, 0.55), 0 6px 34px rgba(255, 170, 80, 0.55); } }

.numbers { position: absolute; inset: 0; }
.num { position: absolute; left: 0; top: 0; font-family: var(--serif); font-weight: 700; font-size: 22px; color: #f4efe6; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8); white-space: nowrap; will-change: transform; }
.num.chip { color: #8a8398; font-size: 16px; }
.num.woken { color: #ffd690; }
.num.crit { color: #fff3c4; font-size: 26px; }
.num.hurt { color: var(--hurt); }
.num.guard { color: #b8b6c6; font-size: 17px; }
.num.reaction { color: #fff0d8; font-family: var(--serif); font-size: 26px; font-weight: 600; text-shadow: 0 0 14px rgba(255, 200, 120, 0.9), 0 0 30px rgba(160, 200, 255, 0.6); }
.deed { position: absolute; right: 24px; top: 96px; width: 300px; padding: 14px 18px; border-radius: 12px; background: rgba(14, 10, 20, 0.88); box-shadow: 0 0 0 1px rgba(255, 210, 150, 0.35), 0 10px 40px rgba(0, 0, 0, 0.5); animation: rise 0.5s ease; transition: opacity 1s ease, transform 1s ease; pointer-events: none; }
.deed.go { opacity: 0; transform: translateY(-10px); }
.d-head { font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); }
.d-name { font-family: var(--serif); font-size: 24px; color: var(--warm); margin: 2px 0; }
.d-text { font-family: var(--serif); font-style: italic; font-size: 15px; color: #d6cdbd; }
.screen.sanct-screen { background: linear-gradient(180deg, rgba(3, 3, 6, 0.55), transparent 30%, transparent 55%, rgba(3, 3, 6, 0.85)); place-items: end center; }
.sanct { width: min(900px, 100%); text-align: center; padding-bottom: 12px; }
.s-line { min-height: 96px; margin: 8px auto 14px; max-width: 640px; }
.s-name { font-family: var(--serif); font-size: 26px; color: var(--warm); }
.s-name span { font-family: var(--sans, inherit); font-size: 12px; color: var(--dim); letter-spacing: 0.08em; margin-left: 8px; }
.s-text { font-family: var(--serif); font-style: italic; font-size: 20px; color: #efe4d2; margin-top: 6px; }
.s-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 16px; }
.book { width: min(980px, 100%); text-align: center; }
.screen.book-screen { background: radial-gradient(ellipse at center, rgba(5, 5, 9, 0.84), rgba(3, 3, 6, 0.96)); place-items: start center; }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 22px 0; text-align: left; }
.page { padding: 14px 16px; border-radius: 10px; min-height: 92px; background: rgba(255, 244, 228, 0.05); box-shadow: 0 0 0 1px var(--edge); }
.page.found { background: rgba(255, 214, 160, 0.08); box-shadow: 0 0 0 1px rgba(255, 210, 150, 0.3); }
.page.blank .pg-text { color: rgba(255, 255, 255, 0.18); text-align: center; margin-top: 18px; letter-spacing: 0.4em; }
.pg-name { font-family: var(--serif); font-size: 19px; color: var(--warm); }
.pg-text { font-family: var(--serif); font-style: italic; font-size: 14px; color: #d6cdbd; margin-top: 4px; }
.pg-when { font-size: 11px; color: var(--dim); margin-top: 8px; }
@media (max-width: 720px) { .deed { right: 16px; left: 16px; width: auto; top: 76px; } }
.num.foestance { color: #9a88b8; font-family: var(--serif); font-style: italic; font-size: 22px; text-shadow: 0 0 8px rgba(0, 0, 0, 0.9); }
.num.hollow { color: #b89cff; font-size: 20px; letter-spacing: 0.14em; text-shadow: 0 0 10px rgba(120, 70, 220, 0.8); }
.num.minor { font-size: 15px; opacity: 0.85; }
.num.minor.blaze { color: #ff9a4a; } .num.minor.volt { color: #9fdcff; } .num.minor.frost { color: #c8f0ff; } .num.minor.tide { color: #6cc4f0; }
.num.kept { color: var(--warm); font-style: italic; font-weight: 600; letter-spacing: 0.04em; text-shadow: 0 0 14px rgba(255, 170, 80, 0.9); }

/* ---------------- banner, veil */
.banner { position: absolute; left: 0; right: 0; top: 30%; text-align: center; opacity: 0; transition: opacity 0.8s; }
.banner.show { opacity: 1; }
.veil { position: absolute; inset: 0; background: #000; opacity: 1; pointer-events: none; }

/* ---------------- screens */
.screen { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: auto; background: radial-gradient(ellipse at center, rgba(5, 5, 9, 0.35), rgba(3, 3, 6, 0.86)); animation: rise 0.5s ease; overflow-y: auto; padding: 24px; }
.screen.end-screen { background: radial-gradient(ellipse at center, rgba(5, 5, 9, 0.78), rgba(3, 3, 6, 0.95)); }
.screen.hidden { display: none; }
@keyframes rise { from { opacity: 0; } to { opacity: 1; } }
.btn { pointer-events: auto; font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--parch); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--edge); padding: 12px 22px; border-radius: 10px; cursor: pointer; transition: all 0.15s; }
.btn:hover { background: rgba(255, 255, 255, 0.12); }
.btn.primary { background: linear-gradient(180deg, #f3c784, #d99a4e); color: #1a1008; border: none; box-shadow: 0 6px 30px rgba(255, 170, 80, 0.3); }
.btn.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }


/* ---- who goes down: the roster title */
.card.corrupted .c-art { background: radial-gradient(circle at 50% 60%, #000 0 18%, rgba(255, 180, 90, 0.35) 22%, rgba(120, 90, 200, 0.25) 45%, transparent 65%), #120f18; }
.card.corrupted { border-color: rgba(255, 190, 120, 0.3); }
.e-who { font-size: 13px; color: var(--dim); margin: -16px 0 14px; }
.e-woken { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--warm); margin-bottom: 22px; }
.num.foe-move { font-size: 15px; font-style: italic; font-weight: 600; letter-spacing: 0.04em; }
.num.foe-move.amber { color: #ffb45e; } .num.foe-move.hollow { color: #b49cff; } .num.foe-move.linger { color: #a8c878; }

.pick { text-align: center; max-width: 980px; }
.p-head { font-family: var(--serif); font-size: 40px; font-weight: 600; }
.p-sub { color: var(--dim); margin-top: 4px; font-size: 14px; }
.cards { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 26px 0; }
.card { pointer-events: auto; width: 250px; min-height: 250px; text-align: left; padding: 20px; border-radius: 16px; cursor: pointer; color: var(--parch); background: linear-gradient(180deg, rgba(30, 28, 38, 0.95), rgba(14, 13, 19, 0.95)); border: 1px solid var(--edge); display: flex; flex-direction: column; gap: 10px; transition: transform 0.15s, box-shadow 0.15s; font-family: var(--sans); }
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 200, 140, 0.4); }
.c-art { height: 86px; border-radius: 10px; background: radial-gradient(circle at 50% 80%, rgba(255, 170, 80, 0.5), transparent 60%), #15131b; display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 34px; color: var(--warm); }
.card.hearth .c-art { background: radial-gradient(circle at 50% 90%, rgba(255, 120, 60, 0.7), transparent 55%), #15131b; }
.card.shelf .c-art { background: radial-gradient(circle at 50% 60%, rgba(255, 210, 140, 0.45), transparent 60%), #15131b; }
.c-title { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.c-text { font-size: 14px; line-height: 1.5; color: #cfc6b8; }
.c-foot { margin-top: auto; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--warm); opacity: 0.7; }

.altar-screen { background: linear-gradient(180deg, rgba(2, 2, 6, 0) 0%, rgba(2, 2, 6, 0.35) 35%, rgba(2, 2, 6, 0.92) 70%); place-items: end center; padding-bottom: 5vh; }
.altar-screen .pick { max-width: 900px; }
.altar-screen .cards { margin: 18px 0; }
.altar-screen .card { min-height: 0; }
.nolem-line { font-family: var(--serif); font-size: clamp(22px, 2.6vw, 32px); font-style: italic; max-width: 720px; margin: 0 auto; color: #d8d4ee; }
.nolem-name { font-family: var(--serif); color: #8a86b0; margin-top: 8px; letter-spacing: 0.1em; }
.card.pact { background: linear-gradient(180deg, rgba(22, 20, 36, 0.96), rgba(8, 8, 14, 0.96)); border-color: rgba(168, 140, 255, 0.25); }
.card.pact:hover { box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(168, 140, 255, 0.6); }
.pact-art { background: radial-gradient(circle at 50% 55%, #000 0 22%, rgba(120, 100, 220, 0.35) 24%, transparent 60%), #0b0a12 !important; }
.c-price { margin-top: auto; font-size: 12.5px; line-height: 1.5; color: #b7a8e8; border-top: 1px solid rgba(168, 140, 255, 0.2); padding-top: 10px; }
.c-price b { color: #ffb0a0; }
.btn.refuse { background: linear-gradient(180deg, #f3c784, #d99a4e); color: #1a1008; border: none; }

.ending { text-align: center; max-width: 720px; }
.e-title { font-family: var(--serif); font-size: clamp(48px, 7vw, 88px); font-weight: 600; }
.e-sub { font-family: var(--serif); font-style: italic; font-size: 22px; color: #d6cdbd; margin: 8px 0 30px; }
.ending.dead .e-title { color: #cfc8d8; }
.ending.victory .e-title { color: var(--warm); text-shadow: 0 0 40px rgba(255, 170, 80, 0.5); }
.e-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 30px; }
.e-stats div { padding: 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); box-shadow: 0 0 0 1px var(--edge); }
.e-stats b { display: block; font-family: var(--serif); font-size: 32px; }
.e-stats span { font-size: 12px; color: var(--dim); letter-spacing: 0.06em; }
.vows { margin-top: 26px; }
.v-head { font-family: var(--serif); font-style: italic; color: #d6cdbd; margin-bottom: 10px; }
.v-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.vow { width: 230px; text-align: left; padding: 12px 14px; border-radius: 12px; border: none; cursor: pointer; background: rgba(255, 244, 228, 0.05); box-shadow: 0 0 0 1px rgba(200, 180, 240, 0.3); color: inherit; font: inherit; display: flex; flex-direction: column; gap: 4px; transition: all 0.15s; }
.vow:hover { background: rgba(200, 180, 240, 0.1); box-shadow: 0 0 0 1px rgba(200, 180, 240, 0.7); }
.vow b { font-family: var(--serif); font-size: 18px; color: #e6dcff; font-weight: 600; }
.vow span { font-size: 13px; color: #efe4d2; }
.vow i { font-size: 12px; color: var(--dim); }
.e-nolem { font-family: var(--serif); font-style: italic; font-size: 21px; color: #b9a8c8; margin: 8px auto 22px; max-width: 560px; }
.e-nolem span { display: block; font-style: normal; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); margin-top: 6px; }
.e-who { color: var(--dim); margin-bottom: 18px; }
.e-peak { display: inline-flex; align-items: baseline; gap: 14px; padding: 12px 22px; margin-bottom: 22px; border-radius: 14px; background: radial-gradient(ellipse at center, color-mix(in srgb, var(--c) 22%, transparent), transparent 75%); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent); }
.e-shot { width: min(360px, 100%); aspect-ratio: 16 / 9; margin: 0 auto 10px; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 210, 150, 0.3), 0 12px 40px rgba(0, 0, 0, 0.6); }
.e-shot img { width: 100%; height: 100%; object-fit: cover; display: block; animation: peakIn 9s ease-out forwards; }
@keyframes peakIn { from { transform: scale(1.18); filter: brightness(1.35) saturate(1.2); } to { transform: scale(1); filter: none; } }
.e-plabel { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); }
.e-pname { font-family: var(--serif); font-size: 30px; color: var(--c); text-shadow: 0 0 22px color-mix(in srgb, var(--c) 70%, transparent); }
.e-pdmg { font-family: var(--serif); font-size: 22px; color: #fff4e4; }
.e-map { display: flex; flex-direction: column; gap: 6px; align-items: center; margin-bottom: 10px; }
.e-stratum { display: flex; gap: 12px; align-items: center; }
.e-sname { width: 190px; text-align: right; font-size: 12px; color: var(--dim); }
.e-pips { display: flex; gap: 7px; width: 190px; }
.e-pip { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.22); }
.e-pip.big { transform: rotate(45deg); border-radius: 2px; }
.e-pip.apex { width: 16px; height: 16px; box-shadow: inset 0 0 0 2px rgba(255, 190, 120, 0.55); }
.e-pip.walked { background: rgba(255, 220, 180, 0.55); box-shadow: none; }
.e-pip.fell { background: var(--warm); box-shadow: 0 0 12px var(--warm); }
.e-pip.ghost { box-shadow: inset 0 0 0 2px rgba(200, 190, 255, 0.7), 0 0 10px rgba(200, 190, 255, 0.4); }
.e-pip.here { background: #fff4e4; box-shadow: 0 0 12px rgba(255, 240, 220, 0.9); }
.e-pip.k-altar { box-shadow: inset 0 0 0 1.5px rgba(170, 140, 230, 0.6); }
.e-pip.place { box-shadow: inset 0 0 0 2px rgba(255, 214, 140, 0.9), 0 0 8px rgba(255, 200, 120, 0.6); }
.e-pip.echo { box-shadow: inset 0 0 0 2px rgba(150, 230, 255, 0.9), 0 0 8px rgba(140, 220, 255, 0.6); }
.d-map { margin: 4px 0 18px; }
.e-dist { font-family: var(--serif); font-style: italic; font-size: 18px; color: #d6cdbd; margin-bottom: 22px; }
.ending .e-stats { grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 20px; }
.ending .e-stats div { padding: 8px 6px; }
.ending .e-stats b { font-size: 24px; }
.ending .e-stats span { font-size: 11px; }
.ending .e-title { font-size: clamp(44px, 6vw, 72px); }
.e-buttons { display: flex; gap: 12px; justify-content: center; }
.pause { display: flex; flex-direction: column; gap: 12px; align-items: center; }

@media (max-width: 720px) {
  .card { width: 100%; min-height: 0; }
  .e-stats, .ending .e-stats { grid-template-columns: repeat(3, 1fr); }
  .e-sname { width: 110px; }
  .e-pips { width: auto; }
}


/* =====================================================================================================================
   NIKEVERSE: DEADWAKE — the interface. A console-grade dark: ink and parchment, one gold hairline language, small caps
   for labels, the serif for names. Every bar is framed, every ability is a tile, and the title is a cinematic menu.
   ================================================================================================================== */
:root {
  --gold: #e7b670;
  --gold-hi: #ffe3b0;
  --hair: rgba(231, 182, 112, 0.34);
  --hair-lo: rgba(231, 182, 112, 0.14);
  --glass: linear-gradient(180deg, rgba(16, 14, 22, 0.86), rgba(8, 8, 12, 0.92));
  --self: #ff9f7a;
}
.caps { font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; }

/* ---------------- the player's plate: sigil, name, framed health, embers */
.hud-self { position: absolute; left: 28px; top: 24px; display: flex; gap: 14px; align-items: flex-start; }
.sigil { position: relative; width: 56px; height: 56px; border-radius: 50%; flex: none;
  background: radial-gradient(circle, rgba(6, 6, 10, 0.92) 54%, transparent 55%), conic-gradient(from 210deg, var(--self), rgba(255, 255, 255, 0.05) 45%, var(--self) 80%, var(--self));
  box-shadow: 0 0 0 1px var(--hair), 0 0 22px -6px var(--self), inset 0 0 12px rgba(0, 0, 0, 0.8); }
.sigil i { position: absolute; inset: 17px; transform: rotate(45deg); border: 1.5px solid var(--self); box-shadow: 0 0 12px var(--self), inset 0 0 6px var(--self); }
.self-name { font-family: var(--serif); font-size: 23px; font-weight: 700; letter-spacing: 0.05em; line-height: 1; margin: 3px 0 9px; display: flex; gap: 10px; align-items: center; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9); }
.pacts { display: inline-flex; gap: 5px; }
.pacts i { width: 9px; height: 9px; transform: rotate(45deg); background: #241c33; box-shadow: 0 0 0 1px #7a68a0, 0 0 8px rgba(120, 90, 200, 0.5); display: inline-block; }
.bar { position: relative; width: 300px; height: 12px; background: linear-gradient(180deg, rgba(0, 0, 0, 0.75), rgba(20, 18, 26, 0.85)); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.9), 0 0 0 2px var(--hair-lo), inset 0 2px 4px rgba(0, 0, 0, 0.9); overflow: visible; }
.bar::before, .bar::after { content: ''; position: absolute; top: 50%; width: 8px; height: 8px; background: var(--gold); transform: translate(-50%, -50%) rotate(45deg); box-shadow: 0 0 6px rgba(231, 182, 112, 0.7); z-index: 2; }
.bar::before { left: -5px; } .bar::after { left: calc(100% + 5px); }
.bar-fill, .bar-lag { position: absolute; inset: 1px; transform-origin: left center; }
.bar-ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(0, 0, 0, 0.55) calc(10% - 1px) 10%); pointer-events: none; }
.hp .bar-lag { background: linear-gradient(180deg, #ffd9c9, #d98f78); opacity: 0.55; }
.hp .bar-fill { background: linear-gradient(180deg, #fff6e6 0%, #efdcbc 45%, #c9a878 100%); box-shadow: 0 0 10px rgba(255, 226, 180, 0.35); }
.hud.low .hp .bar-fill { background: linear-gradient(180deg, #ffb3a4, #e0533f 60%, #a9302a); animation: low 0.9s infinite alternate; }
@keyframes low { to { filter: brightness(1.45); } }
.hud.low .sigil { animation: lowRing 0.9s infinite alternate; }
@keyframes lowRing { to { box-shadow: 0 0 0 1px #ff6a5a, 0 0 26px -2px #ff5040, inset 0 0 12px rgba(0, 0, 0, 0.8); } }
.self-row { display: flex; align-items: center; gap: 14px; margin-top: 11px; }
.hp-num { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; color: rgba(239, 230, 214, 0.62); font-variant-numeric: tabular-nums; }
.embers { display: flex; gap: 7px; align-items: flex-end; }
.ember { position: relative; width: 18px; height: 26px; border-radius: 50% 50% 45% 45% / 62% 62% 38% 38%; background: rgba(255, 190, 120, 0.05); box-shadow: inset 0 0 0 1px rgba(255, 190, 120, 0.34), 0 0 0 1px rgba(0, 0, 0, 0.5); overflow: hidden; }
.ember-fill { position: absolute; inset: 0; transform-origin: bottom center; background: radial-gradient(circle at 50% 72%, #fff4d0, #ffb45e 45%, #d9581f 92%); transition: transform 0.18s; }
.ember.full { box-shadow: inset 0 0 0 1px rgba(255, 220, 160, 0.9), 0 0 16px rgba(255, 170, 80, 0.75); }
.ember-gone { font-family: var(--serif); font-style: italic; color: var(--dim); font-size: 14px; }
.self-vow { font-size: 11px; color: #c4b2dc; font-style: italic; margin-top: 8px; max-width: 300px; padding-left: 10px; border-left: 1px solid rgba(190, 170, 230, 0.4); }
.self-vow:empty { display: none; }

/* ---------------- where you are */
.hud-where { position: absolute; right: 30px; top: 24px; text-align: right; }
.where-name { font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: 0.06em; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9); }
.where-rule { height: 1px; width: 180px; margin: 7px 0 7px auto; background: linear-gradient(90deg, transparent, var(--gold)); }
.where-sub { font-family: var(--sans); font-size: 10.5px; font-weight: 600; color: var(--dim); letter-spacing: 0.24em; text-transform: uppercase; }

/* ---------------- the WEIGHT's bar: a framed plate, phase ticks for guardians and the Apex */
.hud-foe { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); width: min(640px, 62vw); text-align: center; transition: opacity 0.35s, transform 0.35s; }
.hud-foe.hidden { opacity: 0; transform: translate(-50%, -8px); }
.foe-name { font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 9px; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95); display: inline-flex; align-items: center; gap: 14px; }
.foe-name::before, .foe-name::after { content: ''; width: 60px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.foe-name::after { transform: scaleX(-1); }
.foe-frame { padding: 0 8px; }
.bar.foe { width: 100%; height: 13px; }
.foe .bar-lag { background: rgba(210, 190, 255, 0.3); }
.foe .bar-fill { background: linear-gradient(180deg, #8d80a6, #5a4e6e 60%, #3d3350); }
.hud-foe.woken .foe .bar-fill { background: linear-gradient(180deg, #fff0d0, #ffb25e 55%, #d9782c); box-shadow: 0 0 18px rgba(255, 180, 90, 0.85); }
.foe-ph { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--gold-hi); box-shadow: 0 0 6px var(--gold); display: none; z-index: 2; }
.foe-ph.p1 { left: 60%; } .foe-ph.p2 { left: 30%; }
.hud-foe.phased .foe-ph { display: block; }
.foe-skin { margin-top: 8px; font-size: 12.5px; color: var(--dim); min-height: 18px; letter-spacing: 0.02em; }
.foe-skin b { color: var(--warm); letter-spacing: 0.14em; }
.foe-skin i { display: block; height: 2px; margin: 6px auto 0; width: var(--w); background: var(--warm); box-shadow: 0 0 8px var(--warm); }

/* ---------------- the ability dock: tiles, keys, cooldown sweeps */
.hud-verbs { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: flex-start; gap: 10px; padding: 12px 22px 10px;
  background: radial-gradient(ellipse at 50% 100%, rgba(8, 7, 12, 0.88), rgba(8, 7, 12, 0.55) 60%, transparent 76%); }
.dock-sep { width: 1px; align-self: stretch; margin: 6px 2px 18px; background: linear-gradient(180deg, transparent, var(--hair), transparent); }
.verb { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 64px; color: var(--dim); transition: color 0.15s; }
.v-tile { position: relative; isolation: isolate; width: 46px; height: 46px; display: grid; place-items: center; color: rgba(239, 230, 214, 0.72); transition: color 0.15s, filter 0.15s; --chamfer: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px); }
.v-tile::before { content: ''; position: absolute; inset: 0; z-index: -2; clip-path: var(--chamfer); background: var(--tile-bg, linear-gradient(180deg, rgba(34, 30, 44, 0.95), rgba(12, 11, 17, 0.95))); box-shadow: inset 0 -10px 16px rgba(0, 0, 0, 0.5); transition: background 0.15s; }
.v-tile::after { content: ''; position: absolute; inset: 0; z-index: -1; clip-path: var(--chamfer); box-shadow: inset 0 0 0 1px var(--tile-edge, var(--hair)); pointer-events: none; }
.ico { width: 24px; height: 24px; display: block; }
.v-tile kbd { position: absolute; right: -7px; bottom: -6px; z-index: 1; box-shadow: 0 0 0 1px var(--hair); font-size: 8.5px; font-weight: 700; letter-spacing: 0.04em; padding: 1px 4px; border-radius: 3px 0 0 0; background: rgba(0, 0, 0, 0.85); border: none; color: var(--gold-hi); }
.verb > span { font-family: var(--sans); font-size: 9.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; }
.verb-move { font-style: italic; font-family: var(--serif); font-size: 12px; color: rgba(255, 236, 214, 0.6); max-width: 92px; margin-top: -3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.verb-move:empty { display: none; }
.verb.key .v-tile { color: var(--amber); }
.verb.key > span { color: var(--amber); }
.verb.on .v-tile { --tile-bg: linear-gradient(180deg, rgba(255, 171, 82, 0.45), rgba(80, 40, 10, 0.92)); --tile-edge: var(--amber); color: #fff4e0; filter: drop-shadow(0 0 9px rgba(255, 171, 82, 0.6)); }
.verb.warm .v-tile { color: rgba(255, 207, 138, 0.35); }
.verb.warm > span { color: rgba(255, 207, 138, 0.45); }
.verb.warm.ready .v-tile { color: var(--gold-hi); --tile-bg: linear-gradient(180deg, rgba(90, 58, 24, 0.95), rgba(26, 16, 8, 0.95)); --tile-edge: var(--gold); animation: readyPulse 1.6s ease-in-out infinite; }
.verb.warm.ready > span { color: var(--warm); text-shadow: 0 0 10px rgba(255, 180, 90, 0.8); }
@keyframes readyPulse { 0%, 100% { filter: drop-shadow(0 0 0 transparent); } 50% { filter: drop-shadow(0 0 7px rgba(255, 180, 90, 0.85)); } }
.st-cd { position: absolute; inset: 0; z-index: 0; clip-path: var(--chamfer); background: conic-gradient(rgba(4, 4, 8, 0.78) calc(var(--cd, 0) * 360deg), transparent 0); pointer-events: none; }
.verb.stance.ready .v-tile { color: #f1e6d6; }
.verb.stance.on .v-tile { color: #fff1d0; --tile-bg: linear-gradient(180deg, rgba(243, 199, 132, 0.38), rgba(40, 26, 10, 0.95)); --tile-edge: #f3c784; filter: drop-shadow(0 0 9px rgba(243, 199, 132, 0.55)); }
.verb.stance.on > span { color: var(--warm); }
.hud-relics { position: absolute; left: 28px; bottom: 26px; display: flex; gap: 8px; flex-wrap: wrap; max-width: 28vw; }
.relic-pip { width: 30px; height: 30px; display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 12px; color: var(--gold-hi); transform: rotate(45deg);
  background: linear-gradient(180deg, rgba(60, 44, 24, 0.9), rgba(16, 12, 8, 0.9)); box-shadow: 0 0 0 1px var(--hair), 0 0 10px -3px var(--gold); }
.relic-pip > * , .relic-pip { line-height: 1; }
.hint { position: absolute; left: 50%; bottom: 136px; transform: translate(-50%, 10px); max-width: min(640px, 86vw); text-align: center; font-size: 14.5px; line-height: 1.5; padding: 11px 22px 12px; background: var(--glass); box-shadow: 0 0 0 1px var(--hair-lo), 0 12px 30px rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.3s, transform 0.3s; }
.hint::before { content: ''; position: absolute; left: 20%; right: 20%; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.hint.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- room titles */
.b-title { font-family: var(--serif); font-size: clamp(40px, 6vw, 76px); font-weight: 700; letter-spacing: 0.08em; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.95); }
.b-title::after { content: ''; display: block; height: 1px; width: min(520px, 60vw); margin: 12px auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.b-sub { font-family: var(--serif); font-style: italic; font-size: 20px; color: #d4c9b6; margin-top: 10px; }
.banner.show .b-title { animation: bannerIn 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes bannerIn { from { letter-spacing: 0.3em; opacity: 0; } to { letter-spacing: 0.08em; opacity: 1; } }

/* =================================================================== the title: a cinematic menu */
.screen.title-screen { padding: 0; place-items: stretch; background: radial-gradient(ellipse 70% 90% at 58% 50%, transparent 30%, rgba(2, 2, 4, 0.7) 75%, rgba(2, 2, 4, 0.94)); }
.ttl { position: relative; width: 100%; height: 100%; display: grid; grid-template-columns: minmax(360px, 520px) 1fr minmax(340px, 430px); grid-template-rows: 1fr auto; column-gap: 24px; padding: calc(6vh + 20px) clamp(24px, 4vw, 64px) 0; overflow: hidden; }
.ttl::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(3, 3, 6, 0.92) 0%, rgba(3, 3, 6, 0.6) 30%, transparent 46%, transparent 62%, rgba(3, 3, 6, 0.7) 100%); pointer-events: none; }
.lb { position: absolute; left: 0; right: 0; height: 6vh; background: #000; z-index: 3; pointer-events: none; }
.lb-top { top: 0; } .lb-bot { bottom: 0; }
.ttl.open .lb { animation: lbIn 1.1s cubic-bezier(0.3, 0.7, 0.2, 1) both; }
@keyframes lbIn { from { height: 50vh; } to { height: 6vh; } }
.grain { position: absolute; inset: -50%; z-index: 4; pointer-events: none; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(4) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } 100% { transform: translate(0, 0); } }
.ttl-left { position: relative; z-index: 2; align-self: center; display: flex; flex-direction: column; }
.logo-over { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.72em; text-transform: uppercase; color: var(--gold); margin-left: 4px; }
.logo-word { font-family: var(--serif); font-weight: 700; font-size: clamp(60px, 7.2vw, 112px); line-height: 0.92; letter-spacing: 0.06em; margin-top: 6px; padding-right: 0.12em; width: max-content;
  background: linear-gradient(180deg, #fff8ea 0%, #f1dcb6 48%, #b98c52 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 170, 90, 0.28)) drop-shadow(0 6px 20px rgba(0, 0, 0, 0.9)); }
.logo-rule { display: flex; align-items: center; gap: 10px; margin: 14px 0 12px; color: var(--gold); max-width: 440px; }
.logo-rule i { flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }
.logo-rule i:first-child { flex: 0 0 40px; background: linear-gradient(90deg, transparent, var(--gold)); }
.logo-rule .ico { width: 9px; height: 9px; }
.logo-tag { font-family: var(--serif); font-style: italic; font-size: 21px; color: #e2d6c2; }
.menu { display: flex; flex-direction: column; margin-top: 5.5vh; }
.m-item { pointer-events: auto; cursor: pointer; display: grid; grid-template-columns: 22px auto 1fr; align-items: center; column-gap: 8px; text-align: left; background: none; border: none; padding: 9px 0; color: rgba(239, 230, 214, 0.5); font-family: var(--serif); font-size: 25px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; transition: color 0.18s, letter-spacing 0.25s; position: relative; }
.m-mark { color: var(--gold); opacity: 0; transform: translateX(-8px) scale(0.6); transition: all 0.2s; display: grid; place-items: center; }
.m-mark .ico { width: 10px; height: 10px; }
.m-label { white-space: nowrap; }
.m-tag { justify-self: start; margin-left: 6px; font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-hi); padding: 3px 8px; border: 1px solid var(--hair); }
.m-tag.done { opacity: 0.55; }
.m-desc { grid-column: 2 / span 2; font-family: var(--sans); font-size: 12.5px; font-weight: 400; letter-spacing: 0.02em; text-transform: none; color: #b9ae9c; max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.25s, opacity 0.25s, margin 0.25s; }
.m-item.focus { color: #fff5e4; letter-spacing: 0.17em; text-shadow: 0 0 22px rgba(255, 190, 110, 0.45); }
.m-item.focus .m-mark { opacity: 1; transform: none; }
.m-item.focus .m-desc { max-height: 40px; opacity: 1; margin-top: 4px; }
.m-item.focus::after { content: ''; position: absolute; left: 30px; right: 20%; bottom: 2px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }
.m-item[data-go] { color: rgba(255, 214, 160, 0.72); }
.t-opts { margin-top: 3vh; display: flex; flex-direction: column; gap: 12px; }
.t-opt { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 6px 12px; }
.t-opt-l { font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.t-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.t-depth-text { grid-column: 2; font-size: 12px; color: #c4b2dc; }
.chip { pointer-events: auto; cursor: pointer; font: 600 11.5px var(--sans); letter-spacing: 0.06em; color: var(--c, var(--parch)); background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.12); padding: 5px 11px; transition: all 0.15s; }
.chip:hover { border-color: var(--hair); }
.chip.on { background: rgba(231, 182, 112, 0.12); border-color: var(--c, var(--gold)); box-shadow: 0 0 14px -3px var(--c, var(--gold)); color: var(--c, var(--gold-hi)); }

/* who goes down */
.t-right { position: relative; z-index: 2; grid-column: 3; align-self: center; display: flex; flex-direction: column; max-height: 78vh; min-height: 0; padding: 20px 20px 16px; background: var(--glass); box-shadow: 0 0 0 1px var(--hair-lo), 0 30px 80px rgba(0, 0, 0, 0.6);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.t-right::before { content: ''; position: absolute; left: 14px; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, var(--gold), transparent 70%); }
.r-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); }
.r-head i { flex: 1; height: 1px; background: linear-gradient(90deg, var(--hair), transparent); }
.r-detail { padding: 2px 2px 14px; margin-bottom: 12px; border-bottom: 1px solid var(--hair-lo); }
.r-detail.swap { animation: swapIn 0.35s ease-out; }
@keyframes swapIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.nd-head { display: flex; gap: 14px; align-items: center; }
.nd-crest { width: 34px; height: 34px; flex: none; transform: rotate(45deg); border: 1.5px solid var(--tc); box-shadow: 0 0 16px -2px var(--tc), inset 0 0 10px -2px var(--tc); background: radial-gradient(circle, color-mix(in srgb, var(--tc) 35%, transparent), transparent 70%); }
.nd-name { font-family: var(--serif); font-size: 27px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.05; color: #fff4e2; }
.nd-sub { font-size: 12px; color: var(--dim); margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rar { font-size: 9.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; padding: 2px 7px; border: 1px solid currentColor; }
.r-common { color: #b8b2a8; } .r-uncommon { color: #8fd48a; } .r-rare { color: #7fb4ff; } .r-ultra-rare { color: #c79bff; } .r-legendary { color: #ffc862; box-shadow: 0 0 10px -2px #ffc862; }
.nd-gift { margin: 12px 0 10px; font-size: 13.5px; line-height: 1.5; color: #e6dccb; }
.nd-moves { display: grid; gap: 5px; margin-bottom: 12px; }
.nd-move { display: grid; grid-template-columns: 82px 1fr auto; align-items: baseline; gap: 8px; }
.nd-move span { font-size: 9.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); }
.nd-move b { font-family: var(--serif); font-size: 16px; font-weight: 600; color: #f4ead8; }
.nd-move b::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; transform: rotate(45deg) translateY(-2px); background: var(--mc); box-shadow: 0 0 6px var(--mc); }
.nd-move em { font-size: 10.5px; color: #f3c784; font-style: normal; letter-spacing: 0.1em; text-transform: uppercase; }
.nd-bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pb span { display: block; font-size: 9px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin-bottom: 5px; }
.pb i { display: flex; gap: 2px; }
.pb b { flex: 1; height: 5px; background: rgba(255, 255, 255, 0.08); transform: skewX(-20deg); }
.pb b.on { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); box-shadow: 0 0 6px -1px var(--gold); }
.nd-rec { margin-top: 10px; font-size: 11.5px; color: var(--dim); }
.nd-reach { margin-top: 8px; font-family: var(--serif); font-style: italic; color: #c4b2dc; font-size: 14px; }
.r-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; align-content: start; padding: 2px 4px 2px 2px; }
.nk { pointer-events: auto; cursor: pointer; position: relative; display: grid; grid-template-columns: 12px 1fr; column-gap: 8px; align-items: center; text-align: left; padding: 9px 10px; background: rgba(255, 255, 255, 0.025); border: 1px solid rgba(255, 255, 255, 0.06); color: var(--parch); font-family: var(--sans); transition: background 0.12s, border-color 0.12s, transform 0.12s; }
.nk:hover { background: rgba(255, 255, 255, 0.06); transform: translateY(-1px); }
.nk.on { background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 16%, transparent), rgba(255, 255, 255, 0.02)); border-color: color-mix(in srgb, var(--tc) 60%, transparent); box-shadow: 0 0 18px -8px var(--tc); }
.nk-crest { grid-row: span 2; width: 9px; height: 9px; transform: rotate(45deg); background: var(--tc); box-shadow: 0 0 8px -1px var(--tc); }
.nk-name { font-family: var(--serif); font-size: 16.5px; font-weight: 600; line-height: 1.1; }
.nk-meta { font-size: 10px; color: var(--dim); letter-spacing: 0.04em; }
.nk-apex { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; transform: rotate(45deg); background: var(--warm); box-shadow: 0 0 8px var(--warm); }
.nk-reach { position: absolute; bottom: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: #2a1840; box-shadow: 0 0 0 1.5px #9d86c8; }
.ttl-foot { position: relative; z-index: 5; grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; height: 6vh; min-height: 34px; margin: 0 calc(-1 * clamp(24px, 4vw, 64px)); padding: 0 clamp(24px, 4vw, 64px); font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(239, 230, 214, 0.5); }
.f-prompts { display: flex; align-items: center; gap: 8px; }
.f-prompts kbd { font-size: 10px; padding: 1px 6px; margin-left: 8px; }
.f-prompts kbd + kbd { margin-left: 2px; }
/* the gate, and the reveal once it opens */
.gate { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: auto; cursor: pointer; background: radial-gradient(ellipse at center, rgba(3, 3, 6, 0.35), rgba(3, 3, 6, 0.9)); transition: opacity 0.8s; }
.gate-over { font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: 0.9em; text-transform: uppercase; color: var(--gold); margin-left: 0.9em; animation: fadeUp 1.4s 0.2s both; }
.gate-word { font-family: var(--serif); font-weight: 700; font-size: clamp(72px, 12vw, 180px); letter-spacing: 0.08em; line-height: 1; margin-top: 10px; padding: 0 0.12em;
  background: linear-gradient(180deg, #fff8ea 0%, #f1dcb6 48%, #b98c52 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 40px rgba(255, 160, 80, 0.35)); animation: gateIn 2.2s cubic-bezier(0.2, 0.6, 0.2, 1) both; }
.gate-press { margin-top: 7vh; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.5em; text-transform: uppercase; color: #efe6d6; animation: fadeUp 1s 1.6s both, pressPulse 2.2s 2.6s ease-in-out infinite; }
@keyframes gateIn { from { opacity: 0; letter-spacing: 0.5em; filter: blur(8px) drop-shadow(0 0 40px rgba(255, 160, 80, 0)); } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pressPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.ttl.gated .ttl-left, .ttl.gated .t-right, .ttl.gated .ttl-foot { opacity: 0; }
.ttl.open .gate { opacity: 0; pointer-events: none; }
.ttl.open .logo { animation: fadeUp 0.9s 0.15s both; }
.ttl.open .m-item { animation: fadeUp 0.6s both; }
.ttl.open .m-item:nth-child(1) { animation-delay: 0.35s; } .ttl.open .m-item:nth-child(2) { animation-delay: 0.42s; } .ttl.open .m-item:nth-child(3) { animation-delay: 0.49s; }
.ttl.open .m-item:nth-child(4) { animation-delay: 0.56s; } .ttl.open .m-item:nth-child(5) { animation-delay: 0.63s; } .ttl.open .m-item:nth-child(6) { animation-delay: 0.7s; } .ttl.open .m-item:nth-child(7) { animation-delay: 0.77s; } .ttl.open .m-item:nth-child(8) { animation-delay: 0.84s; } .ttl.open .m-item:nth-child(9) { animation-delay: 0.91s; } .ttl.open .m-item:nth-child(n+10) { animation-delay: 0.98s; }
.ttl.open .t-opts { animation: fadeUp 0.6s 0.8s both; }
.ttl.open .t-right { animation: panelIn 0.8s 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.ttl.open .ttl-foot { animation: fadeUp 0.6s 0.9s both; }
@keyframes panelIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* buttons everywhere else speak the same language */
.btn { border-radius: 0; letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.btn.primary, .btn.refuse { background: linear-gradient(180deg, #f6d29a, #d69a4c); }
.screen .card { border-radius: 0; clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.p-head { letter-spacing: 0.06em; }
.p-head::after { content: ''; display: block; height: 1px; width: min(420px, 60vw); margin: 10px auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

@media (max-width: 1100px) { .ttl { grid-template-columns: minmax(320px, 460px) 0 minmax(300px, 1fr); } }
@media (max-width: 820px) {
  /* narrow: one scrolling column, logo, menu, then the roster */
  .ttl { display: flex; flex-direction: column; overflow-y: auto; padding: calc(6vh + 16px) 16px calc(6vh + 16px); }
  .ttl-left, .t-right { align-self: stretch; flex: none; }
  .lb { display: none; } /* the letterbox belongs to a still frame, not a scrolling column */
  .t-right { max-height: none; margin-top: 24px; }
  .logo-word { font-size: clamp(44px, 14vw, 72px); }
  .logo-over { letter-spacing: 0.5em; }
  .menu { margin-top: 3vh; }
  .m-item { font-size: 19px; padding: 7px 0; }
  .t-opt { grid-template-columns: 1fr; }
  .ttl-foot { display: none; }
  .nd-bars { grid-template-columns: repeat(3, 1fr); }
  .hud-verbs { display: none; }
  .bar { width: 170px; }
}

/* keyboard / pad focus on any menu: a gold ring and a lift, the same language as hover */
/* chamfered cards and buttons clip anything drawn outside them, so the focus ring is drawn inside */
.screen button.kfocus { outline: none; position: relative; transform: translateY(-3px); filter: brightness(1.12); }
.screen button.kfocus::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 28px -8px var(--gold); }
.screen .chip.kfocus, .screen .vow.kfocus, .screen .m-item.kfocus { transform: none; }

@media (max-width: 560px) {
  .hud-where { display: none; } /* the room names itself in its banner; the corner is the player's plate */
  .hud-self { left: 14px; top: 14px; }
  .sigil { width: 44px; height: 44px; }
  .self-name { font-size: 19px; }
  .bar { width: 150px; }
  .chain { right: 18px; }
  .hint { bottom: 24px; }
}

/* the wallet link (NFT Stage 1) */
.walletp { max-width: 520px; margin: 0 auto; text-align: center; }
.w-list { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0 8px; }
.w-pick img { width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; }
.w-none, .w-msg, .w-linked { color: var(--dim); font-size: 14px; line-height: 1.5; margin: 10px 0; }
.w-linked { color: var(--warm); }
.w-or { color: var(--dim); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 14px; }
.w-addr { display: flex; gap: 8px; margin-top: 8px; }
.w-in { flex: 1; min-width: 0; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--edge); color: var(--parch); font: 14px var(--sans); padding: 10px 12px; }
.w-foot { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }

/* the Sanctuary's holder corner (NFT Stage 1) */
.s-mine { margin: 22px auto 0; padding: 14px 18px; max-width: 560px; text-align: left; pointer-events: auto; background: rgba(12, 10, 16, 0.82); border: 1px solid var(--edge); border-radius: 10px; backdrop-filter: blur(4px); }
.s-mh { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.s-pig { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 0; }
.s-pn { color: var(--parch); font-weight: 600; }
.s-pt, .s-ps, .s-cur { color: var(--dim); font-size: 13px; }
.s-pig.home .s-ps { color: var(--warm); }
.s-bye { color: var(--dim); font-style: italic; font-size: 14px; margin: 6px 0; }
.s-none, .s-pmsg { color: var(--dim); font-size: 14px; margin: 6px 0; }
.s-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.s-pl { color: var(--parch); font-size: 14px; flex-basis: 100%; }
.s-in { background: rgba(0, 0, 0, 0.35); border: 1px solid var(--edge); color: var(--parch); font: 14px var(--sans); padding: 8px 10px; min-width: 0; max-width: 260px; }

/* the Deadwake card (NFT Stage 1) */
.e-shared { color: var(--dim); font-size: 14px; margin-top: 10px; min-height: 18px; }
.w-signed { color: var(--warm); font-size: 14px; margin: 14px 0 4px; }
.w-note { color: var(--dim); font-size: 12px; margin-top: 6px; }

/* the Daily Cup (Stage 2b) */
.cupp { max-width: 760px; margin: 0 auto; text-align: center; }
.c-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; text-align: left; }
@media (max-width: 640px) { .c-cols { grid-template-columns: 1fr; } }
.c-col { background: rgba(12, 10, 16, 0.78); border: 1px solid var(--edge); border-radius: 10px; padding: 12px 14px; }
.c-h { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.c-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; padding: 4px 0; font-size: 14px; color: var(--parch); }
.c-row.mine { color: var(--warm); }
.c-rk { color: var(--dim); }
.c-sc { color: var(--dim); font-size: 13px; }
.c-you { color: var(--warm); margin-top: 8px; font-size: 14px; }
.c-none, .c-note { color: var(--dim); font-size: 13px; margin-top: 6px; }
.c-split { color: var(--dim); font-size: 13px; line-height: 1.5; margin: 16px auto 0; max-width: 620px; }

/* the Shop (Stage 2c) */
.shopp { max-width: 880px; margin: 0 auto; text-align: center; }
.sh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; text-align: left; max-height: 58vh; overflow: auto; pointer-events: auto; }
@media (max-width: 720px) { .sh-grid { grid-template-columns: 1fr; } }
.sh-sec { background: rgba(12, 10, 16, 0.8); border: 1px solid var(--edge); border-radius: 10px; padding: 10px 12px; }
.sh-row { display: grid; grid-template-columns: 16px 1fr auto auto; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; color: var(--parch); }
.sh-sw { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.2); }
.sh-p { color: var(--dim); font-size: 12px; }
.sh-msg { color: var(--warm); font-size: 14px; min-height: 20px; margin-top: 10px; }
.chip.buy { border-color: var(--warm); color: var(--warm); }
.c-title { color: var(--warm); font-style: italic; font-size: 12px; }
.c-pot { color: var(--parch); font-size: 15px; margin-top: 14px; }
.c-pot b { color: var(--warm); }
.s-heard { color: var(--warm); font-style: italic; font-size: 14px; margin: 10px auto 0; max-width: 560px; }

/* F15: the title's menu grew (the Shop, the Cup, Bring your own Nike): on shorter screens it tightens, and the left column scrolls */
@media (max-height: 900px) and (min-width: 821px) {
  .m-item { font-size: 20px; padding: 6px 0; }
}
@media (min-width: 821px) { .ttl-left { overflow-y: auto; max-height: calc(100vh - 6vh - 40px); } }

/* =====================================================================================================================
   A PHONE HELD SIDEWAYS (touch controls). body.touch is set by src/touch.js; the short-screen rules apply to any input.
   Everything here is gated by body.touch, a max-height of 500px, hover:none or portrait, so the desktop is unchanged.
   ================================================================================================================== */
:root { --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px); --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior: none; }
#game, .touch-ui { touch-action: none; }
.nw { white-space: nowrap; }

/* one string, two variants: CSS shows the one for the current input */
.t-only { display: none; }
body.touch .t-only { display: inline; }
body.touch .k-only { display: none; }
kbd.tk { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 1px 8px; border-radius: 999px; white-space: nowrap; color: var(--gold-hi); background: rgba(231, 182, 112, 0.1); border: 1px solid var(--hair); box-shadow: 0 0 8px -3px var(--gold); }

body.touch { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.touch input, body.touch textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* ---------------- the layer: a floating stick under the left thumb, a pad under the right */
.touch-ui { display: none; position: absolute; inset: 0; }
body.touch .touch-ui.live { display: block; }
.t-zone { position: absolute; left: 0; top: 28%; bottom: 0; width: 44%; pointer-events: auto; }
.t-stick { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; pointer-events: none;
  left: calc(max(12px, var(--sl)) + 72px); top: calc(100% - max(10px, var(--sb)) - 72px); opacity: 0.35; transition: opacity 0.15s;
  background: radial-gradient(circle, rgba(8, 7, 12, 0.2) 40%, rgba(8, 7, 12, 0.62) 72%); box-shadow: 0 0 0 1px var(--hair), inset 0 0 22px rgba(0, 0, 0, 0.55); }
.t-stick.on { opacity: 0.9; }
.t-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; transform: translate(var(--kx, 0px), var(--ky, 0px));
  background: radial-gradient(circle at 50% 38%, var(--gold-hi), var(--gold) 52%, rgba(120, 78, 30, 0.95) 100%); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 18px rgba(231, 182, 112, 0.45); }
.t-pad { position: absolute; right: max(12px, var(--sr)); bottom: max(10px, var(--sb)); width: 300px; height: 200px; pointer-events: none; }
.t-btn { position: absolute; pointer-events: auto; transform: translate(-50%, -50%); border-radius: 50%; width: var(--d); height: var(--d); isolation: isolate;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; touch-action: none; -webkit-user-select: none; user-select: none;
  color: rgba(239, 230, 214, 0.82); background: radial-gradient(circle at 50% 32%, rgba(40, 35, 52, 0.8), rgba(10, 9, 14, 0.84)); box-shadow: 0 0 0 1px var(--hair), inset 0 -8px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.08s, filter 0.08s, color 0.15s, box-shadow 0.15s; }
.t-btn .ico { width: calc(var(--d) * 0.34); height: calc(var(--d) * 0.34); flex: none; }
.t-btn > span { font-family: var(--sans); font-size: 9px; font-weight: 600; letter-spacing: 0.01em; text-transform: uppercase; line-height: 1; white-space: nowrap; }
/* centres inside the 300×200 pad; every pair of circles is at least 6px apart. Stance sits above the right thumb,
   by Plant, well away from the ember buttons. */
.t-btn[data-t='jab'] { left: 252px; top: 150px; --d: 78px; }
.t-btn[data-t='jab'] > span { font-size: 10px; letter-spacing: 0.1em; }
.t-btn[data-t='plant'] { left: 262px; top: 76px; --d: 58px; }
.t-btn[data-t='heavy'] { left: 186px; top: 96px; --d: 62px; }
.t-btn[data-t='step'] { left: 168px; top: 168px; --d: 58px; }
.t-btn[data-t='send'] { left: 96px; top: 168px; --d: 52px; }
.t-btn[data-t='finisher'] { left: 112px; top: 100px; --d: 54px; }
.t-btn[data-t='stance'] { left: 230px; top: 24px; --d: 48px; }
.t-btn.down { transform: translate(-50%, -50%) scale(0.94); filter: brightness(1.4); box-shadow: 0 0 0 1.5px var(--gold), inset 0 -8px 14px rgba(0, 0, 0, 0.45); }
.t-btn.key { color: var(--amber); box-shadow: 0 0 0 1px rgba(255, 171, 82, 0.5), inset 0 -8px 14px rgba(0, 0, 0, 0.45); }
.t-btn.on { color: #fff4e0; background: radial-gradient(circle at 50% 32%, rgba(255, 171, 82, 0.5), rgba(80, 40, 10, 0.92)); box-shadow: 0 0 0 2px var(--amber), 0 0 16px rgba(255, 171, 82, 0.55); }
.t-btn.warm { color: rgba(255, 207, 138, 0.55); }
.t-btn.warm.ready { color: var(--gold-hi); background: radial-gradient(circle at 50% 32%, rgba(90, 58, 24, 0.95), rgba(26, 16, 8, 0.95)); box-shadow: 0 0 0 1.5px var(--gold); animation: readyPulse 1.6s ease-in-out infinite; }
.t-btn .st-cd { z-index: -1; clip-path: none; border-radius: 50%; }
.t-btn.stance.ready { color: #f1e6d6; }
.t-btn.stance.on { color: #fff1d0; background: radial-gradient(circle at 50% 32%, rgba(243, 199, 132, 0.42), rgba(40, 26, 10, 0.95)); box-shadow: 0 0 0 2px #f3c784, 0 0 14px rgba(243, 199, 132, 0.5); }
.t-btn.hide { display: none; }
.t-pause { position: absolute; top: max(6px, var(--st)); right: max(8px, var(--sr)); width: 44px; height: 44px; border-radius: 50%; pointer-events: auto; touch-action: none;
  display: flex; align-items: center; justify-content: center; gap: 6px; background: rgba(8, 7, 12, 0.62); box-shadow: 0 0 0 1px var(--hair); }
.t-pause i { width: 4px; height: 16px; border-radius: 1px; background: var(--parch); }

/* the keyboard's furniture has no place on a touch screen */
body.touch .hud-verbs, body.touch .f-prompts, body.touch .tut-next kbd { display: none; }

/* ---------------- short screens (a phone on its side is ~342px tall): every input */
@media (max-height: 500px) {
  .hud-self { left: max(12px, var(--sl)); top: max(8px, var(--st)); gap: 10px; }
  .sigil { width: 36px; height: 36px; }
  .sigil i { inset: 11px; }
  .self-name { font-size: 16px; margin: 1px 0 6px; }
  .bar { width: 150px; height: 9px; }
  .self-row { margin-top: 7px; gap: 10px; }
  .embers { gap: 5px; }
  .ember { width: 12px; height: 17px; }
  .hp-num { font-size: 10px; }
  .self-vow { font-size: 10px; margin-top: 5px; max-width: 200px; }
  .hud-where { top: max(8px, var(--st)); right: max(12px, var(--sr)); }
  .where-name { font-size: 16px; }
  .where-rule { width: 120px; margin: 5px 0 5px auto; }
  .hud-foe { top: max(6px, var(--st)); width: min(340px, 44vw); }
  .foe-name { font-size: 15px; margin-bottom: 5px; gap: 10px; }
  .foe-name::before, .foe-name::after { width: 30px; }
  .foe-skin { font-size: 11px; margin-top: 5px; }
  .chain { top: 24%; }
  .chain-n { font-size: 44px; }
  .chain[data-tier='3'] .chain-n { font-size: 50px; }
  .chain[data-tier='4'] .chain-n { font-size: 58px; }
  .callout { top: 18%; font-size: 26px; }
  .b-title { font-size: 34px; }
  .b-sub { font-size: 16px; }
  .deed { width: 240px; top: calc(max(8px, var(--st)) + 56px); padding: 10px 14px; }

  /* screens: centred while they fit, and scrolled from the top when they don't */
  .screen, .screen.altar-screen, .screen.sanct-screen { place-items: start center; padding: max(8px, var(--st)) max(14px, var(--sr)) max(8px, var(--sb)) max(14px, var(--sl)); }
  .screen:not(.title-screen) > * { margin-block: auto; }
  .p-head { font-size: 26px; }
  .p-head::after { margin-top: 6px; }
  .p-sub { font-size: 12.5px; }
  .cards { gap: 10px; margin: 12px 0; }
  .card { width: min(210px, calc((100vw - 60px) / 3)); min-height: 0; padding: 12px; gap: 6px; }
  .c-art { height: 40px; font-size: 22px; }
  .c-text { font-size: 12.5px; line-height: 1.4; }
  .nolem-line { font-size: 19px; }
  .vow { width: 200px; }
  .e-title, .ending .e-title { font-size: 40px; }
  .e-stats, .ending .e-stats { grid-template-columns: repeat(6, 1fr); }
  .pause { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: stretch; width: min(520px, 100%); }
  .pause .p-head, .pause [data-r] { grid-column: 1 / -1; }
  .pause .p-head { text-align: center; }
  .pause .btn { padding: 10px 14px; }
  /* the title: the logo shrinks and loses its rule and tagline, so the whole menu shows */
  .ttl { padding-top: max(16px, var(--st)); }
  .lb { height: 10px; }
  .logo-over { font-size: 10px; letter-spacing: 0.5em; }
  .logo-word { font-size: 40px; margin-top: 2px; }
  .logo-rule, .logo-tag { display: none; }
  .menu { margin-top: 8px; }
  .m-item { font-size: 16px; padding: 2px 0; letter-spacing: 0.12em; }
  .m-item.focus { letter-spacing: 0.14em; }
  .m-desc { font-size: 11.5px; }
  .m-item.focus .m-desc { margin-top: 2px; }
  .t-opts { margin-top: 12px; }
}
@media (max-height: 500px) and (min-width: 821px) {
  .ttl-left { max-height: calc(100vh - max(16px, var(--st)) - max(34px, 6vh) - 6px); }
}
@media (max-height: 500px) and (max-width: 820px) {
  .ttl-left::after { content: none; }
  .ttl { padding-bottom: 12px; }
  .ttl::after { content: ''; position: sticky; bottom: -12px; z-index: 5; flex: none; display: block; height: 26px; margin-top: -26px; pointer-events: none; background: linear-gradient(rgba(3, 3, 6, 0), rgba(3, 3, 6, 0.9)); }
}
@media (max-height: 500px) {

  /* the lesson card: under the player's plate, clear of the foe bar and the middle of the room; its body scrolls */
  .tut { left: max(12px, var(--sl)); right: auto; top: calc(max(8px, var(--st)) + 58px); bottom: auto; width: min(360px, 30vw); max-height: calc(100% - max(8px, var(--st)) - 58px - 112px);
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-areas: 'count title skip' 'body body body' 'hint hint hint' 'wait wait next';
    column-gap: 10px; row-gap: 4px; align-items: center; padding: 7px 12px 8px; transform: translate(-6px, 0); }
  .tut.show { transform: translate(0, 0); }
  .tut-top, .tut-foot { display: contents; }
  .tut-count { grid-area: count; font-size: 10px; }
  .tut-title { grid-area: title; font-size: 15px; line-height: 1.2; }
  .tut-skip { grid-area: skip; justify-self: end; padding: 1px 8px; font-size: 10.5px; }
  .tut-body { grid-area: body; align-self: stretch; font-size: 12px; line-height: 1.4; margin-top: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
  .tut-hint { grid-area: hint; font-size: 11.5px; margin-top: 0; }
  .tut-hint.show { max-height: 32px; }
  .tut-wait, .tut-foot .tut-wait { grid-area: wait; margin-top: 0; font-size: 10.5px; }
  .tut-next { grid-area: next; padding: 4px 14px; font-size: 13px; }
  /* while the card is up, the lesson is the only voice: no hint under it, and the corner's room name steps back */
  #ui:has(.tut.show) .hint, #ui:has(.tut.show) .hud-where { visibility: hidden; }
  #screen:not(.hidden) ~ .banner { visibility: hidden; }
}
/* a card body with more below: its last line fades until it has been scrolled to the end */
@supports (animation-timeline: scroll()) {
  @media (max-height: 500px) {
    .tut-body { animation: tutMore linear both; animation-timeline: scroll(self); }
  }
}
@keyframes tutMore { 0%, 92% { -webkit-mask-image: linear-gradient(#000 calc(100% - 18px), transparent); mask-image: linear-gradient(#000 calc(100% - 18px), transparent); } 100% { -webkit-mask-image: none; mask-image: none; } }
@supports not (animation-timeline: scroll()) {
  @media (max-height: 500px) {
    .tut-body { background: linear-gradient(rgba(10, 10, 16, 0), rgb(10, 10, 16) 70%) bottom / 100% 16px no-repeat local, linear-gradient(rgba(255, 190, 120, 0), rgba(255, 190, 120, 0.3)) bottom / 100% 10px no-repeat scroll; }
  }
}

/* ---------------- touch overrides: after the short-screen rules, so they win */
/* hints: one compact line along the bottom, between the stick's rest ring (ends 144px in) and the pad's leftmost
   button (242px in from the right), and stays clear of the pad down to 640px wide; clear of banners, callouts and the foe bar */
body.touch .hint { top: auto; bottom: max(10px, var(--sb)); left: min(calc(max(12px, var(--sl)) + 140px), calc(50% - 90px)); right: calc(max(12px, var(--sr)) + 250px);
  width: fit-content; max-width: 560px; margin: 0 auto; padding: 6px 12px 7px; font-size: 12px; line-height: 1.35; transform: translate(0, 8px); }
body.touch .hint.show { transform: translate(0, 0); }
body.touch .hint kbd.tk { font-size: 9px; padding: 0 6px; }
body.touch .hud-relics { left: max(28px, var(--sl)); top: calc(max(24px, var(--st)) + 112px); bottom: auto; max-width: 220px; }
body.touch .hud-where { right: 82px; }
body.touch #screen:not(.hidden) ~ .tut { visibility: hidden; }
body.touch #screen:not(.hidden) ~ .banner { visibility: hidden; }
body.touch #ui:has(.tut.show) .hint { visibility: hidden; }
/* the lesson card on a tablet: top right, under the room's name, so the left thumb's side stays open */
body.touch .tut { left: auto; right: max(16px, var(--sr)); top: calc(max(24px, var(--st)) + 86px); width: min(360px, 36vw); max-height: calc(100% - max(24px, var(--st)) - 86px - max(10px, var(--sb)) - 216px); overflow-y: auto; }
@media (max-height: 500px) {
  body.touch .hud-relics { left: max(12px, var(--sl)); top: calc(max(8px, var(--st)) + 84px); }
  body.touch .hud-where { right: calc(max(12px, var(--sr)) + 52px); }
  body.touch .chain { top: calc(max(8px, var(--st)) + 58px); right: calc(max(12px, var(--sr)) + 52px); }
  /* the lesson card on a phone: under the player's plate, ending above the stick's rest ring. Only its buttons and
     its scrolling body take a touch, so a thumb anywhere else still finds the stick. */
  body.touch .tut { left: max(12px, var(--sl)); right: auto; top: calc(max(8px, var(--st)) + 58px); width: min(300px, 42vw); overflow: visible;
    max-height: calc(100% - max(8px, var(--st)) - 58px - max(10px, var(--sb)) - 143px); pointer-events: none; }
  body.touch .tut button, body.touch .tut .tut-body { pointer-events: auto; }
}

@media (hover: none) {
  .card:hover, .btn.primary:hover { transform: none; }
}

/* ---------------- held upright: ask for the phone on its side */
#turn { display: none; position: fixed; inset: 0; z-index: 100; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; background: var(--ink); color: var(--parch); font-family: var(--sans); }
@media (orientation: portrait) and (pointer: coarse) and (max-width: 600px) { #turn { display: flex; } }
@media (orientation: portrait) and (pointer: coarse) { body.touch #turn { display: flex; } }
.turn-phone { position: relative; width: 44px; height: 78px; margin-bottom: 18px; border-radius: 9px; border: 2px solid var(--gold); box-shadow: 0 0 20px -4px var(--gold); animation: turnPhone 2.4s ease-in-out infinite; }
.turn-phone::after { content: ''; position: absolute; left: 50%; bottom: 5px; width: 12px; height: 2px; margin-left: -6px; border-radius: 1px; background: var(--gold); }
@keyframes turnPhone { 0%, 20% { transform: rotate(0deg); } 50%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0deg); } }
.turn-t { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--warm); }
.turn-s { font-size: 14px; line-height: 1.45; color: var(--dim); max-width: 280px; }
