/* Stillshot 3D. One dark look: the tower. System fonts only, nothing loaded from anywhere. */
:root {
  --ink: #0d0a10; --paper: #f3ead6; --gold: #ffc94a; --gold-hi: #fff3c4; --glass: #8ff3ea; --scarf: #ff5a3c; --dim: rgba(243, 234, 214, .66);
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sar: env(safe-area-inset-right, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: #160b09; color: var(--paper); font-family: var(--sans); overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
/* the host's corner mascot is hidden while a climb is being played, so it never sits on the controls */
body.playing #ss-overlay { display: none !important; }

/* ---- touch controls */
#touch { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
.tb { position: absolute; pointer-events: auto; touch-action: none; border-radius: 50%; border: 2px solid rgba(243, 234, 214, .5); background: rgba(13, 10, 16, .42); color: var(--paper); padding: 0; display: grid; place-items: center; transition: transform .06s, background .06s; }
.tb svg { width: 46%; height: 46%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tb.down { transform: scale(.92); background: rgba(255, 201, 74, .35); }
.tb em { position: absolute; left: 50%; bottom: -17px; transform: translateX(-50%); font: 800 11px var(--sans); letter-spacing: .08em; color: var(--paper); text-shadow: 0 1px 3px #000, 0 0 6px #000; pointer-events: none; }
#b-pause em { display: none; }
#b-parry { width: 92px; height: 92px; right: calc(16px + var(--sar)); bottom: calc(26px + var(--sab)); border-color: var(--gold); color: var(--gold-hi); background: rgba(255, 201, 74, .16); }
#b-jump { width: 72px; height: 72px; right: calc(118px + var(--sar)); bottom: calc(18px + var(--sab)); }
#b-dash { width: 64px; height: 64px; right: calc(22px + var(--sar)); bottom: calc(130px + var(--sab)); border-color: var(--scarf); color: #ffd9cf; }
#b-ult { width: 58px; height: 58px; right: calc(106px + var(--sar)); bottom: calc(104px + var(--sab)); opacity: .28; }
#b-ult.ready { opacity: 1; border-color: #fff; color: #fff; background: rgba(143, 243, 234, .4); animation: pulse .7s infinite alternate; }
#b-pause { width: 40px; height: 40px; right: calc(10px + var(--sar)); top: calc(8px + var(--sat)); border-width: 1.5px; opacity: .8; }
.tb.pulse { animation: pulse .5s infinite alternate; }
@keyframes pulse { from { box-shadow: 0 0 0 0 rgba(255, 243, 196, .0); } to { box-shadow: 0 0 0 12px rgba(255, 243, 196, .35); } }
#stick { position: absolute; width: 104px; height: 104px; margin: -52px 0 0 -52px; border-radius: 50%; border: 2px solid rgba(243, 234, 214, .3); background: rgba(13, 10, 16, .22); }
#knob { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(243, 234, 214, .6); }

/* ---- screens */
#ui { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.screen { position: absolute; inset: 0; display: grid; place-items: center; padding: calc(14px + var(--sat)) calc(14px + var(--sar)) calc(14px + var(--sab)) calc(14px + var(--sal)); background: radial-gradient(ellipse at 50% 40%, rgba(13, 10, 16, .5), rgba(13, 10, 16, .86)); pointer-events: auto; overflow-y: auto; }
#s-title { background: linear-gradient(180deg, rgba(13, 10, 16, .25), rgba(13, 10, 16, .78) 62%); }
.card { width: min(420px, 100%); text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; margin: auto; }
.card.wide { width: min(680px, 100%); }
h1 small { font: 800 .32em var(--sans); letter-spacing: .12em; color: var(--gold); vertical-align: .9em; }
h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(44px, 13vw, 84px); line-height: .95; margin: 0; letter-spacing: -.01em; color: var(--paper); text-shadow: 0 3px 0 #160b09, 0 0 34px rgba(255, 154, 46, .5); }
h2 { font-family: var(--serif); font-weight: 700; font-size: clamp(26px, 6vw, 36px); margin: 0; }
.tag { font-family: var(--serif); font-style: italic; font-size: 17px; margin: 0; color: var(--gold-hi); max-width: 30ch; line-height: 1.35; }
.dim { color: var(--dim); font-size: 14px; margin: 0; line-height: 1.4; }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.col { display: flex; flex-direction: column; gap: 9px; width: min(280px, 100%); }
.btn { font: 700 16px var(--sans); color: var(--paper); background: rgba(243, 234, 214, .09); border: 1.5px solid rgba(243, 234, 214, .45); border-radius: 10px; padding: 12px 20px; min-height: 46px; cursor: pointer; }
.btn:hover { background: rgba(243, 234, 214, .18); }
.btn:focus-visible, .link:focus-visible, .boon:focus-visible { outline: 3px solid var(--glass); outline-offset: 2px; }
.btn.primary { background: var(--gold); color: #1a1208; border-color: var(--gold); }
.btn.primary:hover { background: var(--gold-hi); color: #1a1208; }
.btn.risk { border-color: var(--scarf); color: #ffd9cf; }
.btn.small { min-height: 36px; padding: 4px 14px; }
.btn:disabled { opacity: .4; cursor: default; }
.link { background: none; border: 0; color: var(--dim); font: 600 14px var(--sans); text-decoration: underline; padding: 8px; cursor: pointer; }
.asc { display: flex; gap: 12px; align-items: center; font: 600 14px var(--sans); color: var(--gold-hi); }
.keys { display: flex; gap: 6px 14px; flex-wrap: wrap; justify-content: center; font-size: 13px; color: var(--dim); }
.keys span { white-space: nowrap; }
.keys kbd { font: 700 12px var(--sans); color: var(--gold-hi); border: 1.5px solid rgba(255, 201, 74, .6); border-radius: 5px; padding: 2px 6px; margin-right: 5px; background: rgba(13, 10, 16, .6); }
.gem { display: inline-block; width: 9px; height: 13px; background: #a8fff0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); margin-right: 6px; vertical-align: -1px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.boon { font: inherit; color: var(--paper); text-align: left; background: rgba(13, 10, 16, .72); border: 1.5px solid rgba(243, 234, 214, .4); border-radius: 12px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 112px; }
.boon b { font: 700 18px var(--serif); color: var(--gold-hi); }
.boon span { font-size: 14px; line-height: 1.35; color: var(--dim); }
.boon i { font: 700 11px var(--sans); color: var(--dim); font-style: normal; }
.boon:hover { border-color: var(--gold); }
.boon.sel { border-color: var(--glass); background: rgba(143, 243, 234, .16); box-shadow: 0 0 0 2px var(--glass) inset; }
.list { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.perk { display: flex; gap: 12px; align-items: center; text-align: left; background: rgba(13, 10, 16, .72); border: 1.5px solid rgba(243, 234, 214, .25); border-radius: 12px; padding: 10px 12px; }
.perk div { flex: 1; min-width: 0; }
.perk b { font: 700 16px var(--serif); color: var(--gold-hi); display: block; }
.perk span { font-size: 13px; color: var(--dim); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 0; width: min(340px, 100%); font-size: 15px; }
.stats dt { text-align: left; color: var(--dim); }
.stats dd { text-align: right; margin: 0; font-weight: 700; color: var(--paper); }
.stats dd.hi { color: var(--gold-hi); }
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .boon { min-height: 0; padding: 11px 13px; }
}
@media (max-height: 460px) {
  h1 { font-size: 44px; } .card { gap: 8px; } .tag { font-size: 15px; }
  #b-parry { width: 80px; height: 80px; bottom: calc(14px + var(--sab)); }
  #b-jump { width: 64px; height: 64px; right: calc(104px + var(--sar)); bottom: calc(10px + var(--sab)); }
  #b-dash { width: 56px; height: 56px; bottom: calc(104px + var(--sab)); }
  #b-ult { width: 50px; height: 50px; right: calc(94px + var(--sar)); bottom: calc(84px + var(--sab)); }
  .cards { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .tb.pulse, #b-ult.ready { animation: none; } }

/* ---- heads-up display: plain DOM over the 3D view, so the words stay sharp at any render scale */
#hud { position: fixed; inset: 0; z-index: 1; pointer-events: none; font-family: var(--sans); }
#fx-red, #fx-flash, #fx-slow { position: absolute; inset: 0; opacity: 0; }
#fx-red { background: linear-gradient(0deg, rgba(255, 46, 99, .55), rgba(255, 46, 99, 0) 45%); }
#fx-flash { background: #fff; }
#fx-slow { box-shadow: inset 0 0 0 6px rgba(223, 252, 255, .6), inset 0 0 60px rgba(143, 243, 234, .35); }
#h-left { position: absolute; left: calc(12px + var(--sal)); top: calc(10px + var(--sat)); display: flex; flex-direction: column; gap: 6px; }
#h-hearts { display: flex; gap: 4px; flex-wrap: wrap; max-width: 150px; }
#h-hearts i { width: 17px; height: 16px; background: var(--scarf); clip-path: path("M8.5 15.5C3 11 0 8.2 0 4.8 0 2 2 0 4.4 0 6 0 7.6.9 8.5 2.3 9.4.9 11 0 12.6 0 15 0 17 2 17 4.8c0 3.4-3 6.2-8.5 10.7z"); filter: drop-shadow(0 1px 1px #000); }
#h-hearts i.off { background: rgba(243, 234, 214, .22); }
#h-focus { display: flex; gap: 3px; }
#h-focus i { width: 9px; height: 9px; border-radius: 2px; background: rgba(255, 255, 255, .18); transform: rotate(45deg); }
#h-focus i.on { background: var(--glass); box-shadow: 0 0 6px var(--glass); }
#h-focus.full i { background: #fff; box-shadow: 0 0 8px #fff; }
#h-mid { position: absolute; left: 50%; top: calc(8px + var(--sat)); transform: translateX(-50%); text-align: center; text-shadow: 0 1px 3px #000, 0 0 8px rgba(0, 0, 0, .8); }
#h-height { display: block; font: 800 20px var(--sans); color: #fff; }
#h-stage { font: 600 12px var(--sans); color: var(--dim); letter-spacing: .04em; }
#h-boss { display: flex; gap: 6px; justify-content: center; margin-top: 4px; }
#h-boss i { width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff; }
#h-boss i.off { background: rgba(255, 255, 255, .2); box-shadow: none; }
#h-right { position: absolute; right: calc(12px + var(--sar)); top: calc(10px + var(--sat)); text-align: right; font: 800 18px var(--sans); color: #a8fff0; text-shadow: 0 1px 3px #000; }
body.touch #h-right { right: calc(60px + var(--sar)); }
#h-bank { display: block; font: 600 11px var(--sans); color: var(--dim); }
/* the coach: what to do next, in words, where the eye already is */
#coach { position: absolute; left: 50%; top: calc(76px + var(--sat)); transform: translateX(-50%); width: min(560px, calc(100vw - 20px)); background: rgba(13, 10, 16, .86); border: 2px solid var(--gold); border-radius: 12px; padding: 9px 13px 10px; text-align: center; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); }
#coach b { display: block; font: 800 17px/1.25 var(--sans); color: #fff; }
#coach span { display: block; margin-top: 4px; font: 500 14.5px/1.35 var(--sans); color: var(--gold-hi); }
#coach.stuck { border-color: var(--scarf); }
#now { position: absolute; left: 0; top: 0; padding: 7px 12px; border-radius: 9px; background: #fff; color: #1a1208; font: 800 16px var(--sans); white-space: nowrap; box-shadow: 0 0 0 3px var(--gold), 0 4px 16px rgba(0, 0, 0, .6); animation: nowpulse .28s infinite alternate; will-change: transform; }
#now::after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; }
@keyframes nowpulse { from { box-shadow: 0 0 0 3px var(--gold), 0 4px 16px rgba(0, 0, 0, .6); } to { box-shadow: 0 0 0 7px rgba(255, 201, 74, .5), 0 4px 16px rgba(0, 0, 0, .6); } }
#reach { position: absolute; left: 0; top: 0; font: 700 12.5px var(--sans); color: #fff; background: rgba(13, 10, 16, .78); border-radius: 6px; padding: 3px 8px; white-space: nowrap; will-change: transform; }
#combo { position: absolute; left: 50%; top: 34%; transform: translateX(-50%); font: 800 20px var(--sans); letter-spacing: .08em; color: var(--glass); text-shadow: 0 2px 4px #000, 0 0 14px rgba(143, 243, 234, .7); opacity: 0; white-space: nowrap; }
#combo.perfect { color: #fff; }
#combo.go { animation: combo .7s ease-out; }
@keyframes combo { 0% { opacity: 0; transform: translateX(-50%) scale(.7); } 15% { opacity: 1; transform: translateX(-50%) scale(1.12); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-18px); } }
#card { position: absolute; left: 0; right: 0; top: 26%; text-align: center; text-shadow: 0 2px 6px #000, 0 0 24px rgba(0, 0, 0, .8); animation: card 3.2s ease-out forwards; }
#card b { display: block; font: 700 clamp(26px, 7vw, 46px) var(--serif); color: #fff; }
#card span { font: italic 17px var(--serif); color: var(--gold-hi); }
@keyframes card { 0% { opacity: 0; transform: translateY(10px); } 12% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; } }
#arrows i { position: absolute; left: 0; top: 0; width: 0; height: 0; margin: -11px 0 0 -9px; border: 11px solid transparent; border-left: 18px solid #ff9a2e; border-right: 0; filter: drop-shadow(0 0 5px #ff9a2e); display: none; will-change: transform; }
body.touch #coach { top: calc(72px + var(--sat)); }

/* ---- checkpoints, replays, photo mode, the daily tower */
.bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--sab)); z-index: 4; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100vw - 16px); background: rgba(13, 10, 16, .82); border: 1.5px solid rgba(243, 234, 214, .35); border-radius: 12px; padding: 8px 10px; }
.bar small { flex-basis: 100%; text-align: center; font: 500 12px var(--sans); color: var(--dim); }
#rp-time { font: 600 14px var(--sans); color: var(--gold-hi); min-width: 11ch; text-align: center; font-variant-numeric: tabular-nums; }
#ph-hint { font: 500 13px var(--sans); color: var(--paper); }
.cp-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: 0 0 auto !important; }
.cp-head { color: var(--dim); font-size: 13px; margin: 8px 0 0; text-align: left; }
.btn.daily { border-color: var(--glass); color: #dffcff; background: rgba(143, 243, 234, .14); }
.btn.daily:hover { background: rgba(143, 243, 234, .26); }
.mode-line { margin: -4px 0 0; font: 500 13.5px/1.35 var(--sans); color: #c9f7f1; max-width: 36ch; }
.row.links { gap: 2px 6px; }
#h-ghost { display: block; margin-top: 2px; font: 700 12px var(--sans); color: var(--glass); letter-spacing: .02em; }
#gtag { position: absolute; left: 0; top: 0; font: 800 10.5px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #0d0a10; background: var(--glass); border-radius: 5px; padding: 1px 6px; opacity: .85; will-change: transform; }
body.photo #c { cursor: grab; }
@media (max-width: 560px) { .perk { flex-wrap: wrap; } .cp-btns { flex-basis: 100% !important; } }

/* ---- how to climb */
.how { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; width: 100%; counter-reset: how; }
.how li { counter-increment: how; display: flex; gap: 12px; align-items: center; text-align: left; background: rgba(13, 10, 16, .78); border: 1.5px solid rgba(243, 234, 214, .3); border-radius: 12px; padding: 9px 12px; }
.how svg { flex: 0 0 84px; width: 84px; height: 84px; background: rgba(243, 234, 214, .06); border-radius: 8px; }
.how b { display: block; font: 700 18px var(--serif); color: var(--gold-hi); }
.how b::before { content: counter(how) ". "; color: var(--gold); }
.how span { display: block; font-size: 14.5px; line-height: 1.35; color: var(--paper); margin-top: 2px; }
.how .ctl { margin: 7px 0 0; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 12.5px; color: var(--dim); }
.how .ctl i { font-style: normal; }
.how kbd { font: 700 12.5px var(--sans); color: var(--gold-hi); border: 1.5px solid rgba(255, 201, 74, .6); border-radius: 5px; padding: 2px 7px; margin-right: 8px; background: rgba(13, 10, 16, .6); }
.how .ledge { fill: #e39a55; } .how .me { fill: #f3ead6; } .how .step { fill: #8ff3ea; } .how .shot { fill: #ff9a2e; }
.how .ghost { fill: rgba(143, 243, 234, .25); stroke: #8ff3ea; stroke-width: 1.5; stroke-dasharray: 4 3; }
.how .dash { stroke: #fff; stroke-width: 1.5; stroke-dasharray: 4 4; fill: none; } .how .arc { stroke: #f3ead6; stroke-width: 1.6; stroke-dasharray: 2 4; fill: none; stroke-linecap: round; }
.how .no { stroke: #ff5a3c; stroke-width: 3.5; stroke-linecap: round; } .how .ring { fill: rgba(255, 201, 74, .12); stroke: #ffc94a; stroke-width: 2; } .how .trail { stroke: #ff9a2e; stroke-width: 3; stroke-linecap: round; opacity: .6; }
@media (max-height: 460px) {
  #coach, body.touch #coach { top: calc(46px + var(--sat)); padding: 5px 10px 6px; width: min(520px, calc(100vw - 250px)); } #coach b { font-size: 15px; } #coach span { font-size: 13px; margin-top: 2px; }
  .how { flex-direction: row; } .how li { flex: 1; flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px; } .how svg { flex-basis: 56px; width: 56px; height: 56px; } .how b { font-size: 15px; } .how span { font-size: 13px; }
  .tb em { bottom: auto; top: -14px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { #now, #combo.go { animation: none; } }

/* ---- version 3: lost bells in the heads-up display, one-line lessons and medal toasts, the highlights on the end card */
#h-lost { display: flex; gap: 5px; min-height: 12px; }
#h-lost i { width: 11px; height: 12px; border-radius: 6px 6px 2px 2px; border: 1.5px solid #9fd0ff; opacity: .55; box-sizing: border-box; }
#h-lost i.on { background: #dfeeff; border-color: #fff; opacity: 1; box-shadow: 0 0 7px #9fd0ff; }
#toast { position: absolute; left: 50%; top: calc(76px + var(--sat)); transform: translateX(-50%); width: max-content; max-width: min(540px, calc(100vw - 20px)); display: flex; gap: 9px; align-items: center; background: rgba(13, 10, 16, .88); border: 1.5px solid rgba(243, 234, 214, .45); border-radius: 11px; padding: 8px 13px; font: 600 14.5px/1.35 var(--sans); color: #fff; text-align: left; box-shadow: 0 6px 22px rgba(0, 0, 0, .5); animation: toast .25s ease-out; }
#toast[hidden] { display: none; }
#toast.medal { border-color: var(--gold); color: var(--gold-hi); }
#toast-dot { flex: 0 0 13px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px currentColor; }
@keyframes toast { from { opacity: 0; transform: translateX(-50%) translateY(-6px); } to { opacity: 1; transform: translateX(-50%); } }
body.touch #toast { top: calc(72px + var(--sat)); }
#combo.big { font-size: 26px; color: var(--gold-hi); text-shadow: 0 2px 4px #000, 0 0 18px rgba(255, 201, 74, .8); }
.medals { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0; }
.medals[hidden] { display: none; }
.medals span { font: 700 12.5px var(--sans); letter-spacing: .03em; color: #1a1208; background: var(--gold); border-radius: 999px; padding: 3px 10px 3px 8px; white-space: nowrap; }
.medals span::before { content: "\2726  "; }
.medals span.blue { background: #bfe0ff; }
.medals em { flex-basis: 100%; font: 500 13px var(--sans); color: var(--dim); font-style: normal; }
@media (max-height: 460px) { #toast, body.touch #toast { top: calc(46px + var(--sat)); font-size: 13px; padding: 5px 10px; max-width: calc(100vw - 250px); } }
@media (prefers-reduced-motion: reduce) { #toast { animation: none; } }
