:root {
  --bg: #07142b; --bg2: #0d2a55; --card: #10244a; --line: #2a4f99; --txt: #eef4ff; --mut: #9db4dd;
  --accent: #7dd3fc; --blue: #3b82f6; --violet: #8b5cf6;
  /* só o 13 e o 22 usam vermelho/amarelo/verde (fora o cenário) */
  --c13: #e11d2e; --c13e: #ffffff; --c22: #ffd400; --c22e: #0b8f3a;
  --font: Bangers, Impact, 'Arial Black', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--txt); font: 16px/1.35 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
body { background: radial-gradient(1200px 600px at 50% -10%, var(--bg2), var(--bg)); min-height: 100dvh; overscroll-behavior: none; }
.hidden { display: none !important; }
.muted { color: var(--mut); } .small { font-size: 12.5px; }
button { font: inherit; color: inherit; cursor: pointer; }

#loading { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; z-index: 80; transition: opacity .4s; }
#loading.done { opacity: 0; pointer-events: none; }
#loading img { width: min(60vw, 320px); }
#loading .bar { width: min(60vw, 320px); height: 10px; border-radius: 6px; background: #ffffff22; overflow: hidden; }
#loading .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--accent)); transition: width .2s; }

/* ---------- home ---------- */
#home { max-width: 760px; margin: 0 auto; padding: 14px 16px 40px; padding-top: max(14px, env(safe-area-inset-top)); }
.hero { text-align: center; }
.logo { width: min(70vw, 340px); filter: drop-shadow(0 6px 14px #0008); }
.tag { margin: 0 0 8px; color: var(--mut); }
.card { background: linear-gradient(180deg, #14305f, var(--card)); border: 2px solid var(--line); border-radius: 18px; padding: 14px 16px; margin: 12px 0; box-shadow: 0 8px 20px #0005; }
.card h2 { margin: 0 0 10px; font-family: var(--font); font-weight: 400; letter-spacing: 1px; font-size: 26px; color: var(--accent); text-shadow: 0 2px 0 #000a; }
.grid { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } .grid .card:last-child { grid-column: span 2; } }

.versus { display: flex; align-items: stretch; justify-content: space-around; gap: 8px; }
.versus .vs { width: 64px; align-self: center; }
.side { flex: 1; text-align: center; border-radius: 14px; padding: 8px 4px 10px; }
.side img { width: 84px; height: 84px; border-radius: 14px; border: 3px solid currentColor; object-fit: cover; background: #0b1d3a; }
.s13 { color: var(--c13); background: #e11d2e18; } .s22 { color: var(--c22); background: #ffd40014; }
.s13 img { box-shadow: 0 0 0 3px var(--c13e); } .s22 img { box-shadow: 0 0 0 3px var(--c22e); }
.side .num { display: block; font-family: var(--font); font-size: 34px; font-weight: 400; line-height: 1; margin-top: 4px; }
.side .big { font-family: var(--font); font-size: 52px; line-height: 1; color: var(--txt); margin-top: 4px; }
.side .mid { font-family: var(--font); font-size: 30px; line-height: 1; color: var(--txt); margin-top: 6px; }
.side small { display: block; color: var(--mut); font-size: 12px; }
.c13 { color: #ff6b76; } .c22 { color: #ffe14d; }

.field { display: block; font-weight: 600; }
input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: #0a1a38; color: var(--txt); font-size: 18px; margin-top: 6px; outline: none; }
input:focus { border-color: var(--accent); }
input.code { text-align: center; letter-spacing: 8px; font-family: var(--font); font-size: 34px; text-transform: uppercase; margin: 0 0 10px; }
.lbl { margin: 8px 0 6px; font-weight: 600; }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; padding: 10px 0; border-radius: 12px; border: 2px solid var(--line); background: #0a1a38; font-family: var(--font); font-size: 24px; }
.seg button.on { background: var(--blue); color: #fff; border-color: #fff4; }
.seg button.s13 { color: #ff6b76; } .seg button.s22 { color: #ffe14d; }
.seg button.s13.on { background: var(--c13); color: #fff; border-color: #fff; }
.seg button.s22.on { background: var(--c22); color: #0a5a26; border-color: var(--c22e); }
.cta { width: 100%; margin-top: 12px; padding: 13px; border-radius: 14px; border: 0; font-family: var(--font); font-size: 26px; letter-spacing: 1px; background: linear-gradient(180deg, #5aa2ff, #2f5fe0); color: #fff; text-shadow: 0 2px 0 #10245c; box-shadow: 0 5px 0 #1b3a9a, 0 8px 14px #0006; }
.cta:active { transform: translateY(3px); box-shadow: 0 2px 0 #1b3a9a; }
.cta:disabled { filter: grayscale(1) brightness(.6); }
.ghost { width: 100%; margin-top: 10px; padding: 11px; border-radius: 14px; border: 2px solid var(--line); background: transparent; font-weight: 600; }

.live { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.live li { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 10px 12px; border-radius: 12px; background: #0a1a38; border: 1px solid var(--line); }
.live li button { padding: 6px 14px; border-radius: 10px; border: 0; background: var(--accent); color: #082a4a; font-weight: 700; }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 8px 6px; text-align: center; border-bottom: 1px solid #ffffff14; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
th { color: var(--mut); font-weight: 600; font-size: 13px; }
footer { text-align: center; margin-top: 18px; }

/* ---------- sala ---------- */
#room { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; background: #000; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
#stage { position: relative; width: min(100vw, calc(100dvh * 16 / 9)); aspect-ratio: 16 / 9; background: #000; }
#cv { width: 100%; height: 100%; display: block; }
#topbar { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 0; pointer-events: none; z-index: 3; }
#topbar > * { pointer-events: auto; }
.pill { white-space: nowrap; font-weight: 700; font-size: 12px; padding: 3px 8px; border-radius: 99px; background: #0008; border: 1px solid #fff3; }
.pill.s13 { background: var(--c13); color: #fff; border-color: #fff; } .pill.s22 { background: var(--c22); color: #0a5a26; border-color: var(--c22e); }
.icon { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #fff4; background: #0008; font-size: 16px; line-height: 1; padding: 0; }
#rec-ind { width: 12px; height: 12px; border-radius: 50%; background: var(--violet); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }

#keys { position: absolute; left: 6px; top: 24%; display: grid; grid-template-columns: auto auto; gap: 3px 4px; font-size: 10px; opacity: .62; pointer-events: none; z-index: 2; }
#keys span { background: #0a1128aa; border: 1px solid #ffffff33; border-radius: 6px; padding: 1px 5px; white-space: nowrap; }
#keys kbd { font: 700 11px/1 ui-monospace, monospace; background: #fff; color: #10245c; border-radius: 4px; padding: 1px 5px; margin-right: 4px; }
body.touch #keys { display: none; }

#panel { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #000a; padding: 8px; overflow: auto; z-index: 4; }
#panel .box { width: min(92%, 440px); max-height: 100%; overflow: auto; background: linear-gradient(180deg, #14305f, var(--card)); border: 2px solid var(--line); border-radius: 18px; padding: 14px 16px; text-align: center; }
#panel-title { font-family: var(--font); font-size: 28px; color: var(--accent); letter-spacing: 1px; }
.roomcode { font-family: var(--font); font-size: 64px; letter-spacing: 12px; line-height: 1; margin: 6px 0; padding-left: 12px; }
.slots { display: flex; gap: 8px; margin: 10px 0; }
.slot { flex: 1; border-radius: 12px; padding: 8px 4px; border: 2px solid currentColor; background: #0006; }
.slot.s13 { color: #ff6b76; } .slot.s22 { color: #ffe14d; }
.slot b { display: block; font-family: var(--font); font-size: 30px; font-weight: 400; line-height: 1; }
.slot span { display: block; color: var(--txt); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot.empty span { color: var(--mut); font-style: italic; }
.row { display: flex; gap: 8px; flex-wrap: wrap; } .row > * { flex: 1; }
.winner { font-family: var(--font); font-size: 40px; line-height: 1.05; margin: 6px 0; }
.vids { display: grid; gap: 6px; margin-top: 8px; }
.vids button { padding: 8px; border-radius: 12px; border: 2px solid var(--violet); background: #1b1450; font-weight: 700; }

/* ---------- controles de toque ---------- */
#controls { width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: space-between; padding: 8px 14px 18px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
body.kb:not(.pad) #controls { display: none !important; }
#left { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
#minis { display: flex; gap: 8px; }
.tb { position: relative; border: 0; background: none; padding: 0; touch-action: none; display: flex; flex-direction: column; align-items: center; transition: transform .05s; }
.tb img { display: block; width: 100%; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.tb small { font: 700 10px/1 system-ui, sans-serif; letter-spacing: .5px; margin-top: 2px; color: #fff; text-shadow: 0 1px 2px #000; pointer-events: none; }
.tb.down { transform: scale(.9); filter: brightness(.8); }
.tb .cnt { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; border-radius: 10px; background: #fff; color: #10245c; font: 800 12px/20px system-ui; text-align: center; border: 2px solid var(--violet); pointer-events: none; }
.tb.off { filter: grayscale(1) brightness(.55); }
#minis .tb { width: 54px; }
#joy { position: relative; width: 150px; height: 150px; touch-action: none; flex: none; }
#joy img { position: absolute; user-select: none; -webkit-user-drag: none; pointer-events: none; }
#joy-base { inset: 0; width: 100%; height: 100%; opacity: .92; }
#joy-knob { width: 56px; height: 56px; left: 47px; top: 47px; }
#btns { display: grid; grid-template-columns: repeat(3, auto); gap: 8px 10px; align-items: end; justify-items: center; }
#btns .tb { width: 64px; } #btns .tb.big { width: 84px; }

#rotate { display: none; position: fixed; inset: 0; z-index: 70; background: radial-gradient(800px 500px at 50% 30%, var(--bg2), var(--bg)); flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; padding: 24px; }
#rotate .phone { width: 74px; height: 124px; border: 6px solid var(--accent); border-radius: 16px; position: relative; animation: rot 2.4s ease-in-out infinite; }
#rotate .phone::after { content: ''; position: absolute; left: 50%; bottom: 7px; width: 18px; height: 4px; margin-left: -9px; border-radius: 2px; background: var(--accent); }
@keyframes rot { 0%, 25% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }
#rotate p { margin: 0; font-family: var(--font); font-size: 30px; letter-spacing: 1px; color: var(--accent); }
#rotate small { color: var(--mut); }
@media (orientation: portrait) { body.in-room.touch #rotate { display: flex; } }

#room.panel-open #controls { visibility: hidden; }

@media (orientation: landscape) and (max-height: 520px) {
  #room { justify-content: center; }
  #controls { position: fixed; inset: 0; pointer-events: none; padding: 0 14px 8px; z-index: 5; }
  #controls > * { pointer-events: auto; }
  #joy { width: 112px; height: 112px; opacity: .88; } #joy-knob { width: 42px; height: 42px; left: 35px; top: 35px; }
  #minis .tb { width: 42px; } #minis .tb small, #btns .tb small { font-size: 8px; }
  #btns { gap: 4px 8px; opacity: .92; }
  #btns .tb { width: 54px; } #btns .tb.big { width: 70px; }
  #left { gap: 4px; }
}
@media (orientation: portrait) {
  body:not(.touch) #stage { margin-bottom: 46px; }
  body:not(.touch) #topbar { top: 100%; bottom: auto; left: 0; transform: none; width: 100%; justify-content: center; padding: 6px; }
}

/* ---------- painéis compactos (celular deitado) ---------- */
@media (max-height: 520px) {
  #panel { align-items: flex-start; padding: 8px; }
  #panel .box { width: min(96%, 640px); padding: 8px 12px; }
  #panel-title { font-size: 22px; }
  .roomcode { font-size: 40px; letter-spacing: 8px; margin: 0; }
  .slots { margin: 6px 0; } .slot b { font-size: 22px; } .slot span { font-size: 13px; }
  .lbl { margin: 4px 0; font-size: 13px; }
  #panel .seg button { padding: 5px 0; font-size: 20px; }
  #panel .cta { margin-top: 8px; padding: 8px; font-size: 22px; }
  #panel .ghost { margin-top: 6px; padding: 6px; font-size: 14px; }
  .winner { font-size: 30px; margin: 2px 0; }
}

dialog { width: min(92vw, 420px); border: 2px solid var(--line); border-radius: 18px; background: var(--card); color: var(--txt); padding: 14px; }
dialog::backdrop { background: #000b; }
dialog h3 { margin: 0 0 8px; font-family: var(--font); font-weight: 400; font-size: 26px; color: var(--accent); }
dialog video { width: 100%; max-height: 50vh; border-radius: 12px; background: #000; }
dialog .row .cta, dialog .row .ghost { margin-top: 10px; font-size: 20px; padding: 10px; }

#toast { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 90; background: #000d; border: 1px solid #fff4; padding: 10px 16px; border-radius: 14px; max-width: 90vw; text-align: center; font-weight: 600; }
#toast button { margin-left: 10px; padding: 4px 12px; border-radius: 8px; border: 0; background: var(--accent); color: #082a4a; font-weight: 700; }

/* ================= v3: nova página inicial ================= */
#home { max-width: 1120px; padding: 12px 16px 36px; }
.home-wrap { display: block; }
.hero { display: flex; align-items: center; justify-content: center; gap: 14px; text-align: left; padding: 4px 0 2px; }
.hero .logo { width: min(34vw, 150px); }
.hero .tag { margin: 0; font-size: 15px; max-width: 24ch; }
.namebar { padding: 10px 14px; margin: 8px 0 10px; }
.namebar .field { display: flex; align-items: center; gap: 12px; }
.namebar input { margin: 0; flex: 1; }
.layout { display: grid; gap: 12px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } .hero { justify-content: flex-start; } .hero .logo { width: 140px; } }
.col-main > .card, .col-side > .card { margin: 0 0 12px; }
.hub { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.hub button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 16px; border: 2px solid var(--line); background: linear-gradient(180deg, #14305f, #0d2147); font-weight: 700; font-size: 13px; line-height: 1.1; text-align: center; }
.hub button b { font-size: 24px; line-height: 1; }
.hub button.on { border-color: var(--accent); background: linear-gradient(180deg, #2c5bb0, #1b3d86); box-shadow: 0 0 0 2px #7dd3fc55, 0 6px 14px #0006; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--violet); color: #fff; font: 800 11px/18px system-ui; font-style: normal; }
.tab h3, .tab .lbl:first-child { margin-top: 0; }
.steps { margin: 4px 0 12px; padding-left: 20px; display: grid; gap: 6px; color: var(--txt); }
.scoreboard h2 { margin-bottom: 6px; }
.scoreboard .side img { width: 64px; height: 64px; }
.scoreboard .side .big { font-size: 44px; } .scoreboard .side .mid { font-size: 26px; }
.versus .vs { width: 52px; }

/* ================= v3: sala ================= */
.pill.btn { cursor: pointer; font-family: inherit; color: inherit; }
.pill.btn.on { background: var(--violet); border-color: #fff; color: #fff; }
.pill#friendly { background: #1b1450; border-color: var(--violet); color: #ddd6fe; }
#minis .tb { width: 48px; }
.tb.glow { animation: glow 0.9s ease-in-out infinite; }
@keyframes glow { 50% { filter: drop-shadow(0 0 10px #7dd3fc) brightness(1.25); transform: scale(1.08); } }
#pad-qr { display: flex; justify-content: center; margin: 8px 0; }
#pad-qr svg, #pad-qr img { width: 160px; height: 160px; background: #fff; padding: 8px; border-radius: 12px; }
#pad-modal { text-align: center; }

/* ================= v3: celular usado como controle ================= */
#padbar { width: 100%; padding: 10px 14px 4px; padding-top: max(10px, env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 8px; }
.pad-top { display: flex; align-items: center; gap: 8px; }
.pad-top b { font-family: var(--font); font-size: 22px; font-weight: 400; letter-spacing: .5px; flex: 1; }
.pad-hp { height: 12px; border-radius: 8px; background: #05101f; border: 2px solid var(--line); overflow: hidden; }
.pad-hp i { display: block; height: 100%; width: 100%; background: linear-gradient(180deg, #ff6b76, #8f0f1c); transition: width .15s; }
body.pad-22 .pad-hp i { background: linear-gradient(180deg, #fff27a, #e6a800); }
#pad-msg { text-align: center; font-size: 13px; }
body.pad #hint { display: none !important; }
body.pad #stage { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: max(100vw, calc(100dvh * 16 / 9)); opacity: .28; pointer-events: none; z-index: 0; } /* a luta de fundo, transparente */
body.pad #stage > :not(canvas) { display: none !important; }
body.pad #padbar { position: relative; z-index: 2; }
body.pad #room { justify-content: flex-start; background: radial-gradient(900px 400px at 50% 0, var(--bg2), #040c1c); }
body.pad #controls { position: fixed; inset: 0; pointer-events: none; align-items: flex-end; padding: 0 16px 10px; z-index: 5; display: flex !important; }
body.pad #controls > * { pointer-events: auto; }
body.pad #joy { width: 130px; height: 130px; } body.pad #joy-knob { width: 48px; height: 48px; left: 41px; top: 41px; }
body.pad #minis .tb { width: 54px; } body.pad #btns .tb { width: 62px; } body.pad #btns .tb.big { width: 82px; }
body.pad #left { gap: 6px; }

/* ajustes v3.1: sem rolagem horizontal no celular */
body { overflow-x: clip; } /* corta o excesso lateral sem criar uma área de rolagem (hidden travava a roda do mouse) */
.layout > *, .col-main, .col-side, .card, .namebar .field { min-width: 0; }
.namebar input { min-width: 0; width: 100%; }
.hub button { min-width: 0; padding: 10px 2px; font-size: 12px; overflow-wrap: anywhere; }
.hero .logo { width: min(42vw, 190px); }
.hero .tag { max-width: 36ch; }
@media (min-width: 900px) { .hero .logo { width: 190px; } .hero .tag { font-size: 17px; } }
.seg button { min-width: 0; padding-left: 4px; padding-right: 4px; }
@media (max-width: 440px) { table { font-size: 13px; } th, td { padding: 7px 3px; } th:first-child, td:first-child { max-width: 90px; } }

/* ================= v3.2 ================= */
.quick { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 6px 0 4px; }
.quick a { padding: 8px 16px; border-radius: 99px; border: 2px solid var(--line); background: #0a1a38; color: var(--txt); text-decoration: none; font-weight: 700; font-size: 14px; }
.quick a:hover { border-color: var(--accent); }
.quick small { color: var(--violet); }
.paid select, .paid input { width: 100%; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: #0a1a38; color: var(--txt); font-size: 16px; margin: 0 0 4px; }
.paid select:disabled, .paid input:disabled { opacity: .5; }
.lock { color: var(--violet); font-weight: 700; }
input.pad8 { letter-spacing: 4px; font-size: 26px; }
.padcode { font-family: var(--font); font-size: 44px; letter-spacing: 6px; line-height: 1; margin: 6px 0; word-break: break-all; }
.cpusides { display: flex; gap: 8px; margin: 8px 0; }
.cpuside { flex: 1; border-radius: 12px; padding: 8px; text-align: center; border: 2px solid currentColor; background: #0004; }
.cpuside b { display: block; font-family: var(--font); font-size: 28px; font-weight: 400; line-height: 1; }
.cpuside span { color: var(--txt); font-size: 13px; }
.cpuside.s13 { color: #ff6b76; } .cpuside.s22 { color: #ffe14d; }

/* ================= v3.3: introdução ================= */
#intro { max-width: 760px; margin: 0 auto; padding: 14px 16px 40px; padding-top: max(14px, env(safe-area-inset-top)); text-align: center; }
.intro-hero .logo { width: min(48vw, 210px); filter: drop-shadow(0 6px 14px #0008); }
.intro-hero h1 { font-family: var(--font); font-weight: 400; font-size: clamp(28px, 6vw, 40px); margin: 4px 0; letter-spacing: 1px; }
.intro-hero h1 span { color: var(--accent); }
.intro-hero p { margin: 0 0 6px; color: var(--mut); }
.avail { border-color: var(--violet); background: linear-gradient(180deg, #25186a, #140f3c); }
.avail-title { font-family: var(--font); font-size: 24px; color: #ddd6fe; letter-spacing: 1px; }
.avail-dates { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 8px 0 2px; }
.avail-dates small { display: block; color: #a5b4fc; font-weight: 700; letter-spacing: 2px; font-size: 11px; }
.avail-dates b { font-family: var(--font); font-weight: 400; font-size: clamp(26px, 6vw, 38px); letter-spacing: 1px; color: #fff; }
.avail-arrow { font-size: 28px; color: var(--accent); }
.avail-note { color: #c7d2fe; font-size: 13px; font-weight: 600; }
.avail-status { margin-top: 8px; display: inline-block; padding: 6px 14px; border-radius: 99px; background: #0b1d3a; border: 1px solid var(--accent); color: #e0f2fe; font-weight: 700; }
.avail-status.open { background: #1e3a8a; border-color: #fff; }
.avail-status.closed { border-color: #94a3b8; color: #cbd5e1; }
.avail-local { margin-top: 6px; color: var(--mut); font-size: 12.5px; }
.demo { text-align: left; }
.demo h2 { margin-bottom: 2px; }
.demo-lead { margin: 0 0 8px; }
.demo-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.demo-top .lbl { margin: 0; }
.seg.mini { width: auto; } .seg.mini button { padding: 4px 16px; font-size: 22px; flex: none; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--mut); cursor: pointer; margin-left: auto; }
.chk input { width: 18px; height: 18px; margin: 0; }
.demo-stage { position: relative; border-radius: 14px; overflow: hidden; border: 2px solid var(--line); background: #000; aspect-ratio: 16 / 9; touch-action: manipulation; }
.demo-stage canvas { width: 100%; height: 100%; display: block; }
#demo-flash { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); font-family: var(--font); font-size: clamp(32px, 9vw, 64px); color: #fff; text-shadow: 0 3px 0 #2b3fb8, 0 0 24px #7dd3fc; pointer-events: none; animation: pop .4s ease-out; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.5); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.demo-hint { margin: 10px 0 6px; padding: 8px 12px; border-radius: 12px; background: #0b1d3a; border: 1px solid var(--line); font-weight: 600; text-align: center; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.demo-pad { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0; touch-action: none; }
.dm { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2px solid var(--line); background: linear-gradient(180deg, #14305f, #0d2147); border-radius: 14px; padding: 6px 8px; min-width: 68px; user-select: none; -webkit-user-select: none; touch-action: none; transition: transform .05s; }
.dm img { width: 44px; height: 44px; pointer-events: none; }
.dm span { font: 700 11px/1 system-ui, sans-serif; letter-spacing: .5px; pointer-events: none; }
.dm.walk { justify-content: center; font-size: 26px; min-width: 52px; }
.dm.down { transform: scale(.92); border-color: var(--accent); filter: brightness(1.25); }
.keys-tip kbd, .intro-hero kbd { font: 700 11px/1 ui-monospace, monospace; background: #fff; color: #10245c; border-radius: 4px; padding: 2px 5px; margin: 0 2px; }
body.touch .keys-tip { display: none; }
.checks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px; }
.checks li { padding: 6px 10px; border-radius: 10px; background: #0a1a38; border: 1px solid var(--line); font-size: 14px; color: var(--mut); }
.checks li::before { content: '○  '; color: var(--mut); }
.checks li.done { color: #e0f2fe; border-color: var(--accent); background: #12306a; }
.checks li.done::before { content: '✔  '; color: var(--accent); }
.cta.enter { margin-top: 16px; font-size: 32px; padding: 16px; animation: nudge 2.2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: scale(1.02); } }
.home-avail { margin: 4px 0 0; font-size: 13px; color: #c7d2fe; font-weight: 600; }
.hero .home-avail { max-width: 36ch; }
@media (prefers-reduced-motion: reduce) { .cta.enter { animation: none; } }

#intro a { color: var(--accent); }
.demo-hint span { display: block; }
.avail-dates { gap: 8px; }
.avail-dates b { white-space: nowrap; font-size: clamp(19px, 5.6vw, 38px); }
.avail-arrow { font-size: clamp(18px, 5vw, 28px); }

/* ================= v3.4: introdução enxuta, treinamento, encerramento ================= */
.cdlabel { margin-top: 8px; font-weight: 800; letter-spacing: 3px; font-size: 12px; color: #a5b4fc; min-height: 14px; }
.cd { display: flex; gap: 8px; justify-content: center; margin: 4px 0 6px; }
.cdbox { min-width: 64px; padding: 6px 6px 4px; border-radius: 12px; background: #0b1d3a; border: 2px solid var(--accent); text-align: center; }
.cdbox b { display: block; font-family: var(--font); font-weight: 400; font-size: clamp(28px, 7.5vw, 40px); line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.cdbox i { font-style: normal; font-size: 11px; color: #a5b4fc; letter-spacing: 1px; }
.pickrow { display: flex; gap: 10px; margin-top: 10px; }
.pickbtn { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; border: 3px solid currentColor; background: #0b1d3a; text-align: left; transition: transform .1s; }
.pickbtn:active { transform: scale(.97); }
.pickbtn img { width: 58px; height: 58px; border-radius: 12px; object-fit: cover; flex: none; }
.pickbtn b { font-family: var(--font); font-weight: 400; font-size: 40px; line-height: 1; }
.pickbtn span { display: block; font-size: 13px; color: var(--txt); font-weight: 700; }
.pickbtn.s13 { color: var(--c13); box-shadow: inset 0 0 0 2px #fff3; } .pickbtn.s22 { color: var(--c22); box-shadow: inset 0 0 0 2px #0b8f3a88; }
.pickbtn > b, .pickbtn > span { display: block; }
.demo-pad.two { justify-content: center; } .demo-pad.two .dm { min-width: 110px; padding: 8px 14px; } .demo-pad.two .dm img { width: 56px; height: 56px; }
.checks.two { grid-template-columns: 1fr 1fr; }
.train-h, .close-h { font-family: var(--font); font-weight: 400; font-size: clamp(30px, 7vw, 44px); margin: 4px 0 8px; color: var(--accent); letter-spacing: 1px; }
.close-lead { color: var(--mut); margin: 0 0 8px; }
.winner-banner { font-family: var(--font); font-size: clamp(30px, 7vw, 46px); padding: 6px; border-radius: 14px; margin: 6px 0 10px; border: 3px solid var(--accent); background: #0b1d3a; }
.winner-banner.s13 { color: #fff; border-color: #fff; background: var(--c13); } .winner-banner.s22 { color: #0a5a26; border-color: var(--c22e); background: var(--c22); }
#closing, #training { max-width: 760px; margin: 0 auto; padding: 14px 16px 40px; text-align: center; }
#closing .scoreboard .side img { width: 76px; height: 76px; }
.thanks p { font-size: 17px; line-height: 1.5; }
.intro-links { margin: 10px 0 0; }
.cta.enter:disabled { animation: none; filter: grayscale(.4) brightness(.8); cursor: not-allowed; }
/* a introdução/treinamento/encerramento são páginas comuns: devem rolar normalmente no computador */
#intro, #training, #closing { overflow: visible; touch-action: pan-y; }
.pill.btn.dim { opacity: .45; }

/* ================= testador: painel do checklist ================= */
#tpanel { position: absolute; right: 6px; top: 140px; bottom: 44px; width: min(270px, 42%); z-index: 3; display: flex; flex-direction: column; background: #07142bdd; border: 2px solid var(--violet); border-radius: 14px; padding: 8px 10px; font-size: 12px; overflow: hidden; }
#tpanel header { display: flex; align-items: center; gap: 8px; } #tpanel header b { flex: 1; font-family: var(--font); font-weight: 400; font-size: 17px; letter-spacing: .5px; color: #ddd6fe; }
#tpanel .icon { width: 26px; height: 26px; font-size: 14px; }
.tp-bar { height: 8px; border-radius: 6px; background: #1b1450; margin: 6px 0; overflow: hidden; } .tp-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8b5cf6, #7dd3fc); transition: width .3s; }
#tp-step { margin-bottom: 6px; } .tp-tour { color: #a5b4fc; } .tp-now { font-weight: 800; color: #fff; font-size: 13px; }
#tp-list { overflow-y: auto; flex: 1; } .tp-group h4 { margin: 8px 0 2px; color: var(--accent); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.tp-item { padding: 1px 0; color: #94a3b8; } .tp-item.ok { color: #e0f2fe; } .tp-item.bad { color: #f9a8d4; }
#tpanel.collapsed { bottom: auto; } #tpanel.collapsed #tp-list, #tpanel.collapsed #tp-step { display: none; }
@media (max-width: 700px) { #tpanel { width: 46%; top: 120px; } }
.roomcode.named { font-size: clamp(26px, 6vw, 44px); letter-spacing: 2px; padding-left: 0; overflow-wrap: anywhere; }
.tp-item { display: flex; align-items: flex-start; gap: 6px; }
.tp-one { flex: none; width: 22px; height: 20px; padding: 0; font-size: 10px; border-radius: 6px; border: 1px solid #8b5cf6; background: #1b1450; color: #ddd6fe; cursor: pointer; }
.tp-one:hover { background: #8b5cf6; color: #fff; }
.tp-start { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 10px; background: #1b1450; color: #ddd6fe; }
.tp-start b { color: #fff; font-size: 13px; }
.tp-play { min-height: 34px; border-radius: 10px; border: 2px solid var(--ink, #10245c); font-weight: 800; color: #fff; background: linear-gradient(180deg,#b79cff,#8b5cf6 55%,#6d33dd); cursor: pointer; }
