:root {
  --ink: #e9f1ff;
  --muted: #9fb0cc;
  --panel: rgba(9, 13, 24, 0.82);
  --line: rgba(134, 217, 255, 0.28);
  --cy: #86d9ff;
  --pink: #ff7ab6;
  --good: #6dffa6;
  --bad: #ff5d7c;
  --gold: #ffe28a;
  --head: "Orbitron", "Segoe UI", system-ui, sans-serif;
  --body: "Exo 2", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #04060c; color: var(--ink); font-family: var(--body); overflow: hidden; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#app { position: fixed; inset: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.ui, .touch, .pausebtn { z-index: 2; }
body.playing #cv { cursor: none; }

/* ---------- overlay screens */
.ui { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); overflow-y: auto; background: radial-gradient(ellipse at center, rgba(4,6,12,0.25), rgba(4,6,12,0.7)); }
.ui[hidden] { display: none; }
.panel { width: min(560px, 100%); max-height: 100%; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px 28px; box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: rise 0.35s ease-out; }
.panel.wide { width: min(860px, 100%); }
.panel.small { width: min(420px, 100%); text-align: center; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.kicker { font: 700 12px/1.2 var(--head); letter-spacing: 0.18em; color: var(--cy); margin-bottom: 6px; }
.kicker.good { color: var(--good); } .kicker.bad { color: var(--bad); }
h1, h2, h3 { font-family: var(--head); margin: 0 0 12px; letter-spacing: 0.04em; }
h2 { font-size: clamp(22px, 4vw, 30px); }
h2.big { font-size: clamp(34px, 7vw, 52px); color: var(--gold); }
h3 { font-size: 14px; color: var(--cy); margin-top: 16px; }
p { line-height: 1.5; margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.good { color: var(--good); } .cy { color: var(--cy); }

/* title */
.title { text-align: center; width: min(500px, 100%); }
.logo { font-size: clamp(40px, 9vw, 68px); line-height: 0.95; margin: 4px 0 12px; font-weight: 900; display: flex; flex-direction: column; align-items: center; }
.logo span { background: linear-gradient(180deg, #ffffff, #9fdcff 60%, #4aa8ff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 18px rgba(80,180,255,0.45)); }
.logo .b { background: linear-gradient(180deg, #ffe0ef, #ff8fc4 60%, #ff4f9a); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 18px rgba(255,90,160,0.45)); letter-spacing: 0.12em; }
.tag { color: var(--muted); margin-bottom: 18px; }
.note { color: var(--muted); font-size: 13px; margin-top: 8px; }
.hint-rotate { display: none; color: var(--gold); font-size: 13px; }
@media (orientation: portrait) and (pointer: coarse) { .hint-rotate { display: block; } }

/* buttons */
.menu { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.menu.row { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.menu.row button { flex: 1 1 160px; }
.menu.grid2 { display: grid; grid-template-columns: 1fr 1fr; }
button { font: 600 16px var(--body); color: var(--ink); background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); border-radius: 12px; padding: 12px 16px; cursor: pointer; transition: transform 0.08s, background 0.15s, border-color 0.15s; min-height: 46px; }
button:hover:not([disabled]) { background: rgba(134,217,255,0.12); border-color: rgba(134,217,255,0.5); }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
button:active:not([disabled]) { transform: scale(0.98); }
button.primary { background: linear-gradient(180deg, #4cc3ff, #1f7fd6); border-color: #7fd6ff; color: #fff; font-weight: 700; box-shadow: 0 6px 22px rgba(40,150,255,0.35); }
button.primary:hover { background: linear-gradient(180deg, #6fd0ff, #2b8fe6); }
button.danger { border-color: rgba(255,93,124,0.5); color: #ffb3c2; }
button[disabled] { opacity: 0.4; cursor: not-allowed; }



/* tables */
.scores { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 10px; }
.scores th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 4px; }
.scores td { padding: 7px 4px; border-top: 1px solid rgba(255,255,255,0.07); }
.scores td:nth-child(3) { font-family: var(--head); color: var(--gold); }
.scores tr.me td { background: rgba(255,226,138,0.12); }

/* name entry */


/* how-to */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 22px; }
.cols p { font-size: 14px; }
kbd { display: inline-block; min-width: 24px; padding: 1px 6px; margin: 0 2px 2px 0; font: 700 12px var(--head); color: var(--ink); background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); border-bottom-width: 3px; border-radius: 6px; text-align: center; }

/* settings */
.slider { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; }
.slider input { flex: 1; accent-color: var(--cy); }

/* ---------- touch controls */

/* link to the web guide on the How to play screen */
.guidelink { text-align: center; margin: 14px 0 0; font-size: 15px; }
.guidelink a { color: #86d9ff; }

/* online high scores */
.tabs { display: flex; gap: 6px; margin: 4px 0 12px; }
.tabs button { flex: 1; padding: 9px 8px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--ink); font: 700 13px var(--head); letter-spacing: 0.06em; cursor: pointer; }
.tabs button.sel { border-color: var(--cy); color: var(--cy); background: rgba(80,220,255,0.1); }
.scores tr.gap td { text-align: center; color: var(--muted); border-top: 0; padding: 2px; }
.pilotbox { margin: 12px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,0.25); text-align: left; }
.pilotbox p { margin: 0 0 6px; }
.pilotbox .code { font-family: var(--head); letter-spacing: 0.08em; color: var(--gold); }
.pilotbox .row { display: flex; gap: 8px; margin-top: 8px; }
.pilotbox input { flex: 1; min-width: 0; font: 600 14px var(--head); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); background: rgba(0,0,0,0.35); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; -webkit-user-select: text; user-select: text; }
.pilotbox button[type="submit"] { padding: 9px 14px; border-radius: 10px; border: 1px solid var(--cy); background: rgba(80,220,255,0.12); color: var(--cy); font: 700 13px var(--head); cursor: pointer; }
.linkish { border: 0; background: none; padding: 0 2px; color: var(--cy); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.online { margin: 12px 0; }
.online .ranks { font-weight: 700; margin: 0 0 4px; }
.online .ranks b { color: var(--gold); font-family: var(--head); }
.newbest { color: var(--gold); font-weight: 700; margin: 8px 0 0; }
.pname { margin: 10px 0 2px; text-align: left; }
.pname label { display: block; font-weight: 700; font-size: 13px; color: var(--gold); margin-bottom: 6px; }
.pname .row { display: flex; gap: 8px; }
.pname input { flex: 1; min-width: 0; font: 700 15px var(--head); letter-spacing: 0.04em; color: var(--ink); background: rgba(0,0,0,0.35); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; -webkit-user-select: text; user-select: text; }
.pname input:focus { outline: 2px solid var(--gold); }
.pname button[type="submit"] { padding: 9px 14px; border-radius: 10px; border: 1px solid var(--gold); background: rgba(255,226,138,0.12); color: var(--gold); font: 700 13px var(--head); cursor: pointer; }
.nmsg { min-height: 16px; margin: 6px 0 0; }
.nmsg.bad { color: var(--bad); } .nmsg.good { color: var(--good); }


/* ---------- Gotta Go! */
:root { --head: "Nunito", "Segoe UI", system-ui, sans-serif; --body: "Nunito", "Segoe UI", system-ui, sans-serif; --cy: #8fdcff; --gold: #ffd76a; --line: rgba(255, 215, 106, 0.3); --panel: rgba(16, 22, 52, 0.9); }
html, body { background: #6fc1ee; }
h2 { font-family: "Luckiest Guy", "Nunito", sans-serif; font-weight: 400; letter-spacing: 0.03em; font-size: clamp(26px, 5vw, 36px); }
h3 { font-weight: 800; }
.kicker { font-weight: 900; }
.title { width: min(520px, 100%); }
.covertitle { margin: -8px -8px 10px; line-height: 0; }
.title .tag { margin-bottom: 10px; font-size: 14px; }
.title .menu { gap: 8px; margin-top: 8px; }
.covertitle { text-align: center; }
.covertitle img { display: inline-block; width: auto; height: auto; max-width: 100%; max-height: 32vh; border-radius: 12px; border: 3px solid #1c1a22; }
.worktitle { font-size: 12px; color: var(--muted); margin: -4px 0 10px; }
button { font-weight: 800; }
button.primary { background: linear-gradient(180deg, #ffb53a, #e2731a); border-color: #ffd58a; color: #2a1200; box-shadow: 0 6px 22px rgba(240, 140, 30, 0.35); }
button.primary:hover { background: linear-gradient(180deg, #ffc65c, #ec8426); }
.ui { background: radial-gradient(ellipse at center, rgba(6, 18, 34, 0.25), rgba(4, 10, 22, 0.66)); }
.bad { color: var(--bad); } .gold { color: var(--gold); }
.from { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-top: 12px; font-size: 13px; color: var(--muted); }
.from button { min-height: 36px; padding: 6px 12px; font-size: 13px; border-radius: 999px; }
.from button small { opacity: 0.6; font-weight: 700; }
.from button.sel { border-color: var(--gold); background: rgba(255, 215, 106, 0.16); color: var(--gold); }
.how-list { margin: 0; padding: 0; list-style: none; }
.how-list li { font-size: 14px; line-height: 1.45; margin: 0 0 8px; padding-left: 26px; position: relative; }
.how-list li i { position: absolute; left: 0; top: 0; font-style: normal; }

/* touch: a stick bottom-left, JUMP bottom-right */
.touch { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.touch[hidden] { display: none; }
.stick, .jumpbtn { position: absolute; pointer-events: auto; touch-action: none; -webkit-touch-callout: none; }
.stick { left: max(18px, env(safe-area-inset-left)); bottom: max(18px, env(safe-area-inset-bottom)); width: 148px; height: 148px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.3); }
.stick i { position: absolute; font-style: normal; font-size: 15px; line-height: 1; color: rgba(255, 255, 255, 0.45); pointer-events: none; }
.stick .al { left: 9px; top: 50%; transform: translateY(-50%); } .stick .ar { right: 9px; top: 50%; transform: translateY(-50%); }
.stick .au { top: 8px; left: 50%; transform: translateX(-50%); } .stick .ad { bottom: 8px; left: 50%; transform: translateX(-50%); }
.stick .knob { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; background: rgba(255, 215, 106, 0.5); border: 2px solid rgba(255, 255, 255, 0.7); z-index: 1; }
.stick.on { background: rgba(255, 255, 255, 0.16); }
.jumpbtn { right: max(22px, env(safe-area-inset-right)); bottom: max(30px, env(safe-area-inset-bottom)); width: 112px; height: 112px; min-height: 0; padding: 0; border-radius: 50%; font: 900 17px var(--head); letter-spacing: 0.06em; color: #fff; background: rgba(255, 150, 40, 0.32); border: 2px solid rgba(255, 215, 106, 0.75); }
.jumpbtn.on { background: rgba(255, 180, 60, 0.6); transform: scale(0.95); }
.pausebtn { position: absolute; z-index: 2; top: max(6px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); width: 42px; height: 30px; min-height: 0; padding: 0; font: 900 13px var(--head); background: rgba(0, 0, 0, 0.35); border-radius: 8px; opacity: 0.8; }
.pausebtn[hidden] { display: none; }
@media (max-height: 460px) { .stick { width: 124px; height: 124px; } .jumpbtn { width: 94px; height: 94px; } .panel { padding: 16px 20px; } .covertitle img { max-height: 26vh; } .tag { font-size: 13px; margin-bottom: 8px; } }

/* "What's in store": the five worlds and the boss, on the title screen and in How to play */
.instore { text-align: left; margin: 12px auto 0; max-width: 520px; font-size: 13px; color: var(--muted); }
.instore > b { display: block; text-align: center; color: var(--gold); font-size: 13px; margin-bottom: 4px; }
.store { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 2px 14px; }
.store li { font-size: 13px; line-height: 1.35; padding-left: 24px; position: relative; }
.store li i { position: absolute; left: 0; top: 0; font-style: normal; }
.store li b { color: #fff; }
.store li em { font-style: normal; color: var(--gold); font-weight: 800; white-space: nowrap; }
.comingup { margin-top: 10px; border-top: 1px solid rgba(255,255,255,0.12); padding-top: 8px; }
.guidelink { text-align: center; font-size: 13px; margin: 8px 0 0; }
.guidelink a { color: var(--gold); }
@media (max-height: 520px) { .instore { display: none; } }
