/* Ascent: a full-screen pixel climb. The world is a low-res canvas scaled up
   with crisp pixels (scene.js); everything you read sits over it in pixel
   type on dark slate panels. */

.asc-body {
  --ink: #f3f6fa;
  --dim: #a9b8c8;
  --panel: rgba(18, 28, 44, 0.88);
  --edge: #4d6a8a;
  --hot: #ff6a4d;
  --gold: #ffd166;
  --pix: 'Pixelify Sans', 'VT323', monospace;
  --mono: 'VT323', 'Courier New', monospace;
  background: #152f56;
  color: var(--ink);
}
/* the climb is the whole page: nothing to scroll to, ever */
html:has(.asc-body), .asc-body { height: 100%; overflow: hidden; overscroll-behavior: none; }

.climb { position: fixed; inset: 0; overflow: hidden; touch-action: manipulation; }
.world { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }

/* altitude facts + ruler that ride the camera */
.layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.layer .mk { position: absolute; left: 10px; top: 0; margin: 0; max-width: 56%; padding: 3px 6px 4px; font: 18px/1 var(--mono); color: rgba(243, 246, 250, 0.85); background: rgba(18, 28, 44, 0.55); }
.layer .mk b { display: block; font-weight: 400; color: var(--gold); }
.layer .tk { position: absolute; right: 0; top: 0; width: 8px; height: 1px; background: rgba(18, 28, 44, 0.45); font: 15px/1 var(--mono); font-style: normal; color: rgba(18, 28, 44, 0.7); }
.layer .tk.big { width: 14px; }
.layer .tk span { position: absolute; right: 18px; top: -8px; }
.layer .you { position: absolute; right: 16px; top: 0; padding: 0 3px; font: 16px/1 var(--mono); color: #fff; background: var(--hot); }
.layer .you::after { content: ' ◀'; }

/* HUD */
.hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5;
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto minmax(0, 1fr) 36px; align-items: start; gap: 6px;
  padding: max(10px, env(safe-area-inset-top)) 10px 0;
}
.hud-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 2px solid var(--edge); background: var(--panel); color: var(--ink); font: 18px var(--pix); text-decoration: none; cursor: pointer; }
.hud-btn[aria-pressed="true"] { color: var(--dim); text-decoration: line-through; }
.hud-box { justify-self: start; min-width: 0; padding: 4px 8px 6px; border: 2px solid var(--edge); background: var(--panel); }
.hud-box.right { justify-self: end; text-align: right; }
.hud-box small, .hud-mid small { display: block; font: 13px/1 var(--mono); letter-spacing: 0.12em; color: var(--dim); }
.hud-box b { display: block; font: 600 19px/1.1 var(--pix); white-space: nowrap; color: var(--ink); font-variant-numeric: tabular-nums; }
.hud-box.right b { color: var(--hot); }
.hud-mid { text-align: center; padding: 4px 6px 5px; background: var(--panel); border: 2px solid var(--edge); }
.pips { display: flex; gap: 3px; justify-content: center; }
.pips i { width: 11px; height: 11px; border: 2px solid var(--edge); background: rgba(18, 28, 44, 0.7); }
.pips i.now { border-color: var(--hot); background: var(--hot); }
.pips i.t1 { background: #9b6b43; } .pips i.t2 { background: #6dbb5a; } .pips i.t3 { background: #4ea8ff; }
.pips i.t4 { background: #b48cff; } .pips i.t5 { background: #f4f8fb; } .pips i.t6 { background: var(--gold); border-color: #fff; }
.pips i.t0 { background: var(--hot); opacity: 0.5; }
.hud-mid small { margin-top: 5px; }

/* title screen (over the sky, the mountain behind) */
.title { position: absolute; left: 0; right: 0; top: calc(max(10px, env(safe-area-inset-top)) + 62px); z-index: 4; padding: 0 20px; text-align: center; }
.logo { margin: 0; font: 700 clamp(48px, 15vw, 84px)/0.9 var(--pix); letter-spacing: 0.04em; color: #152f56; text-shadow: 3px 3px 0 #ffffff, 6px 6px 0 rgba(21, 47, 86, 0.25); }
.sub { margin: 14px auto 0; max-width: 340px; padding: 4px 8px; font: 22px/1.05 var(--mono); color: #152f56; background: rgba(255, 255, 255, 0.6); }
.replay { margin: 10px auto 0; font: 18px var(--mono); color: #7a2a3c; }
.title-btns { position: absolute; left: 0; right: 0; top: calc(100svh - 270px); margin: 0; display: grid; justify-items: center; gap: 12px; }
.title-meta { margin: 0; padding: 2px 8px; font: 18px var(--mono); color: var(--ink); background: var(--panel); }
.title-btns .row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* pixel buttons */
.pix-btn {
  border: 2px solid #ffc2b3; background: var(--panel); color: var(--ink); cursor: pointer;
  font: 600 18px/1 var(--pix); letter-spacing: 0.08em; padding: 12px 16px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
}
.pix-btn:hover { background: #24344d; }
.pix-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45); }
.pix-btn.big { font-size: 24px; padding: 18px 30px; min-width: 260px; }
.pix-btn.small { font-size: 15px; padding: 9px 12px; border-color: var(--edge); }
.pix-btn.climb-btn { background: var(--hot); border-color: #ffd6cc; color: #2a0a04; padding: 0 16px; }

/* the prompt card */
.card {
  position: absolute; left: 12px; right: 12px; top: calc(max(10px, env(safe-area-inset-top)) + 78px); z-index: 4;
  max-width: 560px; margin: 0 auto; padding: 14px 16px 16px;
  border: 2px solid var(--edge); background: var(--panel); box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.35);
}
.card-k { margin: 0 0 8px; font: 16px/1 var(--mono); letter-spacing: 0.18em; color: var(--hot); }
.ask { margin: 0; font: 600 clamp(24px, 7vw, 32px)/1.15 var(--pix); color: var(--ink); text-wrap: balance; }
.card-hint { margin: 10px 0 0; font: 18px/1 var(--mono); color: var(--dim); }

/* the answer bar */
.bar {
  position: absolute; left: 0; right: 0; bottom: var(--kb, 0px); z-index: 6;
  display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; align-items: center;
  padding: 10px 10px max(12px, env(safe-area-inset-bottom));
  background: rgba(18, 28, 44, 0.92);
}
.bar input {
  min-width: 0; height: 50px; padding: 0 14px; border: 2px solid #ffc2b3; border-radius: 0;
  background: rgba(10, 16, 26, 0.95); color: var(--ink); font: 22px var(--mono); caret-color: var(--hot);
}
.bar input::placeholder { color: #7d8ea3; }
.bar input:focus { outline: none; border-color: #ffffff; }
.bar .pix-btn.climb-btn { height: 50px; }
.bar.nope input { animation: nope 0.35s; border-color: var(--hot); }
@keyframes nope { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.ring { position: relative; width: 50px; height: 50px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: rgba(10, 16, 26, 0.95); stroke: #2c3c52; stroke-width: 4; }
.ring-fg { fill: none; stroke: #ffc2b3; stroke-width: 4; stroke-dasharray: 119.4; stroke-dashoffset: 0; }
.ring.low .ring-fg { stroke: var(--hot); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font: 600 20px var(--pix); color: var(--ink); }
.ring.low span { color: var(--hot); }

/* after an answer: where you stopped, and the board */
.land {
  position: absolute; left: 12px; right: 12px; top: calc(max(10px, env(safe-area-inset-top)) + 70px); z-index: 4;
  max-width: 460px; margin: 0 auto; padding: 14px 14px 16px; text-align: center;
  border: 2px solid var(--edge); background: rgba(18, 28, 44, 0.97); box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.35);
}
.land .tier { margin: 0; font: 700 clamp(30px, 9vw, 48px)/1 var(--pix); letter-spacing: 0.06em; text-transform: uppercase; color: #ffffff; animation: rise 0.5s steps(5); }
.land .tier.t1 { color: #d9a477; } .land .tier.t2 { color: #8ad67a; } .land .tier.t3 { color: #6fb9ff; }
.land .tier.t4 { color: #c9a8ff; } .land .tier.t5 { color: #ffffff; } .land .tier.t6 { color: var(--gold); }
.land .tier.t0 { color: #9aa9b8; }
.land .said { margin: 10px 0 0; font: 600 22px var(--pix); color: var(--ink); }
.land .rank { display: inline-block; margin-left: 6px; padding: 0 6px; font-size: 18px; color: #2a0a04; background: var(--gold); }
.land .pts { margin: 8px 0 0; font: 600 20px var(--pix); color: var(--gold); }
.land .line { margin: 6px auto 0; max-width: 340px; font: 20px/1.05 var(--mono); color: var(--dim); }
.land .pix-btn { margin-top: 14px; min-width: 220px; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* the top 10, two columns of five */
.board { margin: 12px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(5, auto); gap: 4px; text-align: left; }
.board li { display: flex; gap: 6px; align-items: baseline; min-width: 0; padding: 3px 6px; font: 18px/1.1 var(--mono); color: var(--ink); background: rgba(255, 255, 255, 0.06); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.board li b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.board li span { flex: none; min-width: 1.4em; font-family: var(--pix); color: var(--dim); }
.board li.mine { background: var(--gold); color: #2a0a04; }
.board li.mine span { color: #2a0a04; }

/* results + help reuse the shared modal, dressed for the climb */
.asc-body .d-modal { background: rgba(10, 16, 26, 0.6); }
.asc-body .d-sheet { background: #1a2638; color: var(--ink); border: 2px solid var(--edge); border-radius: 0; box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.4); }
.asc-body .d-title { font: 700 30px/1 var(--pix); color: var(--ink); }
.asc-body .d-body, .asc-body .d-body p, .asc-body .d-body li { font: 20px/1.15 var(--mono); }
.asc-body .d-body h3 { font: 600 14px var(--pix); letter-spacing: 0.12em; color: var(--gold); }
.asc-body .d-x { color: var(--ink); }
.asc-body .d-x:hover { background: #24344d; }
.asc-body .d-body .d-big { font: 700 52px/1 var(--pix); color: var(--gold); }
.asc-body .d-body .d-sub { color: var(--dim); }
.asc-body .d-stats b { font: 600 30px var(--pix); color: var(--ink); }
.asc-body .d-stats span { font: 15px var(--mono); color: var(--dim); }
.asc-body .btn { border-radius: 0; border: 2px solid #ffc2b3; background: transparent; color: var(--ink); font: 600 17px var(--pix); letter-spacing: 0.06em; }
.asc-body .btn.solid { background: var(--hot); border-color: #ffd6cc; color: #2a0a04; }
.asc-body .d-next span { color: var(--ink); font-family: var(--pix); }
.asc-body .d-toast { top: 50%; border-radius: 0; background: var(--hot); color: #2a0a04; font: 600 18px var(--pix); }
.d-body .climb-list { margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 6px; }
.d-body .climb-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--edge); }
.d-body .climb-list li:last-child { border-bottom: 0; }
.d-body .climb-list .q { font-size: 16px; color: var(--dim); }
.d-body .climb-list .a { font: 600 18px var(--pix); }
.d-body .climb-list .more { grid-column: 1 / -1; font-size: 16px; color: rgba(243, 246, 250, 0.55); }
.chip { display: inline-block; padding: 2px 8px; font: 600 14px/1.3 var(--pix); white-space: nowrap; grid-row: span 2; }
.chip.t1 { background: #9b6b43; color: #fff; } .chip.t2 { background: #6dbb5a; color: #0d2a08; } .chip.t3 { background: #4ea8ff; color: #04203d; }
.chip.t4 { background: #b48cff; color: #1c0b3b; } .chip.t5 { background: #f4f8fb; color: #1a2638; } .chip.t6 { background: var(--gold); color: #2b1d00; }
.chip.t0 { background: #3a1520; color: var(--hot); }
.d-body .tiers-help { display: grid; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.d-body .tiers-help li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.d-body .tiers-help small { font-size: 16px; color: var(--dim); }

@media (prefers-reduced-motion: reduce) {
  .land .tier, .bar.nope input { animation: none; }
}
