:root { --ink: #1c2434; --cream: #fff8ec; --red: #d83a34; --gold: #ffc93c; --sky: #7ec8ff; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1c2434; color: var(--ink); font-family: "Nunito", system-ui, sans-serif; touch-action: none; user-select: none; -webkit-user-select: none; }
canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }

.sheet { position: fixed; inset: 0; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: max(16px, env(safe-area-inset-top)) 16px 24px;
  background: radial-gradient(ellipse at 50% 0%, rgba(126,200,255,.55), rgba(28,36,52,.82) 70%); touch-action: pan-y; }
.menu-in, .res-in { width: 100%; max-width: 860px; text-align: center; }
.logo { font-family: "Lilita One", sans-serif; font-weight: 400; margin: 6px 0 0; line-height: .9; letter-spacing: 2px; transform: rotate(-3deg); }
.logo span { display: inline-block; font-size: clamp(48px, 11vw, 96px); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); }
.logo .l1 { color: var(--red); } .logo .l2 { color: var(--gold); margin-left: 12px; }
.tag { color: var(--cream); font-weight: 900; font-size: 18px; margin: 10px 0 4px; text-shadow: 0 2px 0 var(--ink); }
h2 { font-family: "Lilita One", sans-serif; font-weight: 400; color: var(--cream); margin: 16px 0 8px; font-size: 24px; text-shadow: 0 3px 0 var(--ink); }

