/* Platform Blaster: its own look (Doug, 1 Oct: every game looks unique; 5 Oct: "much better graphics"). Chunky
   cartoon 3D at golden hour, Doug's "Sunset 3D" style: a fat rounded display font (Lilita One, SIL OFL, self-hosted),
   glossy rounded buttons with a thick bottom edge, sunset orange and gold on deep plum. Not games.css. */

@font-face { font-family: 'Lilita One'; src: url('/fonts/lilita-one.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --ink: #1a0f1e;
  --night: #2b1a3a;
  --plum: #3d2450;
  --rust: #e2793c;
  --rust-dk: #a8421c;
  --gold: #ffd23f;
  --cream: #fff3d6;
  --cyan: #7ff5ff;
  --red: #ff3b5c;
  --green: #5aff8a;
  --pix: 'Lilita One', system-ui, sans-serif;
  --edge: #8a2e10;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.pb {
  background: var(--ink);
  color: var(--cream);
  font: 16px/1.4 system-ui, -apple-system, 'Segoe UI', sans-serif;
  overflow: hidden;
  touch-action: manipulation;
}
/* No selectable text anywhere in the game (Doug, 1 Oct; test/no-select.test.js): the same rules as games.css. */
html, body, body * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; }
img, svg, canvas, a { -webkit-user-drag: none; }
#app { height: 100dvh; display: flex; flex-direction: column; }
.hidden { display: none !important; }
h1, h2, h3, .pix, .hud, .banner, .big-score { font-family: var(--pix); }
h2 { margin: 0 0 10px; font-size: 26px; font-weight: 400; color: var(--gold); text-shadow: 0 3px 0 var(--ink); letter-spacing: 0.5px; }

