@font-face { font-family: "DM Sans"; src: url("/assets/fonts/dao/dm-sans.woff2") format("woff2"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/assets/fonts/dao/montserrat.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #000; --card: #0E100E; --line: rgba(200,222,199,0.14); --text: #E6F0E5; --muted: rgba(230,240,229,0.62);
  --lime: #B1FC03; --r: 16px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif; overscroll-behavior: none; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-text-size-adjust: 100%; }
body { position: fixed; inset: 0;
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(230,240,229,.5), transparent 60%),
    radial-gradient(1px 1px at 70% 80%, rgba(230,240,229,.4), transparent 60%),
    radial-gradient(1px 1px at 85% 15%, rgba(230,240,229,.45), transparent 60%),
    radial-gradient(900px 480px at 12% -8%, rgba(177,252,3,.04), transparent 55%), #000; }
#stage { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); overflow: hidden; background: #000; }
@media (min-width: 700px) { #stage { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; touch-action: none; }
img { image-rendering: pixelated; }
[hidden] { display: none !important; }

#topbar { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + var(--sat)) calc(10px + var(--sar)) 0 calc(10px + var(--sal)); pointer-events: none; z-index: 5; }
#topbar > * { pointer-events: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(14,16,14,.82);
  color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0; }
.icon-btn svg { fill: var(--text); stroke: var(--text); }
.icon-btn:active { transform: scale(.96); }
#btnMute .cross { display: none; } #btnMute.muted .cross { display: inline; } #btnMute.muted .wave { display: none; }
.pill { height: 40px; padding: 0 12px 0 7px; border-radius: 999px; border: 1px solid var(--line); background: rgba(14,16,14,.82);
  display: inline-flex; align-items: center; gap: 6px; font: 700 16px/1 "Montserrat", sans-serif; }
.pill img { width: 24px; height: 24px; }
.rules img { width: 24px; height: 24px; margin: -4px 0; }
#hudScore { position: absolute; left: 0; right: 0; top: calc(60px + var(--sat)); display: flex; justify-content: center; align-items: baseline; gap: 8px;
  z-index: 4; pointer-events: none; color: var(--text); text-shadow: 0 2px 0 #000, 0 0 18px rgba(0,0,0,.8); }
#hudScore .blk { font: 700 15px/1 "Montserrat", sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
#hudBlock { font: 800 44px/1 "Montserrat", sans-serif; }
#hudTick { align-self: center; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(177,252,3,.12);
  border: 1px solid rgba(177,252,3,.45); opacity: 0; transform: scale(.6); }
#hudTick svg { stroke: var(--lime); }
#hudTick.pop { animation: tick .6s ease-out; }
@keyframes tick { 0% { opacity: 0; transform: scale(.5); } 25% { opacity: 1; transform: scale(1.15); } 60% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }
#hint { position: absolute; left: 0; right: 0; top: 62%; text-align: center; z-index: 4; pointer-events: none;
  font: 700 15px/1 "Montserrat", sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
#runNote { position: absolute; left: 16px; right: 16px; bottom: 14%; text-align: center; z-index: 4; pointer-events: none;
  font: 600 13px/1.35 "Montserrat", sans-serif; color: var(--muted); }

