:root {
  --ink: #23343b; --ink2: #4b6069; --muted: #7d9098;
  --glass: rgba(255, 253, 247, 0.74); --glass-strong: rgba(255, 253, 247, 0.9); --glass-line: rgba(255, 255, 255, 0.85);
  --shadow: 0 10px 30px rgba(18, 52, 64, 0.18), 0 2px 6px rgba(18, 52, 64, 0.12);
  --sea: #1fa3b3; --sea-d: #137d8a; --leaf: #58b35a; --bell: #f5b82e; --bell-d: #d6951a; --coral: #ff7a6b; --night: #1b2446;
  --C: #8aa39b; --U: #4fae6f; --R: #3f8ce0; --E: #a052e0; --L: #f2a81d;
  --r: 18px; --font: "Rubik", system-ui, sans-serif; --title: "Lilita One", "Rubik", system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #8fd0e8; font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; touch-action: none; user-select: none; -webkit-user-select: none; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
#ui > * { pointer-events: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
.glass { background: var(--glass); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border: 1px solid var(--glass-line); box-shadow: var(--shadow); border-radius: var(--r); }
.title { font-family: var(--title); font-weight: 600; letter-spacing: 0.01em; }
.hidden { display: none !important; }

/* ---------- HUD ---------- */
.hud-clock { position: absolute; left: calc(14px + var(--safe-l)); top: calc(14px + var(--safe-t)); padding: 10px 16px 11px; min-width: 176px; }
.hud-clock .time { font-family: var(--title); font-weight: 600; font-size: 30px; line-height: 1; display: flex; align-items: baseline; gap: 6px; }
.hud-clock .time small { font-size: 14px; color: var(--ink2); font-weight: 600; }
.hud-clock .date { font-size: 13px; color: var(--ink2); font-weight: 700; margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.hud-clock .date svg { width: 16px; height: 16px; }
.hud-market { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 999px; background: rgba(35, 52, 59, 0.07); color: var(--ink2); white-space: nowrap; }
.pill svg { width: 14px; height: 14px; }
.pill.open { background: rgba(88, 179, 90, 0.18); color: #2f7d33; }
.pill.closed { background: rgba(35, 52, 59, 0.08); }
.pill.up { color: #2f7d33; } .pill.down { color: #c24a3d; }
.hud-top-r { position: absolute; right: calc(14px + var(--safe-r)); top: calc(14px + var(--safe-t)); display: flex; gap: 10px; align-items: flex-start; }
.bells { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; font-family: var(--title); font-weight: 600; font-size: 20px; }
.bells .coin { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe699, var(--bell) 55%, var(--bell-d)); box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12); display: grid; place-items: center; }
.bells .coin svg { width: 17px; height: 17px; color: #fff8e0; }
.icon-btn { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:active { transform: scale(0.94); }

/* action + tools */
.hud-actions { position: absolute; right: calc(18px + var(--safe-r)); bottom: calc(22px + var(--safe-b)); display: flex; align-items: flex-end; gap: 12px; }
.act { width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; flex-direction: column; font-family: var(--title); font-weight: 600; font-size: 15px; color: #fff; background: radial-gradient(circle at 40% 30%, #3cc6d4, var(--sea) 60%, var(--sea-d)); box-shadow: 0 10px 24px rgba(19, 125, 138, 0.45), inset 0 -4px 0 rgba(0, 0, 0, 0.15); transition: transform 0.12s, opacity 0.2s; }
.act span { display: block; margin-top: -4px; }
.act svg { width: 30px; height: 30px; }
.act:active { transform: scale(0.93); }
.act.off { opacity: 0.35; pointer-events: none; }
.act.urgent { animation: pulse 0.5s ease-in-out infinite alternate; background: radial-gradient(circle at 40% 30%, #ff9d8c, var(--coral) 60%, #d95443); }
@keyframes pulse { to { transform: scale(1.1); } }
.tools { display: flex; flex-direction: column; gap: 8px; padding: 8px; }
.tool { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; position: relative; transition: background 0.15s, transform 0.15s; }
.tool svg { width: 28px; height: 28px; }
.tool.on { background: rgba(31, 163, 179, 0.18); box-shadow: inset 0 0 0 2px var(--sea); }
.tool kbd { position: absolute; right: 3px; bottom: 2px; font: 700 10px var(--font); color: var(--muted); }
.hint { position: absolute; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%); padding: 9px 16px; font-weight: 800; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.hint { max-width: calc(100vw - 32px); text-align: center; }
.hint:has(~ .keys:not(.hidden)) { bottom: calc(74px + var(--safe-b)); } /* (above the controls bar while it shows) */
.hint kbd, .keycap { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 6px; border-radius: 7px; background: #fff; box-shadow: 0 2px 0 rgba(0,0,0,0.12); font: 800 12px var(--font); color: var(--ink); }

/* joystick */
.joy { position: absolute; left: calc(22px + var(--safe-l)); bottom: calc(26px + var(--safe-b)); width: 132px; height: 132px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); border: 2px solid rgba(255, 255, 255, 0.6); backdrop-filter: blur(6px); display: none; }
.joy i { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(255, 255, 255, 0.9); box-shadow: 0 4px 14px rgba(0,0,0,0.2); }
@media (pointer: coarse) { .joy { display: block; } .tool kbd, .hint .k { display: none; } }

/* toasts and banners */
.toasts { position: absolute; left: 50%; top: calc(16px + var(--safe-t)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 18px; font-weight: 800; font-size: 14px; animation: toastIn 0.35s cubic-bezier(.2,1.4,.4,1); }
.toast.good { color: #2f7d33; } .toast.bad { color: #c24a3d; }
@keyframes toastIn { from { transform: translateY(-14px) scale(0.9); opacity: 0; } }
.banner { position: absolute; left: 50%; top: 22%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; font-family: var(--title); color: #fff; text-shadow: 0 3px 14px rgba(0,0,0,0.35); animation: bannerIn 0.6s cubic-bezier(.2,1.3,.4,1); }
.banner b { display: block; font-size: 44px; font-weight: 700; }
.banner small { font-size: 18px; font-weight: 500; }
@keyframes bannerIn { from { transform: translate(-50%, -30%) scale(0.8); opacity: 0; } }

/* reel meter */
.reel { position: absolute; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%); width: min(420px, 86vw); padding: 14px 18px 16px; }
.reel .row { display: flex; justify-content: space-between; font-weight: 800; font-size: 13px; color: var(--ink2); margin-bottom: 8px; }
.meter { position: relative; height: 18px; border-radius: 99px; background: linear-gradient(90deg, #cde9ee 0 15%, #9fe0a4 15% 80%, #ffb8a8 80% 100%); overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,0.12); }
.meter .needle { position: absolute; top: -3px; width: 6px; height: 24px; border-radius: 3px; background: var(--ink); left: 0; transition: left 0.05s linear; }
.progress { margin-top: 10px; height: 8px; border-radius: 99px; background: rgba(35,52,59,0.1); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sea), #57d3c1); border-radius: 99px; }

/* modal cards */
.veil { position: absolute; inset: 0; background: rgba(20, 44, 54, 0.22); display: grid; place-items: center; animation: fadeIn 0.25s; padding: 16px; }
@keyframes fadeIn { from { opacity: 0; } }
.card { width: min(430px, 100%); padding: 20px 22px 18px; position: relative; animation: cardIn 0.45s cubic-bezier(.2,1.25,.4,1); max-height: calc(100vh - 32px); overflow: auto; }
@keyframes cardIn { from { transform: translateY(24px) scale(0.94); opacity: 0; } }
.card h2 { margin: 0; font-family: var(--title); font-weight: 600; font-size: 25px; line-height: 1.15; }
.card .sub { color: var(--ink2); font-weight: 700; font-size: 14px; margin-top: 4px; }
.card .x { position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: var(--ink2); }
.card .x svg { width: 20px; height: 20px; }
.tier { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; color: #fff; }
.catch-view { position: relative; height: 220px; margin: 12px -8px 10px; border-radius: 16px; overflow: hidden; background: radial-gradient(circle at 50% 60%, rgba(255,255,255,0.9), rgba(200,236,240,0.6) 60%, rgba(160,215,225,0.4)); }
.catch-view canvas { width: 100%; height: 100%; display: block; }
.catch-view .gold { position: absolute; inset: 0; background: radial-gradient(circle at 50% 55%, rgba(255, 215, 90, 0.55), transparent 65%); pointer-events: none; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 14px; }
.fact { background: rgba(255,255,255,0.7); border-radius: 12px; padding: 8px 10px; }
.fact small { display: block; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.fact b { font-family: var(--title); font-weight: 600; font-size: 18px; }
.fact .up { color: #2f7d33; } .fact .down { color: #c24a3d; }
.stock-line { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,0.72); font-weight: 700; font-size: 13px; color: var(--ink2); }
.stock-line img { width: 34px; height: 34px; border-radius: 10px; background: #fff; }
.btns { display: flex; gap: 10px; margin-top: 14px; }
.btn { flex: 1; padding: 12px 14px; border-radius: 14px; font-family: var(--title); font-weight: 600; font-size: 16px; background: #fff; box-shadow: 0 3px 0 rgba(0,0,0,0.08); }
.btn.main { background: var(--sea); color: #fff; box-shadow: 0 4px 0 var(--sea-d); }
.btn.gold { background: var(--bell); color: #4a3200; box-shadow: 0 4px 0 var(--bell-d); }
.btn:active { transform: translateY(2px); box-shadow: none; }

/* dialogue (villagers, shopkeepers) */
.talk { position: absolute; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); width: min(640px, 94vw); padding: 22px 24px 18px; font-size: 18px; font-weight: 700; line-height: 1.45; animation: cardIn 0.3s cubic-bezier(.2,1.25,.4,1); }
.talk .who { position: absolute; top: -18px; left: 22px; padding: 6px 16px; border-radius: 12px; font-family: var(--title); font-weight: 600; font-size: 17px; color: #fff; background: var(--coral); box-shadow: var(--shadow); }
.talk .more { position: absolute; right: 18px; bottom: 10px; width: 18px; height: 18px; animation: bob 0.8s ease-in-out infinite alternate; color: var(--sea); }
@keyframes bob { to { transform: translateY(4px); } }
.talk .choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.talk .choices .btn { flex: 0 0 auto; font-size: 15px; padding: 9px 14px; }

/* pockets */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 12px; }
.slot { aspect-ratio: 1; border-radius: 14px; background: rgba(255,255,255,0.7); display: grid; place-items: center; position: relative; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.05); overflow: hidden; }
.slot img { width: 86%; height: 86%; object-fit: contain; }
.slot .q { position: absolute; right: 5px; bottom: 3px; font-weight: 800; font-size: 12px; }
.slot .dot { position: absolute; left: 6px; top: 6px; width: 9px; height: 9px; border-radius: 50%; }
.slot.empty { background: rgba(255,255,255,0.35); }
.slot.sel { box-shadow: inset 0 0 0 3px var(--sea); }

/* loader */
.boot { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #bfeaf2, #7ecbdc 55%, #4aa9bf); transition: opacity 0.9s; }
.boot.gone { opacity: 0; pointer-events: none; }
.boot .mark { text-align: center; color: #fff; }
.boot .mark b { display: block; font-family: var(--title); font-weight: 700; font-size: clamp(44px, 9vw, 86px); letter-spacing: 0.01em; text-shadow: 0 6px 24px rgba(10, 60, 80, 0.35); }
.boot .mark small { display: block; font-weight: 800; font-size: 15px; opacity: 0.9; margin-top: 4px; }
.boot .bar { width: min(280px, 60vw); height: 8px; margin: 22px auto 0; border-radius: 99px; background: rgba(255,255,255,0.35); overflow: hidden; }
.boot .bar i { display: block; height: 100%; width: 0; background: #fff; border-radius: 99px; transition: width 0.3s; }
.boot .play { margin-top: 26px; padding: 14px 34px; border-radius: 18px; font-family: var(--title); font-weight: 600; font-size: 20px; color: var(--sea-d); background: #fff; box-shadow: 0 6px 0 rgba(10, 70, 90, 0.25); opacity: 0; transform: translateY(8px); transition: opacity 0.4s, transform 0.4s; }
.boot .play.on { opacity: 1; transform: none; }

/* world labels (names above characters) */
.tag { position: absolute; transform: translate(-50%, -100%); padding: 3px 10px; border-radius: 10px; font-weight: 800; font-size: 13px; pointer-events: none; white-space: nowrap; }
@media (max-width: 640px) {
  .hud-clock { min-width: 0; padding: 8px 12px; }
  .hud-clock .time { font-size: 24px; }
  .act { width: 76px; height: 76px; }
  .tool { width: 46px; height: 46px; }
}
/* phones: the two buttons on top, the Bells under them; a tighter clock */
@media (max-width: 480px) {
  .hud-top-r { width: 104px; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .hud-top-r .bells { order: 2; padding: 6px 12px 6px 8px; font-size: 17px; }
  .bells .coin { width: 24px; height: 24px; }
  .icon-btn { width: 46px; height: 46px; border-radius: 15px; }
  .hud-clock { padding: 7px 11px 8px; max-width: calc(100vw - 150px); }
  .hud-clock .time { font-size: 22px; }
  .hud-clock .date { font-size: 12px; }
  .pill { font-size: 11px; padding: 3px 8px; }
}
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn svg { width: 19px; height: 19px; flex: none; }

/* ---------- the phone ---------- */
.phone { width: min(560px, 100%); min-height: min(640px, calc(100vh - 32px)); display: flex; flex-direction: column; }
.phone .apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 10px; margin-top: 16px; }
.app { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; font-size: 12.5px; color: var(--ink2); }
.app i { width: 62px; height: 62px; border-radius: 20px; display: grid; place-items: center; color: #fff; box-shadow: 0 6px 14px rgba(0,0,0,0.12), inset 0 -3px 0 rgba(0,0,0,0.12); }
.app i svg { width: 30px; height: 30px; }
.app:active i { transform: scale(0.94); }
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--sea-d); margin-bottom: 6px; }
.back svg { width: 18px; height: 18px; transform: rotate(90deg); }
.tabs { display: flex; gap: 6px; margin: 10px 0; }
.tabs button { padding: 7px 14px; border-radius: 99px; font-weight: 800; font-size: 13px; background: rgba(255,255,255,0.6); }
.tabs button.on { background: var(--sea); color: #fff; }
.dex { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.dexe { border-radius: 14px; background: rgba(255,255,255,0.72); padding: 6px 6px 8px; text-align: center; font-size: 11.5px; font-weight: 800; color: var(--ink2); position: relative; }
.dexe img { width: 100%; aspect-ratio: 1.3; object-fit: contain; }
.dexe.unknown img { filter: brightness(0) opacity(0.25); }
.dexe .tk { display: block; font-size: 10.5px; color: var(--muted); }
.dexe .ch { position: absolute; right: 6px; top: 5px; font-size: 10.5px; }
.rows { display: flex; flex-direction: column; gap: 6px; }
.rowi { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,0.7); font-weight: 700; font-size: 14px; }
.rowi .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowi .up { color: #2f7d33; } .rowi .down { color: #c24a3d; }
.mapbox { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 1; background: #1d6f8f; }
.mapbox img { width: 100%; height: 100%; display: block; }
.mapbox .pin { position: absolute; transform: translate(-50%, -50%); width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
.mapbox .me { background: var(--coral); width: 16px; height: 16px; }
.mapbox .lbl { position: absolute; transform: translate(-50%, -150%); font-size: 10.5px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.6); white-space: nowrap; }
.set { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.7); font-weight: 700; }
.set input[type=range] { width: 50%; accent-color: var(--sea); }
.seg { display: inline-flex; background: rgba(35,52,59,0.08); border-radius: 99px; padding: 3px; }
.seg button { padding: 6px 12px; border-radius: 99px; font-weight: 800; font-size: 13px; color: var(--ink2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.bar { height: 10px; border-radius: 99px; background: rgba(35,52,59,0.1); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--sea), #57d3c1); }
.phone-card { width: min(560px, 100%); }
.boot.title { background: linear-gradient(180deg, rgba(30, 90, 120, 0.25), rgba(30, 90, 120, 0) 45%, rgba(20, 60, 80, 0.35)); }
.boot.title .bar { opacity: 0; transition: opacity .6s; }
.boot { transition: opacity 0.9s, background 1.4s; }
body[data-view="title"] .hud, body[data-view="boot"] .hud { opacity: 0; pointer-events: none; }
.hud { transition: opacity 0.6s; }
body[data-photo] .hud { opacity: 0; pointer-events: none; }
.photo { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); width: min(560px, 94vw); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.prow { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.prow svg { width: 20px; height: 20px; }
.prow input[type=range] { flex: 1; accent-color: var(--bell); }
.prow .btn { flex: 1; }
.prow .out { flex: 0 0 48px; }
.decor { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); width: min(760px, 94vw); padding: 12px 14px; }
.decor .row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.decor .row .sub { flex: 1; margin: 0; }
.decor .row .btn { flex: 0 0 auto; }
.decor .store { display: flex; flex-wrap: wrap; gap: 6px; max-height: 120px; overflow: auto; align-items: center; }
.chip { padding: 7px 12px; border-radius: 99px; background: rgba(255,255,255,0.8); font-weight: 800; font-size: 13px; }
.chip.on { background: var(--sea); color: #fff; }

/* a message in a bottle: a sheet of paper, handwritten */
.note { margin-top: 14px; padding: 18px 20px; border-radius: 6px; background: linear-gradient(180deg, #fbf3dc, #f3e5bf); color: #4a3a22; font-family: var(--title); font-size: 18px; line-height: 1.45; box-shadow: 0 6px 16px rgba(80, 60, 20, 0.18), inset 0 0 30px rgba(170, 130, 60, 0.18); transform: rotate(-0.6deg); }
/* photo mode and the title: no name tags over the picture */
body[data-photo] .tags, body[data-view="title"] .tags { display: none; }

/* ---------- v2: the goal tracker, the controls, the one action button ---------- */
.goal { position: absolute; left: calc(14px + var(--safe-l)); top: calc(var(--clock-h, 118px) + 22px + var(--safe-t)); display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 10px; max-width: min(360px, calc(100vw - 150px)); text-align: left; pointer-events: auto; color: var(--ink); }
.goal.hidden { display: none; }
.goal .gi { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(160deg, #ffd35a, #e9a21a); color: #fff; display: grid; place-items: center; flex: none; box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.goal .gi svg { width: 20px; height: 20px; }
.goal .gt { display: flex; flex-direction: column; min-width: 0; }
.goal .gt b { font-family: var(--title); font-weight: 600; font-size: 15px; line-height: 1.15; }
.goal .gt small { font-size: 12px; font-weight: 700; color: var(--ink2); line-height: 1.25; margin-top: 2px; }
.goal .gd { display: flex; flex-direction: column; align-items: center; gap: 1px; flex: none; margin-left: 2px; }
.goal .gd i { width: 22px; height: 22px; color: #e9a21a; display: block; transition: transform .2s; }
.goal .gd i svg { width: 22px; height: 22px; }
.goal .gd em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--ink2); }
.goal.urgent .gi { background: linear-gradient(160deg, #ff8b7a, #e5533d); }
.goal.pop { animation: goalPop .6s cubic-bezier(.2,1.5,.4,1); }
@keyframes goalPop { 0% { transform: scale(.9); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } }
.keys { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); padding: 9px 16px; font-size: 13px; font-weight: 700; color: var(--ink2); white-space: nowrap; }
.keys b { color: var(--ink); margin-left: 6px; }
.keys.hidden { display: none; }
.tierb { margin-left: 6px; padding: 2px 8px; border-radius: 99px; background: var(--E); color: #fff; font-family: var(--font); font-size: 11px; font-weight: 800; }
.tierb.hidden { display: none; }
.bells.gain { animation: gain .7s cubic-bezier(.2,1.5,.4,1); }
@keyframes gain { 40% { transform: scale(1.12); box-shadow: 0 0 0 6px rgba(255, 205, 80, .35); } }
.act kbd { position: absolute; right: 8px; bottom: 8px; font: 800 10px var(--font); color: rgba(255,255,255,.75); }
@media (pointer: coarse) { .act kbd { display: none; } }
.howto { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.hrow { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.72); font-size: 14px; font-weight: 700; color: var(--ink2); line-height: 1.35; }
.hrow svg { width: 22px; height: 22px; flex: none; color: var(--sea); margin-top: 1px; }
.hrow b { color: var(--ink); }
@media (max-width: 480px) {
  .goal { top: calc(var(--clock-h, 104px) + 20px + var(--safe-t)); max-width: calc(100vw - 28px); }
}
.act { position: relative; }
.act .al { font-size: 14px; line-height: 1.05; max-width: 74px; text-align: center; }
.stock-line .up, .facts .up { color: #2f7d33; } .stock-line .down, .facts .down { color: #c24a3d; }
.stock-line .adv { display: inline-block; margin-top: 4px; color: var(--ink); }
/* the bag and the counter: one row per thing, with today's move and its worth */
.explain { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 211, 90, .22); font-size: 13px; font-weight: 700; color: var(--ink2); line-height: 1.4; }
.explain b { color: var(--ink); }
.items { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; max-height: min(46vh, 420px); overflow: auto; padding-right: 2px; }
.item { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 14px; background: rgba(255,255,255,.75); text-align: left; font: inherit; color: var(--ink); box-shadow: inset 0 -2px 0 rgba(0,0,0,.04); }
.item .th { width: 44px; height: 44px; border-radius: 12px; background: rgba(200,236,240,.6); display: grid; place-items: center; flex: none; overflow: hidden; }
.item .th img { width: 90%; height: 90%; object-fit: contain; }
.item .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item .nm b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .nm small { font-size: 11.5px; font-weight: 700; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .pr { font-family: var(--title); font-weight: 600; font-size: 16px; text-align: right; min-width: 64px; display: flex; flex-direction: column; line-height: 1.05; }
.item .pr small { font-family: var(--font); font-size: 10px; font-weight: 800; color: var(--ink2); }
.chip { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 800; flex: none; }
.chip svg { width: 13px; height: 13px; }
.chip.up { background: rgba(88, 179, 90, .16); color: #2f7d33; } .chip.down { background: rgba(214, 80, 60, .13); color: #c24a3d; }
.item.pick .ck { width: 24px; height: 24px; border-radius: 8px; border: 2px solid rgba(35,52,59,.2); flex: none; display: grid; place-items: center; color: transparent; }
.item.pick .ck svg { width: 14px; height: 14px; }
.item.pick.on { box-shadow: inset 0 0 0 2.5px var(--sea); background: rgba(255,255,255,.95); }
.item.pick.on .ck { background: var(--sea); border-color: var(--sea); color: #fff; }
.sumline { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding: 0 4px; font-weight: 800; }
.sumline b { font-family: var(--title); font-size: 18px; }
.sumline.bonus { color: var(--E); margin-top: 4px; } .sumline.muted { color: var(--ink2); font-size: 12.5px; font-weight: 700; margin-top: 4px; }
/* ---------- the menu ---------- */
.phone .tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.tile { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 18px; background: rgba(255,255,255,.78); text-align: left; font: inherit; color: var(--ink); box-shadow: 0 2px 0 rgba(0,0,0,.04); transition: transform .12s; }
.tile:active { transform: scale(.97); }
.tile i { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.tile i svg { width: 25px; height: 25px; }
.tile span { display: flex; flex-direction: column; min-width: 0; }
.tile b { font-family: var(--title); font-weight: 600; font-size: 18px; line-height: 1.1; }
.tile small { font-size: 12.5px; font-weight: 700; color: var(--ink2); line-height: 1.3; margin-top: 2px; }
.tile em { font-style: normal; font-size: 12px; font-weight: 800; color: var(--sea-d); margin-top: 5px; }
.smalls { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.smallb { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 99px; background: rgba(255,255,255,.7); font: inherit; font-weight: 800; font-size: 13px; color: var(--ink2); }
.smallb svg { width: 17px; height: 17px; }
.app-body h3 { font-family: var(--title); font-weight: 600; font-size: 17px; margin: 16px 0 8px; }
.ckb { width: 24px; height: 24px; border-radius: 8px; border: 2px solid rgba(35,52,59,.18); display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 800; color: var(--ink2); }
.ckb svg { width: 15px; height: 15px; }
.rowi.done .ckb { background: #58b35a; border-color: #58b35a; color: #fff; }
.rowi.done .grow { color: var(--ink2); text-decoration: line-through; text-decoration-color: rgba(35,52,59,.3); }
.rowi.me { box-shadow: inset 0 0 0 2px var(--E); }
.note-s { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(160, 82, 224, .1); font-size: 13.5px; font-weight: 700; color: var(--ink2); line-height: 1.35; }
.note-s svg { width: 20px; height: 20px; flex: none; color: var(--E); }
.note-s.ok { background: rgba(88, 179, 90, .14); } .note-s.ok svg { color: #2f7d33; }
.note-s b { color: var(--ink); }
.mkt { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mkt .pill.up { background: rgba(88,179,90,.16); color: #2f7d33; } .mkt .pill.down { background: rgba(214,80,60,.12); color: #c24a3d; }
.rowi.mrow { padding: 7px 10px; }
.mrow .tk { width: 52px; font-size: 13px; }
.mrow .grow { display: flex; flex-direction: column; }
.mrow .grow small { font-size: 11.5px; font-weight: 700; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; }
.mrow .fx { width: 50px; text-align: right; font-family: var(--title); font-weight: 600; }
.mrow .lg { width: 30px; height: 30px; border-radius: 50%; background: #fff; flex: none; }
.mrow .ext { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(35,52,59,.07); font-weight: 800; color: var(--ink2); text-decoration: none; flex: none; }
.list.rows { display: flex; flex-direction: column; gap: 6px; }
@media (min-width: 760px) { .phone .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .tile { padding: 11px; gap: 10px; } .tile i { width: 40px; height: 40px; } .tile b { font-size: 16px; } .tile small { font-size: 11.5px; } }
.phone-card { width: min(720px, 100%); } .phone { width: 100%; }
.boot .fail { margin-top: 18px; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.4); text-align: center; }
.boot .fail .retry { margin-top: 10px; padding: 10px 22px; border-radius: 99px; background: #fff; color: var(--ink); font: 800 15px var(--font); }
/* phones: a compact clock (the date goes, the market stays) */
@media (max-width: 480px) {
  .hud-clock .date { display: none; }
  .hud-clock .time { font-size: 20px; }
  .hud-market { margin-top: 5px; gap: 4px; }
  .goal { padding: 7px 10px 7px 8px; gap: 8px; }
  .goal .gi { width: 30px; height: 30px; }
  .goal .gt b { font-size: 14px; } .goal .gt small { font-size: 11.5px; }
}
.callbox { padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.78); }
.callbox .q { font-size: 15px; font-weight: 700; line-height: 1.35; }
.callbox .q .up, .callbox .up b { color: #2f7d33; } .callbox .q .down { color: #c24a3d; }
.callbox .btns { margin-top: 10px; }
.btn.pick { flex: 1; justify-content: center; background: rgba(35,52,59,.07); color: var(--ink); }
.btn.pick.up.on { background: #58b35a; color: #fff; box-shadow: 0 4px 0 #3d8a40; }
.btn.pick.down.on { background: #e5533d; color: #fff; box-shadow: 0 4px 0 #b53b28; }
.callbox .sub { margin-top: 8px; }

/* =================== the site around the game =================== */
.boot .mark img { width: 96px; height: 96px; display: block; margin: 0 auto 6px; filter: drop-shadow(0 8px 18px rgba(10, 60, 80, .35)); }
#top { position: fixed; z-index: 3; left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); top: calc(10px + var(--safe-t)); height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 10px; border-radius: 18px; background: rgba(255, 253, 247, .72); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border: 1px solid rgba(255,255,255,.85); box-shadow: 0 8px 24px rgba(18, 52, 64, .14); pointer-events: auto; }
body[data-view="boot"] #top { opacity: 0; pointer-events: none; }
#top .brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); flex: none; }
#top .brand img { width: 34px; height: 34px; }
#top .brand b { font-family: var(--title); font-weight: 700; font-size: 22px; letter-spacing: .01em; }
#top .nav { display: flex; gap: 2px; margin-left: 8px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
#top .nav::-webkit-scrollbar { display: none; }
#top .nav a { padding: 8px 13px; border-radius: 12px; font-weight: 800; font-size: 14.5px; color: var(--ink2); text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
#top .nav a:hover { background: rgba(35,52,59,.06); color: var(--ink); }
#top .nav a.on { background: var(--ink); color: #fff; }
#top .nav a.play-tab { background: var(--sea); color: #fff; box-shadow: 0 3px 0 var(--sea-d); margin-right: 6px; }
#top .nav a.play-tab.on { background: var(--sea-d); box-shadow: none; }
#top .top-r { display: flex; align-items: center; gap: 8px; flex: none; }
#top .icon-btn { width: 40px; height: 40px; border-radius: 12px; }
#top .icon-btn svg { width: 20px; height: 20px; }
#top .x-btn { display: grid; place-items: center; color: var(--ink); }
#top .x-btn.hidden, .hidden { display: none !important; }
.wallet-btn { padding: 10px 16px; border-radius: 12px; background: var(--ink); color: #fff; font: 800 14px var(--font); white-space: nowrap; }
.wallet-btn.on { background: rgba(160, 82, 224, .14); color: var(--E); }
#top .burger { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
#top .burger i { display: block; width: 18px; height: 2.5px; border-radius: 2px; background: var(--ink); }
.drawer { position: fixed; inset: 0; z-index: 4; background: rgba(20, 40, 50, .25); }
.drawer-in { position: absolute; right: calc(10px + var(--safe-r)); top: calc(72px + var(--safe-t)); width: min(280px, calc(100vw - 20px)); padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.drawer-in a { padding: 12px 14px; border-radius: 12px; font-weight: 800; font-size: 16px; color: var(--ink); text-decoration: none; }
.drawer-in a.on { background: var(--ink); color: #fff; }
.drawer-in .btn { margin-top: 6px; justify-content: center; }
@media (max-width: 1020px) { #top .nav { display: none; } #top .burger { display: flex; } #top .set-btn, #top .x-btn { display: none; } }
@media (max-width: 480px) { #top { height: 50px; left: 8px; right: 8px; top: calc(8px + var(--safe-t)); } #top .brand b { font-size: 19px; } .wallet-btn { padding: 8px 11px; font-size: 12.5px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; } }

/* in play, the HUD sits under the bar; the old menu button is the bar now */
body[data-view="play"] .hud-clock { top: calc(78px + var(--safe-t)); }
body[data-view="play"] .hud-top-r { top: calc(78px + var(--safe-t)); }
.b-menu { display: none !important; }
@media (max-width: 480px) { body[data-view="play"] .hud-clock, body[data-view="play"] .hud-top-r { top: calc(66px + var(--safe-t)); } }

/* the pages, over the living island */
#screens { position: fixed; inset: 0; z-index: 2; overflow-y: auto; overflow-x: hidden; pointer-events: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; user-select: text; -webkit-user-select: text; }
body[data-view="play"] #screens, body[data-view="boot"] #screens { display: none; }
body[data-view="title"] .hud, body[data-view="title"] .tags { display: none; }
#screens .page { min-height: 100%; padding: calc(86px + var(--safe-t)) 16px 40px; background: linear-gradient(180deg, rgba(232, 246, 249, .55), rgba(240, 248, 245, .78)); }
#screens .page-in { width: min(980px, 100%); margin: 0 auto; }
#screens .page .app-body { padding: 22px 24px 24px; border-radius: 22px; background: rgba(255, 253, 247, .8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.85); box-shadow: 0 10px 30px rgba(18, 52, 64, .12); }
#screens .page .app-body h2 { font-family: var(--title); font-weight: 600; font-size: 30px; margin: 0; }
#screens .page .app-body > .sub { font-size: 15px; margin-top: 6px; }
#screens .page .items, #screens .page .list { max-height: none; }
@media (max-width: 480px) { #screens .page { padding: calc(72px + var(--safe-t)) 8px 30px; } #screens .page .app-body { padding: 16px 14px; } #screens .page .app-body h2 { font-size: 25px; } }

/* the home page */
.home .hero { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: calc(90px + var(--safe-t)) 18px 60px; position: relative; background: radial-gradient(ellipse at 50% 52%, rgba(8, 40, 55, .28), rgba(8, 40, 55, 0) 68%); }
.home .kicker { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 99px; background: rgba(255,255,255,.82); font-weight: 800; font-size: 13.5px; color: var(--sea-d); box-shadow: 0 4px 14px rgba(18,52,64,.15); }
.home .kicker svg { width: 16px; height: 16px; }
.home .word { display: flex; align-items: center; gap: 14px; margin: 16px 0 0; font-family: var(--title); font-weight: 700; font-size: clamp(56px, 11vw, 120px); line-height: .95; color: #fff; letter-spacing: .005em; text-shadow: 0 6px 0 rgba(12, 80, 100, .35), 0 16px 40px rgba(8, 40, 55, .45); }
.home .word img { width: clamp(64px, 11vw, 118px); height: auto; filter: drop-shadow(0 10px 20px rgba(8, 40, 55, .45)); }
.home .tagline { margin: 18px 0 0; font-family: var(--title); font-weight: 600; font-size: clamp(22px, 3.6vw, 34px); color: #fff; text-shadow: 0 3px 16px rgba(8, 40, 55, .6); }
.home .sub { max-width: 640px; margin: 12px auto 0; font-size: clamp(15px, 2vw, 18px); font-weight: 700; line-height: 1.5; color: #fff; text-shadow: 0 2px 12px rgba(8, 40, 55, .75); }
.home .sub b { color: #ffe08a; }
.home .cta { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; justify-content: center; }
.btn.big { padding: 16px 28px; font-size: 19px; font-family: var(--title); font-weight: 600; border-radius: 18px; text-decoration: none; }
.btn.big svg { width: 22px; height: 22px; }
.home .ca { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; padding: 8px 10px 8px 14px; border-radius: 14px; background: rgba(255,255,255,.85); font-weight: 800; font-size: 13.5px; color: var(--ink2); max-width: calc(100vw - 36px); }
.home .ca svg { width: 18px; height: 18px; color: var(--bell-d); }
.home .ca code { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home .ca .copy { padding: 6px 12px; border-radius: 10px; background: var(--ink); color: #fff; font: 800 12px var(--font); }
.home .chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.chipx { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 14px; background: rgba(255,253,247,.86); box-shadow: 0 6px 16px rgba(18,52,64,.16); }
.chipx svg { width: 18px; height: 18px; color: var(--sea); }
.chipx b { font-family: var(--title); font-weight: 600; font-size: 17px; }
.chipx small { font-size: 12px; font-weight: 800; color: var(--ink2); }
.chipx.up svg, .chipx.up b { color: #2f7d33; } .chipx.down svg, .chipx.down b { color: #c24a3d; }
.chipx.gold svg { color: var(--bell-d); }
.home .hint-scroll { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); width: 34px; height: 34px; color: #fff; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(-50%, 6px); } }
.home-in { width: min(1060px, 100%); margin: 0 auto; padding: 0 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.home .panel { padding: 24px 26px; border-radius: 24px; background: rgba(255, 253, 247, .84); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.9); box-shadow: 0 10px 30px rgba(18, 52, 64, .13); }
.home .panel h2 { font-family: var(--title); font-weight: 600; font-size: 28px; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.home .panel h2 svg { width: 26px; height: 26px; color: var(--sea); }
.home .panel h3 { font-family: var(--title); font-weight: 600; font-size: 18px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.home .panel h3 svg { width: 20px; height: 20px; color: var(--sea); }
.home .panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.home .panel-head h2 { margin: 0; }
.home .muted { color: var(--ink2); font-weight: 700; font-size: 14px; }
.home .steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.home .step { padding: 16px; border-radius: 18px; background: rgba(255,255,255,.8); }
.home .step b { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--sea); color: #fff; font-family: var(--title); font-size: 18px; }
.home .step h3 { margin: 12px 0 6px; }
.home .step p, .home .use p { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink2); line-height: 1.45; }
.home .two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.home .rowi .tk { width: 52px; font-size: 13px; }
.home .rowi .grow { display: flex; flex-direction: column; }
.home .rowi .grow small { font-size: 11.5px; font-weight: 700; color: var(--ink2); }
.home .rowi .fx { width: 48px; text-align: right; font-family: var(--title); font-weight: 600; }
.home .rowi .lg { width: 30px; height: 30px; border-radius: 50%; background: #fff; flex: none; }
.home .rowi .ext, .rowi .ext { flex: none; padding: 4px 8px; border-radius: 8px; background: rgba(35,52,59,.07); font-weight: 800; font-size: 12px; color: var(--ink2); text-decoration: none; }
.home .btns { flex-wrap: wrap; }
.home .btns .btn { text-decoration: none; }
.call-teaser { background: linear-gradient(120deg, rgba(31,163,179,.92), rgba(19,125,138,.92)) !important; color: #fff; }
.call-teaser .call-in { display: flex; align-items: center; gap: 20px; justify-content: space-between; flex-wrap: wrap; }
.call-teaser h2 { color: #fff; margin-bottom: 6px !important; } .call-teaser h2 svg { color: #ffe08a !important; }
.call-teaser p { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.45; max-width: 640px; }
.call-teaser .btn.main { background: #fff; color: var(--sea-d); box-shadow: 0 4px 0 rgba(0,0,0,.15); text-decoration: none; }
.home .uses { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.home .use { padding: 16px; border-radius: 18px; background: rgba(255,255,255,.8); }
.home .use > svg { width: 28px; height: 28px; color: var(--bell-d); }
.home .use h3 { margin: 10px 0 6px; }
.home .tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.tier-card { padding: 12px 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(160,82,224,.12), rgba(245,184,46,.14)); display: flex; flex-direction: column; gap: 2px; }
.tier-card b { font-family: var(--title); font-weight: 600; font-size: 18px; }
.tier-card span { font-weight: 800; font-size: 13px; color: var(--ink2); }
.tier-card em { font-style: normal; font-weight: 800; font-size: 12.5px; color: var(--E); }
.home .boards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.home .board { padding: 14px; border-radius: 18px; background: rgba(255,255,255,.8); }
.home .board .prz { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.home .board .prz span { padding: 3px 8px; border-radius: 99px; background: rgba(155,107,255,.14); color: #6b3fd1; font-weight: 800; font-size: 12px; }
.home .board .rk { display: flex; gap: 8px; align-items: center; padding: 5px 0; font-weight: 700; font-size: 14px; border-top: 1px solid rgba(35,52,59,.06); }
.home .board .rk span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home .board .rk em { font-style: normal; font-weight: 800; color: var(--ink2); }
.home #h-proof h3 { margin-top: 16px; }
.home .feed { display: flex; flex-direction: column; gap: 6px; }
.home .fe { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; background: rgba(255,255,255,.8); font-weight: 700; font-size: 14px; color: var(--ink2); }
.home .fe svg, .home .fe img { width: 26px; height: 26px; border-radius: 50%; flex: none; color: var(--sea); }
.home .fe span { flex: 1; } .home .fe b { color: var(--ink); } .home .fe em { font-style: normal; font-size: 12px; color: var(--muted); }
.home .faq details { padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.8); margin-top: 8px; }
.home .faq summary { cursor: pointer; font-weight: 800; font-size: 15px; }
.home .faq p { margin: 10px 0 2px; font-weight: 700; font-size: 14px; color: var(--ink2); line-height: 1.5; }
.home .foot { text-align: center; padding: 20px 10px 10px; color: #fff; text-shadow: 0 2px 10px rgba(8,40,55,.5); }
.home .foot .brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--title); font-weight: 700; font-size: 22px; }
.home .foot .brand img { width: 32px; height: 32px; }
.home .foot p { max-width: 720px; margin: 10px auto 0; font-size: 13px; font-weight: 700; line-height: 1.5; opacity: .92; }
@media (max-width: 860px) { .home .steps, .home .uses, .home .boards { grid-template-columns: 1fr 1fr; } .home .two { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .home .steps, .home .uses, .home .boards, .home .tiers { grid-template-columns: 1fr; } .home .panel { padding: 18px 16px; border-radius: 20px; } .home .panel h2 { font-size: 23px; } .btn.big { padding: 14px 22px; font-size: 17px; } }
.phone-card { width: min(720px, 100%); }
/* layers: the island · the pages (2) · the bar (3) · the drawer (4) · cards, talk and toasts (6) · the loader (7) */
#ui { z-index: 6; }
.boot { z-index: 7; }
.btn.big { white-space: nowrap; }
/* toasts sit under the bar on top */
.toasts { top: calc(78px + var(--safe-t)); }
@media (max-width: 480px) { .toasts { top: calc(66px + var(--safe-t)); } }
.tk-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.tk-stats .fact { background: rgba(255,255,255,.8); }
.ca.wide { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 10px 8px 14px; border-radius: 14px; background: rgba(255,255,255,.85); font-weight: 800; font-size: 13px; color: var(--ink2); }
.ca.wide code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca.wide .btn { padding: 6px 12px; font-size: 12px; }
.faqs details { padding: 11px 13px; border-radius: 14px; background: rgba(255,255,255,.78); margin-top: 8px; }
.faqs summary { cursor: pointer; font-weight: 800; font-size: 14.5px; }
.faqs p { margin: 8px 0 2px; font-weight: 700; font-size: 13.5px; color: var(--ink2); line-height: 1.5; }
@media (max-width: 520px) { .tk-stats { grid-template-columns: 1fr 1fr; } }

/* going to sleep */
.sleep { position: fixed; inset: 0; z-index: 8; display: grid; place-items: center; background: #0b1426; opacity: 0; transition: opacity .8s; pointer-events: none; }
.sleep.on { opacity: .96; }
.sleep b { font-family: var(--title); font-size: 56px; color: #cfe3ff; letter-spacing: .08em; animation: zz 1.6s ease-in-out infinite; }
@keyframes zz { 50% { transform: translateY(-8px); opacity: .7; } }
/* phones in the game: the clock and the goal fill the top, the joystick and the button the bottom — toasts and the
   big banner go in the open middle, the hint above the thumbs */
@media (max-width: 560px) {
  body[data-view="play"] .toasts { top: auto; bottom: calc(196px + var(--safe-b)); width: calc(100vw - 32px); }
  body[data-view="play"] .toast { font-size: 13px; text-align: center; padding: 9px 14px; }
  .banner { top: 46%; width: calc(100vw - 40px); }
  .banner b { font-size: 32px; } .banner small { font-size: 14px; }
  body[data-view="play"] .hint { bottom: calc(186px + var(--safe-b)); font-size: 13px; }
}
/* the site before the island (js/boot.js): a real picture of the island behind the pages until the 3D one is built,
   then the canvas fades in; a small chip says how far the building is */
#gl { transition: opacity 1.2s ease; }
body[data-world="loading"] #gl { opacity: 0; }
body[data-world="loading"] { background: #8fd0e8 url(/assets/ui/poster-wide.jpg) center / cover no-repeat; }
@media (max-aspect-ratio: 4/5) { body[data-world="loading"] { background-image: url(/assets/ui/poster-tall.jpg); } }
.worldchip { position: fixed; right: calc(16px + var(--safe-r, 0px)); bottom: calc(16px + var(--safe-b)); z-index: 3; display: flex; align-items: center; gap: 9px; padding: 8px 14px 8px 10px; border-radius: 99px; background: rgba(255, 253, 247, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 18px rgba(18, 52, 64, .15); font-weight: 800; font-size: 13px; color: var(--ink2); transition: opacity .8s; pointer-events: none; }
.worldchip i { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid rgba(31, 159, 179, .25); border-top-color: var(--sea-d, #1f8fa3); animation: spin .9s linear infinite; }
.worldchip b { color: var(--ink); }
.worldchip.gone { opacity: 0; }
body[data-view="play"] .worldchip { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot .pc { margin-top: 10px; font-size: 13px; opacity: .85; }
/* the home page's gallery: real pictures of the game */
.home .gallery .shots { display: grid; grid-template-columns: 1.4fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; margin-top: 14px; }
.home .gallery figure { position: relative; margin: 0; border-radius: 18px; overflow: hidden; background: #cfe9ef; aspect-ratio: 16 / 10; box-shadow: 0 8px 22px rgba(18, 52, 64, .16); }
.home .gallery figure.big { grid-row: span 2; aspect-ratio: auto; }
.home .gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.home .gallery figure:hover img { transform: scale(1.04); }
.home .gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 11px; background: linear-gradient(180deg, transparent, rgba(6, 24, 32, .72)); color: #fff; font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.home .gallery figcaption b { display: block; font-family: var(--title); font-size: 17px; font-weight: 600; }
@media (max-width: 860px) { .home .gallery .shots { grid-template-columns: 1fr 1fr; grid-template-rows: none; } .home .gallery figure.big { grid-column: span 2; grid-row: auto; aspect-ratio: 16 / 10; } }
@media (max-width: 520px) { .home .gallery .shots { gap: 8px; } .home .gallery figcaption { font-size: 11px; padding: 20px 10px 8px; } .home .gallery figcaption b { font-size: 15px; } .home .gallery figure:not(.big) figcaption span { display: none; } }
/* the missions streak */
.streak { display: flex; gap: 14px; align-items: center; margin: 14px 0 4px; padding: 12px 14px; border-radius: 18px; background: linear-gradient(135deg, rgba(255, 214, 102, .35), rgba(255, 170, 60, .18)); border: 1px solid rgba(233, 162, 26, .35); }
.streak .sk-n { flex: none; width: 76px; height: 76px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: #fff8e6; box-shadow: inset 0 0 0 3px #f2b233; }
.streak .sk-n b { font-family: var(--title); font-size: 30px; line-height: 1; color: #c97a00; }
.streak .sk-n small { font-size: 10.5px; font-weight: 800; color: var(--ink2); }
.streak .sk-t { min-width: 0; font-size: 13.5px; }
.streak .sk-t > small { display: block; margin-top: 6px; color: var(--ink2); font-weight: 700; }
.streak .sk-steps { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.streak .sk-steps span { position: relative; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px 4px 6px; border-radius: 99px; background: rgba(255,255,255,.75); font-weight: 900; font-size: 12px; color: var(--ink2); }
.streak .sk-steps span i { font-style: normal; font-weight: 700; font-size: 11px; }
.streak .sk-steps span.got { background: #f2b233; color: #3d2600; }
.streak .sk-steps svg { width: 13px; height: 13px; }
@media (max-width: 480px) { .streak .sk-steps span i { display: none; } .streak .sk-n { width: 64px; height: 64px; } .streak .sk-n b { font-size: 25px; } }
/* holder badges and titles on the boards */
.hold { display: inline-block; margin-left: 5px; padding: 1px 7px; border-radius: 99px; font-size: 10.5px; font-weight: 900; vertical-align: 1px; color: #3d2600; background: #ffe39a; }
.hold.t2 { background: #ffc94d; } .hold.t3 { background: linear-gradient(90deg, #f7c843, #e9a21a); color: #fff; }
.rowi .ttl { display: block; font-size: 11.5px; color: #b7791f; font-weight: 800; }
/* the Daily Call's crowd */
.crowd { margin-top: 10px; }
.crowd .cb { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: #e6ece9; }
.crowd .cb i { display: block; height: 100%; transition: width .6s ease; }
.crowd .cb i.u { background: linear-gradient(90deg, #58b35a, #7fd07c); } .crowd .cb i.d { background: linear-gradient(90deg, #e87766, #c24a3d); }
.crowd .cl { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; font-size: 12px; font-weight: 800; color: var(--ink2); }
.crowd .cl .up { color: #2f7d33; } .crowd .cl .down { color: #c24a3d; }
/* the museum's sets */
.sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.setc { padding: 12px 13px 11px; border-radius: 16px; background: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.9); }
.setc.done { background: linear-gradient(135deg, rgba(88,179,90,.16), rgba(255,255,255,.85)); border-color: rgba(88,179,90,.35); }
.setc .sh { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.setc .sh b { font-family: var(--title); font-weight: 600; font-size: 16px; }
.setc .sh .tier svg { width: 12px; height: 12px; vertical-align: -2px; }
.setc small { display: block; margin-top: 2px; color: var(--ink2); font-weight: 700; font-size: 12px; }
.setc .ids { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 8px; }
.setc .ids span { padding: 2px 7px; border-radius: 99px; font-size: 11.5px; font-weight: 900; background: #eef2f0; color: #5f6f69; }
.setc .ids span.caught { background: #fff1c9; color: #8a6200; }
.setc .ids span.got { background: #58b35a; color: #fff; }
.setc .bar { display: block; }
.home .kicker.ev { background: linear-gradient(90deg, rgba(60, 30, 90, .82), rgba(255, 127, 39, .82)); color: #fff; }
#screens .page .app-body h1.page-title { font-family: var(--title); font-weight: 600; font-size: 30px; margin: 0; }
@media (max-width: 480px) { #screens .page .app-body h1.page-title { font-size: 25px; } }
.dexe .tk { color: #5f6f69; }
/* the welcome card alone on screen: no clock, goal, joystick or controls behind it yet */
body[data-welcome] .hud, body[data-welcome] .goal, body[data-welcome] .joy, body[data-welcome] .keys, body[data-welcome] .hint { opacity: 0 !important; pointer-events: none !important; }
/* a logo that couldn't load: a soft round placeholder */
img.noimg { background: radial-gradient(circle at 35% 30%, #fff, #dfe8e5); border-radius: 50%; min-width: 24px; min-height: 24px; }
.drawer-in .dset { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 0; border-radius: 12px; background: transparent; font: 800 16px var(--font); color: var(--ink2); text-align: left; cursor: pointer; }
.drawer-in .dset svg { width: 18px; height: 18px; }
/* links styled as buttons look like buttons (no blue, no underline) */
a.btn { text-decoration: none; }
a.btn:not(.main):not(.gold) { color: var(--ink); }
/* phones: the home's two live lists and the Market rows never overflow their panel */
.home .two > div { min-width: 0; }
.home .two .rowi { min-width: 0; }
@media (max-width: 480px) {
  .home .two .rowi .fx { display: none; }
  .home .two .rowi .chip { flex: none; }
  .mrow .tk { width: 44px; font-size: 12px; }
  .mrow .grow b { white-space: normal; line-height: 1.15; }
  .mrow .fx { width: 42px; font-size: 14px; }
  .rowi .chip { padding-left: 7px; padding-right: 7px; }
}
/* an islander's public island (#/i/CODE) */
.isl-head { display: flex; gap: 16px; align-items: center; }
.isl-av { flex: none; width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; background: linear-gradient(135deg, #ffe7a3, #ffc94d); box-shadow: 0 8px 20px rgba(233, 162, 26, .3); }
.isl-av img { width: 52px; height: 52px; }
.isl-head .kick { font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--sea-d); }
.isl-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.isl-badges .tier, .isl-badges .hold { font-size: 12px; padding: 3px 10px; margin: 0; }
.isl-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
@media (max-width: 560px) { .isl-stats { grid-template-columns: 1fr 1fr; } .isl-head { align-items: flex-start; } .isl-av { width: 60px; height: 60px; border-radius: 18px; } }
a.isl-link { color: inherit; text-decoration: none; border-bottom: 1.5px dotted rgba(35, 52, 59, .35); }
a.isl-link:hover { color: var(--sea-d); border-bottom-color: var(--sea-d); }
/* the little map in the corner (js/game/minimap.js): north up, the islander's arrow in the middle, their house, the goal */
.minimap { position: absolute; right: calc(14px + var(--safe-r)); top: 140px; width: 150px; height: 150px; padding: 0; border-radius: 22px; border: 3px solid rgba(255,255,255,.95); background: #1d6f8f; box-shadow: 0 6px 18px rgba(20,44,54,.28); cursor: pointer; transition: transform .15s; }
.minimap:hover { transform: scale(1.03); }
.minimap.hidden { display: none; }
.minimap .mm-in { position: absolute; inset: 0; border-radius: 19px; overflow: hidden; }
.minimap img { position: absolute; left: 0; top: 0; max-width: none; will-change: transform; user-select: none; pointer-events: none; }
.minimap .mm-me { position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; color: #ff5a47; filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1.5px #fff) drop-shadow(0 1px 2px rgba(0,0,0,.4)); z-index: 3; }
.minimap .mm-me svg, .isle-map .pin.me svg { width: 100%; height: 100%; }
.minimap .mm-pin { position: absolute; left: 0; top: 0; display: grid; place-items: center; }
.mm-home, .isle-map .pin.home { width: 26px; height: 26px; border-radius: 9px; background: #fff; color: #e2574c; box-shadow: 0 2px 6px rgba(0,0,0,.35); display: grid; place-items: center; z-index: 2; border: 0; }
.mm-home svg, .isle-map .pin.home svg { width: 18px; height: 18px; stroke-width: 2.5; }
.mm-home.edge { width: 21px; height: 21px; border-radius: 7px; } .mm-home.edge svg { width: 15px; height: 15px; }
.mm-goal, .isle-map .pin.goal { width: 14px; height: 14px; border-radius: 50%; background: #ffd35a; border: 2px solid #fff; box-shadow: 0 0 8px #ffc930; }
.mm-goal.edge { width: 11px; height: 11px; }
.mm-boat, .isle-map .pin.boat { width: 11px; height: 11px; border-radius: 3px; background: #8a5a36; border: 2px solid #fff; }
.minimap .mm-n { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font: 800 10px var(--font); color: var(--ink); background: #fff; border-radius: 6px; padding: 1px 5px; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.minimap kbd { position: absolute; right: 6px; bottom: 5px; font: 800 10px var(--font); color: #fff; background: rgba(20,44,54,.6); padding: 1px 5px; border-radius: 5px; }
@media (pointer: coarse) { .minimap kbd { display: none; } }
@media (max-width: 480px) { .minimap { width: 100px; height: 100px; border-radius: 18px; } .minimap .mm-in { border-radius: 15px; } .mm-home { width: 22px; height: 22px; border-radius: 7px; } .mm-home svg { width: 15px; height: 15px; } }
body[data-welcome] .minimap, body[data-photo] .minimap { display: none; }
/* the whole island (M, or a tap on the little map) */
.card:has(.map-card) { width: min(640px, 100%); }
.map-card h2 { display: flex; align-items: center; gap: 8px; } .map-card h2 svg { width: 24px; height: 24px; color: var(--sea); }
.map-card .mapbox { margin: 12px auto 0; width: min(100%, calc(100vh - 230px)); cursor: crosshair; }
.isle-map .pin { z-index: 1; }
.isle-map .pin.me { width: 26px; height: 26px; border-radius: 0; background: none; border: 0; box-shadow: none; color: #ff5a47; filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1.5px #fff) drop-shadow(0 1px 2px rgba(0,0,0,.4)); z-index: 4; }
.isle-map .pin.goal { z-index: 3; }
.isle-map .lbl { padding: 2px 7px; border-radius: 8px; border: 0; font: 800 11px var(--font); color: #fff; background: rgba(20,44,54,.5); text-shadow: none; z-index: 2; }
.isle-map button.lbl { cursor: pointer; } .isle-map button.lbl:hover { background: var(--sea); }
.isle-map .lbl.home { background: #e2574c; z-index: 3; } .isle-map .lbl.boat { background: #8a5a36; }
/* "Your house" over the roof, seen from anywhere */
.hometag { left: 0; top: 0; display: flex; align-items: center; gap: 5px; color: #e2574c; font-size: 13px; transform-origin: 50% 100%; }
.hometag svg { width: 15px; height: 15px; stroke-width: 2.5; }
.hometag.hidden { display: none; }
.minimap { isolation: isolate; }
.map-card .btns .btn { white-space: nowrap; }
@media (max-width: 480px) { .map-card .btns .btn.main { flex: 1.6; } .map-card h2 { font-size: 22px; } }
/* in the game the island moves under the HUD every frame: a frosted blur behind each card would be computed again
   60 times a second (a real load on a laptop's GPU) — the cards are plain cream there, a touch more opaque */
body[data-view="play"] .glass, body[data-view="play"] #top, body[data-view="play"] .joy { backdrop-filter: none; -webkit-backdrop-filter: none; }
body[data-view="play"] .glass { background: rgba(255, 253, 247, 0.9); }
body[data-view="play"] #top { background: rgba(255, 253, 247, 0.93); }
.boattag { left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 0; color: #6b4428; line-height: 1.15; padding: 4px 11px 5px; }
.boattag b { font-size: 13px; } .boattag small { font-size: 11px; font-weight: 700; color: var(--ink2); }
.boattag.hidden { display: none; }
/* the title face has a single weight: never a fake bold of it */
html, body { font-synthesis: none; }
