:root {
  --bg: #14081f; --panel: rgba(30, 12, 44, 0.92); --panel2: rgba(52, 22, 72, 0.92); --line: rgba(255, 210, 160, 0.16);
  --ink: #fff4e6; --muted: #cdb8d8; --gold: #ffb703; --pink: #ff4fa3; --mint: #3ddc6b; --red: #ff4d4d; --on-gold: #2a1300;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body.touch { -webkit-user-select: none; user-select: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: 0.45; cursor: default; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 12px; }
#loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--bg); z-index: 50; }
#loading b { font-size: 34px; letter-spacing: 6px; font-weight: 900; color: var(--gold); }
#loading span { color: var(--muted); }

/* ------------------------------------------------------------ screens */
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.screen { position: absolute; inset: 0; display: none; pointer-events: auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 70% 40%, rgba(20, 8, 31, 0.35), rgba(20, 8, 31, 0.86)); }
.screen.active { display: flex; }
.screen > * { margin: auto; }
#title.screen { background: linear-gradient(90deg, rgba(20, 8, 31, 0.95) 0%, rgba(20, 8, 31, 0.7) 45%, rgba(20, 8, 31, 0.05) 100%); gap: 24px; align-items: center; }
.t-main { max-width: 500px; width: 100%; margin: auto auto auto clamp(0px, 5vw, 80px); }
.kicker { color: var(--gold); letter-spacing: 1.5px; text-transform: uppercase; font-size: 12.5px; font-weight: 800; margin: 0; }
.logo { margin: 6px 0 10px; font-size: clamp(46px, 8.5vw, 88px); line-height: 0.88; font-weight: 900; letter-spacing: 1px;
  background: linear-gradient(90deg, #ffd166, #ff8a1f 45%, #ff4fa3); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 18px rgba(255, 79, 163, 0.35)); }
.logo span { display: inline-block; }
.lead { color: #f0dfee; font-size: 15.5px; line-height: 1.5; margin: 0 0 16px; }
.challenge:empty { display: none; }
.challenge { background: rgba(255, 183, 3, 0.12); border: 1px solid rgba(255, 183, 3, 0.45); padding: 8px 12px; border-radius: 10px; margin-bottom: 12px; }
.menu { display: flex; flex-direction: column; gap: 8px; }
.menu .row { display: flex; gap: 8px; } .menu .row button { flex: 1; }
.menu button, .buttons button, .sheet button.primary { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 17px; font-weight: 800; text-align: left; transition: transform 0.1s, border-color 0.15s; }
.menu button:hover, .buttons button:hover { border-color: var(--gold); }
.menu button:active, .buttons button:active { transform: translateY(1px); }
button.primary { background: linear-gradient(90deg, #ffb703, #ff8a1f) !important; color: var(--on-gold) !important; border-color: transparent !important; }
button.ghost { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; color: var(--muted); }
.disclaimer { color: var(--muted); font-size: 12px; margin-top: 14px; line-height: 1.45; } .disclaimer a { color: var(--muted); }
.t-side { width: 320px; max-width: 100%; margin: auto clamp(0px, 4vw, 60px) auto auto; display: flex; flex-direction: column; gap: 10px; }
.t-side > div:empty { display: none; }
.gn-board { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }

.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px 20px; width: 100%; max-width: 760px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sheet.wide { max-width: 1020px; } .sheet.narrow { max-width: 380px; }
.sheet header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sheet h2 { margin: 0; font-size: 26px; font-weight: 900; } .sheet h2 small { font-size: 16px; margin-left: 6px; } .sheet h2 em { font-style: normal; font-size: 13px; background: var(--pink); color: #fff; padding: 2px 8px; border-radius: 99px; vertical-align: middle; }
.sheet h4 { margin: 16px 0 8px; font-size: 12.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--gold); }
.big { width: 100%; margin-top: 16px; padding: 15px !important; text-align: center !important; font-size: 19px !important; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.choice { text-align: left; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.choice b { font-size: 15px; } .choice small { color: var(--muted); font-size: 12.5px; } .choice span { color: var(--gold); font-weight: 800; font-size: 14px; }
.choice.on { border-color: var(--gold); background: rgba(255, 183, 3, 0.12); box-shadow: inset 0 0 0 1px var(--gold); }
.choice[style*="--c"] b { color: var(--c); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 99px; padding: 6px 13px; font-weight: 800; font-size: 14px; }
.chip.on { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin: 6px 0 0; }

/* report */
.rh { margin: 2px 0; font-size: 32px; font-weight: 900; }
.stars { color: var(--gold); font-size: 30px; letter-spacing: 4px; }
.score small { display: block; color: var(--muted); letter-spacing: 2px; font-size: 12px; } .score b { font-size: 42px; font-weight: 900; }
.rgrid { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 16px; margin-top: 8px; }
.kv { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.kv li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 4px 0; color: var(--muted); }
.kv li b { color: var(--ink); } .kv li.good b { color: var(--mint); } .kv li.bad b { color: var(--red); }
.reviews { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.reviews li { background: rgba(255, 255, 255, 0.05); border-left: 3px solid var(--pink); border-radius: 6px; padding: 7px 10px; font-size: 13.5px; line-height: 1.4; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.buttons button { text-align: center; min-width: 120px; }
.e-board { color: var(--muted); font-size: 14px; min-height: 1em; }
.help { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; } .help p { font-size: 14px; line-height: 1.5; margin: 0 0 8px; } .help .small { font-size: 12.5px; color: var(--muted); }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* ------------------------------------------------------------ HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud > * { pointer-events: auto; }
.top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(20, 8, 31, 0.92), rgba(20, 8, 31, 0)); pointer-events: none; }
.top > * { pointer-events: auto; }
.t-night { display: flex; flex-direction: column; line-height: 1.1; background: var(--panel); border-radius: 12px; padding: 6px 10px; }
.t-night b { font-size: 15px; font-weight: 900; } .t-night span { font-size: 12px; font-weight: 800; color: var(--c); }
.t-clock { display: flex; align-items: center; gap: 6px; background: var(--panel); border-radius: 12px; padding: 4px 6px 4px 10px; }
.t-clock b { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 56px; }
.speed { display: flex; gap: 2px; } .speed button { background: rgba(255, 255, 255, 0.07); border: 0; border-radius: 7px; padding: 5px 8px; font-size: 12px; font-weight: 900; }
.speed button.on { background: var(--gold); color: var(--on-gold); }
.t-stats { display: flex; gap: 8px; align-items: center; flex: 1; flex-wrap: wrap; }
.stat { display: flex; align-items: center; gap: 5px; background: var(--panel); border-radius: 12px; padding: 6px 10px; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat i { font-style: normal; color: var(--gold); } .stat small { color: var(--muted); font-weight: 700; font-size: 11.5px; } .stat.neg b { color: var(--red); }
.stat.meter .bar { width: 90px; height: 9px; border-radius: 9px; background: rgba(255, 255, 255, 0.1); overflow: hidden; } .stat.meter u { display: block; height: 100%; transition: width 0.4s, background 0.4s; }
.stat.warn:empty { display: none; } .stat.warn { gap: 8px; color: #ffd23f; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: 0.6; } }
.t-btns { display: flex; gap: 6px; }
.t-menu { background: var(--panel); border: 0; border-radius: 12px; width: 40px; height: 36px; font-size: 18px; }
.now { position: absolute; top: calc(max(8px, env(safe-area-inset-top)) + 52px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; background: rgba(30, 12, 44, 0.75); border-radius: 99px; padding: 5px 14px; font-size: 13px; white-space: nowrap; pointer-events: none !important; }
.now small { color: var(--muted); } .now.off .eq { opacity: 0.3; } .now.off .eq i { animation: none; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; } .eq i { width: 3px; background: var(--gold); animation: eq 0.6s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: 0.2s; } .eq i:nth-child(3) { animation-delay: 0.4s; }
@keyframes eq { from { height: 3px; } to { height: 12px; } }
body.closing .now { display: none; }

.cards { position: absolute; top: calc(max(8px, env(safe-area-inset-top)) + 58px); right: max(10px, env(safe-area-inset-right)); width: min(330px, 42vw); display: flex; flex-direction: column; gap: 8px; max-height: calc(100% - 180px); overflow-y: auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 12px; padding: 9px 11px 10px; animation: cin 0.35s cubic-bezier(.2, 1.4, .4, 1); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.card.flash { animation: flash 0.6s; }
@keyframes cin { from { transform: translateX(30px); opacity: 0; } }
@keyframes flash { 50% { box-shadow: 0 0 0 3px var(--c); } }
.card header { display: flex; align-items: center; gap: 8px; cursor: pointer; } .card header i { font-style: normal; font-size: 20px; } .card header b { font-size: 15px; font-weight: 900; }
.card p { margin: 4px 0 8px; font-size: 13px; line-height: 1.4; color: #f0dfee; }
.opts { display: grid; gap: 5px; } .opts button { text-align: left; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; font-weight: 800; font-size: 13.5px; }
.opts button:hover:not(:disabled) { border-color: var(--c); } .opts small { color: var(--gold); font-weight: 800; margin-left: 4px; } .opts button:disabled small { color: var(--muted); }
.timer { height: 4px; background: rgba(255, 255, 255, 0.1); border-radius: 4px; overflow: hidden; margin-top: 8px; } .timer u { display: block; height: 100%; background: var(--c); width: 100%; transition: width 0.15s linear; }

.toasts { position: absolute; top: calc(max(8px, env(safe-area-inset-top)) + 92px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 5px; pointer-events: none !important; width: min(520px, 90vw); }
.toast { background: rgba(30, 12, 44, 0.9); border-radius: 10px; padding: 6px 12px; font-weight: 800; font-size: 13.5px; text-align: center; transition: opacity 0.5s; border: 1px solid var(--line); }
.toast.good { color: var(--mint); } .toast.bad { color: var(--red); } .toast.out { opacity: 0; }

.dock { position: absolute; left: 50%; transform: translateX(-50%); bottom: max(10px, env(safe-area-inset-bottom)); display: flex; gap: 6px; background: var(--panel); padding: 6px; border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); }
.dock button { display: flex; flex-direction: column; align-items: center; gap: 1px; background: transparent; border: 0; border-radius: 12px; padding: 6px 12px; font-size: 21px; min-width: 62px; }
.dock button span { font-size: 11.5px; font-weight: 800; color: var(--muted); }
.dock button.on { background: rgba(255, 183, 3, 0.18); } .dock button.on span { color: var(--gold); }
.panel { position: absolute; right: max(10px, env(safe-area-inset-right)); bottom: calc(max(10px, env(safe-area-inset-bottom)) + 76px); width: min(380px, 44vw); max-height: calc(100% - 170px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
.panel header { display: flex; justify-content: space-between; align-items: center; position: sticky; top: -10px; background: var(--panel); margin: -10px -14px 6px; padding: 10px 14px 6px; z-index: 1; }
.panel h3 { margin: 0; font-size: 17px; font-weight: 900; } .panel .x { background: transparent; border: 0; font-size: 18px; color: var(--muted); }
.panel h5 { margin: 12px 0 6px; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--gold); } .panel h5 small { text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 600; }
.np { background: rgba(255, 183, 3, 0.1); border: 1px solid rgba(255, 183, 3, 0.35); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; } .np b { display: block; font-size: 16px; } .np small { color: var(--muted); }
.row2 { display: flex; gap: 8px; align-items: center; margin: 8px 0; } .row2 label { font-weight: 800; font-size: 14px; white-space: nowrap; }
.row2 > button { flex: 1; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 12px; padding: 9px; font-weight: 900; }
.big2 { background: linear-gradient(90deg, #ff4fa3, #ff8a1f) !important; border: 0 !important; color: #fff; } .big2 small { display: block; font-weight: 700; font-size: 11.5px; opacity: 0.9; }
.chk { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--muted); margin: 8px 0; }
.queue { margin: 0; padding-left: 20px; font-size: 13.5px; } .queue li { padding: 3px 0; } .queue small { color: var(--muted); } .queue button { background: none; border: 0; color: var(--muted); float: right; }
.queue .empty { color: var(--muted); list-style: none; margin-left: -20px; }
.songs { display: grid; gap: 5px; } .song { text-align: left; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; }
.song b { display: block; font-size: 14px; } .song small { color: var(--muted); font-size: 12px; } .song:hover { border-color: var(--gold); }
.kv2 { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 14px; background: rgba(255, 255, 255, 0.04); border-radius: 12px; padding: 8px 12px; } .kv2 span { color: var(--muted); } .kv2 b { text-align: right; }
.power { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 800; } .power .bar { flex: 1; height: 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.1); overflow: hidden; } .power u { display: block; height: 100%; }
.panel input[type=range] { width: 100%; accent-color: var(--gold); }
.slots { display: grid; gap: 6px; } .slot { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; background: rgba(255, 255, 255, 0.04); border: 1px dashed var(--line); border-radius: 12px; padding: 7px 10px; }
.slot.built { border-style: solid; } .slot i { font-style: normal; font-size: 20px; } .slot b { font-size: 14px; } .slot small { display: block; color: var(--muted); font-size: 12px; } .slot em { color: var(--red); font-style: normal; }
.slot button, .stepper button { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; font-weight: 800; }
#stallpick .choices { grid-template-columns: 1fr; }
.staff .srow { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; padding: 8px 0; } .staff i { font-style: normal; font-size: 20px; } .staff small { display: block; color: var(--muted); font-size: 12px; }
.stepper { display: flex; align-items: center; gap: 8px; } .stepper b { min-width: 18px; text-align: center; font-size: 16px; } .stepper button { width: 34px; height: 34px; padding: 0; font-size: 18px; }

.swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.swc { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); padding: 0; }
.swc.on { border-color: #fff; box-shadow: 0 0 0 2px var(--gold); }

/* ------------------------------------------------------------ in-night extras */
.t-night em { font-style: normal; color: var(--muted); font-weight: 700; }
.opts .od { display: block; color: var(--muted); font-weight: 600; font-size: 12px; line-height: 1.3; margin-top: 2px; }
.song.real { border-color: rgba(255, 79, 163, 0.5); background: rgba(255, 79, 163, 0.08); }
.song em { font-style: normal; font-size: 10.5px; background: var(--pink); color: #fff; padding: 1px 6px; border-radius: 99px; margin-left: 4px; vertical-align: middle; }
.dock .dance { background: linear-gradient(135deg, rgba(255, 79, 163, 0.25), rgba(255, 138, 31, 0.25)); }
.dock .dance.on { background: linear-gradient(135deg, #ff4fa3, #ff8a1f); } .dock .dance.on span { color: #fff; }
.who { position: absolute; left: max(10px, env(safe-area-inset-left)); bottom: calc(max(10px, env(safe-area-inset-bottom)) + 76px); width: min(300px, 44vw); background: var(--panel); border: 1px solid var(--line); border-left: 4px solid #ffe066; border-radius: 12px; padding: 9px 12px 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.who header { display: flex; justify-content: space-between; align-items: center; } .who header b { font-size: 16px; font-weight: 900; } .who .x { background: none; border: 0; color: var(--muted); font-size: 16px; }
.who small { color: var(--muted); font-size: 12px; display: block; } .who small b { color: var(--ink); }
.who p { margin: 5px 0 6px; font-size: 13px; line-height: 1.35; color: #f0dfee; }
.wb { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin: 2px 0; }
.wb i { height: 7px; border-radius: 7px; background: rgba(255, 255, 255, 0.1); overflow: hidden; } .wb u { display: block; height: 100%; }
.wbtn { margin-top: 7px; } .wbtn button { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); border-radius: 9px; padding: 5px 10px; font-weight: 800; font-size: 13px; }
.rhythm { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(max(10px, env(safe-area-inset-bottom)) + 76px); width: min(640px, 92vw); display: grid; grid-template-columns: 1fr auto auto; grid-template-rows: auto auto; gap: 4px 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 8px 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.lane { position: relative; height: 54px; border-radius: 12px; background: linear-gradient(90deg, rgba(255, 183, 3, 0.18), rgba(255, 255, 255, 0.04) 30%); overflow: hidden; grid-row: span 2; touch-action: none; cursor: pointer; }
.lane .hitc { position: absolute; left: 14px; top: 7px; width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--gold); box-shadow: 0 0 14px rgba(255, 183, 3, 0.6); }
.lane small { position: absolute; left: 66px; right: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12.5px; font-weight: 800; pointer-events: none; }
.note { position: absolute; left: 0; top: 13px; width: 28px; height: 28px; margin-left: 6px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffe7a3, #ff8a1f); box-shadow: 0 0 10px rgba(255, 138, 31, 0.8); font-style: normal; }
.note::after { content: '👏'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.note.stick::after { content: '🥢'; } .note.hit { background: radial-gradient(circle, #b7ffcf, #3ddc6b); opacity: 0.5; } .note.miss { background: #555; opacity: 0.45; }
.rinfo { display: flex; flex-direction: column; align-items: flex-end; min-width: 86px; } .rinfo b { font-size: 15px; font-weight: 900; color: var(--gold); } .rinfo small { font-weight: 900; font-size: 13px; color: var(--mint); } .rinfo small.p { color: #ffe066; } .rinfo small.m { color: var(--red); }
.rtap { grid-row: span 2; width: 74px; height: 64px; border-radius: 16px; border: 0; background: linear-gradient(135deg, #ff4fa3, #ff8a1f); font-size: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; touch-action: none; }
.rtap span { font-size: 11px; font-weight: 900; color: #fff; } .rtap.bump { animation: bump 0.15s; }
@keyframes bump { 50% { transform: scale(0.92); } }
.rhythm .ghost { padding: 3px 10px; font-size: 12px; justify-self: end; }
body.flash::after { content: ''; position: fixed; inset: 0; background: #fff; opacity: 0; animation: camflash 0.35s; pointer-events: none; z-index: 60; }
@keyframes camflash { 10% { opacity: 0.8; } }
body:has(#rhythm:not(.hidden)) .now { display: none; }

/* ------------------------------------------------------------ phones */
/* ------------------------------------------------------------ moments: the clock stops, in person */
body.in-moment #hud > :not(#moment) { display: none !important; }
.moment { position: absolute; inset: 0; pointer-events: none; }
.moment::before, .moment::after { content: ""; position: absolute; left: 0; right: 0; height: 9vh; background: #07020c; animation: mbar 0.5s ease-out both; }
.moment::before { top: 0; } .moment::after { bottom: 0; height: 4vh; }
@keyframes mbar { from { transform: scaleY(0); } }
.m-top { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 0; right: 0; z-index: 2; text-align: center; animation: mfade 0.6s 0.2s both; }
.m-top small { display: block; text-shadow: 0 1px 6px #000; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); font-weight: 800; }
.m-top b { font-size: clamp(17px, 2.6vw, 26px); font-weight: 900; text-shadow: 0 2px 10px #000; }
@keyframes mfade { from { opacity: 0; transform: translateY(-6px); } }
.m-tags span { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: rgba(20, 8, 31, 0.78); border: 1px solid var(--line); transition: background 0.2s, transform 0.2s; }
.m-tags span.speak { background: var(--gold); color: var(--on-gold); transform: translate(-50%, -100%) scale(1.12); }
.m-tags span i { font-style: normal; color: var(--gold); margin-right: 3px; } .m-tags span.speak i { color: inherit; }
.m-box { position: absolute; left: 50%; bottom: calc(4vh + max(8px, env(safe-area-inset-bottom))); transform: translateX(-50%); width: min(720px, calc(100vw - 24px)); max-height: 56vh; overflow-y: auto; pointer-events: auto;
  background: linear-gradient(180deg, rgba(46, 16, 66, 0.96), rgba(26, 10, 40, 0.97)); border: 1px solid rgba(255, 210, 160, 0.28); border-top: 3px solid var(--mc, var(--gold)); border-radius: 16px; padding: 12px 16px 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55); animation: mbox 0.45s 0.15s cubic-bezier(.2, 1.3, .4, 1) both; cursor: pointer; }
@keyframes mbox { from { opacity: 0; transform: translate(-50%, 24px); } }
.m-who { display: flex; align-items: baseline; gap: 8px; min-height: 20px; } .m-who b { font-size: 16px; font-weight: 900; color: var(--gold); } .m-who small { font-size: 12px; color: var(--muted); }
.m-who .sw { width: 11px; height: 11px; border-radius: 50%; display: inline-block; align-self: center; border: 1px solid rgba(255, 255, 255, 0.5); }
.m-text { margin: 4px 0 6px; font-size: 16px; line-height: 1.45; min-height: 2.9em; }
.m-text.mc { font-style: italic; color: #f0dfee; }
.m-more { text-align: right; font-size: 12px; color: var(--muted); animation: mblink 1.2s infinite; } @keyframes mblink { 50% { opacity: 0.35; } }
.m-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.m-choices button { text-align: left; padding: 9px 12px; border-radius: 12px; border: 1px solid rgba(255, 210, 160, 0.25); background: rgba(255, 255, 255, 0.06); font-weight: 800; font-size: 14.5px; line-height: 1.25; animation: mfade 0.3s both; }
.m-choices button:hover:not(:disabled) { background: rgba(255, 183, 3, 0.16); border-color: var(--gold); }
.m-choices button kbd { float: right; opacity: 0.6; font-weight: 600; }
.m-choices button small { display: block; font-weight: 600; font-size: 12px; color: var(--muted); margin-top: 2px; }
.m-choices button em { font-style: normal; color: var(--gold); font-size: 12.5px; margin-left: 4px; }
.m-choices button.go, .m-choices button.go:hover:not(:disabled) { background: var(--gold); color: var(--on-gold); text-align: center; border: 0; font-size: 16px; } .m-choices button.go small { color: var(--on-gold); opacity: 0.75; }
.m-choices button .cheer { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12px; }
.m-choices button .cheer i { flex: 1; height: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.1); overflow: hidden; } .m-choices button .cheer u { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff4fa3, #ffd23f); border-radius: 8px; }
.m-cheer { display: grid; gap: 4px; margin-bottom: 8px; } .m-cheer:empty { display: none; }
.m-cheer div { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; }
.m-cheer i { height: 9px; border-radius: 9px; background: rgba(255, 255, 255, 0.1); overflow: hidden; } .m-cheer u { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff4fa3, #ffd23f); transition: width 0.25s; border-radius: 9px; }
.m-res { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; }
.m-res.good { color: var(--mint); } .m-res.bad { color: var(--red); } .m-res.info { color: #5fd4ff; }
.m-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.m-chips span { font-size: 13px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); animation: mchip 0.4s cubic-bezier(.2, 1.6, .4, 1) both; }
.m-chips span.good { background: rgba(61, 220, 107, 0.18); color: #9ff0b6; } .m-chips span.bad { background: rgba(255, 77, 77, 0.18); color: #ffb3b3; } .m-chips span.info { background: rgba(95, 212, 255, 0.15); color: #bfeeff; }
@keyframes mchip { from { opacity: 0; transform: scale(0.6); } }
.m-moments li { display: flex; gap: 8px; } .m-moments li span { flex: 1; } .m-moments li.good b { color: var(--mint); } .m-moments li.bad b { color: var(--red); }

@media (max-width: 900px) {
  .help, .rgrid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  #title.screen { flex-direction: column; background: rgba(20, 8, 31, 0.82); }
  .t-main, .t-side { margin: 0 auto; }
  .t-stats .stat small { display: none; }
}
/* portrait phones: panel and cards become sheets, the dock stays at the bottom */
@media (max-width: 640px) and (orientation: portrait) {
  .top { gap: 6px; }
  .t-night { padding: 4px 8px; } .t-night b { font-size: 13px; }
  .t-clock b { font-size: 17px; min-width: 48px; }
  .stat { padding: 5px 8px; font-size: 13px; } .stat.meter .bar { width: 60px; }
  .now { top: calc(max(8px, env(safe-area-inset-top)) + 124px); }
  .cards { left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); width: auto; top: auto; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 78px); max-height: 42%; }
  .panel { left: 0; right: 0; width: auto; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 72px); max-height: 52%; border-radius: 16px 16px 0 0; }
  .dock { left: 8px; right: 8px; transform: none; justify-content: space-between; }
  .dock button { min-width: 0; flex: 1; padding: 5px 2px; }
  .toasts { top: calc(max(8px, env(safe-area-inset-top)) + 158px); }
  body:has(#panel:not(.hidden)) .cards { display: none; }
  .who { left: 8px; right: 8px; width: auto; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 72px); }
  .rhythm { width: auto; left: 8px; right: 8px; transform: none; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 72px); }
  body:has(#rhythm:not(.hidden)) .cards { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 160px); max-height: 34%; }
  .top .t-menu { width: 34px; }
  .t-btns { order: 1; margin-left: auto; } .t-clock { order: 2; } .t-stats { order: 3; flex-basis: 100%; }
}
/* landscape phones: short screens */
@media (max-height: 500px) {
  .top { padding-top: max(4px, env(safe-area-inset-top)); gap: 6px; }
  .t-night { padding: 3px 8px; } .t-night b { font-size: 13px; } .t-night span { font-size: 11px; }
  .t-clock b { font-size: 16px; min-width: 46px; } .speed button { padding: 4px 6px; }
  .stat { padding: 4px 8px; font-size: 13px; } .stat.meter .bar { width: 60px; }
  .now { top: auto; bottom: calc(max(6px, env(safe-area-inset-bottom)) + 58px); font-size: 12px; padding: 3px 10px; }
  .cards { top: calc(max(4px, env(safe-area-inset-top)) + 42px); width: min(300px, 38vw); max-height: calc(100% - 110px); }
  .card { padding: 7px 9px 8px; } .card p { font-size: 12px; margin: 2px 0 6px; } .opts button { padding: 5px 8px; font-size: 12.5px; }
  .toasts { top: calc(max(4px, env(safe-area-inset-top)) + 44px); left: max(10px, env(safe-area-inset-left)); transform: none; width: min(380px, 56vw); align-items: flex-start; }
  .toast { font-size: 12.5px; padding: 5px 10px; text-align: left; }
  .dock { bottom: max(6px, env(safe-area-inset-bottom)); padding: 4px; } .dock button { padding: 3px 10px; font-size: 18px; min-width: 54px; } .dock button span { font-size: 10.5px; }
  .panel { left: max(10px, env(safe-area-inset-left)); right: auto; width: min(360px, 48vw); top: calc(max(4px, env(safe-area-inset-top)) + 42px); bottom: calc(max(6px, env(safe-area-inset-bottom)) + 58px); max-height: none; }
  .logo { font-size: 46px; } .lead { font-size: 13px; margin-bottom: 10px; } .menu button { padding: 8px 12px; font-size: 15px; }
  .sheet { padding: 12px 14px; } .sheet h2 { font-size: 21px; }
  .who { bottom: calc(max(6px, env(safe-area-inset-bottom)) + 58px); width: min(280px, 40vw); padding: 6px 10px; } .who p { font-size: 12px; margin: 3px 0; }
  .rhythm { bottom: calc(max(6px, env(safe-area-inset-bottom)) + 56px); width: min(520px, 60vw); padding: 5px 8px; } .lane { height: 46px; } .lane .hitc { top: 3px; } .note { top: 9px; } .rtap { height: 52px; width: 64px; }
  .t-menu { width: 34px; height: 30px; font-size: 15px; } #photo-btn { display: none; } .t-btns { gap: 4px; } .gname { display: none; }
  .stat.meter .bar { width: 46px; } .t-stats { gap: 5px; }
}
/* Safari landscape with the tab bar showing leaves about 260 to 300px: keep Start on screen */
@media (max-height: 500px) {
  .moment::before { height: 30px; } .moment::after { height: 0; }
  .m-top { top: 3px; } .m-top small { display: inline; font-size: 9.5px; margin-right: 8px; } .m-top b { font-size: 15px; }
  .m-box { left: auto; right: max(6px, env(safe-area-inset-right)); top: 36px; bottom: max(6px, env(safe-area-inset-bottom)); transform: none; width: min(430px, 54vw); max-height: none; padding: 7px 12px 8px; animation-name: mboxs; }
  @keyframes mboxs { from { opacity: 0; transform: translateX(24px); } }
  .m-top { text-align: left; left: max(12px, env(safe-area-inset-left)); right: auto; } .m-top small { display: block; }
  .moment::before { height: 0; }
  .m-choices button small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .m-text { font-size: 14px; margin: 2px 0 4px; min-height: 0; } .m-choices { gap: 5px; grid-template-columns: 1fr; }
  .m-choices button { padding: 5px 9px; font-size: 13px; } .m-choices button small { font-size: 11px; }
  .m-cheer div { grid-template-columns: 60px 1fr; } .m-cheer { gap: 2px; margin-bottom: 4px; }
}
@media (max-height: 340px) {
  .logo { font-size: 34px; margin: 2px 0 6px; } .logo br { display: none; } .logo span { margin-left: .25em; }
  .lead { font-size: 12px; line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .menu button { padding: 6px 12px; font-size: 14px; }
}
/* the two songs: call the step, queue a song with a step */
.steps { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.steps .chip small { font-size: 11px; }
.steps .chip:disabled { opacity: 0.4; }
.song .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.song .chips .chip { font-size: 12px; padding: 4px 8px; }
/* shown only while the browser blocks the theme music */
#tapmusic { white-space: nowrap; pointer-events: auto; position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; display: none; background: var(--gold); color: var(--on-gold); border: 0; border-radius: 99px; padding: 10px 18px; font-weight: 800; font-size: 15px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); animation: tapmusic 1.4s ease-in-out infinite; }
#tapmusic.show { display: block; }
@keyframes tapmusic { 50% { transform: translateX(-50%) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { #tapmusic { animation: none; } }
/* the top stats keep their size, so the vibe bar never moves: fixed number widths, and "+N outside"
   hangs under the people pill instead of widening it */
#s-cash { min-width: 8.6ch; } #s-in { min-width: 3.5ch; }
.stat:has(#s-foot) { position: relative; }
#s-foot { position: absolute; left: 50%; top: calc(100% + 2px); transform: translateX(-50%); white-space: nowrap; background: var(--panel); border-radius: 8px; padding: 1px 7px; font-size: 11px; pointer-events: none; }
#s-foot:empty { display: none; }
.qstep { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 6px; } .qstep span { color: var(--muted); font-size: 12px; margin-right: 2px; }
.qstep .chip { font-size: 12px; padding: 4px 9px; }
@media (max-height: 500px), (max-width: 640px) { #s-cash { min-width: 7.5ch; } }

/* ------------------------------------------------------------ the planner: the ground is the menu
   A cream "kankotri" card on the side (a bottom sheet on portrait phones), the cash box over the
   ground, and markers floating over the places themselves. --acc is the colour of the night. */
#plan { --paper: #fff8ea; --paper2: #f8ead2; --card: #fffdf8; --ink: #3b0d22; --ink2: #7a4b5b; --rule: rgba(59, 13, 34, 0.14);
  --maroon: #4a0d27; --foil: linear-gradient(180deg, #ffe48f, #f5b301 55%, #cf8d00); --good: #1f8a45; --bad: #c0262d;
  --cardw: min(440px, 40vw); }
#plan.screen { padding: 0; background: radial-gradient(ellipse 70% 40% at 0% 0%, rgba(14, 4, 20, 0.75), transparent 70%); pointer-events: none; overflow: hidden; }
#plan.screen.active { display: block; }
#plan .pl-top, #plan .pl-card, #plan .pin { pointer-events: auto; }
.pl-top { position: absolute; top: max(14px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); right: calc(var(--cardw) + 36px); display: flex; align-items: flex-start; gap: 14px; pointer-events: none; }
.pl-menu { pointer-events: auto; background: rgba(20, 6, 26, 0.55); border: 1px solid rgba(255, 255, 255, 0.18); color: #f3e3ee; border-radius: 99px; padding: 6px 13px; font-weight: 800; font-size: 14px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pl-night { flex: 1; min-width: 0; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8); }
.pl-night small { display: block; font-size: 12px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: #f4dcc0; }
.pl-night b { display: flex; align-items: center; gap: 10px; font-size: clamp(24px, 3.2vw, 38px); font-weight: 900; line-height: 1.05; color: #fff; }
.pl-night b i { width: 0.62em; height: 0.62em; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 0 18px var(--acc); flex: none; }
.pl-night span { font-size: 13.5px; color: #f1dfe9; font-weight: 700; } .pl-night em { font-style: normal; background: var(--acc); color: #1a0710; padding: 1px 8px; border-radius: 99px; }

/* the cash box */
.wallet { pointer-events: auto; position: relative; width: 250px; flex: none; color: #ffe9b8; border-radius: 18px; padding: 10px 14px 11px;
  background: linear-gradient(160deg, #5b1231, #2b0716 70%); border: 1px solid rgba(255, 207, 92, 0.55);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 230, 160, 0.25), inset 0 -3px 0 rgba(0, 0, 0, 0.35); }
.w-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 900; letter-spacing: 1.6px; text-transform: uppercase; color: #e8b960; }
.w-label::before { content: '₹'; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--foil); color: var(--maroon); font-size: 11px; box-shadow: 0 1px 0 #8a5a00; }
.w-cash { display: block; font-size: 34px; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; margin: 2px 0 6px;
  background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.45)); }
.w-bill { display: grid; gap: 2px; font-size: 12.5px; color: #e9c9d6; }
.w-bill span { display: flex; justify-content: space-between; gap: 8px; } .w-bill b { color: #ff9aa5; font-variant-numeric: tabular-nums; }
.w-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); margin: 7px 0 5px; overflow: hidden; }
.w-bar u { display: block; height: 100%; background: var(--foil); transition: width 0.5s cubic-bezier(.2, .8, .2, 1); }
.w-after { font-size: 12.5px; color: #e9c9d6; display: flex; justify-content: space-between; } .w-after b { color: #ffe08a; font-size: 14px; } .w-after b.neg { color: #ff7a85; }
.wallet.hit { animation: whit 0.45s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes whit { 30% { transform: scale(1.05); } }
.wallet.loss { animation: whit 0.45s cubic-bezier(.2, 1.8, .4, 1), wloss 0.9s; } .wallet.gain { animation: whit 0.45s cubic-bezier(.2, 1.8, .4, 1), wgain 0.9s; }
@keyframes wloss { 20% { border-color: #ff6b78; box-shadow: 0 0 0 4px rgba(255, 107, 120, 0.35), 0 10px 30px rgba(0, 0, 0, 0.55); } }
@keyframes wgain { 20% { border-color: #6ef09a; box-shadow: 0 0 0 4px rgba(110, 240, 154, 0.35), 0 10px 30px rgba(0, 0, 0, 0.55); } }
.w-fly { position: absolute; right: 14px; bottom: 26px; font-style: normal; font-weight: 900; font-size: 20px; pointer-events: none; animation: wfly 1.3s ease-out forwards; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
.w-fly.neg { color: #ff6b78; } .w-fly.pos { color: #6ef09a; }
@keyframes wfly { from { opacity: 0; transform: translateY(6px) scale(0.8); } 15% { opacity: 1; transform: translateY(0) scale(1.1); } to { opacity: 0; transform: translateY(-34px); } }

/* markers over the ground */
.pl-pins { position: absolute; inset: 0; pointer-events: none; }
.pin { position: absolute; left: 0; top: 0; translate: -50% -100%; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0; padding: 0; transition: opacity 0.2s; }
.pin i { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; font-style: normal; font-size: 20px;
  background: #fff8ea; border: 3px solid var(--acc); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5); }
.pin::after { content: ''; order: 3; width: 3px; height: 14px; border-radius: 2px; background: linear-gradient(#fff8ea, rgba(255, 248, 234, 0)); }
.pin span { font-size: 12px; font-weight: 900; color: #fff; background: rgba(20, 6, 26, 0.75); padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.pin:not(.seen) i { animation: pinpulse 1.6s ease-in-out infinite; }
.pin:not(.seen) i::after { content: ''; position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: #ff3b5c; border: 2px solid #fff; }
.pin.seen:not(.on) i { border-color: #3ddc6b; } .pin.on i { border-color: #ffd166; box-shadow: 0 0 0 5px rgba(255, 209, 102, 0.35), 0 6px 16px rgba(0, 0, 0, 0.5); }
@keyframes pinpulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--acc) 35%, transparent), 0 6px 16px rgba(0, 0, 0, 0.5); } }

/* the card */
.pl-card { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); width: var(--cardw);
  display: flex; flex-direction: column; overflow: hidden; color: var(--ink); background: var(--paper); border-radius: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); }
.pl-card::before { content: ''; flex: none; height: 12px; background: radial-gradient(circle at 7px 2px, var(--acc) 5px, transparent 5.5px) 0 0 / 14px 12px, linear-gradient(#e2a400, #e2a400) 0 0 / 100% 3px no-repeat; }
.pl-dock { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 8px 0; border-bottom: 1px solid var(--rule); }
.pl-dock button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; background: none; border: 0; padding: 6px 2px 8px; color: var(--ink2); font-weight: 800; font-size: 12px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.pl-dock i { font-style: normal; font-size: 21px; line-height: 1.1; position: relative; }
.pl-dock button:not(.seen) i::after { content: ''; position: absolute; top: -1px; right: -6px; width: 8px; height: 8px; border-radius: 50%; background: #ff3b5c; }
.pl-dock button.seen:not(.on) i::after { content: '✓'; position: absolute; top: -4px; right: -9px; width: 14px; height: 14px; border-radius: 50%; background: var(--good); color: #fff; font-size: 9px; display: grid; place-items: center; font-weight: 900; }
.pl-dock button.on { color: var(--ink); border-bottom-color: var(--acc-ink); }
.pl-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px 18px; overscroll-behavior: contain; }
.pl-body.in > * { animation: plin 0.35s cubic-bezier(.2, .8, .2, 1) both; }
.pl-body.in > *:nth-child(2) { animation-delay: 0.04s; } .pl-body.in > *:nth-child(3) { animation-delay: 0.08s; } .pl-body.in > *:nth-child(n+4) { animation-delay: 0.12s; }
@keyframes plin { from { opacity: 0; transform: translateY(10px); } }
.pl-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.pl-head > i { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; font-style: normal; font-size: 24px; background: color-mix(in srgb, var(--acc) 22%, #fff); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--acc) 50%, transparent); }
.pl-head b { display: block; font-size: 23px; font-weight: 900; line-height: 1.1; } .pl-head small { color: var(--ink2); font-size: 13.5px; font-weight: 700; }
.pl-note { color: var(--ink2); font-size: 13px; font-weight: 700; line-height: 1.4; margin: 8px 2px; }
.pl-card button { color: var(--ink); }
.cash { display: inline-block; background: var(--maroon); color: #ffd36b; font-weight: 900; font-variant-numeric: tabular-nums; border-radius: 9px; padding: 3px 9px; font-size: 15px; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 220, 140, 0.3), 0 2px 0 #1c0410; }
.cash small { font-size: 11px; color: #e7b9c9; margin-left: 2px; font-weight: 700; }
.stamp { font-style: normal; display: inline-block; border: 2px solid var(--good); color: var(--good); font-weight: 900; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; padding: 0 6px; border-radius: 5px; rotate: -7deg; background: rgba(31, 138, 69, 0.07); }
.pl-card button.on, .pl-card .on { -webkit-tap-highlight-color: transparent; }

/* stage */
.bands { display: grid; gap: 10px; }
.band { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; text-align: left; background: var(--card); border: 2px solid var(--rule); border-radius: 18px; padding: 12px; transition: border-color 0.15s, transform 0.1s; }
.band:active { transform: scale(0.99); }
.band .face { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-style: normal; font-size: 28px; background: var(--maroon); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.35); }
.b-mid b { font-size: 16.5px; font-weight: 900; } .b-mid > small { display: block; color: var(--ink2); font-size: 12.5px; font-weight: 700; margin: 1px 0 6px; line-height: 1.3; }
.meter { display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 6px; margin-top: 3px; } .meter small { font-size: 11px; font-weight: 800; color: var(--ink2); }
.meter u { height: 7px; border-radius: 4px; background: var(--rule); overflow: hidden; } .meter s { display: block; height: 100%; background: var(--acc-ink); border-radius: 4px; }
.b-fee { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; } .b-fee small { font-size: 12px; font-weight: 800; color: var(--ink2); }
.band.on { border-color: var(--acc-ink); background: color-mix(in srgb, var(--acc) 10%, #fff); box-shadow: 0 6px 18px rgba(59, 13, 34, 0.12); }

/* gate */
.tickets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ticket { position: relative; display: flex; flex-direction: column; align-items: center; padding: 12px 2px 10px; border-radius: 10px; border: 2px dashed var(--rule);
  background: radial-gradient(circle at 0 50%, var(--paper) 6px, transparent 6.5px), radial-gradient(circle at 100% 50%, var(--paper) 6px, transparent 6.5px), var(--card); }
.ticket b { font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; } .ticket small { font-size: 10.5px; color: var(--ink2); font-weight: 700; }
.ticket.on { background: radial-gradient(circle at 0 50%, var(--paper) 6px, transparent 6.5px), radial-gradient(circle at 100% 50%, var(--paper) 6px, transparent 6.5px), var(--maroon); border: 2px solid var(--maroon); }
.pl-card .ticket.on b { color: #ffd36b; } .pl-card .ticket.on small { color: #e7b9c9; }
.forecast { background: var(--card); border: 2px solid var(--rule); border-radius: 18px; padding: 12px 14px; margin-top: 6px; }
.fc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; } .fc-row small { display: block; font-size: 11.5px; font-weight: 800; color: var(--ink2); }
.fc-row b { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; } .fc-row b.cash { font-size: 17px; margin-top: 3px; }
.mix { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; } .mix s { display: block; transition: flex 0.4s; }
.mix-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 7px; font-size: 12px; font-weight: 800; color: var(--ink2); }
.mix-key i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }

/* decor and names */
.banner { display: block; background: var(--maroon); border-radius: 14px; padding: 8px 14px 6px; margin-bottom: 12px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.35); }
.banner small { display: block; font-size: 10.5px; font-weight: 900; letter-spacing: 1.4px; text-transform: uppercase; color: #e8b960; }
.banner input { width: 100%; background: none; border: 0; outline: 0; color: #ffe9b8; font: inherit; font-size: 21px; font-weight: 900; padding: 1px 0 2px; }
.banner:focus-within { box-shadow: 0 0 0 3px var(--acc), inset 0 -3px 0 rgba(0, 0, 0, 0.35); }
.decors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.decor { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; background: var(--card); border: 2px solid var(--rule); border-radius: 18px; padding: 0 10px 10px; overflow: hidden; }
.decor .cloth { display: block; height: 30px; margin: 0 -10px 4px; width: calc(100% + 20px); -webkit-mask: radial-gradient(circle at 8px 30px, transparent 7px, #000 7.5px) -8px 0 / 16px 100%; mask: radial-gradient(circle at 8px 30px, transparent 7px, #000 7.5px) -8px 0 / 16px 100%; }
.decor b { font-size: 15px; font-weight: 900; } .decor > small { font-size: 12px; color: var(--ink2); font-weight: 700; line-height: 1.3; }
.taste { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 11.5px; font-weight: 800; color: var(--ink2); margin: 2px 0 4px; } .taste .up { color: var(--good); } .taste .down { color: var(--bad); }
.decor .stamp { position: absolute; top: 5px; right: 8px; background: #fff; rotate: -4deg; }
.decor.on { border-color: var(--acc-ink); box-shadow: 0 6px 18px rgba(59, 13, 34, 0.14); }

/* you */
.match { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: var(--card); border: 2px solid var(--rule); border-radius: 16px; padding: 10px 12px; margin-bottom: 4px; font-weight: 900; font-size: 14.5px; }
.match > i { flex: none; width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.15); }
.match span { flex: 1; } .match span small { display: block; font-size: 12px; color: var(--ink2); font-weight: 700; }
.match > b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--maroon); color: #ffd36b; font-size: 17px; }
.match.on { border-color: var(--good); background: rgba(31, 138, 69, 0.07); } .match.on > b { background: var(--good); color: #fff; }
.av-group { background: var(--card); border: 2px solid var(--rule); border-radius: 18px; padding: 10px 12px 12px; margin-top: 10px; }
.av-group h5 { margin: 0 0 8px; font-size: 11.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--acc-ink); font-weight: 900; }
.av-row { display: grid; grid-template-columns: 86px 1fr; gap: 8px; align-items: center; margin-top: 8px; } .av-row > small { font-size: 12.5px; font-weight: 800; color: var(--ink2); }
.seg { display: flex; flex-wrap: wrap; gap: 5px; } .seg + .seg { margin-top: 6px; }
.seg button { background: #fff; border: 1.5px solid var(--rule); border-radius: 99px; padding: 6px 12px; font-weight: 800; font-size: 13.5px; }
.pl-card .seg button.on { background: var(--maroon); border-color: var(--maroon); color: #ffd36b; }
.pl-card .swatches { gap: 6px; } .pl-card .swc { width: 28px; height: 28px; border: 2px solid rgba(0, 0, 0, 0.12); }
.pl-card .swc.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--maroon); border-color: transparent; }

/* upgrades */
.shop { display: grid; gap: 8px; }
.ware { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; background: var(--card); border: 2px solid var(--rule); border-radius: 18px; padding: 10px 10px 10px 12px; }
.ware > i { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-style: normal; font-size: 23px; background: var(--paper2); }
.w-mid b { font-size: 15px; font-weight: 900; } .w-mid > small { display: block; font-size: 12px; color: var(--ink2); font-weight: 700; line-height: 1.3; margin: 1px 0 5px; }
.lvl { display: flex; align-items: center; gap: 3px; } .lvl u { width: 16px; height: 6px; border-radius: 3px; background: var(--rule); } .lvl u.on { background: var(--good); }
.lvl em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--ink2); margin-left: 5px; }
.w-act { display: flex; flex-direction: column; align-items: stretch; gap: 5px; min-width: 96px; }
.buy { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; border-radius: 12px; padding: 5px 8px 6px; background: var(--foil); font-weight: 900; font-size: 12px; color: var(--maroon) !important; box-shadow: 0 3px 0 #9a6400; }
.buy .cash { font-size: 13.5px; padding: 2px 7px; } .buy:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #9a6400; }
.buy:disabled { background: #eadfcb; box-shadow: none; color: var(--ink2) !important; opacity: 1; } .buy:disabled .cash { background: #b9a891; color: #fff; box-shadow: none; }
.undo { background: none; border: 1.5px solid var(--rule); border-radius: 10px; padding: 4px 6px; font-size: 11.5px; font-weight: 800; color: var(--ink2) !important; }
.undo b { color: var(--good); }
.ware.own { border-color: rgba(31, 138, 69, 0.45); }

/* open the gates */
.pl-foot { flex: none; padding: 10px 14px max(14px, env(safe-area-inset-bottom)); background: var(--paper2); border-top: 1px solid var(--rule); }
.gates { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 1px; border: 0; border-radius: 16px; padding: 11px 12px 10px; background: var(--foil); color: var(--maroon) !important; box-shadow: 0 5px 0 #9a6400, 0 10px 24px rgba(207, 141, 0, 0.35); transition: transform 0.08s, box-shadow 0.08s; }
.gates b { font-size: 21px; font-weight: 900; letter-spacing: 0.3px; } .gates small { font-size: 12.5px; font-weight: 800; opacity: 0.8; }
.gates:active { transform: translateY(3px); box-shadow: 0 2px 0 #9a6400; }
.gates.locked { background: #eadfcb; color: var(--ink2) !important; box-shadow: 0 4px 0 #cbb796; }
.gates.locked b { font-size: 18px; }
.gates.nudge { animation: nudge 0.4s; } @keyframes nudge { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .pin:not(.seen) i, .pl-body.in > *, .w-fly, .wallet.hit { animation: none; } }

/* portrait phones and tablets: the card is a bottom sheet, the ground shows above it */
@media (orientation: portrait) and (max-width: 820px) {
  #plan { --cardw: auto; }
  .pl-card { top: auto; left: 0; right: 0; bottom: 0; height: 60%; width: auto; border-radius: 24px 24px 0 0; }
  .pl-top { right: max(12px, env(safe-area-inset-right)); left: max(12px, env(safe-area-inset-left)); gap: 8px; flex-wrap: wrap; }
  .pl-menu { order: 0; } .pl-night { order: 2; flex-basis: 100%; } .wallet { order: 1; margin-left: auto; }
  .pl-night b { font-size: 24px; }
  .wallet { width: auto; min-width: 150px; padding: 6px 12px 7px; border-radius: 14px; } .w-cash { font-size: 24px; margin: 0; }
  .w-bill, .w-bar { display: none; } .w-after { font-size: 11px; gap: 6px; } .w-after b { font-size: 12px; } .w-fly { bottom: auto; top: 100%; font-size: 16px; }
  .pl-body { padding: 12px 12px 14px; } .pl-head { margin-bottom: 10px; } .pl-head b { font-size: 20px; } .pl-head > i { width: 40px; height: 40px; font-size: 21px; }
  .decors { grid-template-columns: 1fr 1fr; gap: 8px; } .decor > small { display: none; }
  .ticket b { font-size: 14.5px; }
  .pl-foot { padding: 8px 12px max(10px, env(safe-area-inset-bottom)); } .gates b { font-size: 19px; }
}
/* landscape phones: a narrower card on the right, a compact cash box */
@media (max-height: 500px) and (orientation: landscape) {
  #plan { --cardw: min(410px, 52vw); }
  .pl-card { top: max(6px, env(safe-area-inset-top)); bottom: max(6px, env(safe-area-inset-bottom)); right: max(6px, env(safe-area-inset-right)); border-radius: 18px; }
  .pl-card::before { height: 8px; background-size: 12px 8px, 100% 2px; }
  .pl-top { top: max(8px, env(safe-area-inset-top)); right: calc(var(--cardw) + 18px); flex-wrap: wrap; gap: 6px 10px; }
  .pl-night { order: 2; flex-basis: 100%; } .pl-night b { font-size: 20px; } .pl-night span { display: none; }
  .wallet { order: 1; margin-left: auto; width: auto; padding: 5px 11px 6px; border-radius: 13px; } .w-label { font-size: 9.5px; } .w-cash { font-size: 20px; margin: 0; }
  .w-bill, .w-bar { display: none; } .w-after { font-size: 10.5px; gap: 6px; } .w-after b { font-size: 11.5px; } .w-fly { bottom: auto; top: 100%; font-size: 15px; }
  .pl-dock { padding: 2px 6px 0; } .pl-dock button { padding: 3px 2px 5px; font-size: 10.5px; } .pl-dock i { font-size: 17px; }
  .pl-body { padding: 10px 12px 12px; } .pl-head { margin-bottom: 8px; gap: 9px; } .pl-head b { font-size: 17px; } .pl-head small { font-size: 12px; } .pl-head > i { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
  .band { grid-template-columns: 42px 1fr auto; padding: 8px; gap: 8px; } .band .face { width: 42px; height: 42px; font-size: 22px; border-radius: 12px; } .b-mid > small { display: none; }
  .decor > small { display: none; }
  .pl-foot { padding: 6px 10px max(6px, env(safe-area-inset-bottom)); } .gates { padding: 6px 10px; border-radius: 12px; } .gates b { font-size: 16px; } .gates small { font-size: 11px; }
  .pin i { width: 34px; height: 34px; font-size: 16px; } .pin span { font-size: 10.5px; }
}
@media (max-height: 360px) and (orientation: landscape) {
  .pl-head small, .pl-note { display: none; } .pl-head { margin-bottom: 6px; }
  .banner { padding: 5px 12px 4px; margin-bottom: 8px; } .banner input { font-size: 16px; } .banner small { font-size: 9.5px; }
  .gates small { display: none; } .gates b { font-size: 15px; }
}
