:root { --sol1: #ffc145; --sol2: #ff4fa3; --luna1: #4fe3ff; --luna2: #8a5bff; --ink: #eafff6; --dim: #9fb8b4; --panel: rgba(8, 22, 30, .82); --line: rgba(160, 255, 220, .22); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #020608; color: var(--ink); overflow: hidden; overscroll-behavior: none; font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-user-select: none; user-select: none; }
#app { container: app / size; position: relative; height: 100dvh; width: min(100vw, calc(100dvh * .6)); margin: 0 auto; overflow: hidden; background: #04121a; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; padding: calc(env(safe-area-inset-top) + 10px) 12px 0; }
#score { position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 8px); text-align: center; font-size: 34px; font-weight: 800; text-shadow: 0 2px 8px #000a; font-variant-numeric: tabular-nums; }
#motes { position: absolute; left: 14px; top: calc(env(safe-area-inset-top) + 16px); font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 6px; text-shadow: 0 2px 6px #000a; }
.mote { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #ffe27a 45%, #ffa726); box-shadow: 0 0 8px #ffe27a; vertical-align: -1px; }
#pauseBtn { position: absolute; right: 12px; top: calc(env(safe-area-inset-top) + 8px); width: 44px; height: 44px; border-radius: 14px; background: rgba(8, 22, 30, .6); border: 1px solid var(--line); pointer-events: auto; font-size: 14px; }
#chain { position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 50px); text-align: center; font-weight: 800; font-size: 15px; color: #9dffd9; text-shadow: 0 2px 6px #000a; min-height: 18px; }
#meter { position: absolute; left: 10px; top: 22%; width: 14px; height: 34%; border-radius: 9px; background: rgba(0, 0, 0, .45); border: 1px solid var(--line); overflow: hidden; }
#meter i { position: absolute; left: 0; right: 0; bottom: 0; height: 0%; background: linear-gradient(0deg, var(--luna2), var(--luna1), var(--sol1), var(--sol2)); transition: height .15s; }
#meter b { position: absolute; left: 20px; bottom: -4px; font-size: 9px; letter-spacing: 2px; color: var(--dim); transform-origin: left bottom; transform: rotate(-90deg); white-space: nowrap; }
#meter { overflow: visible; } #meter i { border-radius: 8px; }
#phaseTag { display: none; position: absolute; right: 12px; top: calc(env(safe-area-inset-top) + 60px); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: rgba(8, 22, 30, .6); border: 2px solid var(--sol1); box-shadow: 0 0 14px var(--sol1); }
body.luna #phaseTag { border-color: var(--luna1); box-shadow: 0 0 14px var(--luna1); }
#phaseTag::before { content: "☀"; color: var(--sol1); } body.luna #phaseTag::before { content: "☾"; color: var(--luna1); }
#powers { position: absolute; right: 12px; top: calc(env(safe-area-inset-top) + 116px); display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
#powers span { font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 10px; background: rgba(8, 22, 30, .7); border: 1px solid var(--line); letter-spacing: .5px; }

/* ---------- screens ---------- */
/* studio logo intro: covers everything until it ends or is tapped; black like the video's own edges */
#intro { position: absolute; inset: 0; z-index: 50; background: #000; display: flex; align-items: center; justify-content: center; transition: opacity .45s; touch-action: manipulation; cursor: pointer; }
#intro video { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
#intro small { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 18px); text-align: center; font: 600 11px/1 ui-rounded, "SF Pro Rounded", system-ui, sans-serif; letter-spacing: 1.5px; color: #fff8; text-transform: uppercase; }
#intro.out { opacity: 0; pointer-events: none; }
#screen { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; padding: calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 18px); background: linear-gradient(180deg, rgba(2, 8, 12, .55), rgba(2, 8, 12, .82)); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
#screen.on { display: flex; }
#screen.title { background: linear-gradient(180deg, rgba(2, 8, 12, .15), rgba(2, 8, 12, .7) 70%); backdrop-filter: none; -webkit-backdrop-filter: none; justify-content: space-between; background-size: cover; background-position: center; }
#screen.center { justify-content: center; }
.logo { margin-top: 7dvh; text-align: center; font-weight: 900; font-size: clamp(44px, 14vmin, 76px); line-height: .92; letter-spacing: 1px; filter: drop-shadow(0 6px 18px #000c); }
.logo img { width: min(92%, 440px); display: block; margin: 0 auto; }
.logo .a { background: linear-gradient(90deg, var(--sol1), var(--sol2)); -webkit-background-clip: text; background-clip: text; color: transparent; display: block; }
.logo .b { background: linear-gradient(90deg, var(--luna1), var(--luna2)); -webkit-background-clip: text; background-clip: text; color: transparent; display: block; }
.tag { text-align: center; color: var(--dim); font-size: 13px; letter-spacing: 3px; margin-top: 10px; text-transform: uppercase; }
.col { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 380px; align-items: stretch; }
.btn { padding: 15px 18px; border-radius: 18px; font-weight: 800; font-size: 18px; letter-spacing: .5px; background: var(--panel); border: 1px solid var(--line); transition: transform .08s; }
.btn:active { transform: scale(.96); }
.btn.main { font-size: 24px; padding: 18px; color: #06131a; background: linear-gradient(90deg, var(--sol1), var(--sol2) 48%, var(--luna2) 52%, var(--luna1)); border: 0; box-shadow: 0 8px 30px rgba(255, 79, 163, .35), 0 8px 30px rgba(79, 227, 255, .25); }
.btn.sm { font-size: 14px; padding: 11px 10px; }
.btn small { display: block; font-size: 11px; font-weight: 600; color: var(--dim); letter-spacing: 0; margin-top: 2px; }
.btn.main small { color: #06131acc; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats { display: flex; justify-content: center; gap: 18px; font-weight: 800; font-size: 15px; color: var(--ink); text-shadow: 0 2px 6px #000a; }
.stats span b { color: var(--sol1); }
h2 { margin: 4px 0 12px; font-size: 26px; letter-spacing: 1px; text-align: center; }
.panel { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 16px; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 8px; padding: 2px 2px 12px; -webkit-overflow-scrolling: touch; }
.row { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 11px 13px; text-align: left; width: 100%; }
.row .g { flex: 1; min-width: 0; } .row .g b { display: block; font-size: 15px; } .row .g small { color: var(--dim); font-size: 12px; }
.row.done { border-color: rgba(255, 226, 122, .6); } .row.locked { opacity: .55; }
.row .r { font-weight: 800; font-size: 13px; white-space: nowrap; }
.sw { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 20px; border: 2px solid #fff3; }
.bar { height: 7px; border-radius: 4px; background: #0008; margin-top: 6px; overflow: hidden; } .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--luna1), var(--sol1)); }
.tabs { display: flex; gap: 8px; margin-bottom: 10px; width: 100%; max-width: 420px; } .tabs .btn { flex: 1; } .tabs .btn.sel { border-color: var(--sol1); color: var(--sol1); }
.big { font-size: 58px; font-weight: 900; text-align: center; line-height: 1; font-variant-numeric: tabular-nums; }
.newbest { text-align: center; font-weight: 900; letter-spacing: 3px; color: var(--sol1); animation: pulse .8s infinite alternate; }
@keyframes pulse { to { color: var(--luna1); transform: scale(1.06); } }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 5px 14px; font-size: 14px; margin: 12px 0; } .kv span { color: var(--dim); } .kv b { text-align: right; }
.note { color: var(--dim); font-size: 12px; text-align: center; margin: 8px 0 0; line-height: 1.4; }
.foot { width: 100%; max-width: 420px; margin-top: 10px; display: flex; gap: 8px; } .foot .btn { flex: 1; }
input.name { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: #0008; color: var(--ink); font: inherit; font-weight: 800; font-size: 18px; -webkit-user-select: text; user-select: text; }
.how { display: grid; gap: 10px; font-size: 15px; line-height: 1.35; } .how b { color: var(--sol1); } .how i { font-style: normal; color: var(--luna1); font-weight: 800; }
.count { height: 8px; border-radius: 4px; background: #0008; overflow: hidden; margin: 12px 0; } .count i { display: block; height: 100%; width: 100%; background: var(--sol1); transform-origin: left; animation: shrink 5s linear forwards; }
@keyframes shrink { to { transform: scaleX(0); } }

#toasts { position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 84px); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 5; }
.toast { background: rgba(8, 22, 30, .92); border: 1px solid rgba(255, 226, 122, .7); border-radius: 14px; padding: 8px 14px; font-size: 13px; font-weight: 800; animation: tin .25s ease-out, tout .4s 2.8s forwards; box-shadow: 0 6px 20px #0008; }
.toast small { display: block; color: var(--dim); font-weight: 600; }
@keyframes tin { from { transform: translateY(-14px); opacity: 0; } } @keyframes tout { to { opacity: 0; transform: translateY(-10px); } }

/* ---------- v2: hearts, level progress, form buttons, level select, tutorial cards ---------- */
#hearts { position: absolute; left: 14px; top: calc(env(safe-area-inset-top) + 42px); font-size: 20px; letter-spacing: 3px; color: #ff5f7a; text-shadow: 0 2px 6px #000a; }
#hearts i { font-style: normal; opacity: .25; }
#prog { position: absolute; left: 0; right: 0; top: 0; height: 5px; background: #0008; } #prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb347, #9be8ff, #5fe0b0, #ffd27a); }
#powers { top: calc(env(safe-area-inset-top) + 62px); }
/* the element pad is in the play-hand corner; the Bloom flower is in the OPPOSITE lower corner (Chris, 2026-11-12) */
#forms { position: absolute; right: calc(env(safe-area-inset-right) + 12px); bottom: calc(env(safe-area-inset-bottom) + 14px); width: 144px; pointer-events: none; }
#forms.left { right: auto; left: calc(env(safe-area-inset-left) + 12px); }
#pad { position: relative; width: 144px; height: 144px; border-radius: 50%; pointer-events: auto; touch-action: none; background: radial-gradient(circle, rgba(8, 22, 30, .5) 0 62%, transparent 64%); }
#pad button, #pad i { position: absolute; width: 54px; height: 54px; border-radius: 50%; box-sizing: border-box; }
#pad .u { left: 45px; top: 0; } #pad .d { left: 45px; bottom: 0; } #pad .l { left: 0; top: 45px; } #pad .r { right: 0; top: 45px; }   /* 54 px buttons on a 144 px pad: 36 px between opposite buttons (was 60 on 168: 48) */
#pad i { border: 2px dashed #fff2; transform: scale(.55); }
#pad button { background: rgba(8, 22, 30, .78); border: 3px solid #fff3; font-size: 24px; display: grid; place-items: center; padding: 0; transition: transform .1s; opacity: .75; touch-action: none; }
#pad button img { width: 100%; height: 100%; border-radius: 50%; display: block; pointer-events: none; }
#pad button.on { opacity: 1; transform: scale(1.16); border-color: var(--c); box-shadow: 0 0 18px var(--c); }
#pad button.cool { filter: grayscale(.8) brightness(.7); }
#forms small { display: block; margin-bottom: 6px; text-align: center; font-size: 10px; line-height: 1.35; font-weight: 800; letter-spacing: 1.5px; color: var(--dim); text-shadow: 0 1px 4px #000; }
#forms small span { color: #fff; font-size: 12px; }
.lv { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; }
.lv .n { width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center; font-weight: 900; font-size: 22px; background: linear-gradient(135deg, var(--sol1), var(--sol2)); color: #06131a; }
.lv .g { flex: 1; } .lv .g b { display: block; font-size: 17px; } .lv .g small { color: var(--dim); font-size: 12px; font-weight: 600; }
.lv .s { font-size: 20px; letter-spacing: 2px; color: #ffe27a; white-space: nowrap; } .lv .s i { font-style: normal; opacity: .22; }
.lv.locked { opacity: .45; } .lv.locked .n { background: #223; color: var(--dim); }
.starsBig { text-align: center; font-size: 54px; letter-spacing: 8px; color: #ffe27a; text-shadow: 0 0 22px #ffe27a88; } .starsBig i { font-style: normal; opacity: .2; }
.tutIcon { font-size: 44px; text-align: center; margin-bottom: 4px; }
.tutText { font-size: 16px; line-height: 1.45; text-align: center; margin: 0 0 14px; }
.unlock { text-align: center; font-weight: 800; color: var(--luna1); margin: 8px 0; }
#phaseTag { display: none !important; }

/* ---------- v3: in-world tip caption, world list ---------- */
#tip { position: absolute; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 92px); width: max-content; max-width: 88%; background: rgba(8, 22, 30, .9); border: 1px solid rgba(255, 255, 255, .55); border-radius: 16px; padding: 9px 14px; text-align: center; box-shadow: 0 6px 22px #000a; animation: tin .25s ease-out; }
#tip b { display: block; font-size: 16px; color: #fff6b0; } #tip span { font-size: 14px; line-height: 1.3; }
.world { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 12px; }
.world.locked { opacity: .45; }
.world h3 { margin: 0 0 2px; font-size: 18px; } .world p { margin: 0 0 10px; font-size: 12px; color: var(--dim); }
.world .st { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.world .st button { padding: 10px 4px; border-radius: 14px; background: #0006; border: 1px solid var(--line); font-weight: 800; font-size: 15px; }
.world .st button small { display: block; font-size: 10px; color: var(--dim); font-weight: 700; letter-spacing: .5px; }
.world .st button .s { display: block; font-size: 13px; color: #ffe27a; letter-spacing: 1px; } .world .st button .s i { font-style: normal; opacity: .22; }
.world .st button.locked { opacity: .4; } .world .st button.next { border-color: var(--sol1); box-shadow: 0 0 12px rgba(255, 193, 69, .4); }
#tip { top: auto; bottom: calc(env(safe-area-inset-bottom) + 236px); }

/* ---------- v5: shop preview, four tabs, ending ---------- */
#prev { width: 132px; height: 132px; flex: none; margin: -6px 0 4px; }
.tabs .btn.sm { padding: 10px 2px; font-size: 12px; }
#screen.ending .logo { margin-top: 9dvh; }
#prev { position: static; inset: auto; display: block; }
#screen.ending { background-position: center bottom; }
#screen.ending { background-size: auto 150%; background-position: center 93%; } /* zoom so Nim sits in the gap above the panel on short and tall screens alike */

/* ---------- v6: volume sliders ---------- */
.row.vol .g { display: block; } .row.vol .r { min-width: 34px; text-align: right; font-size: 16px; }
input[type=range] { width: 100%; margin: 10px 0 2px; accent-color: #ffc145; height: 28px; touch-action: pan-x; }

/* ---------- tap-to-continue tips ---------- */
#tipTap { position: absolute; inset: 0; pointer-events: auto; z-index: 3; background: rgba(2, 8, 12, .28); }
#tip { z-index: 4; pointer-events: none; }
#tip em { display: block; margin-top: 6px; font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: 2px; color: #9dffd9; animation: pulse .8s infinite alternate; }


/* ---------- hidden bonus stages in the world list ---------- */
.world .bonus { display: block; width: 100%; margin-top: 8px; padding: 9px 4px; border-radius: 14px; background: linear-gradient(90deg, rgba(255, 226, 122, .16), rgba(155, 232, 255, .16)); border: 1px solid rgba(255, 226, 122, .55); font-weight: 800; font-size: 15px; }
.world .bonus small { display: block; font-size: 10px; color: var(--dim); font-weight: 700; letter-spacing: .5px; }
.world .bonus.won { border-color: #9dffd9; }
.world p.hid { margin: 8px 0 0; font-size: 11px; color: var(--dim); text-align: center; opacity: .8; }

/* ---------- Uprooted title screen (2026-11-12) ---------- */
/* background: 887 x 1774 with Nim standing left of centre, feet at 59% of its height. Pinned low so that on squat screens the
   spare picture is cut from the sky, not from under Nim, and he stays above the mode buttons. */
#screen.title { background-size: cover; background-color: #14183c; background-position: center top, center calc(80% + 3cqh); padding-left: 14px; padding-right: 14px; }
#screen.title .thead { width: 100%; }
#screen.title .logo { margin-top: 1.6dvh; filter: drop-shadow(0 0 1px rgba(255, 236, 176, .8)) drop-shadow(0 5px 10px rgba(0, 0, 0, .85)); } /* thin warm rim so the dark root letters stand off the night sky */
#screen.title .logo img { width: min(98%, 470px); }
#screen.title .logo .a { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; letter-spacing: 3px; background: linear-gradient(180deg, #fff1c4, #d9a441 55%, #8a5a1c); -webkit-background-clip: text; background-clip: text; color: transparent; }
#screen.title .tag { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: -5px; text-transform: none; letter-spacing: 0; }
#screen.title .tag span { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-style: italic; font-size: clamp(17px, 5vmin, 23px); letter-spacing: .6px; white-space: nowrap; background: linear-gradient(180deg, #fff6d8, #e9c46a 60%, #c08a2e); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 6px #000c); }
#screen.title .tag i { flex: 0 1 46px; height: 1px; background: linear-gradient(90deg, transparent, #e9c46a); } #screen.title .tag i:last-child { transform: scaleX(-1); }
#screen.title .tmenu { max-width: 400px; gap: 12px; }
#screen.title .thead { display: flex; flex-direction: column; align-items: center; }
#screen.title .stats { align-self: flex-end; margin-right: 3%; font-size: 13.5px; background: rgba(4, 16, 20, .55); border: 1px solid rgba(233, 196, 106, .28); border-radius: 999px; padding: 7px 16px; gap: 16px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
#screen.title .stats span b { color: #f3d27a; }
/* Play: Memento's living-wood plate when present, a jewel button otherwise */
#screen.title .btn.main { position: relative; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; color: #fff4cf; border: 1px solid #e9c46a; border-radius: 999px; padding: 16px 18px 15px;
  background: radial-gradient(120% 160% at 50% 0%, #2fd3a4 0%, #0e7d6b 42%, #07433f 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .28), inset 0 -10px 22px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .55), 0 0 26px rgba(64, 230, 180, .28); }
#screen.title .btn.main span { display: block; font-size: 30px; font-weight: 700; letter-spacing: 9px; margin-right: -9px; line-height: 1; text-shadow: 0 2px 0 #06302b, 0 0 16px rgba(255, 240, 190, .55); }
#screen.title .btn.main small { color: #cfeee2; font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif; font-size: 11.5px; margin-top: 6px; letter-spacing: .4px; opacity: .92; }
#screen.title .btn.main.plate { border: 0; border-radius: 0; background-color: transparent; background-size: 100% 100%; background-repeat: no-repeat; box-shadow: none; aspect-ratio: 900 / 268; padding: 0 16%; display: flex; flex-direction: column; justify-content: center; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .6)); margin: -6px -10px; width: calc(100% + 20px); animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .6)) drop-shadow(0 0 14px rgba(80, 240, 190, .45)); } }
#screen.title .btn.sm { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-weight: 700; font-size: 15px; letter-spacing: .6px; color: #f6e7bd; padding: 12px 6px; border-radius: 14px; border: 1px solid rgba(233, 196, 106, .45);
  background: linear-gradient(180deg, rgba(20, 58, 54, .86), rgba(6, 26, 28, .9)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 4px 12px rgba(0, 0, 0, .45); }
#screen.title .grid3.plates .btn.sm { border: 0; background: var(--plate) center / 100% 100% no-repeat; box-shadow: none; padding: 15px 6px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); }

/* ---------- Story / Endless / Challenge on the title ---------- */
#screen.title .modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#screen.title .btn.mode { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; color: #fff4cf; border: 0; border-radius: 0; background: url(../assets/img/btn_small.png) center / 100% 100% no-repeat; box-shadow: none; padding: 13px 8px 12px; filter: drop-shadow(0 5px 10px rgba(0, 0, 0, .55)); }
#screen.title .btn.mode b { display: block; font-size: 17px; letter-spacing: 2.5px; line-height: 1.1; text-shadow: 0 2px 0 #06302b; }
#screen.title .btn.mode small { font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif; font-size: 10.5px; font-weight: 600; color: #cfeee2; margin-top: 3px; letter-spacing: .2px; }
#screen.title .btn.mode.locked { filter: grayscale(.75) brightness(.66) drop-shadow(0 5px 10px rgba(0, 0, 0, .55)); }
#screen.title .thead .stats { display: none; align-self: center; margin: 8px 0 0; }
@container app (max-height: 720px) {   /* squat phones: the stars pill moves up under the slogan and the menu tightens, so Nim stays in view */
  #screen.title { background-position: center top, center calc(100% + 3cqh); }
  #screen.title .thead .stats { display: flex; } #screen.title .tmenu .stats { display: none; }
  #screen.title .tmenu { gap: 8px; }
  #screen.title .logo img { width: min(86%, 400px); }
  #screen.title .btn.main.plate { width: 84%; margin: -4px 0; align-self: center; }
  #screen.title .btn.main span { font-size: 24px; letter-spacing: 7px; margin-right: -7px; }
  #screen.title .btn.mode { padding: 9px 6px 8px; } #screen.title .btn.mode b { font-size: 15px; }
  #screen.title .btn.sm, #screen.title .grid3.plates .btn.sm { padding: 10px 6px; font-size: 14px; }
}

/* ---------- every other menu in the title screen's style (pause, results, revive, shop, settings ...) ---------- */
:root { --gold: #e9c46a; --cream: #f6e7bd; --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; }
#screen h2 { font-family: var(--serif); font-weight: 700; font-size: 28px; letter-spacing: 1.5px; margin: 2px 0 14px; background: linear-gradient(180deg, #fff6d8, #e9c46a 60%, #c08a2e); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .8)); }
#screen h2::after { content: ""; display: block; height: 1px; width: 64%; margin: 9px auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
#screen .panel { background: linear-gradient(180deg, rgba(16, 50, 47, .96), rgba(5, 20, 22, .97)); border: 1px solid rgba(233, 196, 106, .6); border-radius: 26px; padding: 20px 17px 17px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 0 0 5px rgba(6, 26, 28, .85), inset 0 0 0 6px rgba(233, 196, 106, .25); }
#screen .btn { font-family: var(--serif); font-weight: 700; letter-spacing: .6px; color: var(--cream); border: 1px solid rgba(233, 196, 106, .45); background: linear-gradient(180deg, rgba(20, 58, 54, .92), rgba(6, 26, 28, .95)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 4px 12px rgba(0, 0, 0, .45); }
#screen .btn small { font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif; color: #cfeee2; opacity: .88; }
#screen .btn.main { color: #fff4cf; border: 0; border-radius: 0; background: url(../assets/img/btn_small.png) center / 100% 100% no-repeat; box-shadow: none; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .55)); font-size: 19px; letter-spacing: 3px; padding: 17px 14px 16px; text-shadow: 0 2px 0 #06302b, 0 0 14px rgba(255, 240, 190, .45); }
#screen .btn.main small { color: #cfeee2; letter-spacing: .3px; text-shadow: none; }
/* a main button that has a row to itself gets the big living-wood plate */
#screen .col > .btn.main { background-image: url(../assets/img/btn_play.png); aspect-ratio: 900 / 268; padding: 0 15%; display: flex; flex-direction: column; justify-content: center; font-size: 25px; letter-spacing: 7px; margin: -5px -9px; width: calc(100% + 18px); }
#screen .col > .btn.main small { font-size: 11px; margin-top: 5px; letter-spacing: .3px; }
#screen .tabs .btn.sel, #screen .tracks .btn.sel { border-color: var(--gold); color: #fff; background: linear-gradient(180deg, rgba(52, 128, 104, .95), rgba(14, 66, 58, .96)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 0 12px rgba(233, 196, 106, .3); }
#screen .big { font-family: var(--serif); background: linear-gradient(180deg, #fff6d8, #e9c46a 60%, #c08a2e); -webkit-background-clip: text; background-clip: text; color: transparent; }
#screen .kv { border-top: 1px solid rgba(233, 196, 106, .22); border-bottom: 1px solid rgba(233, 196, 106, .22); padding: 10px 2px; } #screen .kv b { color: var(--cream); }
#screen .unlock { font-family: var(--serif); color: #9dffd9; font-size: 16px; }
#screen .tlabel { font-family: var(--serif); color: var(--gold); font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; text-align: center; margin: 4px 0 6px; }
#screen .tracks { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 4px; } #screen .tracks .btn { padding: 10px 6px; font-size: 14px; } #screen .tracks .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
@container app (max-height: 600px) {
  #screen.title .tmenu { gap: 6px; }
  #screen.title .btn.mode { padding: 7px 6px 6px; }
  #screen.title .btn.sm, #screen.title .grid3.plates .btn.sm { padding: 7px 6px; font-size: 13px; }
  #screen.title .grid3 { gap: 6px; }
}
#screen.center .panel { max-height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; }   /* the pause menu is long: it scrolls on short phones */
#screen .newbest { font-family: var(--serif); color: var(--gold); letter-spacing: 4px; }
#screen textarea.code { width: 100%; box-sizing: border-box; resize: none; font: 11px/1.35 ui-monospace, Menlo, monospace; color: var(--cream); background: rgba(2, 10, 12, .7); border: 1px solid rgba(233, 196, 106, .4); border-radius: 12px; padding: 9px; word-break: break-all; -webkit-user-select: text; user-select: text; }
#screen .sw.pic { border-radius: 12px; border-color: rgba(233, 196, 106, .45); width: 52px; height: 52px; }
#screen .themes { display: flex; gap: 10px; justify-content: center; margin: 0 0 10px; }
#screen .tdot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; background: rgba(8, 22, 30, .78); border: 2px solid #fff3; opacity: .7; padding: 0; }
#screen .tdot.sel { opacity: 1; border-color: var(--c); box-shadow: 0 0 12px var(--c); transform: scale(1.12); }
/* The Bloom gauge is a flower in a lower corner (the element pad's side, just above the pad once there is one). It only
   takes taps when in full blossom; before that touches pass through to the game. The old bar on the left is retired. */
#meter { display: none; }
#bloomBtn { position: absolute; right: calc(env(safe-area-inset-right) + 8px); bottom: calc(env(safe-area-inset-bottom) + 12px); width: 92px; height: 92px; padding: 0; border: 0; background: none; pointer-events: none; touch-action: none; opacity: .92; }
#bloomBtn.side-left { right: auto; left: calc(env(safe-area-inset-left) + 8px); }
#bloomBtn canvas { position: static; width: 92px; height: 92px; display: block; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .55)); transition: transform .25s; }
#bloomBtn b { position: absolute; left: 0; right: 0; bottom: -6px; text-align: center; font: 800 10px/1 ui-rounded, "SF Pro Rounded", system-ui, sans-serif; letter-spacing: 2px; color: #fff; text-shadow: 0 1px 4px #000; opacity: 0; transition: opacity .2s; }
#bloomBtn.ready { pointer-events: auto; opacity: 1; } #bloomBtn.ready b { opacity: 1; }
#bloomBtn.ready canvas { animation: bloompulse .9s ease-in-out infinite alternate; }
#bloomBtn.off { display: none; }
@keyframes bloompulse { to { transform: scale(1.1); filter: drop-shadow(0 0 14px rgba(255, 200, 120, .95)); } }
.tiltbar { position: relative; height: 14px; margin: 8px 0 4px; border-radius: 7px; background: rgba(0, 0, 0, .45); border: 1px solid var(--line); }
.tiltbar u { position: absolute; left: 44%; right: 44%; top: 0; bottom: 0; background: rgba(255, 255, 255, .14); }                 /* the dead zone */
.tiltbar i { position: absolute; top: -3px; width: 18px; height: 18px; margin-left: -9px; left: 50%; border-radius: 50%; background: #ffc145; box-shadow: 0 0 10px #ffc145; transition: left .06s linear; }
.tiltbar.off i { background: #667; box-shadow: none; }
