:root {
  --bg: #141826;
  --bg-deep: #07080c;
  --brand-blue: #168fe8;
  --brand-red: #f23b2e;
  --brand-orange: #ff7a1a;
  --panel: rgba(255, 255, 255, 0.1);
  --panel-strong: #ffffff;
  --ink: #ffffff;
  --ink-dark: #1d1d1f;
  --muted: rgba(255, 255, 255, 0.72);
  --red: #e21b3c;
  --blue: #1368ce;
  --yellow: #d89e00;
  --green: #26890c;
  --pink: #f2552e;
  --gold: #ffc531;
  --ok: #26890c;
  --bad: #e21b3c;
  --radius: 14px;
  --shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(circle at 0% 0%, rgba(22, 143, 232, 0.32), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(242, 59, 46, 0.28), transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%) fixed;
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input { font: inherit; }
#app { min-height: 100%; display: flex; flex-direction: column; }

/* Formas flutuantes de fundo */
.bg-shapes { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.bg-shapes span {
  position: absolute; opacity: 0.08; animation: float 18s ease-in-out infinite;
  width: 160px; height: 160px; background: #fff;
}
.bg-shapes span:nth-child(1) { left: 5%; top: 10%; border-radius: 50%; }
.bg-shapes span:nth-child(2) { right: 8%; top: 20%; transform: rotate(45deg); animation-delay: -4s; }
.bg-shapes span:nth-child(3) { left: 15%; bottom: 8%; clip-path: polygon(50% 0, 100% 100%, 0 100%); animation-delay: -8s; }
.bg-shapes span:nth-child(4) { right: 20%; bottom: 15%; animation-delay: -12s; width: 110px; height: 110px; }
@keyframes float { 50% { translate: 0 -40px; rotate: 20deg; } }
.screen { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; }

/* Botões */
.btn {
  border: 0; border-radius: 10px; padding: 14px 22px; cursor: pointer;
  background: var(--panel-strong); color: var(--ink-dark); font-weight: 800; font-size: 1.05rem;
  box-shadow: var(--shadow); transition: transform 0.08s, filter 0.15s;
}
.btn:hover { filter: brightness(0.95); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--brand-blue); color: #fff; }
.btn.pink { background: var(--pink); color: #fff; }
.btn.red { background: var(--red); color: #fff; }
.btn.green { background: var(--green); color: #fff; }
.btn.ghost { background: transparent; color: #fff; box-shadow: none; border: 2px solid rgba(255,255,255,.4); }
.btn.big { font-size: 1.4rem; padding: 18px 34px; }
.btn.small { padding: 8px 14px; font-size: 0.9rem; }

.card {
  background: var(--panel-strong); color: var(--ink-dark); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.pill {
  display: inline-block; background: rgba(0,0,0,.35); color: #fff; padding: 6px 14px;
  border-radius: 999px; font-weight: 700; font-size: 0.95rem;
}
.muted { color: var(--muted); }
.center { text-align: center; }
.grow { flex: 1; }
.row { display: flex; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.title {
  font-weight: 900; letter-spacing: -0.02em; line-height: 1.05; margin: 0;
  text-shadow: 0 4px 0 rgba(0,0,0,.2);
}
.logo { font-weight: 900; font-size: clamp(2.2rem, 7vw, 4.5rem); letter-spacing: -0.03em; }
.logo b { color: var(--gold); }

/* Cores e formas das 4 opções */
.opt-0 { background: var(--red); }
.opt-1 { background: var(--blue); }
.opt-2 { background: var(--yellow); }
.opt-3 { background: var(--green); }
.shape { width: 1.3em; height: 1.3em; flex: none; fill: #fff; }

/* Temporizador */
.timer {
  width: 92px; height: 92px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-blue), var(--brand-red)); display: grid; place-items: center;
  font-size: 2.4rem; font-weight: 900; box-shadow: var(--shadow);
}
.timebar { height: 10px; background: rgba(255,255,255,.2); border-radius: 99px; overflow: hidden; }
.timebar > i { display: block; height: 100%; background: var(--gold); width: 100%; border-radius: 99px; }

/* Avatares */
.avatar {
  display: inline-grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 50%;
  background: rgba(255,255,255,.18); font-size: 1.4em; flex: none;
}
.player-chip {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(0,0,0,.3);
  padding: 6px 14px 6px 6px; border-radius: 999px; font-weight: 800; animation: pop .35s ease-out;
}
.player-chip.off { opacity: .45; }
@keyframes pop { 0% { transform: scale(.3); opacity: 0 } 70% { transform: scale(1.12) } 100% { transform: scale(1) } }
@keyframes bounce-in { 0% { transform: translateY(30px) scale(.9); opacity: 0 } 100% { transform: none; opacity: 1 } }
@keyframes pulse { 50% { transform: scale(1.06) } }
.bounce-in { animation: bounce-in .45s cubic-bezier(.2,1.4,.4,1) both; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }

/* Classificação */
.ranking { display: flex; flex-direction: column; gap: 10px; width: min(820px, 100%); margin: 0 auto; }
.rank-row {
  display: flex; align-items: center; gap: 14px; background: #fff; color: var(--ink-dark);
  border-radius: 10px; padding: 12px 18px; font-size: 1.35rem; font-weight: 800; box-shadow: var(--shadow);
}
.rank-row .pos { width: 2.2em; font-weight: 900; color: #6b6b6b; }
.rank-row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .delta { color: var(--green); font-size: .95rem; }
.rank-row.first { background: var(--gold); }

/* Pódio */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 16px; margin-top: auto; }
.podium .step { width: min(26vw, 230px); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.podium .block {
  width: 100%; border-radius: 10px 10px 0 0; display: grid; place-items: center;
  font-size: 3.4rem; font-weight: 900; box-shadow: inset 0 -10px 0 rgba(0,0,0,.15);
  animation: rise 1s cubic-bezier(.2,1.2,.4,1) both;
}
.podium .p1 .block { height: 300px; background: var(--gold); color: var(--ink-dark); animation-delay: 1.6s; }
.podium .p2 .block { height: 220px; background: #cfd3dc; color: var(--ink-dark); animation-delay: .9s; }
.podium .p3 .block { height: 160px; background: #d58b4c; color: var(--ink-dark); animation-delay: .2s; }
.podium .who { font-size: 1.4rem; font-weight: 900; text-align: center; animation: bounce-in .5s both; }
.podium .p1 .who { animation-delay: 2.3s; } .podium .p2 .who { animation-delay: 1.6s; } .podium .p3 .who { animation-delay: .9s; }
.podium .who .avatar { font-size: 2.2rem; }
@keyframes rise { from { transform: scaleY(0); transform-origin: bottom } to { transform: scaleY(1); transform-origin: bottom } }

/* Ecrãs grandes (TV) */
.host-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px;
  background: rgba(0,0,0,.2);
}
.host-body { flex: 1; display: flex; flex-direction: column; padding: 24px; gap: 20px; }
.host-foot { display: flex; justify-content: flex-end; gap: 12px; padding: 0 24px 20px; }

.question-box {
  background: #fff; color: var(--ink-dark); border-radius: 10px; padding: 22px 28px; text-align: center;
  font-size: clamp(1.5rem, 3.4vw, 3rem); font-weight: 900; box-shadow: var(--shadow); line-height: 1.15;
}
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answer {
  display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 8px; color: #fff;
  font-size: clamp(1.1rem, 2.4vw, 2rem); font-weight: 800; box-shadow: var(--shadow); min-height: 100px;
}
.answer.dim { opacity: .3; }
.answer .check { margin-left: auto; font-size: 1.6em; }

.bars { display: flex; align-items: flex-end; justify-content: center; gap: 22px; height: 240px; }
.bars .bar { width: 110px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bars .bar i { display: block; width: 100%; border-radius: 6px 6px 0 0; min-height: 10px; transition: height .8s cubic-bezier(.2,1.2,.4,1); }
.bars .bar b { font-size: 1.8rem; }

/* Letra do Stop */
.letter {
  width: 1.4em; height: 1.4em; display: grid; place-items: center; background: #fff; color: var(--bg);
  border-radius: 22px; font-weight: 900; box-shadow: 0 10px 0 rgba(0,0,0,.25); font-size: clamp(6rem, 18vw, 14rem);
}
.letter.spin { animation: wobble .12s linear infinite; }
@keyframes wobble { 50% { transform: rotate(-4deg) scale(1.03) } }
.letter.small { font-size: 3.2rem; border-radius: 12px; box-shadow: 0 5px 0 rgba(0,0,0,.25); }
.stop-banner {
  font-size: clamp(5rem, 20vw, 16rem); font-weight: 900; color: #fff; background: var(--red);
  padding: 0 .4em; border-radius: 24px; transform: rotate(-6deg); box-shadow: 0 14px 0 rgba(0,0,0,.25);
  animation: slam .4s cubic-bezier(.2,1.6,.4,1) both;
}
@keyframes slam { from { transform: scale(3) rotate(-20deg); opacity: 0 } }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.answer-card {
  background: #fff; color: var(--ink-dark); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px; animation: bounce-in .4s both;
}
.answer-card .who { display: flex; align-items: center; gap: 8px; font-size: .95rem; color: #555; }
.answer-card .who .avatar { font-size: 1rem; }
.answer-card .word { font-size: 1.6rem; font-weight: 900; word-break: break-word; }
.answer-card .meta { display: flex; justify-content: space-between; align-items: center; font-weight: 800; }
.answer-card.bad { background: #ffd9de; }
.answer-card.bad .word { text-decoration: line-through; color: #a01229; }
.answer-card.good { background: #dff5d6; }
.tag { font-size: .8rem; padding: 3px 8px; border-radius: 6px; background: #eee; color: #444; font-weight: 800; }
.tag.red { background: var(--red); color: #fff; }
.tag.green { background: var(--green); color: #fff; }
.tag.gold { background: var(--gold); color: var(--ink-dark); }

.progress-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.progress-item { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.25); padding: 10px 14px; border-radius: 12px; }
.progress-item .grow .timebar > i { background: var(--green); }

/* Lobby do anfitrião */
.lobby-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.join-box { display: flex; gap: 20px; align-items: center; }
.join-box img { width: 190px; height: 190px; border-radius: 12px; background: #fff; padding: 6px; }
.code-big { font-size: clamp(3rem, 7vw, 5.6rem); font-weight: 900; letter-spacing: .08em; line-height: 1; color: var(--ink-dark); }
.game-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.game-card { display: flex; flex-direction: column; gap: 12px; }
.game-card h3 { margin: 0; font-size: 1.8rem; font-weight: 900; }
.game-card .emoji { font-size: 2.6rem; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
.field input[type=number] { width: 80px; padding: 8px; border-radius: 8px; border: 2px solid #ddd; font-weight: 800; text-align: center; background: #fff; color: var(--ink-dark); color-scheme: light; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 2px solid #ccc; background: #fff; color: #444; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-weight: 800; font-size: .9rem;
}
.chip.on { background: var(--bg); border-color: var(--bg); color: #fff; }
.players-wrap { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; min-height: 60px; }
.players-wrap .player-chip { cursor: pointer; font-size: 1.15rem; }
.players-wrap .player-chip:hover { background: var(--red); }

.birthday-banner {
  font-size: clamp(1.4rem, 3vw, 2.4rem); font-weight: 900; cursor: pointer;
}
.birthday-banner b { color: var(--gold); }

/* Telemóvel */
.phone { flex: 1; display: flex; flex-direction: column; padding: 16px; gap: 14px; max-width: 560px; width: 100%; margin: 0 auto; }
.phone-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.phone .answers-phone { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; min-height: 60vh; }
.phone .answers-phone button {
  border: 0; border-radius: 10px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; font-weight: 800; font-size: 1rem; padding: 10px; box-shadow: var(--shadow); cursor: pointer;
}
.phone .answers-phone button .shape { width: 56px; height: 56px; }
.phone .answers-phone button:active { transform: translateY(4px); }
.feedback { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; }
.feedback .big-icon { font-size: 5rem; line-height: 1; }
.feedback-good { background: var(--green); }
.feedback-bad { background: var(--red); }
.score-bar {
  position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center;
  background: #fff; color: var(--ink-dark); padding: 12px 18px; font-weight: 900; font-size: 1.1rem;
}
input.text {
  width: 100%; padding: 16px; border-radius: 10px; border: 3px solid transparent; font-size: 1.2rem; font-weight: 800;
  background: #fff; color: var(--ink-dark); outline: none;
}
input.text:focus { border-color: var(--gold); }
input.text.code { text-align: center; letter-spacing: .3em; text-transform: uppercase; font-size: 1.8rem; }
input.text.warn { border-color: var(--red); }
.avatars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatars button { min-width: 0; aspect-ratio: 1; font-size: 1.6rem; padding: 0; border-radius: 10px; border: 3px solid transparent; background: rgba(255,255,255,.15); cursor: pointer; }
.avatars button.on { border-color: var(--gold); background: rgba(255,255,255,.35); }
.error { background: var(--red); padding: 10px 14px; border-radius: 10px; font-weight: 800; }
.stop-fields { display: flex; flex-direction: column; gap: 10px; padding-bottom: 90px; }
.stop-fields label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); font-weight: 800; }
.stop-fields input:disabled { opacity: .7; }
.stop-btn {
  position: fixed; left: 50%; bottom: 14px; translate: -50% 0; width: min(520px, calc(100% - 32px));
  font-size: 1.6rem; padding: 16px; border-radius: 14px; z-index: 5;
}
.vote-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 90px; }
.vote-item {
  display: flex; align-items: center; gap: 10px; background: #fff; color: var(--ink-dark); padding: 12px; border-radius: 12px; box-shadow: var(--shadow);
}
.vote-item .word { font-size: 1.25rem; font-weight: 900; word-break: break-word; }
.vote-item .who { font-size: .85rem; color: #666; }
.vote-item .toggle { margin-left: auto; display: flex; gap: 6px; }
.vote-item .toggle button { border: 0; border-radius: 10px; width: 52px; height: 48px; font-size: 1.5rem; background: #eee; cursor: pointer; opacity: .45; }
.vote-item .toggle button.on { opacity: 1; }
.vote-item .toggle button.yes.on { background: #bfeab0; }
.vote-item .toggle button.no.on { background: #ffb8c2; }
.vote-item.mine { background: rgba(255,255,255,.85); }
.vote-item.auto { background: #ffd9de; }

.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

@media (max-width: 900px) {
  .lobby-grid, .game-cards { grid-template-columns: 1fr; }
  .join-box img { width: 130px; height: 130px; }
  .answers { grid-template-columns: 1fr; }
  .bars .bar { width: 60px; }
  .podium .block { font-size: 2rem; }
  .podium .p1 .block { height: 190px; } .podium .p2 .block { height: 140px; } .podium .p3 .block { height: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* Retoques */
.stop-btn:disabled { opacity: 1; background: #5a2a2a; color: rgba(255,255,255,.6); }
.players-wrap .player-chip { font-size: 1.4rem; }

/* Forca */
.hangman { width: 100%; height: auto; }
.hangman line, .hangman circle { stroke-width: 6; stroke-linecap: round; fill: none; }
.hangman .gallows line { stroke: rgba(255,255,255,.55); }
.hangman .body line, .hangman .body circle { stroke: #fff; }
.hangman.dark .gallows line { stroke: #b9b9c6; }
.hangman.dark .body line, .hangman.dark .body circle { stroke: var(--ink-dark); }
.hangman.dead .body line, .hangman.dead .body circle { stroke: var(--red); }
.word-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; }
.word-group { display: flex; gap: 6px; }
.tile {
  width: 1.4em; height: 1.7em; display: grid; place-items: center; border-bottom: 5px solid #fff;
  font-weight: 900; font-size: clamp(1.4rem, 4vw, 3.4rem); text-transform: uppercase;
}
.tile.on { animation: pop .3s ease-out; }
.tile.sep { border-bottom-color: transparent; }
.word-tiles.small .tile { font-size: 1.5rem; border-bottom-width: 4px; }
.word-tiles.small { gap: 6px 16px; }
.word-tiles.small .word-group { gap: 4px; }
.keyboard { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.keyboard button {
  border: 0; border-radius: 8px; padding: 12px 0; font-weight: 900; font-size: 1.15rem; cursor: pointer;
  background: #fff; color: var(--ink-dark); box-shadow: 0 4px 0 rgba(0,0,0,.25); min-width: 0;
}
.keyboard button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.keyboard button.hit { background: var(--green); color: #fff; }
.keyboard button.miss { background: rgba(255,255,255,.2); color: rgba(255,255,255,.5); box-shadow: none; }
.keyboard button:disabled { cursor: default; }
.lives { display: flex; gap: 4px; font-size: 1.2rem; }
.forca-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.forca-player {
  background: rgba(0,0,0,.25); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
}
.forca-player .hangman { width: 70px; }
.forca-player.solved { background: var(--green); }
.forca-player.failed { background: rgba(226,27,60,.55); }

/* Equipas */
.team-cols { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.team-col { background: rgba(0,0,0,.25); border-radius: 12px; border-top: 8px solid #fff; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.team-head { font-size: 1.4rem; font-weight: 900; text-align: center; }
.team-col .players-wrap { min-height: 0; }
.team-bars { display: flex; flex-direction: column; gap: 8px; width: min(820px, 100%); margin: 0 auto; }
.team-bar { display: flex; align-items: center; gap: 12px; background: rgba(0,0,0,.3); border-radius: 10px; padding: 10px 16px; font-size: 1.3rem; font-weight: 900; }
.team-bar .pos { width: 2.2em; color: var(--gold); }
.team-bar .tname { width: 11em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-bar .track { flex: 1; height: 18px; background: rgba(255,255,255,.15); border-radius: 99px; overflow: hidden; }
.team-bar .track i { display: block; height: 100%; border-radius: 99px; transition: width .8s; }
.team-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.team-pick button {
  border: 4px solid transparent; border-radius: 14px; padding: 14px 8px; color: #fff; font-weight: 900; font-size: 1.05rem;
  cursor: pointer; box-shadow: var(--shadow); opacity: .6;
}
.team-pick button.on { opacity: 1; border-color: #fff; transform: scale(1.03); }
.team-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; color: #fff; font-size: .85rem; font-weight: 900; }
@media (max-width: 600px) { .team-bar .tname { width: 7em; font-size: 1rem; } }

.notice { background: rgba(255,255,255,.95); color: var(--ink-dark); padding: 12px 14px; border-radius: 10px; font-weight: 800; text-align: center; }

/* Marca Tatami */
.brand-hero { width: min(420px, 80vw, 52vh); height: auto; filter: drop-shadow(0 0 24px rgba(22,143,232,.25)) drop-shadow(0 0 24px rgba(242,59,46,.2)); }
.brand-mini { width: 64px; height: 44px; object-fit: contain; flex: none; }
.wordmark {
  font-weight: 900; letter-spacing: .22em; font-size: clamp(2.4rem, 8vw, 4.6rem); line-height: 1; margin: 0;
  background: linear-gradient(90deg, var(--brand-blue) 0%, #f5f4ef 48%, #f5f4ef 52%, var(--brand-red) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wordmark.small { font-size: 1.1rem; letter-spacing: .18em; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* Xiz Bola */
.xb-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; aspect-ratio: 1; width: 100%; background: rgba(255,255,255,.25); border-radius: 12px; padding: 6px; }
.xb-cell { background: var(--bg); border-radius: 8px; display: grid; place-items: center; font-weight: 900; font-size: clamp(1.2rem, 9vw, 4.5rem); line-height: 1; border: 0; color: #fff; }
.xb-cell.free { cursor: pointer; }
.xb-cell.free:active { background: #222a40; }
.xb-cell.win { background: var(--gold); }
.xb-X { color: var(--brand-blue); }
.xb-O { color: var(--brand-red); }
.xb-cell.win .xb-X, .xb-cell.win .xb-O { color: var(--ink-dark); }
.xb-board.mini { gap: 3px; padding: 3px; border-radius: 8px; }
.xb-board.mini .xb-cell { font-size: 1.4rem; border-radius: 4px; }
.xb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.xb-match { background: rgba(0,0,0,.3); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.xb-match.done { outline: 3px solid var(--gold); }
.xb-vs { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-weight: 900; font-size: .95rem; }
.xb-vs span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xb-vs .turn { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 3px; }
.xb-duel { display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 1.5rem; font-weight: 900; background: rgba(0,0,0,.3); border-radius: 14px; padding: 14px 20px; }
.xb-duel .vs { color: var(--gold); font-size: 1.1rem; }
.xb-phone { width: min(360px, 88vw); margin: 0 auto; }

/* Avançar sozinho */
.auto-c { margin-left: 8px; display: inline-block; min-width: 1.6em; padding: 0 6px; border-radius: 99px; background: rgba(255,255,255,.25); font-size: .9em; }
.auto-badge {
  position: fixed; top: 12px; left: 50%; translate: -50% 0; z-index: 20; background: rgba(0,0,0,.6); color: #fff;
  padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: .9rem; pointer-events: none;
}
.chip-del { margin-left: 4px; padding: 0 5px; border-radius: 99px; background: rgba(255,255,255,.3); font-weight: 900; }
.chip:not(.on) .chip-del { background: #ddd; }

/* Enigmo */
.en-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: min(980px, 100%); }
.en-col { background: rgba(0,0,0,.3); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.en-head { font-weight: 900; font-size: 1.2rem; text-align: center; color: var(--gold); }
.en-card { background: #fff; color: var(--ink-dark); border-radius: 8px; padding: 8px 12px; font-weight: 800; font-size: 1.15rem; text-align: center; }
.en-card.out { background: rgba(255,255,255,.12); color: rgba(255,255,255,.45); text-decoration: line-through; }
.en-card.hit { outline: 3px solid var(--brand-red); animation: pulse 1.2s ease-in-out 3; }
.en-strike { color: var(--brand-red); text-decoration: line-through; text-decoration-thickness: 4px; }
.en-solution { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: min(980px, 100%); }
.en-sol { background: var(--gold); color: var(--ink-dark); border-radius: 14px; padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.en-sol .muted { color: #5a4a10; font-weight: 800; }
.en-sol b { font-size: clamp(1.1rem, 2.6vw, 2rem); font-weight: 900; }
.en-sol:nth-child(2) { animation-delay: .5s; } .en-sol:nth-child(3) { animation-delay: 1s; }
.en-hand { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.en-note { background: rgba(0,0,0,.35); border-radius: 12px; padding: 12px 14px; font-size: 1.1rem; line-height: 1.4; }
.en-pad { display: flex; flex-direction: column; gap: 8px; padding-bottom: 90px; }
.en-pad .en-head { text-align: left; font-size: 1rem; margin-top: 4px; }
.en-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.en-chip { border: 3px solid transparent; border-radius: 10px; padding: 12px 8px; background: #fff; color: var(--ink-dark); font-weight: 800; font-size: 1rem; cursor: pointer; min-width: 0; }
.en-chip.out { background: rgba(255,255,255,.14); color: rgba(255,255,255,.5); text-decoration: line-through; }
.en-chip.on { border-color: var(--gold); background: var(--gold); color: var(--ink-dark); text-decoration: none; }
@media (max-width: 700px) {
  .en-cols { gap: 6px; } .en-col { padding: 6px; } .en-card { font-size: .85rem; padding: 6px; }
  .en-solution { grid-template-columns: 1fr; }
}

/* Galeria de jogos (lobby) */
[hidden] { display: none !important; }
.games-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.game-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.game-tile {
  position: relative; overflow: hidden; border: 0; border-radius: 18px; padding: 20px 18px 16px; min-height: 230px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; color: #fff; cursor: pointer;
  box-shadow: 0 8px 0 rgba(0,0,0,.3), 0 14px 30px rgba(0,0,0,.35); transition: transform .15s, box-shadow .15s;
}
.game-tile::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 85% 10%, rgba(255,255,255,.28), transparent 45%); pointer-events: none; }
.game-tile:hover, .game-tile:focus-visible { transform: translateY(-6px) rotate(-.5deg); box-shadow: 0 14px 0 rgba(0,0,0,.3), 0 22px 40px rgba(0,0,0,.4); outline: none; }
.game-tile:active { transform: translateY(2px); }
.tile-emoji { font-size: 3.4rem; line-height: 1; filter: drop-shadow(0 4px 0 rgba(0,0,0,.25)); }
.tile-name { font-size: 1.9rem; font-weight: 900; letter-spacing: -.01em; text-shadow: 0 3px 0 rgba(0,0,0,.2); }
.tile-tag { font-size: 1rem; font-weight: 700; opacity: .95; flex: 1; }
.tile-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tile-meta span { background: rgba(0,0,0,.28); border-radius: 999px; padding: 3px 10px; font-size: .82rem; font-weight: 800; }
.tile-cta { margin-top: 6px; background: #fff; color: var(--ink-dark); border-radius: 999px; padding: 6px 14px; font-weight: 900; font-size: .95rem; }

/* Onboarding de cada jogo */
.ob-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(4,6,12,.78); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.ob-panel {
  position: relative; width: min(1180px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 22px;
  background: var(--bg); box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: bounce-in .35s cubic-bezier(.2,1.3,.4,1) both;
}
.ob-hero { display: flex; align-items: center; gap: 20px; padding: 26px 30px; color: #fff; }
.ob-hero .tile-emoji { font-size: 5rem; }
.ob-body { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; padding: 24px 30px 30px; align-items: start; }
.ob-how h3 { margin: 0 0 12px; font-size: 1.5rem; }
.ob-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; counter-reset: step; }
.ob-steps li { display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.08); border-radius: 14px; padding: 12px 16px; font-size: 1.2rem; font-weight: 700; line-height: 1.3; counter-increment: step; }
.ob-steps li::before { content: counter(step); flex: none; width: 1.8em; height: 1.8em; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--ink-dark); font-weight: 900; font-size: .95rem; }
.ob-icon { font-size: 1.8rem; flex: none; }
.ob-score { margin-top: 14px; background: rgba(255,197,49,.14); border: 2px solid rgba(255,197,49,.5); border-radius: 14px; padding: 12px 16px; font-size: 1.05rem; line-height: 1.4; }
.ob-settings { display: flex; flex-direction: column; gap: 10px; }
.ob-fields { display: flex; flex-direction: column; gap: 12px; }
.ob-fields .btn.big { margin-top: 8px; width: 100%; }
.ob-close { position: absolute; top: 16px; right: 16px; background: rgba(0,0,0,.3); }

/* Regras no telemóvel enquanto o anfitrião apresenta o jogo */
.ob-phone { width: 100%; border-radius: 18px; padding: 16px; color: #fff; text-align: left; box-shadow: var(--shadow); }
.ob-phone-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ob-phone .ob-steps li { font-size: .98rem; padding: 10px 12px; background: rgba(0,0,0,.25); }
.ob-phone .ob-icon { font-size: 1.4rem; }
.ob-phone .ob-score { background: rgba(0,0,0,.25); border-color: rgba(255,255,255,.4); font-size: .95rem; }

@media (max-width: 900px) {
  .ob-body { grid-template-columns: 1fr; }
  .ob-hero .tile-emoji { font-size: 3.4rem; }
  .ob-close { position: static; margin: 0 30px 24px; }
}

/* Página inicial */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.landing { position: relative; z-index: 1; width: min(1080px, 100%); margin: 0 auto; padding: 32px 16px 40px; display: flex; flex-direction: column; gap: 34px; }
.landing-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.landing-hero .brand-hero { width: min(380px, 80vw, 42vh); }
.landing-lead { margin: 0; font-size: clamp(1.1rem, 2.6vw, 1.45rem); line-height: 1.45; color: var(--muted); }
.landing-lead b { color: #fff; }
.landing-resume { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.landing-resume .btn { text-decoration: none; }
.landing-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.choice {
  position: relative; overflow: hidden; border-radius: 22px; padding: 26px 24px; display: flex; flex-direction: column; gap: 10px;
  color: #fff; text-decoration: none; box-shadow: 0 8px 0 rgba(0,0,0,.3), 0 18px 40px rgba(0,0,0,.35);
}
.choice::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 90% 0%, rgba(255,255,255,.25), transparent 45%); pointer-events: none; }
.choice > * { position: relative; z-index: 1; }
.choice-host { background: linear-gradient(135deg, var(--brand-red), var(--brand-orange)); transition: transform .15s; }
.choice-host:hover, .choice-host:focus-visible { transform: translateY(-5px); outline: none; }
.choice-join { background: linear-gradient(135deg, var(--brand-blue), #6a3cff); }
.choice-emoji { font-size: 3.2rem; line-height: 1; }
.choice-title { font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 900; }
.choice-text { font-size: 1.05rem; line-height: 1.4; opacity: .95; flex: 1; }
.choice-cta { align-self: flex-start; background: #fff; color: var(--ink-dark); border-radius: 999px; padding: 10px 20px; font-weight: 900; font-size: 1.1rem; box-shadow: var(--shadow); }
.choice-join .btn.primary { background: var(--ink-dark); }
.landing-error { min-height: 1.3em; font-weight: 800; color: #ffd0d4; }
.landing-section h2 { margin: 0 0 14px; font-size: 1.6rem; font-weight: 900; }
.landing-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.landing-steps li { background: rgba(255,255,255,.07); border-radius: 16px; padding: 18px; font-size: 1.05rem; line-height: 1.4; display: flex; flex-direction: column; gap: 6px; }
.landing-steps li span { font-size: 2rem; }
.landing-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.landing-game {
  display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: rgba(255,255,255,.06);
  box-shadow: 0 6px 0 rgba(0,0,0,.28), 0 14px 30px rgba(0,0,0,.3); transition: transform .15s;
}
.landing-game:hover { transform: translateY(-4px); }
.lg-art { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; padding: 12px; }
.lg-art::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 85% 10%, rgba(255,255,255,.25), transparent 50%); pointer-events: none; }
.lg-art img { width: 100%; height: 100%; object-fit: contain; }
.lg-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lg-body h3 { margin: 0; font-size: 1.45rem; font-weight: 900; }
.lg-tag { margin: 0; font-weight: 800; color: var(--gold); }
.lg-desc { margin: 0; color: var(--muted); line-height: 1.45; font-size: .98rem; flex: 1; }
.lg-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lg-meta span { background: rgba(255,255,255,.1); border-radius: 999px; padding: 4px 10px; font-size: .82rem; font-weight: 800; }
.landing-foot { text-align: center; color: var(--muted); font-weight: 700; }
@media (max-width: 760px) {
  .landing { gap: 26px; padding-top: 20px; }
  .landing-choices, .landing-steps { grid-template-columns: 1fr; }
}
.landing-steps li p { margin: 0; }

/* Números ao vivo (página inicial) */
.landing-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; text-align: center; }
.stat-num { font-size: clamp(1.8rem, 4.5vw, 2.6rem); font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .9rem; font-weight: 800; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.stat-live { border-color: rgba(242,59,46,.45); background: rgba(242,59,46,.12); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #8a8f9c; flex: none; }
.landing-stats.is-live .live-dot { background: #ff3b30; box-shadow: 0 0 0 0 rgba(255,59,48,.7); animation: live-pulse 1.6s ease-out infinite; }
.landing-stats.is-live .stat-live .stat-num { color: #ff6b5f; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,59,48,.7); } 70% { box-shadow: 0 0 0 10px rgba(255,59,48,0); } 100% { box-shadow: 0 0 0 0 rgba(255,59,48,0); } }
@media (max-width: 760px) { .landing-stats { grid-template-columns: 1fr 1fr; } }

/* Logótipo novo (com o nome e a frase) */
.brand-logo { width: min(540px, 90vw, 70vh); height: auto; display: block; margin: 0 auto; filter: drop-shadow(0 10px 30px rgba(0,0,0,.35)); }
.landing-hero .brand-logo { margin-bottom: -6px; }
.brand-mini { width: 78px; height: 43px; object-fit: contain; }
