/* Show de bolso v2 — interface no idioma visual do Pip: painéis azul-noite com borda dourada de 2 px, cantos quase retos,
   títulos em Pixelify Sans e texto em DotGothic16 (grade de 16 px, algarismos legíveis). Fontes OFL servidas localmente. */
@font-face { font-family: 'Pixelify Sans'; src: url('vendor/fonts/PixelifySans.ttf') format('truetype'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'DotGothic16'; src: url('vendor/fonts/DotGothic16-latin.woff2') format('woff2'); font-weight: 400; font-display: swap; }
:root {
  --ink: #fff4de; --ink-2: #e7dcc6; --muted: #b8b2dc; --gold: #ecc978; --gold-2: #ffd87a; --amber: #ffb65c; --lime: #dcff7c;
  --pink: #ff6f9f; --mint: #62e8c0; --orange: #ffae42; --lilac: #b28cff; --danger: #ff6b82;
  --panel-bg: linear-gradient(180deg, rgba(34, 30, 82, .94), rgba(13, 12, 38, .95));
  --panel-edge: 0 0 0 2px rgba(8, 6, 22, .85), inset 0 0 0 1px rgba(255, 236, 190, .10), 0 10px 26px rgba(4, 2, 14, .55);
  --line: rgba(236, 201, 120, .28);
  --pix: 'Pixelify Sans', ui-rounded, system-ui, sans-serif; --text: 'DotGothic16', ui-monospace, 'Segoe UI', system-ui, sans-serif;
  --top-h: 60px; --panel-w: clamp(360px, 31vw, 440px); --stage-h: clamp(230px, 36vh, 330px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #140f30; color: var(--ink); font: 16px/1.5 var(--text); overflow: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
h1, h2, h3 { font-family: var(--pix); font-weight: 700; margin: 0; letter-spacing: .02em; }
kbd { font-family: var(--pix); font-weight: 600; }

#stage3d { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; touch-action: none; }
.stage-simple { position: fixed; inset: 0; z-index: 0; display: none;
  background: radial-gradient(ellipse at 50% 30%, rgba(255, 176, 90, .35), transparent 60%), linear-gradient(180deg, #2a1a6a 0%, #7a2d6a 42%, #f08a4a 55%, #22215a 56%, #141438 100%); }
body.simple-stage .stage-simple { display: block; }
body.simple-stage #stage3d { visibility: hidden; }
/* a vinheta do palco 3D é feita no pós-processamento; a de CSS fica só no palco simples */
.vignette { display: none; position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(10, 4, 24, .6) 100%); }
body.simple-stage .vignette { display: block; }

/* ---------- barra superior ---------- */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--top-h); z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 18px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; padding: 5px 12px 5px 6px; background: var(--panel-bg); border: 2px solid var(--gold); border-radius: 5px; box-shadow: var(--panel-edge); }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 3px; background: linear-gradient(180deg, #ffd87a, #e59a45); color: #3a1830; font-weight: 800; box-shadow: inset 0 -3px 0 rgba(120, 50, 20, .45); }
.brand-mark.big { width: 56px; height: 56px; font-size: 28px; border-radius: 6px; }
.brand-name { font-family: var(--pix); font-weight: 700; font-size: 17px; letter-spacing: .06em; }
.badge-v2 { font-family: var(--pix); font-size: 12px; padding: 0 6px; border-radius: 3px; background: var(--lime); color: #25360c; font-weight: 700; }
.brand-person { color: var(--muted); font-size: 16px; }
.now { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; text-shadow: 0 2px 0 rgba(8, 4, 20, .9), 0 0 8px rgba(8, 4, 20, .8); }
.now strong { font-family: var(--pix); font-size: 17px; }
.now span { font-size: 16px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-state="menu"] .now, body[data-state="loading"] .now { visibility: hidden; }
.top-actions { display: flex; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--gold); background: var(--panel-bg); display: grid; place-items: center; color: var(--ink); box-shadow: var(--panel-edge); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover:not(:disabled) { border-color: var(--gold-2); color: var(--gold-2); }
.icon-btn:disabled { opacity: .45; }
#sound-button .off { display: none; } #sound-button[aria-pressed="true"] .off { display: inline; } #sound-button[aria-pressed="true"] .on { display: none; }

/* ---------- painel (pistas e menus) ---------- */
.panel { position: fixed; z-index: 4; display: flex; flex-direction: column; background: var(--panel-bg); border: 2px solid var(--gold); border-radius: 5px; box-shadow: var(--panel-edge); overflow: hidden; }
body[data-layout="wide"] .panel { top: calc(var(--top-h) + 6px); right: 18px; bottom: 18px; width: var(--panel-w); }
body[data-layout="narrow"] .panel { left: 0; right: 0; bottom: 0; top: var(--stage-h); border-radius: 6px 6px 0 0; border-bottom: 0; }
body.simple-stage[data-layout="wide"] .panel { right: auto; left: 50%; transform: translateX(-50%); width: min(560px, 94vw); }
body[data-state="playing"] .panel, body[data-state="resuming"] .panel, body[data-state="paused"] .panel { background: linear-gradient(180deg, rgba(24, 20, 60, .72), rgba(10, 8, 28, .86)); }
.card-screen { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; scrollbar-color: rgba(236, 201, 120, .4) transparent; }
.card-screen[hidden], .play-view[hidden] { display: none !important; }
.eyebrow { font-family: var(--pix); font-size: 12px; letter-spacing: .14em; color: var(--gold); }
.small-label { font-family: var(--pix); font-size: 11px; letter-spacing: .12em; color: var(--muted); }
.secondary { color: var(--muted); font-size: 16px; margin: 0; }
.pill { font-size: 16px; padding: 0 8px; border-radius: 3px; border: 1px solid var(--line); background: rgba(236, 201, 120, .10); color: var(--gold-2); white-space: nowrap; line-height: 1.6; }
.seal-pill { background: rgba(98, 232, 192, .10); color: var(--mint); border-color: rgba(98, 232, 192, .35); }

/* menu: lista rolável + rodapé fixo com a dificuldade e o botão de tocar sempre visível */
.menu-screen { padding: 0; gap: 0; overflow: hidden; }
.menu-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; scrollbar-color: rgba(236, 201, 120, .4) transparent; }
.menu-footer { flex: none; padding: 12px 18px 10px; display: flex; flex-direction: column; gap: 8px; border-top: 2px solid rgba(236, 201, 120, .35); background: rgba(8, 6, 24, .45); }
.menu-head { display: flex; gap: 14px; align-items: center; }
.portrait { width: 72px; height: 72px; object-fit: cover; object-position: 50% 12%; border-radius: 4px; background: linear-gradient(160deg, #ffb06a, #ff6f9f 60%, #6a3aa8); border: 2px solid var(--gold); box-shadow: 0 0 0 2px rgba(8, 6, 22, .85); flex: none; }
.menu-head h1 { font-size: 32px; line-height: 1; margin: 4px 0; color: var(--ink); text-shadow: 0 3px 0 #4a2a18, 0 0 14px rgba(255, 190, 110, .35); }
.tagline { margin: 0; color: var(--ink-2); }
.setlist-head { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.setlist-head h2 { font-size: 18px; flex: 1; color: var(--gold-2); }
.setlist { display: flex; flex-direction: column; gap: 7px; }
.song-card { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; text-align: left; padding: 8px 12px; border-radius: 4px; border: 2px solid rgba(236, 201, 120, .22); background: rgba(255, 244, 222, .03); }
.song-card:hover:not(:disabled) { background: rgba(255, 244, 222, .07); border-color: rgba(236, 201, 120, .55); }
.song-card[aria-pressed="true"] { background: linear-gradient(90deg, rgba(255, 182, 92, .22), rgba(255, 111, 159, .10)); border-color: var(--gold); }
.song-index { font-size: 16px; color: var(--gold-2); }
.song-name { display: block; font-family: var(--pix); font-size: 17px; }
.song-detail { display: block; font-size: 13px; color: var(--muted); }
.song-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 13px; }
.song-stars { color: var(--gold-2); letter-spacing: 1px; font-size: 16px; } .song-stars .off { color: rgba(236, 201, 120, .25); }
.song-seals { display: flex; gap: 3px; }
.seal-dot { width: 10px; height: 10px; border-radius: 1px; border: 2px solid rgba(98, 232, 192, .45); }
.seal-dot.on { background: var(--gold-2); border-color: #fff1b8; box-shadow: 0 0 6px rgba(255, 216, 122, .8); }
.song-artist { display: block; font-size: 13px; color: var(--ink-2); }
.real-tag { display: inline-block; margin-top: 3px; font-family: var(--pix); font-size: 11px; line-height: 1.3; padding: 1px 6px; border-radius: 3px; border: 1px solid rgba(255, 216, 122, .55); color: var(--gold-2); background: rgba(255, 182, 92, .10); }
.song-card.real { border-color: rgba(255, 134, 173, .45); }
.song-card.soon { background: repeating-linear-gradient(135deg, rgba(255, 244, 222, .03) 0 8px, rgba(255, 244, 222, .06) 8px 16px); border-style: dashed; cursor: not-allowed; }
.song-card.soon .song-name { color: var(--ink-2); font-size: 15px; } .song-card.soon .song-index { color: var(--muted); }
.soon-tag { font-family: var(--pix); font-size: 11px; padding: 1px 6px; border-radius: 3px; border: 1px solid rgba(184, 178, 220, .4); color: var(--muted); }
.mode-row { display: flex; align-items: center; gap: 10px; }
.mode-switch { flex: none; width: 210px; display: grid; grid-template-columns: 1fr 1fr; background: rgba(0, 0, 0, .3); border: 2px solid rgba(236, 201, 120, .3); border-radius: 5px; padding: 3px; gap: 3px; }
.mode-switch button { border: 0; border-radius: 3px; padding: 7px; background: transparent; font-family: var(--pix); font-size: 15px; color: var(--ink-2); }
.mode-switch button[aria-pressed="true"] { background: var(--ink); color: #2a1440; box-shadow: inset 0 -3px 0 rgba(120, 90, 60, .35); }
.mode-description { flex: 1; margin: 0; font-size: 13px; line-height: 1.35; color: var(--muted); }
.challenges { border: 2px solid rgba(236, 201, 120, .22); border-radius: 4px; padding: 10px 12px; background: rgba(0, 0, 0, .18); }
.challenges-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.challenges-head h3 { font-size: 15px; color: var(--gold-2); }
.record-line { font-size: 13px; color: var(--muted); text-align: right; }
.challenge-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.challenge-list li { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.challenge-list .sec-name { color: var(--ink); } .challenge-list .sec-goal { color: var(--muted); text-align: right; }
.menu-status { margin: 0; padding: 8px 12px; border-radius: 4px; border: 2px solid rgba(255, 107, 130, .5); background: rgba(255, 107, 130, .14); color: #ffd6dc; }
/* botão dourado com "pé" de 5 px, como no Pip */
.primary-button { border: 2px solid #fff1b8; border-radius: 6px; padding: 12px 18px; font-family: var(--pix); font-size: 19px; font-weight: 700; color: #3a1c10;
  background: linear-gradient(180deg, #ffe7a0, #f0b54c); box-shadow: 0 0 0 2px #3a2410, 0 5px 0 #8a4f1c, 0 10px 22px rgba(255, 170, 80, .3); }
.primary-button:hover:not(:disabled) { box-shadow: 0 0 0 2px #3a2410, 0 0 0 5px rgba(220, 255, 124, .55), 0 5px 0 #8a4f1c, 0 10px 22px rgba(255, 170, 80, .35); }
.primary-button:active { transform: translateY(3px); box-shadow: 0 0 0 2px #3a2410, 0 2px 0 #8a4f1c; }
.primary-button:disabled { filter: grayscale(.6); opacity: .7; }
.secondary-button { border: 2px solid var(--gold); border-radius: 5px; padding: 9px 14px; background: rgba(255, 244, 222, .05); font-family: var(--pix); font-size: 15px; box-shadow: 0 3px 0 rgba(8, 6, 22, .8); }
.secondary-button:hover { background: rgba(255, 244, 222, .12); }
.text-button { border: 0; background: none; padding: 6px 2px; color: var(--ink-2); font-size: 16px; text-decoration: underline; text-decoration-color: rgba(236, 201, 120, .5); text-underline-offset: 4px; }
.text-button span { color: var(--muted); font-size: 13px; margin-left: 4px; }
.menu-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px; }

/* play view */
.play-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
body:not([data-state="playing"]):not([data-state="paused"]):not([data-state="resuming"]) .play-view { display: none; }
.play-hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; padding: 10px 16px 6px; }
.hud-score strong { display: block; font-size: 22px; letter-spacing: .06em; font-weight: 400; }
.hud-combo { text-align: center; position: relative; } .hud-combo strong { display: block; font-size: 32px; line-height: 1; color: var(--gold-2); text-shadow: 0 3px 0 #4a2a18; font-weight: 400; }
.hud-combo.bump strong { animation: bump .22s ease-out; }
@keyframes bump { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.hud-energy { text-align: right; } .hud-energy b { color: var(--ink); font-weight: 400; }
.energy-track { height: 10px; border-radius: 2px; background: rgba(0, 0, 0, .45); margin-top: 5px; overflow: hidden; border: 2px solid rgba(236, 201, 120, .4); }
#energy-fill { height: 100%; width: 75%; background: linear-gradient(90deg, var(--pink), var(--amber)); transition: width .2s; }
.challenge-chip { margin: 2px 12px 6px; padding: 7px 10px; border-radius: 4px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; background: rgba(0, 0, 0, .32); border: 2px solid rgba(236, 201, 120, .3); min-height: 52px; }
.chip-seal { width: 24px; height: 24px; border-radius: 50%; border: 2px dashed rgba(236, 201, 120, .6); display: grid; place-items: center; }
.chip-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.chip-top { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); } .chip-top b { color: var(--gold-2); font-weight: 400; letter-spacing: .08em; }
.chip-goal { font-size: 16px; }
.chip-state { font-size: 16px; color: var(--mint); white-space: nowrap; }
.challenge-chip[data-status="lost"] .chip-state, .challenge-chip[data-status="missed"] .chip-state { color: var(--muted); }
.challenge-chip[data-status="lost"] .chip-goal { text-decoration: line-through; text-decoration-color: rgba(255, 107, 130, .8); color: var(--muted); }
.challenge-chip[data-status="sealed"] { border-color: var(--gold-2); background: linear-gradient(90deg, rgba(255, 216, 122, .24), rgba(0, 0, 0, .28)); }
.challenge-chip[data-status="sealed"] .chip-seal, .seal-badge { border: 0; background: radial-gradient(circle at 35% 35%, #fff6d0, var(--gold-2) 45%, #c07a1a); box-shadow: 0 0 12px rgba(255, 216, 122, .8); }
.challenge-chip[data-status="sealed"] .chip-seal::after, .seal-badge::after { content: '★'; color: #7a3a10; font-size: 14px; }
.challenge-chip[data-status="tutorial"] .chip-seal { border-style: solid; border-color: var(--mint); }
.sections-bar { list-style: none; margin: 0 14px 6px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.sections-bar li { height: 6px; border-radius: 1px; background: rgba(255, 244, 222, .12); position: relative; overflow: hidden; }
.sections-bar li i { position: absolute; inset: 0; width: 0; background: rgba(255, 244, 222, .45); }
.sections-bar li.sealed { background: var(--gold-2); box-shadow: 0 0 8px rgba(255, 216, 122, .8); } .sections-bar li.sealed i { display: none; }
.sections-bar li.missed { background: rgba(184, 178, 220, .35); } .sections-bar li.missed i { display: none; }
.sections-bar li.current { outline: 1px solid rgba(236, 201, 120, .7); }
.highway-wrap { position: relative; flex: 1; min-height: 160px; }
#highway { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.judgement { position: absolute; left: 0; right: 0; bottom: 110px; text-align: center; font-family: var(--pix); font-size: 28px; font-weight: 700; opacity: 0; transform: translateY(6px) scale(.95);
  transition: opacity .12s, transform .12s; text-shadow: 0 3px 0 rgba(8, 4, 20, .9), 0 0 18px rgba(8, 4, 20, .6); pointer-events: none; }
.judgement.show { opacity: 1; transform: none; }
.judgement small { display: block; font-family: var(--text); font-size: 16px; color: var(--ink-2); font-weight: 400; }
.beat-count { position: absolute; inset: 0; display: grid; place-items: center; font-size: 96px; color: var(--ink); text-shadow: 0 6px 0 #4a2a18; pointer-events: none; }
.combo-pop { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%); display: grid; place-items: center; pointer-events: none; animation: combo-pop .9s ease-out forwards; z-index: 2; }
.combo-pop img { width: 150px; height: 150px; }
.combo-pop span { position: absolute; font-family: var(--pix); font-weight: 700; font-size: 26px; color: #3a1c10; text-shadow: 0 0 8px #fff4c8, 0 0 2px #fff4c8; white-space: nowrap; }
@keyframes combo-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(-12deg); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1); } }
.lane-controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 6px 10px 10px; }
.lane-controls button { height: 48px; border-radius: 4px; border: 2px solid rgba(236, 201, 120, .3); background: rgba(255, 244, 222, .05); touch-action: none; user-select: none; -webkit-user-select: none; }
.lane-controls button:nth-child(1) { box-shadow: inset 0 -4px 0 var(--pink); } .lane-controls button:nth-child(2) { box-shadow: inset 0 -4px 0 var(--mint); }
.lane-controls button:nth-child(3) { box-shadow: inset 0 -4px 0 var(--orange); } .lane-controls button:nth-child(4) { box-shadow: inset 0 -4px 0 var(--lilac); }
.lane-controls button.active { background: rgba(255, 244, 222, .22); transform: translateY(2px); }
.lane-controls kbd { font-size: 17px; }
.song-progress { height: 4px; background: rgba(0, 0, 0, .35); } #song-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--gold-2)); }

/* pausa e resultado */
#pause-screen { position: absolute; inset: 0; z-index: 3; justify-content: center; text-align: center; background: rgba(12, 9, 32, .92); }
#pause-screen h2 { font-size: 30px; color: var(--gold-2); } #pause-screen p { margin: 0 0 6px; color: var(--ink-2); }
.result-screen { text-align: center; }
.result-screen h2 { font-size: 28px; color: var(--ink); text-shadow: 0 3px 0 #4a2a18; }
.result-stars { font-size: 38px; color: var(--gold-2); letter-spacing: 6px; text-shadow: 0 3px 0 #4a2a18, 0 0 14px rgba(255, 216, 122, .5); line-height: 1; } .result-stars .off { color: rgba(236, 201, 120, .2); text-shadow: none; }
.result-message { margin: 0; color: var(--ink-2); }
.result-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.result-numbers div { background: rgba(0, 0, 0, .25); border-radius: 4px; padding: 6px 4px; border: 2px solid rgba(236, 201, 120, .25); }
.result-numbers strong { display: block; font-size: 24px; font-weight: 400; } .result-numbers span { font-size: 13px; color: var(--muted); }
.result-sections-title { font-size: 16px; text-align: left; color: var(--gold-2); margin-top: 2px; font-family: var(--text); font-weight: 400; }
.result-sections { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; text-align: left; }
.result-sections li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 4px; background: rgba(0, 0, 0, .22); border: 2px solid rgba(236, 201, 120, .2); }
.result-sections li.sealed { border-color: rgba(255, 216, 122, .7); background: linear-gradient(90deg, rgba(255, 216, 122, .16), rgba(0, 0, 0, .2)); }
.result-sections .rs-name { font-size: 16px; display: block; } .result-sections .rs-goal { font-size: 13px; color: var(--muted); display: block; }
.result-sections .rs-acc { font-size: 16px; text-align: right; } .result-sections .rs-acc small { display: block; font-size: 13px; color: var(--muted); }
.seal-badge { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.seal-empty { width: 26px; height: 26px; border-radius: 50%; border: 2px dashed rgba(184, 178, 220, .5); }
.done-badge { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(98, 232, 192, .2); border: 2px solid var(--mint); color: var(--mint); font-size: 13px; }
.done-badge::after { content: '✓'; }
.unlock-banner { border-radius: 4px; padding: 12px; background: linear-gradient(135deg, rgba(220, 255, 124, .16), rgba(178, 140, 255, .18)); border: 2px solid var(--lime); display: grid; gap: 8px; text-align: left; }
.unlock-banner strong { font-family: var(--pix); font-size: 16px; color: var(--lime); }
.unlock-banner .unlock-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.unlock-banner button { border: 2px solid #f3ffd0; border-radius: 4px; padding: 6px 10px; background: var(--lime); color: #25360c; font-family: var(--pix); font-weight: 700; white-space: nowrap; box-shadow: 0 3px 0 #5a7a1a; }
.result-actions { display: grid; gap: 10px; margin-top: 4px; }

/* aviso de selo sobre o palco */
.seal-toast { position: fixed; z-index: 6; left: 24px; top: calc(var(--top-h) + 14px); display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 5px;
  background: var(--panel-bg); border: 2px solid var(--gold-2); box-shadow: var(--panel-edge); animation: toast-in .35s cubic-bezier(.2, 1.3, .4, 1); max-width: min(440px, 90vw); }
.seal-toast.miss { border-color: rgba(184, 178, 220, .6); }
.seal-toast .seal-badge, .seal-toast .seal-empty { width: 38px; height: 38px; flex: none; } .seal-toast .seal-badge::after { font-size: 20px; }
.seal-toast strong { display: block; font-family: var(--pix); font-size: 17px; color: var(--gold-2); } .seal-toast.miss strong { color: var(--ink); } .seal-toast span { font-size: 16px; color: var(--ink-2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.94); } to { opacity: 1; transform: none; } }
body[data-layout="narrow"] .seal-toast { left: 10px; right: 10px; top: calc(var(--top-h) + 4px); max-width: none; }

/* carregamento, avisos, diálogos */
.loading { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #33236a, #120c2a); transition: opacity .4s; }
.loading.done { opacity: 0; pointer-events: none; }
.loading-card { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 20px; }
.loading-card strong { font-family: var(--pix); font-size: 24px; } .loading-card span { color: var(--muted); }
.loading-bar { width: 220px; height: 10px; border-radius: 2px; border: 2px solid var(--gold); background: rgba(0, 0, 0, .4); overflow: hidden; } .loading-bar i { display: block; height: 100%; width: 10%; background: var(--gold-2); transition: width .3s; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(560px, 92vw); padding: 10px 16px; border-radius: 5px; background: var(--panel-bg); border: 2px solid var(--gold); box-shadow: var(--panel-edge); text-align: center; }
dialog { max-width: min(580px, 94vw); max-height: min(88vh, 900px); overflow-y: auto; border: 2px solid var(--gold); border-radius: 5px; background: #171440; color: var(--ink); padding: 20px 22px; box-shadow: var(--panel-edge), 0 30px 80px rgba(0, 0, 0, .6); }
dialog::backdrop { background: rgba(8, 4, 22, .62); }
dialog h2 { font-size: 24px; margin: 4px 0 10px; color: var(--gold-2); } dialog h3 { font-size: 16px; margin: 16px 0 8px; color: var(--ink-2); }
dialog p { margin: 0 0 10px; }
.close-dialog { position: absolute; right: 12px; top: 10px; border: 2px solid var(--gold); background: rgba(255, 255, 255, .06); width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 1; }
dialog form { margin: 0; }
.range-label { display: flex; justify-content: space-between; font-family: var(--pix); margin-top: 8px; } .range-label output { font-family: var(--text); }
input[type="range"] { width: 100%; accent-color: var(--amber); height: 28px; }
.check-label { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; } .check-label input { width: 20px; height: 20px; accent-color: var(--amber); flex: none; margin-top: 2px; }
.calibration-section { margin-top: 14px; padding-top: 6px; border-top: 2px solid rgba(236, 201, 120, .25); }
.calibration-tap { display: block; width: 100%; margin: 10px 0; padding: 24px; border-radius: 5px; border: 2px solid var(--gold); background: rgba(255, 216, 122, .08); font-family: var(--pix); font-size: 18px; touch-action: manipulation; }
.calibration-tap.pulse { background: rgba(255, 216, 122, .35); }
.option-grid { display: grid; gap: 8px; }
.option-grid.looks { grid-template-columns: 1fr 1fr; } .option-grid.lights { grid-template-columns: repeat(2, 1fr); }
.option { position: relative; display: grid; gap: 6px; text-align: left; padding: 10px; border-radius: 4px; border: 2px solid rgba(236, 201, 120, .25); background: rgba(255, 244, 222, .04); }
.option[aria-pressed="true"] { border-color: var(--gold-2); background: rgba(255, 216, 122, .1); box-shadow: 0 0 0 2px rgba(255, 216, 122, .25); }
.option:disabled { opacity: .65; }
.option img { height: 120px; width: 100%; object-fit: contain; background: linear-gradient(180deg, rgba(255, 176, 106, .25), rgba(106, 58, 168, .25)); border-radius: 3px; }
.option.locked img { filter: grayscale(1) brightness(.45); }
.option strong { font-family: var(--pix); font-size: 15px; } .option span { font-size: 13px; color: var(--muted); }
.swatch { height: 30px; border-radius: 3px; }
.lock { color: var(--gold-2); }
.goal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.goal-list li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 4px; background: rgba(0, 0, 0, .2); border: 2px solid rgba(236, 201, 120, .2); }
.goal-list li.done { border-color: rgba(220, 255, 124, .55); }
.goal-list strong { display: block; font-weight: 400; color: var(--ink); } .goal-list span { font-size: 13px; color: var(--muted); }
.goal-list .gp { font-size: 16px; color: var(--ink-2); text-align: right; }
.goal-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(184, 178, 220, .5); display: grid; place-items: center; font-size: 13px; }
.goal-list li.done .goal-check { background: var(--lime); border-color: var(--lime); color: #25360c; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: #140f30; z-index: 50; margin: 0; }

/* ---------- 2.3.0: guia "Como jogar" (kit da coleção) nas cores e fontes do jogo ---------- */
.cj-fundo { --cj-painel: #0d0c26; --cj-painel-2: #221e52; --cj-texto: #fff4de; --cj-suave: #c9c3ea; --cj-destaque: #ffd87a; --cj-destaque-texto: #3a1c10;
  --cj-borda: #080616; --cj-fonte: 'DotGothic16', ui-monospace, 'Segoe UI', system-ui, sans-serif; --cj-raio: 5px; }
.cj-topo h2, .cj-titulo-cartao { font-family: var(--pix); font-weight: 700; }
.cj-anfitria { object-fit: cover; object-position: 50% 12%; border-radius: 4px; border: 2px solid var(--gold); background: linear-gradient(160deg, #ffb06a, #ff6f9f 60%, #6a3aa8); box-sizing: border-box; }

/* ---------- 2.3.0: tutorial jogável (Passagem de som guiada) ---------- */
.tut-tip { position: absolute; z-index: 2; transform: translate(-50%, calc(-100% - 12px)); width: max-content; max-width: min(92%, 300px); padding: 7px 10px;
  border-radius: 5px; background: rgba(20, 16, 52, .96); border: 2px solid var(--gold-2); box-shadow: var(--panel-edge); color: var(--ink);
  font-size: 15px; line-height: 1.4; text-align: center; pointer-events: none; }
.tut-tip::after { content: ''; position: absolute; top: 100%; left: var(--arrow-x, 50%); transform: translateX(-50%); border: 11px solid transparent; border-top-color: var(--gold-2); }
.tut-tip.waiting { border-color: var(--lime); animation: tut-bob .55s ease-in-out infinite alternate; } .tut-tip.waiting::after { border-top-color: var(--lime); }
.tut-tip b, .tut-banner b { color: var(--lime); font-weight: 400; }
.tut-tip kbd, .tut-banner kbd { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 5px; box-sizing: border-box; border-radius: 4px; vertical-align: middle;
  background: var(--gold-2); color: #3a1c10; border: 2px solid #3a2410; border-bottom-width: 4px; font-size: 15px; line-height: 1; }
.tut-ico { width: 22px; height: 22px; vertical-align: middle; margin-right: 6px; color: var(--gold-2); }
.tut-banner { position: absolute; z-index: 2; left: 6px; right: 6px; top: 6px; padding: 6px 10px; border-radius: 5px; background: rgba(20, 16, 52, .94); border: 2px solid var(--lime);
  box-shadow: var(--panel-edge); text-align: center; font-size: 15px; line-height: 1.4; pointer-events: none; }
.tut-banner b { font-family: var(--pix); font-weight: 700; font-size: 17px; margin-right: 4px; }
.tut-skip { min-height: 44px; padding: 6px 14px; border-radius: 4px; border: 2px solid rgba(236, 201, 120, .7); box-shadow: var(--panel-edge);
  background: rgba(12, 9, 32, .9); color: var(--ink); font-family: var(--pix); font-size: 15px; white-space: nowrap; }
/* Pular tutorial e o aviso de tela deitada ficam fixos logo abaixo da barra de cima, sempre inteiros na tela (fora das pistas) */
.tut-bar { position: fixed; z-index: 6; top: calc(var(--top-h) + 8px); left: 12px; max-width: calc(100vw - 24px); display: flex; align-items: center; gap: 10px; pointer-events: none; }
.tut-bar > * { pointer-events: auto; }
.tut-rotate { margin: 0; padding: 6px 10px; border-radius: 5px; background: var(--panel-bg); border: 2px solid var(--lime); box-shadow: var(--panel-edge);
  font-size: 14px; line-height: 1.35; max-width: 460px; }
.tut-rotate b { color: var(--lime); font-weight: 400; }
body[data-state="paused"] .tut-bar, body[data-state="result"] .tut-bar, body[data-state="menu"] .tut-bar { display: none; }
/* "? Como jogar" no repertório: área de toque de 44 px sem mudar a linha dos outros links (margem negativa compensa o padding) */
#help-button { padding-top: 10px; padding-bottom: 10px; margin-top: -4px; margin-bottom: -4px; }
.tut-skip:hover { border-color: var(--gold-2); color: var(--gold-2); }
.lane-controls button.tut-target { background: rgba(255, 244, 200, .18); outline: 3px solid rgba(255, 244, 200, .9); outline-offset: 1px; animation: tut-glow .6s ease-in-out infinite alternate; }
body.tutorial-on .judgement { bottom: auto; top: 30%; }
@keyframes tut-bob { from { transform: translate(-50%, calc(-100% - 12px)); } to { transform: translate(-50%, calc(-100% - 18px)); } }
@keyframes tut-glow { from { outline-color: rgba(255, 244, 200, .35); } to { outline-color: rgba(255, 244, 200, 1); } }
@media (prefers-reduced-motion: reduce) { .tut-tip.waiting, .lane-controls button.tut-target { animation: none; } }
body.reduced .tut-tip.waiting, body.reduced .lane-controls button.tut-target { animation: none; }

/* ---------- tela estreita (celular em pé) ---------- */
@media (max-width: 859px), (max-aspect-ratio: 1/1) {
  :root { --top-h: 54px; }
  .topbar { padding: 8px 10px; gap: 8px; }
  .brand-person { display: none; } .brand-name { font-size: 14px; } .brand { padding: 4px 8px 4px 4px; }
  .now strong { font-size: 14px; } .now span { font-size: 13px; }
  .card-screen { padding: 14px 14px 18px; }
  .menu-scroll { padding: 12px 12px 10px; } .menu-footer { padding: 10px 12px 12px; }
  .menu-head { gap: 10px; } .menu-head h1 { font-size: 26px; } .portrait { width: 60px; height: 60px; }
  .mode-switch { width: 180px; } .primary-button { padding: 11px 16px; font-size: 18px; }
  .play-hud { padding: 8px 12px 4px; } .hud-score strong { font-size: 18px; } .hud-combo strong { font-size: 28px; }
  .challenge-chip { margin: 2px 8px 4px; padding: 5px 8px; min-height: 46px; } .chip-goal, .chip-state { font-size: 14px; }
  .lane-controls { padding: 4px 6px 8px; } .lane-controls button { height: 64px; }
  .judgement { bottom: 96px; font-size: 24px; }
}
@media (max-width: 380px) { .brand-name { display: none; } }
/* ?foto: cena sem interface (capa) */
body.foto .topbar, body.foto .panel, body.foto .toast, body.foto .seal-toast { display: none !important; }
@media (prefers-reduced-motion: reduce) { .seal-toast, .hud-combo.bump strong, .combo-pop { animation: none; } .judgement { transition: none; } }
body.reduced .seal-toast, body.reduced .hud-combo.bump strong { animation: none; } body.reduced .judgement { transition: none; } body.reduced .combo-pop { animation-duration: .01s; }
/* no celular, o nome da música e a seção já aparecem no cartão do desafio: a barra de cima fica só com a marca e os botões */
body[data-layout="narrow"] .now { visibility: hidden; }
