:root {
  --blue: #005695;      /* PANTONE 647 C */
  --blue60: #5D85B7;
  --blue30: #A4B7D7;
  --deep: #003a66;
  --ink: #040707;       /* logo black */
  --aqua: #00C1D5;      /* PANTONE 3115 C (anniversary accent) */
  --paper: #ffffff;
  --mist: #EEF4FA;
  --muted: #4d5f73;
  --danger: #c0392b;
  --display: "Zilla Slab", "Clarendon", Georgia, serif;
  --ui: "Barlow Condensed", "Univers Condensed", "Arial Narrow", system-ui, sans-serif;
  --radius: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--ui); color: var(--ink); background: #0b2540; -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

/* ---------------- game page */
.game-page { overflow: hidden; overscroll-behavior: none; }
#stage { position: fixed; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; background: linear-gradient(#9FD3F2, #EAF6FC); }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.screen { position: absolute; inset: 0; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); background: rgba(0, 38, 72, .42); overflow-y: auto; }
/* No backdrop blur on menu screens: re-blurring the animated game canvas every frame made slower devices stutter or freeze. */
.screen[hidden] { display: none; }
#screen-title { background: linear-gradient(rgba(0,38,72,.15), rgba(0,38,72,.45)); }

.card { width: min(440px, 100%); background: var(--paper); border-radius: var(--radius); padding: 22px 22px 18px; box-shadow: 0 18px 50px rgba(0, 30, 60, .35); text-align: center; border-top: 6px solid var(--blue); animation: pop .25s ease-out; }
@keyframes pop { from { transform: translateY(10px) scale(.97); opacity: 0; } }
.card h1 { font-family: var(--display); font-size: clamp(44px, 9vw, 60px); line-height: .95; margin: 4px 0 2px; color: var(--blue); letter-spacing: -.5px; }
.card h2 { font-family: var(--display); color: var(--blue); margin: 0 0 10px; font-size: 30px; }
.brand img { display: block; margin: 0 auto 4px; width: min(220px, 60%); height: auto; }
.mascot { display: block; margin: 4px auto 0; animation: bob 1.6s ease-in-out infinite; width: 96px; height: auto; }
@keyframes bob { 50% { transform: translateY(-6px) scaleY(1.03); } }
.tagline { font-family: var(--display); font-style: italic; color: var(--blue60); font-size: 20px; margin: 0 0 8px; }
.month-banner { display: inline-block; background: var(--mist); color: var(--deep); font-weight: 600; letter-spacing: .3px; border-radius: 999px; padding: 4px 12px; margin: 0 0 14px; font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.error { color: var(--danger); font-weight: 600; min-height: 1.2em; margin: 6px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 8px 18px; border-radius: 12px; border: 2px solid var(--blue); background: #fff; color: var(--blue); font-weight: 700; font-size: 19px; letter-spacing: .4px; cursor: pointer; text-decoration: none; text-transform: uppercase; transition: transform .08s, background .15s; }
.btn:hover { background: var(--mist); }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--deep); }
.btn.big { width: 100%; min-height: 58px; font-size: 26px; margin-bottom: 10px; }
.btn.link { border: 0; background: none; text-transform: none; font-weight: 600; font-size: 16px; color: var(--blue60); min-height: 36px; text-decoration: underline; }
.btn.inline { min-height: 0; padding: 0; font-size: inherit; }
.btn:disabled { opacity: .6; cursor: wait; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.row .btn { flex: 1 1 140px; }
.player-chip { margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.rotate-tip { display: none; margin: 10px 0 0; font-size: 15px; color: var(--blue60); font-weight: 600; }
@media (orientation: portrait) and (max-width: 600px) { .rotate-tip { display: block; } }

.howto { text-align: left; padding-left: 18px; margin: 0 0 16px; font-size: 18px; line-height: 1.35; }
.howto li { margin-bottom: 6px; }
kbd { font-family: var(--ui); background: var(--mist); border: 1px solid var(--blue30); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; }

/* form */
.form { text-align: left; }
.form h2, .form > p { text-align: center; }
.form label { display: block; font-weight: 600; font-size: 17px; margin: 10px 0 0; color: var(--deep); }
.form label small { font-weight: 500; color: var(--muted); }
.form input:not([type=checkbox]) { display: block; width: 100%; margin-top: 4px; font: 500 18px var(--ui); padding: 10px 12px; border: 2px solid var(--blue30); border-radius: 10px; color: var(--ink); background: #fff; }
.form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 193, 213, .3); }
.form .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; font-size: 16px; color: var(--ink); }
.form .check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--blue); flex: none; }
.form .btn.primary { width: 100%; margin-top: 8px; }
.form .btn.link { width: 100%; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* game over */
.over-kicker { margin: 0; font-family: var(--display); color: var(--blue60); font-size: 24px; font-style: italic; }
.over-score { margin: 0; font-family: var(--display); font-size: 72px; line-height: 1; color: var(--blue); }
.over-best { margin: 2px 0 10px; color: var(--muted); font-weight: 600; }
.over-stats { list-style: none; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.over-stats li { background: var(--mist); border-radius: 10px; padding: 6px 2px; }
.over-stats b { display: block; font-size: 20px; color: var(--deep); }
.over-stats span { font-size: 13px; color: var(--muted); }
.over-rank { min-height: 1.3em; font-weight: 600; color: var(--deep); margin: 4px 0 12px; }
#btn-save { width: 100%; margin-bottom: 10px; }

/* in-game buttons */
#hud-buttons { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 10px; display: flex; gap: 8px; z-index: 2; }
#hud-buttons[hidden], .slide-btn[hidden] { display: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(0, 40, 80, .55); color: #fff; font-size: 18px; cursor: pointer; }
.slide-btn { position: absolute; right: 16px; bottom: max(18px, env(safe-area-inset-bottom)); width: 78px; height: 78px; border-radius: 50%; border: 3px solid rgba(255,255,255,.85); background: rgba(0, 86, 149, .55); color: #fff; font-size: 30px; line-height: 1; display: grid; place-items: center; z-index: 2; touch-action: none; }
.slide-btn span { font-size: 12px; font-weight: 700; letter-spacing: 1px; margin-top: -14px; }
#demo-badge { position: absolute; left: 50%; bottom: max(8px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: #ffcc33; color: var(--ink); font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 999px; z-index: 3; letter-spacing: .5px; pointer-events: none; }
#toast { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); background: var(--deep); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; z-index: 5; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
#toast[hidden] { display: none; }

/* ---------------- leaderboard */
.board-card { width: min(560px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
.board-card #board { overflow-y: auto; flex: 1; min-height: 120px; margin-bottom: 12px; }
.tabs { display: flex; gap: 4px; background: var(--mist); border-radius: 12px; padding: 4px; margin-bottom: 8px; }
.tabs button { flex: 1; border: 0; background: none; padding: 8px 4px; border-radius: 9px; font-weight: 700; font-size: 16px; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected=true] { background: #fff; color: var(--blue); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.rows { list-style: none; margin: 0; padding: 0; text-align: left; }
.rows li { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--mist); }
.rows li.top { background: linear-gradient(90deg, rgba(0,193,213,.08), transparent); }
.rows li.me { outline: 2px solid var(--aqua); border-radius: 10px; }
.rows .rk { font-weight: 700; font-size: 20px; color: var(--blue60); text-align: center; }
.rows .who b { display: block; font-size: 18px; color: var(--ink); overflow-wrap: anywhere; }
.rows .who small { color: var(--muted); font-size: 14px; }
.rows .sc { font-family: var(--display); font-size: 22px; color: var(--blue); }
.month-h { font-family: var(--display); color: var(--deep); margin: 14px 0 4px; font-size: 20px; text-align: left; }

/* standalone pages (leaderboard.html, rules.html) */
.page { background: var(--mist); min-height: 100%; overflow: auto; }
.page-wrap { width: min(760px, 100%); margin: 0 auto; padding: 20px 16px 48px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head img { width: 200px; height: auto; }
.page .card { width: 100%; text-align: left; }
.page h1 { font-family: var(--display); color: var(--blue); font-size: clamp(32px, 6vw, 44px); margin: 0; }
.page p, .page li { font-size: 18px; line-height: 1.45; }

@media (max-height: 560px) {
  .mascot { display: none; }
  .card { padding: 14px 18px 12px; }
  .card h1 { font-size: 40px; }
  .btn.big { min-height: 48px; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .mascot, .card { animation: none; } }

/* ================= v2: Bring Back the Flow ================= */
#stage.v2 { background: #06203a; }
#top-buttons { position: absolute; top: max(8px, env(safe-area-inset-top)); right: 10px; display: flex; gap: 8px; z-index: 3; }
#top-buttons .icon-btn { background: rgba(0, 40, 80, .7); }
.kicker { margin: 0; color: var(--blue60); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-size: 15px; }
.story-card { width: min(560px, 100%); }
.story-art canvas { width: 100%; height: auto; border-radius: 12px; display: block; margin-bottom: 10px; }
.story-card p { font-size: 19px; line-height: 1.4; margin: 6px 0 12px; }
.dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 12px; }
.dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--blue30); }
.dots span.on { background: var(--blue); width: 22px; border-radius: 5px; }
.level-card .brief { list-style: none; padding: 0; margin: 10px 0 16px; text-align: left; font-size: 18px; }
.level-card .brief li { padding: 6px 10px; background: var(--mist); border-radius: 10px; margin-bottom: 6px; }
.results-card { width: min(520px, 100%); max-height: calc(100dvh - 24px); overflow-y: auto; }
.stars { font-size: 46px; line-height: 1; letter-spacing: 6px; margin: 4px 0; }
.stars span { color: #d4dce6; display: inline-block; }
.stars span.on { color: #ffc93a; animation: starpop .5s backwards cubic-bezier(.2, 1.6, .4, 1); text-shadow: 0 2px 0 #a77b00; }
@keyframes starpop { from { transform: scale(0) rotate(-40deg); } }
.breakdown { list-style: none; padding: 0; margin: 6px 0 10px; text-align: left; font-size: 16px; }
.breakdown li { display: flex; justify-content: space-between; padding: 3px 8px; border-bottom: 1px dashed var(--blue30); }
.breakdown b { color: var(--deep); }
.fieldnote { display: grid; grid-template-columns: 120px 1fr; gap: 12px; text-align: left; background: var(--mist); border-radius: 12px; padding: 10px; margin: 8px 0; }
.fieldnote img { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; }
.fieldnote p { margin: 0 0 4px; font-size: 15px; line-height: 1.3; }
.fn-k { font-weight: 700; color: var(--blue); }
.fn-cap { font-weight: 700; color: var(--deep); }
.ach-pop { background: #fff7d6; border: 1px solid #ffd23f; border-radius: 10px; padding: 6px 10px; margin: 6px 0; text-align: left; font-size: 15px; }
.album-body { overflow-y: auto; flex: 1; min-height: 160px; margin-bottom: 12px; text-align: left; }
.ach-list { list-style: none; padding: 0; margin: 0; }
.ach-list li { display: flex; gap: 10px; align-items: center; padding: 8px; border-bottom: 1px solid var(--mist); opacity: .55; }
.ach-list li.got { opacity: 1; }
.ach-list span { font-size: 24px; }
.ach-list b { display: block; font-size: 17px; }
.ach-list small { color: var(--muted); font-size: 14px; }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.notes figure { margin: 0; background: var(--mist); border-radius: 10px; overflow: hidden; }
.notes img, .notes .ph { width: 100%; height: 120px; object-fit: cover; display: grid; place-items: center; font-size: 30px; background: #cfd9e4; }
.notes figcaption { padding: 6px 8px; font-size: 13px; }
.notes figcaption b { display: block; font-size: 14px; }
.notes figure.locked { opacity: .6; }
.outfits { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.outfit { border: 2px solid var(--blue30); background: #fff; border-radius: 12px; padding: 6px; cursor: pointer; font: inherit; display: flex; flex-direction: column; align-items: center; }
.outfit.on { border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(0,193,213,.3); }
.outfit:disabled { opacity: .5; cursor: not-allowed; }
.outfit canvas { width: 90px; height: auto; }
.outfit small { color: var(--muted); }
#rotate { position: absolute; inset: 0; z-index: 10; background: rgba(6,32,58,.96); color: #fff; display: grid; place-items: center; text-align: center; font-size: 44px; }
#rotate p { font-size: 22px; margin: 8px 0 16px; }
#rotate[hidden] { display: none; }
#stage.v2 #demo-badge { left: auto; right: 10px; transform: none; bottom: max(6px, env(safe-area-inset-bottom)); }

/* ================= runner: outfits + game switcher ================= */
.outfit-btn { width: 100%; margin-top: 10px; }
canvas.mascot { width: 92px; height: auto; display: block; margin: 4px auto 0; }
.more-game { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: 14px; text-decoration: none; text-align: left;
  background: linear-gradient(135deg, #0b2a4a, #005695); color: #fff; box-shadow: 0 6px 18px rgba(0, 40, 80, .25); }
.more-game:hover { filter: brightness(1.1); }
.more-game b { display: block; font-family: var(--display); font-size: 19px; }
.more-game small { display: block; color: var(--blue30); font-size: 14px; line-height: 1.2; }
.mg-new { background: var(--aqua); color: var(--deep); font-weight: 700; font-size: 12px; padding: 2px 7px; border-radius: 6px; }
.mg-go { margin-left: auto; font-size: 20px; }
.game-switch { display: inline-block; margin-top: 12px; color: var(--blue60); font-weight: 600; }
.game-tabs { margin: 8px 0 4px; }
.game-tabs a { flex: 1; text-align: center; text-decoration: none; padding: 8px 4px; border-radius: 9px; font-weight: 700; font-size: 16px; color: var(--muted); }
.game-tabs a[aria-selected=true] { background: #fff; color: var(--blue); box-shadow: 0 1px 4px rgba(0,0,0,.12); }

/* ---------------- Splash Escape */
.splash-page #stage { background: #5DB451; }
.game-switch-row { display: flex; justify-content: space-between; gap: 10px; margin: 4px 0 0; }
.over-ach { min-height: 0; margin: 0 0 6px; color: var(--deep); font-weight: 600; }
.over-ach:empty { display: none; }
.ach-list .ach-ic { font-size: 24px; }

/* ---------------- Drip Run */
.run-page #stage { background: #8fd3f4; }
.run-page #screen-title { background: linear-gradient(rgba(0,38,72,.05), rgba(0,38,72,.35)); }
.title-card { position: relative; }
.game-back { position: absolute; left: 14px; top: 10px; font-weight: 700; color: var(--blue60); text-decoration: none; font-size: 15px; }
.game-back:hover { text-decoration: underline; }
.kicker { margin: 4px 0 -4px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--aqua); font-size: 15px; }
.zone-list { font-size: 14px; color: var(--muted); margin: 12px 0 0; line-height: 1.35; }
.zone-list b { color: var(--deep); }
#run-hud { position: absolute; left: 10px; top: max(10px, env(safe-area-inset-top)); z-index: 2; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.rh-score { background: rgba(0,40,80,.55); color: #fff; border-radius: 14px; padding: 6px 14px 8px; min-width: 140px; }
.rh-score b { display: block; font-size: 34px; line-height: 1; font-weight: 700; }
.rh-score span { color: #CFF6FF; font-weight: 600; font-size: 16px; }
.rh-drops { background: rgba(0,40,80,.55); color: #fff; border-radius: 12px; padding: 4px 12px; font-weight: 700; font-size: 18px; align-self: flex-start; }
#h-mult { background: #7ed957; color: var(--ink); border-radius: 6px; padding: 0 6px; margin-left: 4px; }
.rh-powers { display: flex; flex-direction: column; gap: 4px; }
.pw { background: rgba(0,40,80,.6); color: #fff; border-radius: 10px; padding: 3px 10px; font-weight: 700; font-size: 16px; align-self: flex-start; border-left: 4px solid var(--aqua); }
.pw.magnet { border-color: #ff5a5a; } .pw.mult { border-color: #7ed957; } .pw.boost { border-color: #ffc845; } .pw.warn { border-color: #ff4d5e; background: rgba(160,20,30,.7); }
#zone-banner { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); z-index: 3; text-align: center; color: #fff; pointer-events: none; text-shadow: 0 2px 8px rgba(0,30,60,.7); }
#zone-banner small { display: block; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; font-size: 14px; color: #CFF6FF; }
#zone-banner b { display: block; font-family: var(--display); font-size: clamp(34px, 7vw, 56px); line-height: 1; }
#zone-banner span { display: block; font-weight: 600; font-size: 17px; margin-top: 4px; }
#zone-banner.go { animation: zb 3.2s ease-out forwards; }
@keyframes zb { 0% { opacity: 0; transform: translate(-50%, 12px); } 12%, 75% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
#countdown { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 120px; color: #fff; text-shadow: 0 4px 0 var(--deep), 0 8px 24px rgba(0,0,0,.3); pointer-events: none; z-index: 3; }
#pop { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); z-index: 3; background: rgba(255,200,69,.95); color: var(--ink); font-weight: 700; font-size: 20px; padding: 6px 16px; border-radius: 999px; pointer-events: none; white-space: nowrap; }
#pop.go { animation: popup 1.6s ease-out forwards; }
@keyframes popup { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.9); } 15%, 70% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -14px); } }
.zones-reached { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0 0 8px; }
.zones-reached small { width: 100%; color: var(--muted); font-weight: 600; }
.zones-reached span { background: var(--mist); color: var(--muted); border-radius: 999px; padding: 3px 10px; font-weight: 600; font-size: 14px; }
.zones-reached span.on { background: var(--aqua); color: var(--ink); }
.more-game.featured { background: linear-gradient(120deg, #00a0c8, var(--blue)); box-shadow: 0 0 0 3px var(--aqua), 0 10px 24px rgba(0,86,149,.35); }
.more-game.featured .mg-new { background: #ffc845; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { #zone-banner.go, #pop.go { animation-duration: .01s; animation-iteration-count: 1; } #zone-banner.go { animation: none; } #pop.go { animation: none; } }
.game-back + .brand { margin-top: 18px; }
#zone-banner { background: rgba(0,40,80,.6); border-radius: 18px; padding: 10px 22px 12px; max-width: calc(100vw - 32px); }

/* ---------------- Drip Run: story, journey, project signs */
.story { font-size: 16px; line-height: 1.35; color: var(--deep); margin: 0 0 10px; }
#journey { position: absolute; left: 50%; top: max(12px, env(safe-area-inset-top)); transform: translateX(-50%); width: min(46vw, 420px); z-index: 2; pointer-events: none; }
.jr-track { height: 8px; background: rgba(0,40,80,.5); border-radius: 99px; overflow: hidden; border: 1px solid rgba(255,255,255,.5); }
.jr-fill { height: 100%; width: 0; background: linear-gradient(90deg, #00C1D5, #7ed957); }
.jr-stops { position: relative; height: 0; }
.jr-stops span { position: absolute; top: -9px; width: 2px; height: 10px; background: rgba(255,255,255,.75); }
.jr-stops span:nth-last-child(2) { left: 100% !important; width: auto; height: auto; background: none; top: -18px; font-size: 18px; transform: translateX(-50%); }
.jr-drip { top: -19px !important; width: auto !important; height: auto !important; background: none !important; font-size: 17px; transform: translateX(-50%); transition: left .2s linear; }
.jr-label { display: block; text-align: center; color: #fff; font-weight: 700; font-size: 15px; margin-top: 6px; text-shadow: 0 1px 4px rgba(0,30,60,.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#proj-chip { position: absolute; left: 50%; bottom: max(40px, calc(env(safe-area-inset-bottom) + 34px)); transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 10px; background: rgba(255,200,69,.96); color: var(--ink); border: 0; border-radius: 16px; padding: 8px 16px 8px 10px; font: inherit; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.25); text-align: left; max-width: calc(100vw - 32px); animation: chipin .3s ease-out; }
#proj-chip .pc-i { font-size: 26px; line-height: 1; }
#proj-chip small { display: block; font-size: 13px; font-weight: 600; }
#proj-chip b { display: block; font-size: 17px; line-height: 1.1; }
@keyframes chipin { from { transform: translate(-50%, 12px); opacity: 0; } }
.project-card { width: min(560px, 100%); text-align: left; max-height: calc(100dvh - 32px); overflow-y: auto; }
.pj-kicker { margin: 0; font-weight: 700; color: var(--aqua); letter-spacing: 1px; text-transform: uppercase; font-size: 14px; }
.project-card h2 { margin: 2px 0 10px; font-size: 28px; line-height: 1.1; }
.pj-photo { border-radius: 12px; overflow: hidden; background: var(--mist); aspect-ratio: 4 / 3; display: grid; place-items: center; margin-bottom: 10px; }
.pj-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pj-photo span { color: var(--muted); padding: 20px; text-align: center; }
.pj-facts { margin: 0 0 8px; display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 16px; }
.pj-facts dt { font-weight: 700; color: var(--deep); }
.pj-facts dd { margin: 0; }
.pj-src { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.trail-list { list-style: none; padding: 0; margin: 0 0 12px; text-align: left; overflow-y: auto; }
.trail-list button { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; padding: 8px 6px; border-bottom: 1px solid var(--mist); text-align: left; font: inherit; cursor: pointer; opacity: .6; }
.trail-list li.got button { opacity: 1; }
.trail-list .tl-n { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.trail-list b { display: block; font-size: 17px; color: var(--ink); }
.trail-list small { color: var(--muted); }
.over-journey { margin: 0 0 8px; color: var(--deep); font-size: 16px; }
.zones-reached button { background: var(--mist); color: var(--muted); border: 0; border-radius: 999px; padding: 3px 10px; font: 600 14px var(--ui); cursor: pointer; }
.zones-reached button.on { background: var(--aqua); color: var(--ink); }
@media (max-width: 600px) { #journey { width: calc(100vw - 210px); left: auto; right: 104px; transform: none; } .jr-label { font-size: 12px; } }
@media (max-width: 420px) { #journey { top: auto; bottom: max(118px, calc(env(safe-area-inset-bottom) + 112px)); left: 14px; right: 14px; width: auto; } }
@media (max-width: 600px) { #proj-chip small { font-size: 11px; } #proj-chip b { font-size: 15px; } #proj-chip { padding: 6px 12px 6px 8px; } }

/* ---------------- Drip Run: water tank, mission, stop card */
#mission { position: absolute; right: 10px; top: max(64px, calc(env(safe-area-inset-top) + 58px)); z-index: 2; width: min(280px, 46vw); background: rgba(0,40,80,.6); color: #fff; border-radius: 14px; padding: 8px 10px; pointer-events: none; }
.ms-tank { display: flex; align-items: center; gap: 8px; }
.ms-ico { font-size: 18px; }
.ms-bar { position: relative; flex: 1; height: 12px; background: rgba(255,255,255,.18); border-radius: 99px; overflow: hidden; }
.ms-fill { height: 100%; width: 45%; background: linear-gradient(90deg, #00a0c8, #7fe9f5); transition: width .15s linear; }
.ms-cost { position: absolute; left: 35%; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.8); }
#ms-pct { font-size: 15px; min-width: 38px; text-align: right; }
.ms-goal { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 5px; font-weight: 600; font-size: 14px; }
.ms-pips i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #7fe9f5; margin-left: 4px; }
.ms-pips i.on { background: #7ed957; border-color: #7ed957; }
#mission.low .ms-fill { background: linear-gradient(90deg, #ff4d5e, #ffc845); }
#mission.good { animation: tankgood .6s ease-out; } #mission.bad { animation: tankbad .5s ease-out; }
@keyframes tankgood { 30% { box-shadow: 0 0 0 4px #7ed957; } }
@keyframes tankbad { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
#stop-card { position: absolute; left: 12px; bottom: max(44px, calc(env(safe-area-inset-bottom) + 40px)); z-index: 4; width: min(380px, calc(100vw - 24px)); background: rgba(255,255,255,.96); color: var(--ink); border-radius: 16px; padding: 12px 14px 10px; box-shadow: 0 10px 30px rgba(0,30,60,.3); border-left: 6px solid var(--aqua); overflow: hidden; }
#stop-card.go { animation: scin .3s ease-out; }
@keyframes scin { from { transform: translateY(14px); opacity: 0; } }
#stop-card small { display: block; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--aqua); font-size: 12px; }
#stop-card b { display: block; font-family: var(--display); color: var(--blue); font-size: 22px; line-height: 1.1; margin: 2px 26px 2px 0; }
#stop-card span { display: block; font-size: 14px; font-weight: 600; color: var(--deep); }
#stop-card p { margin: 4px 0 0; font-size: 14px; line-height: 1.3; }
#stop-card .sc-mission { color: var(--deep); background: var(--mist); border-radius: 8px; padding: 4px 8px; margin-top: 6px; }
#sc-close { position: absolute; right: 6px; top: 4px; width: 32px; height: 32px; border: 0; background: none; font-size: 24px; color: var(--muted); cursor: pointer; }
.sc-timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--aqua); transform-origin: left; }
#stop-card.go .sc-timer { animation: sctime 4s linear forwards; }
@keyframes sctime { to { transform: scaleX(0); } }
@media (max-width: 600px) { #mission { top: auto; bottom: max(150px, calc(env(safe-area-inset-bottom) + 146px)); right: 10px; left: 10px; width: auto; } #stop-card { top: 120px; bottom: auto; } #stop-card b { font-size: 19px; } }
@media (prefers-reduced-motion: reduce) { #stop-card.go, #mission.good, #mission.bad { animation: none; } #stop-card.go .sc-timer { animation: sctime 4s linear forwards; } }
#stop-card .sc-mission b { display: inline; font: inherit; font-weight: 700; margin: 0; color: var(--blue); }

/* ---------------- Drip Run: branded pause screen */
.pause-screen { background: rgba(0, 22, 44, .5); backdrop-filter: blur(4px) saturate(.9); -webkit-backdrop-filter: blur(4px) saturate(.9); align-items: center; }
.pause-card { width: min(760px, 100%); padding: 0; text-align: left; overflow: hidden; border-top: 0; display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.pz-hero { position: relative; height: 190px; flex: none; background: linear-gradient(135deg, #5D85B7, #003a66); }
.pz-hero img#pz-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pz-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,30,60,.25) 0%, rgba(0,30,60,.05) 35%, rgba(0,30,60,.82) 100%); }
.pz-top { position: absolute; left: 14px; right: 14px; top: 12px; display: flex; justify-content: space-between; align-items: center; }
.pz-logo { height: 44px; width: auto; background: rgba(255,255,255,.94); border-radius: 10px; padding: 5px 10px; }
.pz-badge { background: var(--aqua); color: var(--ink); font-weight: 700; letter-spacing: 1px; border-radius: 999px; padding: 4px 12px; font-size: 15px; }
.pz-title { position: absolute; left: 16px; right: 16px; bottom: 12px; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.45); }
.pz-title small { display: block; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; font-size: 13px; color: #CFF6FF; }
.pz-title b { display: block; font-family: var(--display); font-size: clamp(24px, 4.5vw, 34px); line-height: 1.05; }
.pz-title span { display: block; font-weight: 600; font-size: 15px; margin-top: 2px; }
.pz-body { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 14px 18px 4px; overflow-y: auto; }
.pz-blurb { margin: 0 0 10px; font-size: 15px; line-height: 1.35; color: var(--deep); }
.pz-stats { list-style: none; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pz-stats li { background: var(--mist); border-radius: 10px; padding: 6px 4px; text-align: center; }
.pz-stats b { display: block; font-size: 19px; color: var(--blue); }
.pz-stats span { font-size: 12px; color: var(--muted); }
.pz-mission { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; color: var(--deep); font-size: 15px; margin-bottom: 8px; }
.pz-pips i { display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--aqua); margin-left: 4px; }
.pz-pips i.on { background: #7ed957; border-color: #7ed957; }
.pz-journey .jr-track { background: var(--mist); border-color: var(--blue30); }
.pz-journey small { display: block; color: var(--muted); font-weight: 600; margin-top: 4px; font-size: 13px; }
.pause-card h3 { margin: 0 0 6px; font-family: var(--display); color: var(--blue); font-size: 20px; }
.pz-ctrl { display: grid; gap: 4px; margin-bottom: 8px; }
.pz-ctrl p { margin: 0; display: flex; justify-content: space-between; gap: 10px; font-size: 15px; border-bottom: 1px solid var(--mist); padding: 3px 0; }
.pz-ctrl .k { font-weight: 600; color: var(--deep); }
.pz-ctrl p > span:last-child { color: var(--muted); text-align: right; }
#pz-touch { display: none; }
@media (pointer: coarse) { #pz-touch { display: grid; } #pz-keys { display: none; } }
.pz-tip { margin: 4px 0 0; font-size: 14px; background: #eaf8fb; border-radius: 10px; padding: 6px 10px; color: var(--deep); }
.pz-actions { padding: 10px 18px 14px; border-top: 1px solid var(--mist); flex: none; background: #fff; }
.pz-actions .btn.big { margin-bottom: 8px; }
.pz-actions .btn.link { width: 100%; }
@media (max-width: 640px) {
  .pz-body { grid-template-columns: 1fr; gap: 10px; padding: 12px 14px 4px; }
  .pz-hero { height: 150px; }
  .pz-logo { height: 34px; }
  .pz-stats b { font-size: 16px; }
}
@media (max-height: 520px) and (orientation: landscape) { .pz-hero { height: 110px; } .pz-blurb { display: none; } }
#pop { max-width: calc(100vw - 24px); white-space: normal; text-align: center; }

/* ---------------------------------------------------------------- sign-up: business email + company detection */
.form .field-hint { display: block; min-height: 0; margin: 4px 2px 0; font-size: 14.5px; line-height: 1.35; color: var(--muted); }
.form .field-hint:empty { display: none; }
.form .field-hint[data-kind=ok] { color: #1b7f4a; }
.form .field-hint[data-kind=warn] { color: #9a5b00; }
.form .field-hint[data-kind=bad] { color: var(--danger); font-weight: 600; }
.form input[aria-invalid=true] { border-color: var(--danger); }
.form input.autofill { animation: coFill 1.2s ease-out; }
@keyframes coFill { from { background: #e3fbff; } to { background: #fff; } }
.form .co-confirm { margin: 10px 0 4px; padding: 12px; border: 2px solid var(--blue); border-radius: 12px; background: #f0fcff; }
.form .co-confirm .co-q { margin: 0 0 8px; font-weight: 700; color: var(--deep); font-size: 16px; text-align: left; }
.form .co-confirm .btn { display: block; width: 100%; margin: 6px 0 0; text-align: left; white-space: normal; }
.form .co-confirm .btn.primary { margin-top: 6px; }
.form .co-confirm .btn small { display: block; font-weight: 500; opacity: .8; font-size: 13px; }
.form .co-confirm .co-edit { text-align: center; }
@media (prefers-reduced-motion: reduce) { .form input.autofill { animation: none; } }

/* ---------------- Navigation: one Home control style for every game */
/* Top of each game's title card: a clear pill button (icon + word), 44px tall touch target. */
.nav-bar { display: flex; justify-content: flex-start; margin: -4px 0 6px; }
.btn.nav-home { min-height: 44px; padding: 6px 16px 6px 12px; border-radius: 999px; font-size: 16px; text-transform: none; letter-spacing: 0; }
/* Under "Play again" / "Next level" and on pause screens: full width, secondary to the primary action. */
.btn.home { width: 100%; margin: 0 0 10px; text-transform: none; font-size: 18px; letter-spacing: 0; }
.nav-ic { width: 20px; height: 20px; flex: none; }
.btn.home .nav-ic { width: 22px; height: 22px; }
.title-card > .btn.link[href] { display: inline-flex; margin-top: 10px; }

/* ---------------- Drip Run: worlds, results states, name check */
.next-world { display: inline-block; margin-top: 6px; color: var(--deep); }
.trail-list .tl-lock { display: flex; gap: 10px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--mist); opacity: .75; }
.trail-list li.locked .tl-n { background: var(--mist); color: var(--ink); }
.over-rank[data-kind=ok] { color: #1b7f4a; }
.over-rank[data-kind=bad] { color: var(--danger); }
.over-rank[data-kind=busy] { color: var(--muted); }
.board-body .retry { margin-top: 8px; }