/* glossy rounded panels and buttons with a thick bottom edge, like a toy */
.panel, .leave-ask .card, .howto { border: 0; border-radius: 22px; box-shadow: 0 0 0 3px rgba(255, 210, 160, 0.18), 0 14px 40px rgba(10, 0, 20, 0.55); }
.pix, .leave-ask button, .acct-card button {
  font-family: var(--pix);
  font-size: 17px;
  letter-spacing: 0.3px;
  color: var(--cream);
  background: linear-gradient(#6a4290, #4a2a6a);
  min-height: 44px;
  padding: 8px 18px;
  margin: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 16px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), 0 5px 0 #2a1440, 0 8px 14px rgba(10, 0, 20, 0.4);
  text-shadow: 0 2px 0 rgba(20, 6, 30, 0.45);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.pix:hover { filter: brightness(1.1); }
.pix:active, .pix.down { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), 0 1px 0 #2a1440, 0 3px 6px rgba(10, 0, 20, 0.4); }
.pix:focus-visible, .leave-ask button:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.pix.go, .leave-ask .stay { background: linear-gradient(#ffb04a, #ff7a1e); color: #fff; text-shadow: 0 2px 0 var(--edge); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 5px 0 var(--edge), 0 8px 18px rgba(255, 120, 30, 0.35); }
.pix.go:active { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 1px 0 var(--edge); }
.pix.small { min-height: 40px; padding: 4px 12px; font-size: 15px; border-radius: 13px; }

/* top bar */
.pb-top { display: flex; align-items: center; gap: 6px; padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left)); background: linear-gradient(#24143a, #1a0f28); box-shadow: 0 2px 0 rgba(255, 170, 90, 0.18); min-height: 56px; z-index: 5; }
.pb-top .top-right { margin-left: auto; display: flex; gap: 4px; }
/* the shared screen lock (/lock.js) sits next to Back; dressed as a pixel button here */
.lock-btn, button.back, .fs-btn { font-family: var(--pix); background: linear-gradient(#6a4290, #4a2a6a); color: var(--cream); min-height: 44px; min-width: 44px; padding: 4px 12px; margin: 4px; border: 0; border-radius: 14px; cursor: pointer; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 4px 0 #2a1440; }
.fs-btn { min-height: 40px; }
.lock-pop { --panel: var(--night); --text: var(--cream); --ink: #000; }
.lock-pop .lk-card { border-radius: 20px; font-family: var(--pix); }
.lock-pop button { font-family: var(--pix); min-height: 44px; border: 0; border-radius: 14px; background: linear-gradient(#ffb04a, #ff7a1e); color: #fff; cursor: pointer; }
.lock-pop input { border-radius: 10px; }
.hud { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; font-size: 16px; overflow: hidden; white-space: nowrap; text-shadow: 0 2px 0 var(--ink); }
.hud b { font-weight: 400; }
.hud .hearts { display: inline-flex; gap: 3px; }
.hud .hearts i { width: 17px; height: 15px; background: #4a3048; clip-path: path('M8.5 15 C2 10 0 7 0 4.2 C0 1.8 1.9 0 4.2 0 C6 0 7.6 1 8.5 2.6 C9.4 1 11 0 12.8 0 C15.1 0 17 1.8 17 4.2 C17 7 15 10 8.5 15Z'); }
.hud .hearts i.full { background: radial-gradient(circle at 35% 30%, #ffd0d8 0 12%, #ff3b5c 45%, #a8102c 100%); }
.hud .lives, .hud .bolts, .hud .gun { display: inline-flex; align-items: center; gap: 4px; }
.hud .bot { width: 15px; height: 14px; border-radius: 5px; background: radial-gradient(circle at 35% 30%, #ffd2a0, #ff8a2a 45%, #b8441a); box-shadow: inset -2px 0 0 0 transparent; position: relative; }
.hud .bot::after { content: ''; position: absolute; right: 1px; top: 4px; width: 8px; height: 5px; border-radius: 3px; background: #0a1428; box-shadow: inset 2px 0 0 #7ff5ff; }
.hud .nut { width: 15px; height: 15px; background: radial-gradient(circle, #7a4a0a 0 22%, transparent 24%), radial-gradient(circle at 35% 30%, #fff6c0, #ffc020 50%, #b8700a); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.hud .gun i { width: 12px; height: 12px; border-radius: 50%; background: var(--gun, var(--cyan)); box-shadow: 0 0 8px var(--gun, var(--cyan)); }
.hud .gun b { color: var(--gun, var(--cyan)); }
.hud .score { margin-left: auto; color: var(--gold); font-size: 20px; }

/* the play area */
#stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% 30%, #3a1e48, var(--ink) 70%); }
#view { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
#game { display: block; background: #2b1a4a; border-radius: 6px; }
.banner { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); text-align: center; pointer-events: none; z-index: 3; max-width: 92%; }
.banner b { display: block; font-weight: 400; font-size: clamp(26px, 6vw, 46px); line-height: 1.05; background: linear-gradient(#fff6c0 10%, #ffd23f 45%, #ff8a2a 90%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 2px #3a1230; paint-order: stroke fill; filter: drop-shadow(0 4px 0 #3a1230) drop-shadow(0 6px 10px rgba(10, 0, 20, 0.5)); letter-spacing: 0.5px; }
.banner small { display: block; font-family: system-ui, sans-serif; font-weight: 800; font-size: 15px; color: var(--cream); text-shadow: 0 2px 0 var(--ink), 0 0 8px rgba(10, 0, 20, 0.8); margin-top: 6px; }
.banner.pop { animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
@keyframes pop { from { transform: translateX(-50%) scale(0.3) rotate(-6deg); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }

/* on-screen controls: only on touch screens, only while playing */
.pad { display: none; }
body.pb-touch #app[data-on='playing'] .pad, body.pb-touch #app[data-on='paused'] .pad { display: flex; }
.pad { justify-content: space-between; align-items: center; padding: 10px max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); gap: 12px; touch-action: none; }
.stick { position: relative; width: 150px; height: 150px; flex: none; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #5a3a78 0 30%, #3d2450 55%, #2b1a3a 70%); box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(255, 210, 160, 0.15); touch-action: none; }
.stick .arrow { position: absolute; font-size: 18px; color: #a88ac0; pointer-events: none; }
.a-up { left: 50%; top: 4px; transform: translateX(-50%); }
.a-down { left: 50%; bottom: 4px; transform: translateX(-50%); }
.a-left { top: 50%; left: 4px; transform: translateY(-50%); }
.a-right { top: 50%; right: 4px; transform: translateY(-50%); }
.stick.on-up .a-up, .stick.on-down .a-down, .stick.on-left .a-left, .stick.on-right .a-right { color: var(--gold); }
.knob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffd2a0, #ff8a2a 45%, #b8441a); box-shadow: 0 5px 0 #6a240a, 0 8px 14px rgba(0, 0, 0, 0.4); pointer-events: none; }
.ab { display: flex; gap: 16px; align-items: flex-end; }
.ab button { font-family: var(--pix); font-size: 17px; width: 84px; height: 84px; border: 0; border-radius: 50%; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); touch-action: none; cursor: pointer; transition: transform 0.06s; }
.ab .jump { background: radial-gradient(circle at 35% 28%, #d8ffe0, #3ad86a 45%, #0a7a3a); box-shadow: 0 6px 0 #064a22, 0 10px 16px rgba(0, 0, 0, 0.4); margin-bottom: 30px; }
.ab .fire { background: radial-gradient(circle at 35% 28%, #ffd0d8, #ff3b5c 45%, #9a0a2a); box-shadow: 0 6px 0 #5a0418, 0 10px 16px rgba(0, 0, 0, 0.4); }
.ab button.down { transform: translateY(4px) scale(0.95); filter: brightness(1.15); }

/* phone held upright: the level on top, the controls underneath */
body.pb-portrait #app[data-on='playing'] #view, body.pb-portrait #app[data-on='paused'] #view { flex: 0 0 auto; height: min(56vh, calc(100vw * 224 / 250)); }
body.pb-portrait #app[data-on='playing'] .pad { flex: 1; max-height: 300px; margin: auto 0; }
/* sideways phone: controls float over the corners of the level */
body.pb-touch:not(.pb-portrait) #app[data-on='playing'] .pad, body.pb-touch:not(.pb-portrait) #app[data-on='paused'] .pad { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
body.pb-touch:not(.pb-portrait) .pad > * { pointer-events: auto; opacity: 0.82; }
body.pb-touch:not(.pb-portrait) .stick { width: 128px; height: 128px; }
body.pb-touch:not(.pb-portrait) .ab button { width: 70px; height: 70px; }
@media (max-width: 520px) { .hud { gap: 6px; font-size: 12px; } .hud .gun { display: none; } #app[data-on='playing'] .fs-btn { display: none; } .pb-top .pix.small, .fs-btn { min-width: 38px; padding: 4px 6px; margin: 3px; } button.back { padding: 4px 8px; font-size: 12px; } }
@media (max-height: 420px) { .pb-top { min-height: 46px; padding-top: max(2px, env(safe-area-inset-top)); padding-bottom: 2px; } .hud .gun b { display: none; } }

/* menu pages sit over the moving demo level */
.page { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; z-index: 4; overflow-y: auto; }
.page:not(.home) { background: rgba(26, 12, 34, 0.66); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.panel { background: linear-gradient(170deg, #4a2a62, #2b1a3a 60%); padding: 20px; width: min(460px, 100%); margin: 4px; max-height: 100%; overflow-y: auto; }
.home { gap: 10px; text-align: center; background: linear-gradient(to bottom, rgba(26, 15, 30, 0), rgba(26, 15, 30, 0.5)); }
.logo { margin: 0; line-height: 0.92; display: flex; flex-direction: column; align-items: center; font-weight: 400; filter: drop-shadow(0 6px 0 #3a1230) drop-shadow(0 12px 18px rgba(10, 0, 20, 0.55)); }
.logo span { display: block; letter-spacing: 1px; -webkit-text-stroke: 3px #3a1230; paint-order: stroke fill; -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo .l1 { font-size: clamp(30px, 9vw, 60px); -webkit-text-stroke: 0; color: #fff3e0; text-shadow: 0 3px 0 #3a1230, 3px 0 0 #3a1230, -3px 0 0 #3a1230, 0 -3px 0 #3a1230, 2px 2px 0 #3a1230, -2px 2px 0 #3a1230, 2px -2px 0 #3a1230, -2px -2px 0 #3a1230; }
.logo .l2 { font-size: clamp(44px, 14vw, 92px); -webkit-text-stroke-width: 4px; background-image: linear-gradient(#fff2a0 8%, #ffc23a 40%, #ff7a1e 75%, #d8461a 95%); }
.tag { margin: 6px 0 4px; max-width: 30em; font-weight: 800; text-shadow: 0 2px 0 var(--ink), 0 0 10px rgba(10, 0, 20, 0.7); }
.go.big { flex-direction: column; min-width: 230px; padding: 10px 28px 12px; gap: 0; border-radius: 22px; }
.go.big b { font-size: 30px; font-weight: 400; }
.go.big small { font-family: system-ui, sans-serif; font-weight: 700; font-size: 13px; }
.row-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.diff-row { display: grid; justify-items: center; gap: 2px; }
.diff { display: flex; gap: 8px; }
.diff button { min-width: 76px; min-height: 44px; opacity: 0.85; }
.diff button[aria-checked='true'] { background: linear-gradient(#fff2a0, #ffc23a); color: #5a2a08; text-shadow: none; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), 0 5px 0 #a8640a; opacity: 1; }
.diff-blurb { font-weight: 800; font-size: 13px; text-shadow: 0 1px 0 var(--ink), 0 0 8px rgba(10, 0, 20, 0.8); min-height: 1.2em; }
.levels-diff { font-size: 13px; color: var(--cream); margin-left: 6px; }
.row-btns .link { color: var(--cream); }
#home-stars { color: var(--gold); font-size: 13px; }

.level-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 14px; }
.lvl { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; font-family: var(--pix); font-size: 18px; color: var(--cream); border: 0; border-radius: 18px; padding: 10px 14px; cursor: pointer; min-height: 62px; text-shadow: 0 2px 0 rgba(20, 6, 30, 0.5); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), 0 5px 0 rgba(20, 6, 30, 0.6), 0 8px 14px rgba(10, 0, 20, 0.35); }
.lvl .num { font-size: 30px; width: 36px; text-align: center; color: var(--gold); text-shadow: 0 3px 0 var(--ink); }
.lvl .txt { flex: 1; display: grid; }
.lvl .txt small { font-family: system-ui, sans-serif; font-size: 13px; font-weight: 700; opacity: 0.85; }
.lvl .st { color: var(--gold); letter-spacing: 2px; }
.lvl.theme-dusk { background: linear-gradient(90deg, #6b3266, #e0684a); }
.lvl.theme-canyon { background: linear-gradient(90deg, #4c4580, #d27a5c); }
.lvl.theme-smelter { background: linear-gradient(90deg, #3a1422, #c04020); }
.lvl.theme-den { background: linear-gradient(90deg, #22183a, #a23a4c); }
.lvl.locked { filter: grayscale(0.85) brightness(0.6); cursor: not-allowed; }
.note { font-size: 14px; opacity: 0.9; margin: 8px 0 0; }
.note.small { font-size: 12px; }

.how-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.how-list li { display: grid; grid-template-columns: 96px 1fr; gap: 8px; font-size: 14px; }
.how-list b { font-family: var(--pix); color: #ff9a4a; font-weight: 400; font-size: 16px; }

.end-card { text-align: center; }
.end-sub { margin: 0 0 8px; }
.end-stars { display: flex; justify-content: center; gap: 10px; min-height: 8px; margin: 6px 0; }
.end-stars i { width: 44px; height: 44px; background: #4a3048; clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 60%, 80% 100%, 50% 77%, 20% 100%, 30% 60%, 0 38%, 38% 35%); }
.end-stars i.on { background: radial-gradient(circle at 40% 35%, #fffbe0, #ffd23f 40%, #e88a0a); animation: star 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.end-stars i.on:nth-child(2) { animation-delay: 0.15s; }
.end-stars i.on:nth-child(3) { animation-delay: 0.3s; }
@keyframes star { from { transform: scale(0); } 70% { transform: scale(1.3); } to { transform: scale(1); } }
.big-score b { display: block; font-weight: 400; font-size: 52px; color: var(--gold); text-shadow: 0 4px 0 var(--ink); }
.big-score span { font-size: 13px; opacity: 0.8; }
.end-parts { list-style: none; padding: 0; margin: 10px auto; max-width: 300px; display: grid; gap: 4px; font-size: 14px; }
.end-parts li { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(255, 210, 160, 0.15); padding: 3px 0; }
.end-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.paused .panel { display: grid; gap: 10px; text-align: center; }

/* kit.js and back.js pop-ups, in this game's look */
.leave-ask { position: fixed; inset: 0; z-index: 50; background: rgba(26, 15, 30, 0.82); display: grid; place-items: center; padding: 16px; }
.leave-ask .card { width: min(420px, 100%); background: linear-gradient(170deg, #4a2a62, #2b1a3a 60%); padding: 20px; display: grid; gap: 12px; }
.leave-ask h2 { margin: 0; }
.leave-ask p { margin: 0; }
.leave-ask ol { margin: 0; padding-left: 20px; }
.howto { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); z-index: 6; display: flex; gap: 10px; align-items: center; background: var(--cream); color: var(--ink); padding: 10px 10px 10px 14px; font-weight: 700; font-size: 14px; }
body.pb-portrait .howto { bottom: auto; top: 8px; }
.howto p { margin: 0; flex: 1; }
.howto { border-radius: 16px; }
.howto button { font-family: var(--pix); font-size: 16px; background: linear-gradient(#ffb04a, #ff7a1e); color: #fff; border: 0; border-radius: 12px; min-height: 40px; padding: 4px 14px; cursor: pointer; box-shadow: 0 4px 0 var(--edge); }

/* sign-in panel (public/account.js) */
.acct-card p { font-size: 14px; }
.acct-age { display: flex; align-items: center; gap: 10px; font-weight: 700; min-height: 44px; cursor: pointer; }
.acct-age input { width: 24px; height: 24px; accent-color: var(--rust); }
.acct-btns { display: grid; gap: 10px; }
.acct-btns[hidden], .acct-kid[hidden] { display: none; }
.acct-google { min-height: 44px; display: grid; place-items: center; }
.acct-btn { display: flex; align-items: center; justify-content: center; min-height: 46px; font-weight: 700; text-decoration: none; border-radius: 14px; }
.acct-btn.fb { background: #1877f2; color: #fff; }
.acct-btn.x { background: #000; color: #fff; }
.acct-fine { font-size: 12px; }
.acct-card a { color: var(--cyan); }
.muted { opacity: 0.85; }

@media (prefers-reduced-motion: reduce) {
  .banner.pop, .end-stars i.on { animation: none; }
}

/* short screens (phones held sideways): smaller logo, no tag line, tighter gaps, so the home with the difficulty row fits */
@media (max-height: 460px) {
  .home { gap: 6px; }
  .home .tag { display: none; }
  .logo .l1 { font-size: clamp(20px, 6.5vh, 34px); }
  .logo .l2 { font-size: clamp(28px, 12vh, 52px); -webkit-text-stroke-width: 2px; }
  .go.big { padding: 4px 22px 6px; }
  .go.big b { font-size: 22px; }
  .diff-row { grid-auto-flow: column; align-items: center; gap: 10px; }
  .diff button { min-height: 40px; }
}