.screen { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding: 0 calc(16px + var(--sar)) calc(20px + var(--sab)) calc(16px + var(--sal)); }
#scrPause, #scrOver { justify-content: center; background: rgba(0,0,0,.45); }
.card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 24px; box-shadow: 0 10px 28px rgba(0,0,0,.28); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.eyebrow { font: 700 11px/1 "Montserrat", sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--lime); }
h1, h2 { margin: 0; font-family: "Montserrat", sans-serif; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: 30px; } h2 { font-size: 22px; }
.sub { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.rules { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.rules span { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; }
.rules b { color: var(--text); }
.btn { min-height: 48px; width: 100%; border-radius: 12px; font: 700 16px/1 "Montserrat", sans-serif; cursor: pointer; border: 1px solid var(--line); }
.btn.primary { background: #E6F0E5; color: #050605; border-color: #E6F0E5; }
.btn.primary:active { background: #cfdccd; }
.btn.ghost { background: transparent; color: var(--text); }
.btn.small { width: auto; min-width: 88px; padding: 0 16px; }
.btn:disabled { opacity: .5; }
.back, .linkbtn { color: var(--muted); font-size: 14px; text-decoration: none; min-height: 44px; display: grid; place-items: center;
  background: none; border: 0; cursor: pointer; font-family: inherit; }
.badge { align-self: center; font: 700 11px/1 "Montserrat", sans-serif; letter-spacing: .12em; text-transform: uppercase;
  color: #050605; background: var(--lime); padding: 6px 10px; border-radius: 999px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stats div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 6px; display: flex; flex-direction: column; gap: 6px; }
.stats span { font-size: 12px; color: var(--muted); }
.stats b { font: 800 24px/1 "Montserrat", sans-serif; }

#sheetBack { position: absolute; inset: 0; z-index: 9; background: rgba(0,0,0,.55); }
#sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; max-height: 82%; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r) var(--r) 0 0;
  padding: 8px calc(16px + var(--sar)) calc(12px + var(--sab)) calc(16px + var(--sal)); animation: up .22s ease-out; touch-action: pan-y; }
@keyframes up { from { transform: translateY(100%); } }
.grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 2px auto 6px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head .icon-btn { background: transparent; }
#submitForm { margin: 8px 0 4px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.sf-label { font-size: 14px; color: var(--muted); margin-bottom: 10px; } .sf-label b { color: var(--text); }
.sf-row { display: flex; gap: 8px; }
#nick { flex: 1; min-width: 0; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: #000; color: var(--text);
  padding: 0 14px; font: 500 16px "DM Sans", sans-serif; -webkit-user-select: text; user-select: text; outline: none; }
#nick:focus { border-color: rgba(177,252,3,.6); }
.sf-msg { font-size: 12px; color: var(--muted); margin-top: 8px; min-height: 16px; }
.sf-msg.err { color: #ff9b8a; } .sf-msg.ok { color: var(--lime); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; }
.tab { min-height: 44px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font: 700 14px "Montserrat", sans-serif; cursor: pointer; }
.tab.on { background: #E6F0E5; color: #050605; }
.note { font-size: 12px; color: var(--muted); text-align: center; margin: 8px 0; }
.rows { list-style: none; margin: 0; padding: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1; min-height: 120px; }
.rows li { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; background: #0b0d0b; }
.rows .rk { font: 800 14px "Montserrat", sans-serif; color: var(--muted); }
.rows li:nth-child(-n+3) .rk { color: var(--lime); }
.rows .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rows .sc { font: 800 16px "Montserrat", sans-serif; }
.rows li.me { border-color: rgba(177,252,3,.55); }
.rows .empty { display: block; text-align: center; color: var(--muted); padding: 18px; min-height: 0; }

a.btn { display: grid; place-items: center; text-decoration: none; color: inherit; }
.lock-badge { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#scrLocked { justify-content: center; background: rgba(0,0,0,.45); }

.teaser { margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
#skinRow { width: 100%; }
#btnSkin[aria-pressed="true"] { border-color: rgba(212, 175, 46, 0.7); color: #F4E18A; }
.rows li.is-holder .nm { color: #F4E18A; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.rows .holder-badge { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F8F0B0, #D4AF2E 55%, #8A6A10);
  box-shadow: 0 0 0 1px rgba(177, 252, 3, 0.45); }

body.is-lava {
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(255,180,80,.45), transparent 60%),
    radial-gradient(1px 1px at 70% 80%, rgba(255,120,40,.35), transparent 60%),
    radial-gradient(900px 480px at 50% 110%, rgba(255,80,10,.24), transparent 55%),
    #140304;
}
body.is-lava .eyebrow { color: #ffb347; }
body.is-lava .btn.primary { background: #ffb347; color: #2a0a00; border-color: #ffb347; }
body.is-lava .btn.primary:active { background: #e89a2d; }
body.is-lava .tab.on { background: #ffb347; color: #2a0a00; }
.map-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.map-btn { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--text); font: 700 14px "Montserrat", sans-serif; cursor: pointer; }
.map-btn.on { background: #E6F0E5; color: #050605; border-color: #E6F0E5; }
body.is-lava .map-btn.on { background: #ffb347; color: #2a0a00; border-color: #ffb347; }
.map-btn.locked { opacity: .7; }
.lava-lock { margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.early-tag { margin: 0; font: 700 11px/1 "Montserrat", sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #F4E18A; }

#scrTitle h1 { line-height: 1.15; }
body.is-lava #scrTitle h1 { font-size: 22px; }

@media (pointer: coarse), (max-width: 700px) {
  #hudScore { text-shadow: 0 2px 0 #000; }
  .card { box-shadow: 0 4px 12px rgba(0,0,0,.28); }
}