.racers { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.racer { width: 108px; padding: 6px 4px 8px; border-radius: 16px; border: 4px solid var(--ink); background: var(--cream); box-shadow: 0 5px 0 var(--ink); transition: transform .12s; }
.racer img { width: 80px; height: 80px; object-fit: contain; display: block; margin: 0 auto; }
.racer b { display: block; font-size: 14px; margin-top: 2px; }
.racer.on { background: var(--gold); transform: translateY(-4px) rotate(-2deg); }
.racer .kc { display: block; height: 8px; border-radius: 4px; margin: 4px 10px 0; border: 2px solid var(--ink); }

.tracks { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.track { position: relative; height: 112px; border-radius: 16px; border: 4px solid var(--ink); box-shadow: 0 5px 0 var(--ink); background-size: cover; background-position: center; overflow: hidden; transition: transform .12s; }
.track b { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 4px; background: rgba(28,36,52,.82); color: var(--cream); font-size: 15px; }
.track .best { position: absolute; top: 6px; right: 6px; background: var(--gold); border: 2px solid var(--ink); border-radius: 10px; padding: 0 6px; font-size: 12px; }
.track.on { outline: 5px solid var(--gold); transform: translateY(-4px); }

.row { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.speeds { display: flex; gap: 6px; }
.speed { border: 3px solid var(--ink); border-radius: 12px; background: var(--cream); padding: 8px 12px; font-weight: 900; box-shadow: 0 4px 0 var(--ink); }
.speed small { display: block; font-size: 11px; opacity: .7; }
.speed.on { background: var(--gold); }
.go { font-family: "Lilita One", sans-serif; font-size: 30px; padding: 10px 28px; border-radius: 18px; border: 4px solid var(--ink); background: var(--red); color: #fff; box-shadow: 0 6px 0 var(--ink); -webkit-text-stroke: 1px var(--ink); }
.go:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.go.alt { background: #3fa66b; } .go.alt2 { background: #5b6b8a; font-size: 22px; }
.how { color: var(--cream); font-size: 13px; opacity: .9; margin-top: 18px; line-height: 1.6; }
.legal { color: var(--cream); font-size: 12px; opacity: .6; }

.res-in { margin-top: 6vh; background: var(--cream); border: 5px solid var(--ink); border-radius: 24px; box-shadow: 0 8px 0 var(--ink); padding: 18px; max-width: 520px; }
.res-title { font-family: "Lilita One", sans-serif; font-size: clamp(36px, 9vw, 60px); color: var(--red); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.res-list { list-style: none; padding: 0; margin: 10px 0; text-align: left; }
.res-list li { display: flex; align-items: center; gap: 10px; padding: 4px 10px; border-radius: 12px; font-weight: 900; font-size: 18px; }
.res-list li.me { background: var(--gold); }
.res-list .pl { width: 38px; font-family: "Lilita One", sans-serif; font-size: 24px; }
.res-list img { width: 40px; height: 40px; object-fit: contain; }
.res-list .t { margin-left: auto; font-size: 14px; opacity: .7; }

#touch .tb { position: fixed; bottom: max(18px, env(safe-area-inset-bottom)); width: 84px; height: 84px; border-radius: 50%; border: 4px solid rgba(28,36,52,.8); background: rgba(255,248,236,.55); font-size: 30px; font-weight: 900; color: var(--ink); touch-action: none; }
#touch .tb.down { background: rgba(255,201,60,.9); }
#tl { left: max(16px, env(safe-area-inset-left)); } #tr { left: calc(max(16px, env(safe-area-inset-left)) + 96px); }
#touch .act { font-size: 15px; font-family: "Lilita One", sans-serif; }
#tdrift { right: calc(max(16px, env(safe-area-inset-right)) + 96px); }
#titem { right: max(16px, env(safe-area-inset-right)); bottom: calc(max(18px, env(safe-area-inset-bottom)) + 70px); }
.snd, .pausebtn { position: fixed; top: max(10px, env(safe-area-inset-top)); width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--ink); background: var(--cream); font-size: 20px; z-index: 5; }
.snd { right: max(10px, env(safe-area-inset-right)); }
.pausebtn { right: calc(max(10px, env(safe-area-inset-right)) + 52px); font-weight: 900; }
@media (max-width: 520px) {
  #touch .tb { width: 70px; height: 70px; font-size: 24px; }
  #tr { left: calc(max(12px, env(safe-area-inset-left)) + 78px); } #tl { left: max(12px, env(safe-area-inset-left)); }
  #tdrift { right: calc(max(12px, env(safe-area-inset-right)) + 78px); } #titem { right: max(12px, env(safe-area-inset-right)); }
  #touch .act { font-size: 13px; }
}
.legal a { color: inherit; }

/* the two modes: kart tracks (index.html) and dune buggies (dunes.html), + the ✨ HD switch (hd.html, dunes-hd.html) */
.modesrow { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 6px 0 2px; }
.modesrow .modes { margin: 0; }
.hdtog { padding: 8px 14px; font-weight: 900; font-size: 16px; color: var(--ink); background: var(--cream); text-decoration: none; border: 4px solid var(--ink); border-radius: 16px; box-shadow: 0 5px 0 var(--ink); white-space: nowrap; }
.hdtog b { display: inline-block; min-width: 2.4em; margin-left: 4px; padding: 0 6px; border-radius: 8px; background: #5b6b8a; color: #fff; font-size: 13px; }
.hdtog.on { background: var(--gold); } .hdtog.on b { background: #3fa66b; }
.mode[href="ultra.html"] { background: linear-gradient(135deg, #e9f7ff, #d8c8ff); } .mode[href="ultra.html"].on { background: linear-gradient(135deg, #7fe0ff, #b78cff); }
@media (max-width: 440px) { .mode { padding: 8px 9px; font-size: 14px; } .hdtog { font-size: 14px; } }
.modes { display: inline-flex; gap: 0; margin: 6px 0 2px; border: 4px solid var(--ink); border-radius: 16px; overflow: hidden; box-shadow: 0 5px 0 var(--ink); }
.mode { padding: 8px 16px; font-weight: 900; font-size: 16px; color: var(--ink); background: var(--cream); text-decoration: none; }
.mode + .mode { border-left: 4px solid var(--ink); }
.mode.on { background: var(--gold); }
body.dunes .sheet { background: radial-gradient(ellipse at 50% 0%, rgba(255,190,120,.6), rgba(28,36,52,.85) 70%); }
.loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(28,36,52,.85); color: var(--cream);
  font-family: "Lilita One", sans-serif; font-size: 34px; text-shadow: 0 3px 0 var(--ink); z-index: 6; }
body.dunes .logo span { font-size: clamp(36px, 9.2vw, 96px); }
/* the painted ROCKO DUNES logo (Ron's DALL·E art) */
.logo-art { transform: none; margin: 0 auto -6px; }
.logo-art img { display: block; width: min(420px, 78vw); height: auto; margin: 0 auto; filter: drop-shadow(0 6px 0 rgba(28,36,52,.6)); }
/* the "Now playing" card on the menus: Ron's Suno theme + its album cover (tap the cover to see it big) */
.song { display: flex; align-items: center; gap: 12px; max-width: 420px; margin: 18px auto 0; padding: 8px 10px; background: rgba(28,36,52,.55);
  border: 2px solid rgba(255,255,255,.15); border-radius: 16px; text-align: left; color: var(--cream); }
.song-cover { padding: 0; border: 0; background: none; cursor: zoom-in; flex: none; }
.song-cover img { display: block; width: 64px; height: 64px; border-radius: 10px; box-shadow: 0 3px 0 var(--ink); }
.song-txt { flex: 1; min-width: 0; line-height: 1.25; }
.song-txt small { display: block; font-size: 12px; opacity: .8; }
.song-txt b { font-family: "Lilita One", sans-serif; font-weight: 400; font-size: 18px; }
.song-play { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--gold); color: var(--ink); font-size: 20px; box-shadow: 0 3px 0 var(--ink); }
.coverbig { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15,20,30,.88); cursor: zoom-out; }
.coverbig img { width: min(560px, 90vw, 80vh); height: auto; border-radius: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
