:root {
  --kaspa-teal: #70c7ba;
  --kaspa-black: #231f20;
  --kaspa-silver: #b6b6b6;
  --kaspa-aqua: #49eacb;
  --danger: #ff5f62;
  --ink: #151314;
  --panel: #292526;
  --white: #f5f7f6;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #151314; color: var(--white); font-family: Inter, Lato, system-ui, sans-serif; }
body { min-height: 100vh; min-height: 100dvh; overflow-x: hidden; }
button { font: inherit; }
.shell { width: min(1500px, 100%); min-height: 100vh; margin: auto; display: grid; grid-template-rows: 74px 1fr 38px; padding: 0 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #ffffff1a; }
.brand { border: 0; color: var(--white); background: transparent; display: flex; align-items: center; gap: 14px; font-weight: 800; letter-spacing: .08em; cursor: pointer; }
.brand b { color: var(--kaspa-teal); }
.brand-mark { width: 35px; height: 30px; display: grid; gap: 4px; transform: skewX(-18deg); }
.brand-mark i { display: block; background: var(--kaspa-teal); }
.brand-mark i:nth-child(1) { width: 70%; margin-left: 30%; }.brand-mark i:nth-child(2) { width: 100%; }.brand-mark i:nth-child(3) { width: 70%; }
.status { display: flex; align-items: center; gap: 9px; color: var(--kaspa-silver); font: 700 .72rem/1 monospace; letter-spacing: .12em; }
.status-dot { width: 8px; height: 8px; background: var(--kaspa-aqua); border-radius: 50%; box-shadow: 0 0 14px var(--kaspa-aqua); }
.status.offline .status-dot { background: #777173; box-shadow: none; }
.stage { position: relative; width: min(100%, calc((100dvh - 112px) * 16 / 9)); max-height: calc(100dvh - 112px); aspect-ratio: 16 / 9; justify-self: center; align-self: center; overflow: hidden; background: var(--kaspa-black); border: 1px solid #ffffff20; box-shadow: 0 24px 80px #0008; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: 0; image-rendering: auto; }
.screen { position: absolute; inset: 0; z-index: 5; }
.hidden { display: none !important; }
.menu-screen { background: linear-gradient(110deg, #080a13e8 0 55%, #11131dcc), radial-gradient(circle at 78% 35%, #70c7ba24, transparent 31%); overflow: hidden; }
.menu-grid { position: absolute; inset: 0; opacity: .11; background-image: linear-gradient(#b6b6b622 1px, transparent 1px), linear-gradient(90deg, #b6b6b622 1px, transparent 1px); background-size: 58px 58px; transform: perspective(500px) rotateX(58deg) scale(1.5); transform-origin: center bottom; }
.menu-copy { position: absolute; z-index: 2; left: clamp(28px, 6vw, 90px); top: 50%; width: min(630px, 58%); transform: translateY(-53%); }
.kicker { margin: 0 0 15px; color: var(--kaspa-teal); font: 800 .78rem/1.1 monospace; letter-spacing: .18em; }
h1, h2 { margin: 0; font-family: Oswald, Impact, sans-serif; letter-spacing: -.035em; line-height: .88; }
h1 { font-size: clamp(3rem, 7vw, 7.5rem); } h1 span { color: var(--kaspa-teal); }
h2 { font-size: clamp(2.6rem, 6vw, 5.5rem); }
.intro { max-width: 520px; color: #d3d0d1; font-size: clamp(.9rem, 1.25vw, 1.1rem); line-height: 1.55; }
.menu-actions, .result-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.primary-button, .secondary-button { min-height: 50px; border: 1px solid var(--kaspa-teal); padding: 0 26px; font-weight: 900; letter-spacing: .08em; cursor: pointer; transition: transform .15s, background .15s; }
.primary-button { color: var(--kaspa-black); background: var(--kaspa-teal); }.primary-button span { margin-left: 32px; }
.secondary-button { color: var(--kaspa-teal); background: transparent; }
.god-mode-button { border-color: #ff5f62; color: #ff9b9d; }
.god-mode-button.on { color: #171415; background: var(--danger); box-shadow: 0 0 24px #ff5f6255; }
.god-mode-intro { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin: -4px 0 30px; padding: 20px; color: #ddd8da; background: #ff5f620d; border: 1px solid #ff5f6244; }
.god-mode-intro p { max-width: 620px; margin: 0; line-height: 1.55; }
.primary-button:hover, .secondary-button:hover { transform: translateY(-2px); background: var(--kaspa-aqua); color: var(--kaspa-black); }
.control-hint { display: flex; align-items: center; gap: 7px; margin-top: 28px; color: #8f898b; font: 700 .7rem/1 monospace; letter-spacing: .08em; }
kbd { min-width: 25px; padding: 7px; text-align: center; color: var(--kaspa-silver); background: #ffffff0b; border: 1px solid #ffffff28; box-shadow: inset 0 -2px #0007; }.space { min-width: 72px; margin-left: 10px; }
.runner-preview { position: absolute; right: 16%; top: 30%; width: 130px; height: 220px; transform: rotate(8deg); filter: drop-shadow(0 22px 12px #0008); }
.preview-head { position: absolute; width: 61px; height: 61px; left: 34px; background: var(--kaspa-teal); border-radius: 46% 48% 44% 46%; }
.preview-body { position: absolute; width: 77px; height: 105px; left: 22px; top: 57px; background: var(--kaspa-teal); clip-path: polygon(18% 0, 82% 0, 100% 78%, 70% 100%, 35% 91%, 0 62%); }
.preview-leg { position: absolute; width: 25px; height: 78px; top: 145px; background: var(--kaspa-teal); }.preview-leg.one { left: 28px; transform: rotate(26deg); }.preview-leg.two { left: 74px; transform: rotate(-33deg); transform-origin: top; }
.speed-lines { position: absolute; width: 320px; height: 180px; right: 70px; top: 20px; background: repeating-linear-gradient(172deg, transparent 0 20px, #70c7ba55 22px 24px, transparent 26px 39px); }
.menu-footer { position: absolute; z-index: 3; left: 6vw; right: 6vw; bottom: 4%; display: flex; gap: 26px; border-top: 1px solid #ffffff1a; padding-top: 16px; }
.menu-footer button, .text-button { color: #a8a3a5; background: none; border: 0; padding: 5px 0; font-weight: 800; font-size: .72rem; letter-spacing: .12em; cursor: pointer; }.menu-footer button:hover, .text-button:hover { color: var(--kaspa-aqua); }
.hud { position: absolute; z-index: 4; left: 0; right: 0; top: 0; height: 66px; display: grid; grid-template-columns: 130px 1fr 170px 170px 55px; align-items: center; background: linear-gradient(#171415ec, #171415bd, transparent); padding: 0 18px; pointer-events: none; }
.hud > div { display: grid; gap: 3px; }.hud strong { font: 800 .95rem/1 monospace; }.hud-center { text-align: center; color: var(--kaspa-silver); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.creator-credit { position: absolute; z-index: 3; top: 78px; right: 20px; padding: 8px 11px; color: #a8a3a5; background: #171415a8; border: 1px solid #ffffff1c; font: 800 .66rem/1 monospace; letter-spacing: .1em; pointer-events: none; animation: creator-blink 1.8s steps(2, end) infinite; }
.creator-credit strong { font-size: .82rem; letter-spacing: .02em; }.creator-kas { color: var(--kaspa-teal); }.creator-btc { color: #f7931a; }
@keyframes creator-blink { 0%, 44% { opacity: 1; filter: drop-shadow(0 0 5px #70c7ba66); } 45%, 100% { opacity: .35; filter: none; } }
.touch-controls { position: fixed; z-index: 6; inset: auto 0 0; display: flex; justify-content: space-between; align-items: center; padding: 8px max(14px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); background: linear-gradient(180deg, #0d0b0c, #1c1819); border-top: 1px solid #70c7ba55; pointer-events: none; }
.touch-directions { display: flex; gap: 12px; }.touch-button { width: clamp(64px, 10vw, 92px); height: clamp(64px, 10vw, 92px); border: 2px solid #70c7baaa; border-radius: 18px; color: var(--white); background: #171415b8; box-shadow: inset 0 0 18px #70c7ba22, 0 5px 18px #0007; font: 900 clamp(1rem, 2.5vw, 1.6rem)/1 monospace; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.touch-button.pressed { color: var(--kaspa-black); background: var(--kaspa-aqua); transform: scale(.95); }.touch-jump { width: clamp(82px, 13vw, 116px); border-radius: 50%; font-size: clamp(.72rem, 1.8vw, 1rem); }
.rotate-device { display: none; }
.god-mode-indicator { justify-self: center; color: #ff8a8d; font: 900 .58rem/1 monospace; letter-spacing: .16em; text-shadow: 0 0 10px #ff5f6288; }
.eyebrow { color: #777173; font: 700 .6rem/1 monospace; letter-spacing: .14em; }.icon-button { pointer-events: auto; width: 38px; height: 38px; background: #ffffff0b; color: var(--white); border: 1px solid #ffffff26; cursor: pointer; }
.panel-screen, .result-screen, .pause-screen { display: grid; place-items: center; padding: 5%; background: #151314e8; backdrop-filter: blur(8px); }
.panel-card { width: min(1040px, 100%); max-height: 90%; overflow: auto; background: var(--panel); border-top: 4px solid var(--kaspa-teal); padding: clamp(24px, 4vw, 54px); box-shadow: 0 30px 80px #000a; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 30px; }.panel-heading > div { min-width: 0; }.panel-heading h2 { overflow-wrap: anywhere; }.close-button { flex: 0 0 auto; color: var(--kaspa-silver); background: none; border: 1px solid #ffffff24; font-size: 2rem; width: 48px; height: 48px; cursor: pointer; }
.level-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.level-button { aspect-ratio: 1.2; display: grid; place-content: center; gap: 7px; border: 1px solid #ffffff20; background: #1b191a; color: var(--white); cursor: pointer; }.level-button:hover:not(:disabled), .level-button.current { border-color: var(--kaspa-aqua); transform: translateY(-2px); }.level-button:disabled { color: #625e5f; cursor: not-allowed; }.level-number { color: var(--kaspa-teal); font: 900 1.25rem/1 monospace; }.level-name { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }.level-best { color: #8f898b; font: .65rem/1 monospace; }
.settings-list, .about-copy { display: grid; gap: 15px; color: #d4d1d2; line-height: 1.6; max-width: 700px; }.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 25px; padding: 18px 0; border-bottom: 1px solid #ffffff15; }.setting-row span { display: grid; }.setting-row small { color: #8f898b; }.toggle { flex: 0 0 auto; width: 54px; height: 30px; border: 0; border-radius: 20px; padding: 4px; background: #4b4648; cursor: pointer; }.toggle::after { content: ""; display: block; width: 22px; height: 22px; border-radius: 50%; background: #aaa; transition: transform .2s; }.toggle.on { background: var(--kaspa-teal); }.danger-toggle.on { background: var(--danger); }.toggle.on::after { background: var(--kaspa-black); transform: translateX(24px); }
.time-table { width: 100%; border-collapse: collapse; }.time-table th, .time-table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid #ffffff12; }.time-table th { color: #7e787a; font: 700 .65rem/1 monospace; letter-spacing: .1em; }.time-table td:last-child { color: var(--kaspa-aqua); font-family: monospace; }
.result-card, .pause-card { width: min(560px, 95%); text-align: center; background: #252122; border-top: 4px solid var(--kaspa-teal); padding: 48px; box-shadow: 0 25px 70px #000a; }.result-card .kicker, .pause-card .kicker { margin-bottom: 12px; }.result-time { display: grid; gap: 4px; margin: 34px 0 0; }.result-time span { color: #8f898b; font: 700 .7rem monospace; }.result-time strong { color: var(--kaspa-aqua); font: 900 2.4rem monospace; }.new-best { color: var(--kaspa-black); background: var(--kaspa-aqua); display: inline-block; padding: 7px 12px; font: 900 .68rem monospace; letter-spacing: .1em; }.result-actions { justify-content: center; }.pause-card { display: grid; gap: 13px; }.pause-card h2 { margin-bottom: 25px; }
.run-verification { margin: 14px 0 0; font: 800 .68rem/1.4 monospace; letter-spacing: .08em; }.run-verification.pending { color: var(--kaspa-silver); }.run-verification.verified { color: var(--kaspa-aqua); }.run-verification.failed { color: #ff9b9d; }
.account-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }.account-form, .account-profile, .recovery-card { display: grid; gap: 18px; padding: 24px; background: #1b191a; border: 1px solid #ffffff1c; }.account-form h3 { margin: 0; }.account-form label, .leaderboard-toolbar label { display: grid; gap: 8px; color: #8f898b; font: 800 .68rem monospace; letter-spacing: .1em; }.account-form input, .leaderboard-toolbar select { min-height: 46px; border: 1px solid #ffffff2c; background: #121011; color: var(--white); padding: 0 14px; font: 700 .9rem monospace; }.form-message, .notice { color: #ff9b9d; font: 800 .72rem/1.5 monospace; letter-spacing: .06em; }.recovery-card code { overflow-wrap: anywhere; color: var(--kaspa-aqua); font: 900 clamp(.9rem, 2vw, 1.35rem)/1.6 monospace; letter-spacing: .08em; }.account-profile strong { color: var(--kaspa-aqua); font-size: 2rem; }.account-profile small { color: #8f898b; }.leaderboard-toolbar { display: flex; gap: 18px; margin-bottom: 24px; }.leaderboard-toolbar label { flex: 1; }
.page-footer { display: flex; align-items: center; justify-content: space-between; color: #625e5f; font: 700 .62rem/1 monospace; letter-spacing: .1em; }
@media (max-width: 800px) {
  .shell { padding: 0; grid-template-rows: 58px 1fr 30px; }.topbar, .page-footer { padding: 0 14px; }.stage { width: min(100%, calc((100dvh - 88px) * 16 / 9)); max-height: calc(100dvh - 88px); border-inline: 0; }.runner-preview { opacity: .28; right: 10%; }.menu-copy { width: 86%; top: 46%; }.intro { max-width: 450px; }.control-hint { flex-wrap: wrap; }.menu-footer { left: 7%; gap: 12px; flex-wrap: wrap; }.panel-heading h2 { font-size: clamp(1.8rem, 10vw, 2.6rem); }.level-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }.level-button { min-width: 0; }.level-name { overflow-wrap: anywhere; font-size: .58rem; }.hud { grid-template-columns: 90px 1fr 120px 45px; }.hud > div:nth-child(4) { display: none; }.account-columns { grid-template-columns: 1fr; }.leaderboard-toolbar { flex-direction: column; }.leaderboard-toolbar select { width: 100%; min-width: 0; }
}
body.touch-device.game-active { overflow: hidden; overscroll-behavior: none; }
body.touch-device .control-hint { display: none; }
body.touch-device:not(.game-active) .stage { width: 100%; height: 100%; max-height: none; aspect-ratio: auto; align-self: stretch; }
body.touch-device.game-active .shell { height: 100dvh; min-height: 0; padding: 0; }
body.touch-device.game-active .topbar, body.touch-device.game-active .page-footer { display: none; }
body.touch-device.game-active .touch-button { width: 60px; height: 60px; border-radius: 14px; font-size: 1.1rem; }
body.touch-device.game-active .touch-jump { width: 64px; border-radius: 18px; font-size: .72rem; }
body.touch-device.game-active .creator-credit { top: 68px; right: max(14px, env(safe-area-inset-right)); font-size: .56rem; }
@media (max-height: 650px) { .control-hint, .intro { display: none; }.menu-actions { margin-top: 18px; }.menu-footer { bottom: 3%; }.runner-preview { transform: scale(.75) rotate(8deg); } }
@media (orientation: portrait) and (pointer: coarse) {
  body.touch-device:not(.game-active) .menu-copy { left: 22px; right: 22px; top: 45%; width: auto; transform: translateY(-50%); }
  body.touch-device:not(.game-active) .menu-copy h1 { font-size: clamp(2.45rem, 12vw, 3.7rem); }
  body.touch-device:not(.game-active) .menu-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
  body.touch-device:not(.game-active) .menu-actions .god-mode-button { grid-column: 1 / -1; }
  body.touch-device:not(.game-active) .menu-actions button { min-width: 0; padding-inline: 14px; }
  body.touch-device:not(.game-active) .menu-footer { left: 22px; right: 22px; bottom: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 12px; padding-top: 10px; }
  body.touch-device:not(.game-active) .menu-footer button { text-align: left; font-size: .62rem; }
  body.touch-device.game-active .shell { grid-template-rows: 1fr; }
  body.touch-device.game-active .stage { width: 100%; height: 100%; max-height: none; aspect-ratio: auto; }
  body.touch-device.game-active .touch-controls { display: none !important; }
  .rotate-device:not(.hidden) { position: absolute; z-index: 8; inset: 0; display: grid; place-content: center; gap: 10px; text-align: center; padding: 28px; background: #151314f2; color: var(--kaspa-teal); letter-spacing: .1em; }
  .rotate-device span { color: var(--kaspa-silver); font-size: .78rem; letter-spacing: .04em; }
}
@media (max-width: 420px) and (orientation: portrait) {
  .panel-heading { position: relative; display: block; }
  .panel-heading .kicker { padding-right: 62px; }
  .panel-heading h2 { font-size: 2.05rem; overflow-wrap: normal; word-break: normal; }
  .panel-heading .close-button { position: absolute; top: 0; right: 0; }
}
@media (orientation: landscape) and (pointer: coarse) {
  body.touch-device.game-active .shell { grid-template-columns: 68px minmax(0, 1fr) 68px; grid-template-rows: 1fr; }
  body.touch-device.game-active .stage { grid-column: 2; grid-row: 1; width: min(100%, calc(100dvh * 16 / 9)); max-height: 100dvh; }
  body.touch-device.game-active .touch-controls { position: static; grid-column: 1 / 4; grid-row: 1; width: 100%; height: 100%; padding: max(8px, env(safe-area-inset-top)) max(5px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(5px, env(safe-area-inset-left)); background: transparent; border: 0; }
  body.touch-device.game-active .touch-directions { flex-direction: column; gap: 12px; }
  body.touch-device.game-active .touch-button { width: 56px; height: 56px; background: #171415e8; }
  body.touch-device.game-active .touch-jump { width: 62px; height: 62px; }
}
@media (orientation: landscape) and (pointer: coarse) and (max-height: 650px) {
  body.touch-device.game-active .shell { grid-template-columns: 74px minmax(0, 1fr) 74px; }
  body.touch-device.game-active .touch-button { width: 62px; height: 62px; }
  body.touch-device.game-active .touch-jump { width: 68px; height: 68px; }
  body.touch-device:not(.game-active) .shell { grid-template-rows: 44px minmax(0, 1fr); }
  body.touch-device:not(.game-active) .topbar { padding-inline: 12px; }
  body.touch-device:not(.game-active) .page-footer { display: none; }
  body.touch-device:not(.game-active) .brand { gap: 9px; font-size: .78rem; }
  body.touch-device:not(.game-active) .brand-mark { width: 27px; height: 23px; }
  body.touch-device:not(.game-active) .menu-copy { left: 24px; top: 50%; width: 62%; transform: translateY(-50%); }
  body.touch-device:not(.game-active) .menu-copy h1 { font-size: clamp(2.25rem, 7vw, 3.4rem); }
  body.touch-device:not(.game-active) .menu-copy .kicker { margin-bottom: 8px; font-size: .64rem; }
  body.touch-device:not(.game-active) .menu-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
  body.touch-device:not(.game-active) .menu-actions .god-mode-button { grid-column: 1 / -1; }
  body.touch-device:not(.game-active) .menu-actions button { min-width: 0; min-height: 42px; padding-inline: 10px; font-size: .72rem; }
  body.touch-device:not(.game-active) .menu-footer { left: auto; right: 20px; top: 50%; bottom: auto; width: 29%; transform: translateY(-50%); display: grid; gap: 5px; padding: 0 0 0 14px; border-top: 0; border-left: 1px solid #ffffff1a; }
  body.touch-device:not(.game-active) .menu-footer button { min-height: 28px; text-align: left; font-size: .58rem; }
  body.touch-device:not(.game-active) .runner-preview { right: 22%; opacity: .15; }
  body.touch-device.game-active .hud { height: 52px; grid-template-columns: 84px 1fr 112px 38px; padding: 0 9px; }
  body.touch-device.game-active .hud > div:nth-child(4) { display: none; }
  body.touch-device.game-active .hud strong { font-size: .76rem; }
  body.touch-device.game-active .hud-center { font-size: .68rem; letter-spacing: .07em; }
  body.touch-device.game-active .creator-credit { top: 55px; right: 8px; padding: 6px 8px; }
  body.touch-device:not(.game-active) .panel-screen, body.touch-device:not(.game-active) .result-screen, body.touch-device:not(.game-active) .pause-screen { padding: 10px; }
  body.touch-device:not(.game-active) .panel-card { max-height: 100%; padding: 18px; }
  body.touch-device:not(.game-active) .panel-heading { margin-bottom: 14px; }
  body.touch-device:not(.game-active) .panel-heading h2 { font-size: 2.2rem; }
  body.touch-device:not(.game-active) .panel-heading .kicker { margin-bottom: 7px; }
  body.touch-device:not(.game-active) .account-columns { grid-template-columns: 1fr 1fr; gap: 12px; }
  body.touch-device:not(.game-active) .account-form, body.touch-device:not(.game-active) .account-profile, body.touch-device:not(.game-active) .recovery-card { gap: 10px; padding: 14px; }
  body.touch-device:not(.game-active) .god-mode-intro { gap: 14px; margin-bottom: 14px; padding: 12px; }
  body.touch-device:not(.game-active) .result-card, body.touch-device .pause-card { max-height: 100%; overflow: auto; padding: 18px; }
  body.touch-device:not(.game-active) .result-card h2, body.touch-device .pause-card h2 { font-size: 2.2rem; }
  body.touch-device .pause-screen { padding: 10px; }
  body.touch-device:not(.game-active) .result-time { margin-top: 12px; }
  body.touch-device:not(.game-active) .result-actions { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) { .creator-credit { animation: none; } }
