/* Long Time Comin'. The look of the TikZ art and Sam_Comm_final.png: one
   plum ink, warm yellow paper, salmon and coral, sage, cool orbs. */
:root {
  --ink: #3b2340;
  --ink-soft: #5a3b5f;
  --paper: #f6e7c4;
  --paper-2: #efd9a8;
  --sky: #efc46a;
  --salmon: #e88a73;
  --coral: #e47a7e;
  --sage: #8dbb7e;
  --teal: #13cfe3;
  --orange: #ff8a3d;
  --magenta: #ff2e88;
  --gold: #ffb000;
  --violet: #7b2ff7;
  --red: #ff4f6d;
  --display: "Avenir Next Condensed", "Futura", "Trebuchet MS", "Helvetica Neue", Arial, sans-serif;
  --type: "Courier New", Courier, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--sky); color: var(--ink); font-family: var(--display); }
canvas#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; color: var(--ink); background: var(--paper); border: 3px solid var(--ink); border-radius: 10px; padding: 8px 16px; box-shadow: 4px 4px 0 var(--ink); transition: transform 80ms, box-shadow 80ms; }
button:hover:not(:disabled) { background: #fff3d6; }
button:active:not(:disabled) { box-shadow: 1px 1px 0 var(--ink); translate: 3px 3px; }
button:disabled { opacity: 0.55; cursor: default; }
button.big { font-size: 1.25rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 12px 26px; background: var(--salmon); }
button.big:hover:not(:disabled) { background: #f29c86; }
button.small { font-size: 0.8rem; padding: 4px 10px; box-shadow: 2px 2px 0 var(--ink); }
button.secret { background: none; border: 0; box-shadow: none; color: var(--ink); opacity: 0.18; font-size: 0.9rem; padding: 0; float: right; cursor: pointer; }
button.secret:hover:not(:disabled), button.secret:focus-visible { opacity: 1; background: none; }
#chumbles-bars { clear: both; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 12px; }
#chumbles-bars[hidden] { display: none; }
button.secret.bar { float: none; opacity: 0.6; font-size: 0.75rem; letter-spacing: 0.05em; }
button.armed { background: var(--red); color: #fff; }

.overlay { position: fixed; inset: 0; z-index: 10; overflow: auto; }
.overlay .art { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.overlay .art.dim { filter: saturate(0.9) brightness(0.92); }
.overlay.center { display: flex; align-items: center; justify-content: center; background: rgba(59, 35, 64, 0.45); }
.panel { background: var(--paper); border: 4px solid var(--ink); border-radius: 16px; box-shadow: 8px 8px 0 var(--ink); padding: 22px 28px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; max-width: min(92vw, 560px); }
.panel h2 { margin: 0; font-size: 2rem; text-transform: uppercase; letter-spacing: 0.05em; }
table.controls { border-collapse: collapse; font-size: 0.85rem; }
table.controls td { padding: 2px 8px; border-bottom: 1px dashed var(--ink-soft); }
table.controls td:first-child { font-weight: 700; white-space: nowrap; }

/* ---- the title ---- */
#title { display: flex; align-items: flex-end; justify-content: flex-start; }
.title-block { margin: 0 0 7vh 6vw; background: var(--paper); border: 4px solid var(--ink); border-radius: 18px; box-shadow: 10px 10px 0 var(--ink); padding: 22px 30px 26px; max-width: min(90vw, 620px); }
.title-block h1 { margin: 0; font-size: clamp(2.6rem, 6vw, 4.8rem); line-height: 0.95; text-transform: uppercase; letter-spacing: 0.02em; color: var(--ink); text-shadow: 3px 3px 0 var(--salmon); }
.title-block .subtitle { margin: 10px 0 18px; font-size: 1.15rem; }
.build { position: fixed; right: 10px; bottom: 6px; font-size: 0.7rem; opacity: 0.6; font-family: var(--type); }

/* ---- paper screens: the sentencing, the indictment, the verdict ---- */
.overlay.paper { display: flex; align-items: center; justify-content: flex-end; }
.sheet { position: relative; margin: 4vh 5vw; width: min(92vw, 640px); max-height: 92vh; overflow: auto; background: var(--paper); border: 4px solid var(--ink); border-radius: 6px; box-shadow: 10px 10px 0 var(--ink); padding: 26px 34px; font-family: var(--type); font-size: 1rem; line-height: 1.45; }
.sheet .case { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 14px; }
.sheet .line { opacity: 0; animation: type-in 900ms ease forwards; animation-delay: calc(var(--k) * 1100ms + 300ms); }
.sheet .stamp { display: inline-block; font-family: var(--display); font-weight: 900; font-size: 1.6rem; color: #b3262e; border: 4px solid #b3262e; border-radius: 6px; padding: 2px 12px; rotate: -3deg; margin-bottom: 12px; letter-spacing: 0.06em; }
.sheet ol { padding-left: 0; list-style: none; margin: 0 0 8px; }
.sheet ol li { opacity: 0.6; margin-bottom: 6px; font-size: 0.9rem; }
.sheet .newest { font-weight: 700; font-size: 1.05rem; animation: type-in 1400ms ease both; border-left: 5px solid #b3262e; padding-left: 12px; }
.sheet .served { font-style: italic; }
.sheet .earned { font-family: var(--display); font-weight: 700; }
.sheet button { margin-top: 10px; }
@keyframes type-in { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }

/* ---- the Holding ---- */
#holding { padding: 3vh 2vw; }
.holding-grid { display: grid; grid-template-columns: minmax(250px, 1fr) minmax(360px, 2.2fr) minmax(240px, 1fr); gap: 18px; align-items: start; }
.holding-grid section { background: var(--paper); border: 4px solid var(--ink); border-radius: 14px; box-shadow: 7px 7px 0 var(--ink); padding: 16px 18px; }
.holding-grid h2 { margin: 0; font-size: 2rem; text-transform: uppercase; }
.holding-grid h3 { margin: 0 0 8px; text-transform: uppercase; }
.holding-grid h4 { margin: 12px 0 4px; }
.lede { margin: 4px 0 10px; }
.stats { display: flex; gap: 10px; }
.stats > div { flex: 1; display: flex; flex-direction: column; align-items: center; background: var(--paper-2); border: 2px solid var(--ink); border-radius: 10px; padding: 6px; font-size: 0.75rem; text-transform: uppercase; text-align: center; }
.big-num { font-size: 1.9rem; font-weight: 900; }
#m-build { margin: 0 0 12px; padding-left: 18px; }
#start-run { width: 100%; margin: 6px 0 12px; }
#carry { margin: 0 0 12px; }
#carry[hidden] { display: none; }
#carry h4 { margin: 0 0 6px; }
#carry-guns { display: flex; flex-wrap: wrap; gap: 6px; }
button.carry-gun { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px; border-radius: 10px; background: #fff3d6; font-size: 0.75rem; opacity: 0.7; }
button.carry-gun img { width: 72px; height: 29px; object-fit: contain; }
button.carry-gun.chosen { background: var(--salmon); opacity: 1; font-weight: 800; }
.tools { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.credit { font-size: 0.75rem; opacity: 0.75; margin: 8px 0 0; }
/* the shop: a passive tree after Path of Exile 2's, a ring round a hub and a
   wedge for each branch bursting out of it; the core places everything */
.tree { position: relative; width: 100%; aspect-ratio: 1; }
#tree-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wedge { stroke: var(--ink); stroke-width: 3; stroke-opacity: 0.35; }
.wedge.body { fill: #f3b4a2; } .wedge.motion { fill: #bfe0e6; } .wedge.arms { fill: #f4cf8a; } .wedge.writs { fill: #cdbbe8; }
.wedge { fill-opacity: 0.55; }
.ring { fill: none; stroke: var(--ink); stroke-width: 7; stroke-opacity: 0.5; }
.hub { fill: var(--paper-2); stroke: var(--ink); stroke-width: 6; }
.edge { stroke: var(--ink); stroke-width: 6; stroke-opacity: 0.35; stroke-linecap: round; }
.edge.open { stroke: var(--orange); stroke-opacity: 0.9; stroke-dasharray: 10 8; }
.edge.lit { stroke: var(--gold); stroke-opacity: 1; stroke-width: 10; }
#tree-labels, #upgrades { position: absolute; inset: 0; pointer-events: none; }
.branch-name { position: absolute; translate: -50% -50%; font-size: clamp(0.6rem, 1.1vw, 0.85rem); font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.75; }
.tree-hub { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: flex; flex-direction: column; align-items: center; font-size: 0.7rem; text-transform: uppercase; pointer-events: none; }
.upgrade { pointer-events: auto; position: absolute; translate: -50% -50%; width: 4.8%; aspect-ratio: 1; padding: 0; border-radius: 50%; border-width: 2px; box-shadow: 2px 2px 0 var(--ink); background: #e9dcc0; display: grid; place-items: center; }
.upgrade .icon { width: 82%; height: 82%; object-fit: contain; filter: grayscale(0.85) opacity(0.6); }
.upgrade[data-ring="0"] { width: 5.4%; }
.upgrade.can { background: #fde3c4; border-color: var(--orange); }
.upgrade.can .icon { filter: none; }
.upgrade.owned { background: var(--gold); }
.upgrade.owned .icon { filter: none; }
.upgrade.picked { outline: 4px solid var(--magenta); outline-offset: 2px; }
.upgrade:hover:not(:disabled) { background: #fff3d6; scale: 1.15; z-index: 1; }
.upgrade.owned:hover { background: var(--gold); }
.tree-card { border-top: 3px solid var(--ink); margin-top: 10px; padding-top: 8px; display: grid; gap: 4px; min-height: 9rem; align-content: start; }
.tree-card h4 { margin: 0; font-size: 1.15rem; }
.tree-card p { margin: 0; font-size: 0.85rem; line-height: 1.3; }
.tree-card .needs { opacity: 0.7; }
.tree-card button { justify-self: start; margin-top: 6px; font-size: 0.95rem; padding: 6px 16px; }
.tree-card button.can { background: var(--sage); }
/* the timeline: the years along the Peak, the River forking below 2056 */
.holding-grid section.timeline { grid-column: 1 / -1; }
#timeline-lines { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
#timeline-lines .line.on { background: var(--sage); }
#timeline-lines .line.river.on { background: #8fd1dc; }
.timeline-map { position: relative; height: 230px; }
#timeline-edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#timeline-edges line { stroke: var(--ink); stroke-width: 3px; stroke-opacity: 0.25; vector-effect: non-scaling-stroke; stroke-dasharray: 6 6; }
#timeline-edges line.followed { stroke-opacity: 0.9; stroke-dasharray: none; stroke-width: 5px; }
#timeline-edges line.river { stroke: #2a8fa8; }
#timeline-nodes { position: absolute; inset: 0; }
.year { position: absolute; translate: -50% -50%; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 6px 10px; min-width: 104px; font-size: 0.75rem; line-height: 1.15; border-radius: 12px; }
.year strong { font-size: 1.1rem; }
.year em { font-style: normal; opacity: 0.7; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em; }
.year small { font-size: 0.65rem; opacity: 0.8; }
.year.open { background: #fde3c4; }
.year.beaten { background: var(--sage); }
.year.river { border-color: #2a8fa8; }
.year.sealed { border-style: dashed; }
.case-file ol { padding-left: 20px; margin: 0 0 14px; font-family: var(--type); font-size: 0.8rem; }
.case-file li { margin-bottom: 6px; }
.case-file li.none { list-style: none; margin-left: -20px; opacity: 0.7; }
.counts-read { font-size: 0.8rem; margin-bottom: 8px; text-transform: uppercase; }
#m-route li.sealed { opacity: 0.6; }

/* ---- the map ---- */
.map-panel { width: min(94vw, 1100px); max-width: none; }
#graph { position: relative; height: 320px; background: var(--paper-2); border: 3px solid var(--ink); border-radius: 12px; }
#edges { position: absolute; inset: 0; width: 100%; height: 100%; }
#edges line { stroke: var(--ink); stroke-width: 0.5; vector-effect: non-scaling-stroke; stroke-width: 3px; }
#edges line.side { stroke-dasharray: 6 5; stroke: var(--orange); }
#edges line.walked { stroke: var(--teal); }
.node { position: absolute; translate: -50% -50%; display: flex; flex-direction: column; align-items: center; width: 110px; text-align: center; font-size: 0.72rem; line-height: 1.1; }
.node .dot { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--ink); background: var(--paper); display: flex; align-items: center; justify-content: center; }
.node .dot img { width: 24px; height: 24px; object-fit: contain; }
.node.side .dot { background: #ffd7b5; }
.node.boss .dot { width: 46px; height: 46px; background: var(--coral); }
.node.rest .dot { background: var(--sage); }
.node.visited .dot { background: var(--teal); }
.node.here .dot { outline: 4px solid var(--magenta); outline-offset: 3px; }
.node.next .dot { box-shadow: 0 0 0 4px var(--gold); }
.node .name { font-weight: 800; margin-top: 3px; }
.node .reward { color: #b3262e; font-weight: 700; }
.node .here-tag { font-size: 0.65rem; text-transform: uppercase; color: var(--magenta); font-weight: 900; }

/* ---- play ---- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud button { pointer-events: auto; }
#vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(255, 40, 80, 0.75) 100%); opacity: calc(var(--hurt, 0) / 100); }
#reticle { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; translate: -50% -50%; border: 2px solid rgba(59, 35, 64, 0.9); border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 243, 214, 0.8); }
#reticle span { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; translate: -50% -50%; background: var(--ink); border-radius: 50%; }
#reticle.enemy { border-color: var(--magenta); box-shadow: 0 0 0 2px #fff; }
#reticle.enemy span { background: var(--magenta); }
#reticle.hook { border-style: dashed; border-color: var(--orange); }
.foe { position: absolute; translate: -50% -50%; width: 34px; height: 6px; border: 2px solid var(--ink); border-radius: 3px; background: rgba(59, 35, 64, 0.5); opacity: 0; }
.foe span { display: block; height: 100%; background: var(--magenta); }
.foe.hurt { opacity: 1; }
.foe.weak { border-radius: 50%; width: 22px; height: 22px; background: rgba(255, 122, 26, 0.35); box-shadow: 0 0 10px var(--c); }
.foe.weak span { display: none; }
.foe.edge.weak { width: 0; height: 0; border-radius: 0; background: none; box-shadow: none; border-left-color: var(--c); }
.boss-timer { font-weight: 900; color: var(--paper); text-shadow: 2px 2px 0 var(--ink); margin-top: 4px; }
.foe.edge { opacity: 1; width: 0; height: 0; border: none; background: none; border-left: 16px solid var(--magenta); border-top: 10px solid transparent; border-bottom: 10px solid transparent; rotate: var(--a); filter: drop-shadow(1px 1px 0 var(--ink)) drop-shadow(-1px -1px 0 var(--ink)); }
.foe.edge span { display: none; }
#reticle.hitmark { animation: hitmark 160ms ease-out; }
@keyframes hitmark { 0% { scale: 1.45; border-color: #fff; } 100% { scale: 1; } }
.gate-label { position: absolute; translate: -50% -100%; white-space: nowrap; font-size: 0.78rem; font-weight: 800; padding: 3px 9px; border: 3px solid var(--ink); border-radius: 8px; background: var(--paper); box-shadow: 3px 3px 0 var(--ink); }
.gate-label.main.open { background: #c9f4f8; }
.gate-label.side.open { background: #ffd7b5; }
.gate-label.shut { opacity: 0.6; }
#top-left { position: absolute; left: 18px; top: 14px; background: rgba(246, 231, 196, 0.92); border: 3px solid var(--ink); border-radius: 10px; padding: 6px 12px; box-shadow: 4px 4px 0 var(--ink); }
#top-left .place { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
#top-left .node { position: static; translate: none; width: auto; display: block; font-size: 1.15rem; font-weight: 900; text-align: left; }
#top-left .left { font-size: 0.8rem; }
#top-right { position: absolute; right: 18px; top: 14px; background: rgba(246, 231, 196, 0.92); border: 3px solid var(--ink); border-radius: 10px; padding: 6px 12px; font-weight: 800; box-shadow: 4px 4px 0 var(--ink); }
#boss { position: absolute; left: 50%; top: 18px; translate: -50% 0; width: min(70vw, 720px); text-align: center; }
.boss-name { font-size: 1.4rem; font-weight: 900; letter-spacing: 0.12em; color: var(--paper); text-shadow: 2px 2px 0 var(--ink), -1px -1px 0 var(--ink); }
.boss-title { font-size: 0.8rem; color: var(--paper); text-shadow: 1px 1px 0 var(--ink); margin-bottom: 4px; }
.bar { position: relative; height: 18px; border: 3px solid var(--ink); border-radius: 9px; background: rgba(59, 35, 64, 0.5); overflow: hidden; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--coral); transition: width 120ms; }
#boss .bar .fill { background: linear-gradient(90deg, var(--violet), var(--magenta)); }
#boss .bar.husk { height: 8px; margin-bottom: 3px; }
#boss .bar.husk .fill { background: #b07be8; }
#boss.staggered .bar:not(.husk) .fill { background: linear-gradient(90deg, var(--gold), var(--orange)); }
/* a bar for each phase (the Idiot God): the ones left lit; the lullaby's
   bar is the sleep, in pale gold */
.boss-bars { justify-content: center; margin-top: 4px; }
#boss.sleep .bar .fill { background: linear-gradient(90deg, #7af0e0, #ffe27a); }
/* the lullaby's staff, after the ocarina's: five lines low in the middle
   of the screen, the notes sliding left to the line */
#staff { position: absolute; left: 50%; bottom: 14px; translate: -50% 0; width: min(38vw, 560px); height: 118px; background: rgba(18, 8, 32, 0.72); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink); }
#staff .staff-label { position: absolute; left: 12px; top: -26px; font-weight: 900; letter-spacing: 0.14em; color: var(--paper); text-shadow: 2px 2px 0 var(--ink); }
#staff[data-part="play"] .staff-label { color: #ffe27a; }
.staff-lines { position: absolute; left: 44px; right: 8px; top: 18px; bottom: 18px; display: flex; flex-direction: column; justify-content: space-between; }
.staff-lines i { display: block; height: 2px; background: rgba(246, 231, 196, 0.55); }
.staff-keys { position: absolute; left: 6px; top: 10px; bottom: 10px; width: 34px; display: flex; flex-direction: column; justify-content: space-between; font-size: 0.72rem; font-weight: 900; color: var(--paper); }
.staff-line { position: absolute; top: 6px; bottom: 6px; width: 4px; translate: -50% 0; background: #ffe27a; box-shadow: 0 0 10px #ffe27a; }
.staff-track { position: absolute; top: 0; bottom: 0; left: 44px; right: 8px; }
.staff-notes { position: absolute; inset: 0; }
/* while the staff is up, the hint stands over it */
body:has(#staff:not([hidden])) #hint { bottom: 168px; }
.note { position: absolute; translate: -50% -50%; width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--ink); display: grid; place-items: center; font-size: 0.72rem; font-weight: 900; color: var(--ink); background: var(--c); }
.note.lane-0 { top: 85%; --c: #4a8cff; }
.note.lane-1 { top: 67.5%; --c: #ffd84a; }
.note.lane-2 { top: 50%; --c: #ffd84a; }
.note.lane-3 { top: 32.5%; --c: #ffd84a; }
.note.lane-4 { top: 15%; --c: #ffd84a; }
.note.ghost { opacity: 0.55; border-style: dashed; }
.note.great { --c: #ffe27a; box-shadow: 0 0 14px #ffe27a; scale: 1.2; }
.note.good { --c: #7af0e0; box-shadow: 0 0 10px #7af0e0; }
.note.miss { --c: #e03030; opacity: 0.6; }
.staff-keys span:nth-child(1) { order: 5; }
.staff-keys span:nth-child(2) { order: 4; }
.staff-keys span:nth-child(3) { order: 3; }
.staff-keys span:nth-child(4) { order: 2; }
.staff-keys span:nth-child(5) { order: 1; }
#bottom-left { position: absolute; left: 18px; bottom: 18px; width: min(36vw, 340px); background: rgba(246, 231, 196, 0.92); border: 3px solid var(--ink); border-radius: 12px; padding: 8px 12px; box-shadow: 4px 4px 0 var(--ink); }
#bottom-left .label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.bar.health { height: 22px; }
.bar.health .fill { background: linear-gradient(90deg, #ff4f6d, #ff8a3d); }
.bar.health span { position: absolute; inset: 0; text-align: center; font-size: 0.8rem; font-weight: 900; color: #fff; text-shadow: 1px 1px 0 var(--ink); line-height: 16px; }
#bottom-left.low .bar.health { animation: low 600ms infinite alternate; }
@keyframes low { to { box-shadow: 0 0 12px 3px var(--red); } }
.pips-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.pips { display: inline-flex; gap: 3px; margin-right: 8px; }
.pips i { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--ink); border-radius: 4px; background: rgba(59, 35, 64, 0.25); }
#h-jumps i.on { background: var(--sage); }
#h-dash i.on { background: var(--teal); }
.ability { font-size: 0.72rem; font-weight: 800; border: 2px solid var(--ink); border-radius: 6px; padding: 1px 6px; background: rgba(59, 35, 64, 0.2); }
.ability.ready { background: var(--gold); }
.ability.active { background: #fff; box-shadow: 0 0 10px var(--gold); }
#bottom-right { position: absolute; right: 18px; bottom: 18px; text-align: right; background: rgba(246, 231, 196, 0.92); border: 3px solid var(--ink); border-radius: 12px; padding: 8px 14px; box-shadow: 4px 4px 0 var(--ink); border-left: 10px solid var(--gun, var(--gold)); }
#h-gun-art { display: block; width: 150px; height: 60px; object-fit: contain; margin-left: auto; }
.gun-name { font-size: 1.2rem; font-weight: 900; text-transform: uppercase; }
.gun-trait { font-size: 0.75rem; max-width: 240px; }
#prompt { position: absolute; left: 50%; bottom: 26%; translate: -50% 0; background: var(--gold); border: 3px solid var(--ink); border-radius: 10px; padding: 6px 14px; font-weight: 900; box-shadow: 4px 4px 0 var(--ink); }
#hint { position: absolute; left: 50%; bottom: 18px; translate: -50% 0; max-width: 40vw; text-align: center; font-size: 0.85rem; font-weight: 700; color: var(--ink); background: rgba(246, 231, 196, 0.85); border-radius: 8px; padding: 4px 10px; }
#hint:empty { display: none; }
#callout { position: absolute; left: 50%; top: 26%; translate: -50% 0; opacity: 0; text-align: center; }
#callout .word { font-size: clamp(1.4rem, 3.4vw, 2.6rem); font-weight: 900; letter-spacing: 0.08em; color: var(--paper); text-shadow: 3px 3px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink); }
#callout.pop { animation: pop 1800ms ease forwards; }
@keyframes pop { 0% { opacity: 0; scale: 0.6; } 10% { opacity: 1; scale: 1.08; } 20% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
#engage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(59, 35, 64, 0.35); pointer-events: auto; }
#message { position: fixed; left: 50%; top: 40%; translate: -50% 0; z-index: 50; font-weight: 800; background: var(--paper); padding: 0; }
#message:not(:empty) { padding: 12px 18px; border: 3px solid var(--ink); border-radius: 10px; }

@media (max-width: 1000px) {
  .holding-grid { grid-template-columns: 1fr; }
  #bottom-left { width: 60vw; }
}

/* ---- the Codex ---- */
#codex { z-index: 30; }
.codex-panel { width: min(96vw, 1100px); max-width: none; max-height: 92vh; }
#codex-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab.on { background: var(--salmon); }
#codex-body { overflow: auto; max-height: 64vh; display: flex; flex-direction: column; gap: 12px; padding-right: 6px; }
.codex-card { background: #fff3d6; border: 3px solid var(--ink); border-radius: 12px; padding: 10px 14px; }
.codex-card.row { display: flex; gap: 12px; align-items: flex-start; }
.codex-card h3 { margin: 0 0 4px; text-transform: uppercase; }
.codex-card h4 { margin: 10px 0 2px; }
.codex-card p { margin: 4px 0; font-size: 0.9rem; line-height: 1.35; }
.codex-card .note { font-size: 0.82rem; opacity: 0.85; }
.codex-card .icon { width: 56px; height: 56px; }
.codex-card .gun-art { float: right; width: 200px; height: 80px; object-fit: contain; }
table.levels, table.stats { border-collapse: collapse; font-size: 0.85rem; margin: 6px 0; }
table.levels th, table.levels td, table.stats td { border: 1px solid var(--ink-soft); padding: 3px 7px; text-align: left; }
table.levels th { background: var(--paper-2); }
.attack { border-left: 4px solid var(--violet); padding-left: 10px; margin: 6px 0; }
.attack .windup { font-weight: 700; }
.attack ul, ul.rules { margin: 2px 0; padding-left: 18px; font-size: 0.85rem; line-height: 1.35; }
ul.rules li { margin-bottom: 6px; }

/* ---- threats, hits, cues, story ---- */
.foe.threat span { background: var(--c, var(--magenta)); }
.foe.edge.threat { border-left-color: var(--c, var(--magenta)); animation: threat 420ms ease-in-out infinite alternate; }
@keyframes threat { from { scale: 1; } to { scale: 1.7; } }
#hit-arc { position: absolute; left: 50%; top: 50%; width: 0; height: 0; rotate: var(--a); opacity: calc(var(--fade, 0) / 100); }
#hit-arc span { position: absolute; left: 150px; top: -60px; width: 26px; height: 120px; border-right: 8px solid #ff2846; border-radius: 0 60px 60px 0; filter: drop-shadow(0 0 6px #ff2846); }
#jump-cue { position: absolute; left: 50%; top: 60%; translate: -50% 0; font-size: 2rem; font-weight: 900; letter-spacing: 0.2em; color: #fff; text-shadow: 3px 3px 0 var(--magenta), -2px -2px 0 var(--ink); animation: cue 160ms ease-in-out infinite alternate; }
@keyframes cue { to { scale: 1.15; } }
#story-banner { position: absolute; left: 50%; top: 12%; translate: -50% 0; width: min(80vw, 760px); background: var(--paper); border: 4px solid var(--ink); border-radius: 6px; box-shadow: 8px 8px 0 var(--ink); padding: 12px 18px; font-family: var(--type); opacity: 0; pointer-events: none; }
#story-banner .heading { font-family: var(--display); font-weight: 900; color: #b3262e; text-transform: uppercase; letter-spacing: 0.08em; }
#story-banner p { margin: 6px 0 0; font-size: 0.95rem; line-height: 1.4; }
#story-banner.show { animation: story 11s ease forwards; }
@keyframes story { 0% { opacity: 0; translate: -50% -12px; } 6% { opacity: 1; translate: -50% 0; } 85% { opacity: 1; } 100% { opacity: 0; } }
.node .tier { font-size: 0.6rem; color: var(--ink-soft); letter-spacing: 0.1em; }

/* the Holding's start on the ice, once its way is open */
#start-later { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
button.big.later { background: #a9d3ea; font-size: 1rem; }
button.big.later:hover:not(:disabled) { background: #c7e4f3; }
button.big.last { background: #e8b6b0; font-size: 1rem; margin-top: 8px; }
button.big.last:hover:not(:disabled) { background: #f2cdc8; }

#stopped { position: absolute; left: 50%; top: 40%; translate: -50% 0; font-size: 2rem; font-weight: 900; letter-spacing: 0.2em; color: var(--paper); text-shadow: 3px 3px 0 var(--ink); pointer-events: none; }
/* the tree's and the timeline's buttons are centred on their place by
   translate; pressed, they keep it (the page's buttons shift by translate
   when pressed, which would move these out from under the pointer) */
.upgrade:active:not(:disabled), .year:active:not(:disabled) { translate: -50% -50%; scale: 0.95; }
