:root {
  --felt: #0d6b3c;
  --felt-dark: #0a4d2c;
  --felt-hi: #13874d;
  --back1: #b71c1c;
  --back2: #8e1515;
  --wood1: #6b3f1d;
  --wood2: #4a2a10;
  --chrome: #062a18;
  --ink: #f4f7f5;
  --muted: #a9c4b4;
  --us: #ffc94a;
  --them: #7cc4ff;
  --red: #c62828;
  --black: #1b1b1b;
  --danger: #e53935;
  --ok: #43a047;
  --radius: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --card-w: min(25vw, 104px, 13dvh);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--chrome);
  color: var(--ink);
  font: 16px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}
input { -webkit-user-select: text; user-select: text; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: #ff8a80; min-height: 1.2em; font-weight: 600; }
.code { font-family: ui-monospace, Menlo, monospace; letter-spacing: 2px; color: var(--us); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--radius);
  background: #1f4d36; color: var(--ink); font-weight: 700; font-size: 15px;
  text-decoration: none; cursor: pointer; touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; }
.btn.big { min-height: 54px; font-size: 18px; width: 100%; }
.btn.primary { background: var(--us); color: #3b2a00; }
.btn.wa { background: #25d366; color: #052e16; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.truco { background: var(--danger); color: #fff; font-size: 19px; letter-spacing: 1px; min-width: 120px; box-shadow: 0 3px 0 #8e1c1a; }
.btn.accept { background: var(--ok); color: #fff; }
.btn.run { background: #455a64; color: #fff; }
.btn.toggle.on { background: #fff; color: #111; }
.icon-btn { background: none; border: 0; color: var(--ink); font-size: 24px; width: 44px; height: 44px; }
.round {
  width: 44px; height: 44px; border-radius: 50%; border: 0; font-size: 20px;
  background: #1f4d36; color: #fff; display: grid; place-items: center;
}
.round.off { background: var(--danger); }

.seg { display: flex; background: #0c3a24; border-radius: var(--radius); padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 42px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-weight: 700; font-size: 15px; }
.seg button.on { background: var(--felt); color: #fff; }
.seg.small button { min-height: 36px; font-size: 14px; }
.seg.disabled { pointer-events: none; opacity: .7; }

/* ---------- Home ---------- */
.screen { height: 100dvh; height: 100svh; }
#home { display: flex; flex-direction: column; padding: 16px; background: radial-gradient(circle at 50% 30%, var(--felt), var(--felt-dark) 70%); overflow-y: auto; }
.home-box { width: 100%; max-width: 380px; margin: auto; }
.logo { text-align: center; margin-bottom: 20px; }
.logo h1 { margin: 0; line-height: 0; }
.logo-img { display: block; margin: 0 auto; width: min(100%, calc(34dvh * 1.79)); height: auto; border-radius: 18px; box-shadow: 0 8px 28px rgba(0,0,0,.45); }
.logo p { margin: 10px 0 0; color: var(--muted); }
#home-form { display: grid; gap: 10px; }
#home-form label { font-weight: 700; font-size: 14px; color: var(--muted); }
input {
  width: 100%; min-height: 52px; border-radius: var(--radius); border: 2px solid transparent;
  background: #fff; color: #111; font-size: 18px; padding: 0 14px; outline: none;
}
input:focus { border-color: var(--us); }
#code-box { margin-top: 18px; color: var(--muted); }
.install-box { margin-top: 16px; display: grid; gap: 10px; }
.btn.install { background: transparent; border: 2px solid var(--us); color: var(--us); }
.ios-help { background: rgba(0,0,0,.3); border-radius: var(--radius); padding: 12px 14px; font-size: 14px; }
.ios-help ol { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
#code-box summary { cursor: pointer; padding: 8px 0; }
.row { display: flex; gap: 8px; }
.row input { text-transform: uppercase; }

/* ---------- Sala ---------- */
#room { display: flex; flex-direction: column; background: var(--felt-dark); }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: max(env(safe-area-inset-top), 4px) 8px 4px; background: var(--chrome); min-height: 48px;
}
.score { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.team { display: flex; align-items: center; gap: 6px; }
.team b { font-size: 24px; min-width: 30px; text-align: center; border-radius: 8px; padding: 0 4px; }
.team.us b { background: var(--us); color: #3b2a00; }
.team.them b { background: var(--them); color: #032742; }
.team .t-name { font-weight: 700; color: var(--muted); }
.x { color: var(--muted); }
.hand-info { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.badge { background: var(--danger); color: #fff; font-weight: 800; font-size: 13px; padding: 2px 8px; border-radius: 99px; }
.dots { display: flex; gap: 5px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.18); display: block; }
.dots i.us { background: var(--us); } .dots i.them { background: var(--them); } .dots i.tie { background: #bbb; }

.arena {
  flex: 1; min-height: 0; position: relative; padding: 14px;
  /* Feltro com textura + luz de lampião de bar vindo de cima */
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(255, 214, 140, .16), transparent 70%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .22 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>"),
    radial-gradient(ellipse at center, var(--felt-hi) 0%, var(--felt) 45%, var(--felt-dark) 100%);
  display: grid; gap: 6px;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr) minmax(0, .8fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: ". top ." "left table right";
}
/* Borda de madeira da mesa, com filete dourado */
.arena::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0; border: 9px solid transparent;
  background: repeating-linear-gradient(100deg, var(--wood1) 0 7px, var(--wood2) 7px 9px, var(--wood1) 9px 16px, #7d4c25 16px 18px) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0);
}
.arena::after { content: ""; position: absolute; inset: 9px; pointer-events: none; z-index: 0; border: 1.5px solid rgba(212, 160, 23, .55); box-shadow: inset 0 0 40px rgba(0,0,0,.45); }
.arena > .seat-slot:not(.pos-bottom), .arena > .table { position: relative; z-index: 1; }
.pos-top { grid-area: top; } .pos-left { grid-area: left; align-self: center; }
.pos-right { grid-area: right; align-self: center; }
.me-wrap { position: relative; width: 62px; flex: none; }
.pos-me .tile { max-height: none; max-width: none; border-width: 2px; }
.pos-me .tile .label { font-size: 9px; }
.pos-me .tile .avatar { font-size: 20px; }
.flip { position: absolute; right: -6px; top: -6px; width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; font-size: 13px; background: rgba(0,0,0,.75); z-index: 2; }
.table { grid-area: table; position: relative; min-height: 0; }
/* 1x1: só o adversário (no topo); a mesa ocupa a largura toda */
.arena.duo .pos-left, .arena.duo .pos-right { display: none; }
.arena.duo .table { grid-column: 1 / -1; }
.arena.duo .pos-top .tile { max-width: 150px; }
#size-select button { font-size: 13px; }

/* Lugar / vídeo */
.tile {
  position: relative; width: 100%; max-width: 130px; aspect-ratio: 4 / 5; max-height: 19dvh; margin: 0 auto;
  border-radius: var(--radius); overflow: hidden; background: #0b3320; border: 3px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.tile.team-us { border-color: rgba(255, 201, 74, .45); }
.tile.team-them { border-color: rgba(124, 196, 255, .45); }
.tile.turn { border-color: #fff; box-shadow: 0 0 0 3px #fff8, 0 0 18px #fff; }
.tile.speaking::after { content: ""; position: absolute; inset: 0; border: 3px solid #69f0ae; border-radius: 9px; pointer-events: none; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #0b3320; }
.tile video.mirror { transform: scaleX(-1); }
.tile canvas.burn { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tile .avatar { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 800; color: #fff; background: #174a31; }
.tile .label {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 5px; font-size: 12px; font-weight: 700;
  background: linear-gradient(transparent, rgba(0,0,0,.75)); display: flex; align-items: center; gap: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile .label .nm { overflow: hidden; text-overflow: ellipsis; }
.tile .chips { position: absolute; top: 3px; left: 3px; right: 3px; display: flex; gap: 3px; flex-wrap: wrap; }
.chip { font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 99px; background: rgba(0,0,0,.6); }
.chip.dealer { background: #fff; color: #111; }
.chip.host { background: var(--us); color: #3b2a00; }
.tile .cnt { position: absolute; right: 3px; top: 3px; display: flex; }
.tile .cnt i { width: 9px; height: 13px; margin-left: -3px; border-radius: 2px; border: 1px solid #fff; background: repeating-linear-gradient(45deg, #b71c1c 0 3px, #8e1515 3px 6px); }
.tile .off { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-size: 12px; font-weight: 700; background: rgba(0,0,0,.65); padding: 4px; }
.tile.empty { display: grid; place-items: center; border: 2px dashed rgba(255,255,255,.35); text-align: center; font-size: 12px; color: var(--muted); padding: 4px; cursor: pointer; }
.tile .react { position: absolute; inset: 0; display: grid; place-items: center; font-size: 44px; animation: pop 1.8s ease forwards; pointer-events: none; }
@keyframes pop { 0% { transform: scale(.3); opacity: 0 } 15% { transform: scale(1.2); opacity: 1 } 80% { opacity: 1 } 100% { transform: translateY(-30px); opacity: 0 } }

/* Cartas */
.card {
  --w: var(--card-w);
  width: var(--w); aspect-ratio: 5 / 7; border-radius: calc(var(--w) * .09); background: #fffdf7;
  box-shadow: 0 2px 5px rgba(0,0,0,.4); position: relative; color: var(--black); flex: none;
  font-family: Georgia, "Times New Roman", serif;
}
.card.red { color: var(--red); }
.card .ix { position: absolute; top: 4%; left: 7%; text-align: center; line-height: 1; font-weight: 700; font-size: calc(var(--w) * .24); }
.card .ix small { display: block; font-size: .8em; }
.card .ix.b { top: auto; left: auto; bottom: 4%; right: 7%; transform: rotate(180deg); }
.card .pip { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--w) * .5); }
.card.back { background: repeating-linear-gradient(45deg, var(--back1) 0 6px, var(--back2) 6px 12px); border: 3px solid #fff; }
.card .star { position: absolute; top: 3%; right: 6%; font-size: calc(var(--w) * .18); color: #e6a100; font-family: system-ui; }
.card.sm { --w: min(15vw, 62px, 9dvh); }
.card.xs { --w: 38px; }

.played { position: absolute; transform: translate(-50%, -50%); transition: opacity .2s; }
.played .card { --w: min(13.5vw, 60px, 8.5dvh); }
.p-bottom { left: 50%; top: 77%; } .p-top { left: 50%; top: 23%; }
.p-left { left: 21%; top: 50%; } .p-right { left: 79%; top: 50%; }
.played .card.win { box-shadow: 0 0 0 3px var(--us), 0 0 14px var(--us); animation: winIn .6s .7s both; }
@keyframes winIn { from { box-shadow: none; transform: scale(1); } 60% { transform: scale(1.12); } to { box-shadow: 0 0 0 3px var(--us), 0 0 18px var(--us); transform: scale(1.06); } }
/* 2x2: vira no canto vazio acima do jogador da esquerda; 1x1: canto da mesa */
.vira { position: absolute; right: calc(100% + 4px); bottom: calc(100% - 4px); display: flex; flex-direction: column; align-items: center; font-size: 10px; color: var(--muted); font-weight: 700; z-index: 1; }
.vira .card { --w: 54px; transform: rotate(-8deg); }
.vira-row { display: flex; align-items: center; }
/* Baralho virado para baixo ao lado do vira (parece um monte de cartas) */
.vira .card.deck { --w: 50px; border-width: 2px; transform: rotate(4deg); margin-right: -10px; z-index: 0;
  box-shadow: 1px 1px 0 #fff, 2px 2px 0 var(--back2), 3px 3px 0 #fff, 4px 4px 0 var(--back2), 5px 5px 0 #fff, 6px 7px 8px rgba(0,0,0,.45); }
.vira #vira-card { position: relative; z-index: 1; }
.arena.duo .vira { right: auto; bottom: auto; left: 8px; top: 0; }

/* Lobby */
.lobby-card {
  background: var(--chrome); padding: 10px 12px calc(12px + var(--safe-b)); display: grid; gap: 8px; text-align: center;
  width: 100%; max-width: 480px; margin: 0 auto;
}
.lobby-card h2 { margin: 0; font-size: 18px; }
.lobby-card p { margin: 0; }
.invite { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

/* Faixa de avisos */
.prompt {
  min-height: 42px; padding: 4px 8px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--chrome); font-weight: 700; text-align: center; flex-wrap: wrap;
}
.prompt .btn { min-height: 40px; }
.prompt.alert { background: #6d1010; }
.prompt.mine { background: #145a33; }
.partner-cards { display: flex; gap: 4px; }

.controls { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; background: var(--chrome); gap: 8px; }
.media-ctl { display: flex; gap: 6px; align-items: center; }
.prompt .btn.toggle { min-height: 34px; font-size: 13px; padding: 0 10px; }
.game-ctl { display: flex; gap: 6px; }
.react-bar { display: flex; justify-content: space-around; background: var(--chrome); padding: 4px 8px; }
.react-bar button { font-size: 28px; background: none; border: 0; padding: 4px; }

.hand {
  display: flex; justify-content: center; align-items: flex-end; gap: 8px;
  padding: 10px 8px calc(10px + var(--safe-b)); background: var(--chrome); min-height: calc(var(--card-w) * 1.4 + 20px);
}
.hand .card { transition: transform .15s; cursor: pointer; touch-action: manipulation; }
.hand.active .card { box-shadow: 0 0 0 2px #fff, 0 3px 8px rgba(0,0,0,.5); }
/* Sua vez (jogar, responder truco ou decidir a mão de onze): o mesmo brilho do quadro de vídeo, em volta das cartas */
.hand.glow .card { box-shadow: 0 0 0 3px #fff8, 0 0 18px #fff; }
.hand.glow .card.sel { box-shadow: 0 0 0 3px var(--us), 0 0 18px #fff; }
.hand .card.sel { transform: translateY(-16px); box-shadow: 0 0 0 3px var(--us), 0 6px 14px rgba(0,0,0,.5); }
.hand:not(.active) .card { filter: brightness(.82); }

/* Faixa de evento (TRUCO!) */
.banner {
  position: absolute; left: 50%; top: 8px; transform: translateX(-50%); z-index: 9; pointer-events: none;
  background: var(--danger); color: #fff; font-size: 30px; font-weight: 900; padding: 12px 22px; border-radius: 14px;
  box-shadow: 0 6px 30px rgba(0,0,0,.5); animation: bannerDrop .25s ease; text-align: center; white-space: nowrap;
}
.banner small { display: block; font-size: 14px; font-weight: 700; }
@keyframes bannerIn { from { transform: translate(-50%, -50%) scale(.5); opacity: 0 } }
@keyframes bannerDrop { from { transform: translate(-50%, -16px) scale(.7); opacity: 0 } }

.overlay { position: absolute; inset: 0; background: rgba(0,0,0,.72); z-index: 8; display: grid; place-items: center; text-align: center; padding: 16px; }
.overlay .box { display: grid; gap: 12px; max-width: 320px; }
.overlay h2 { margin: 0; font-size: 28px; }

/* Menu */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: flex; align-items: flex-end; }
.sheet-body { width: 100%; max-height: 85dvh; overflow-y: auto; background: #0c3a24; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + var(--safe-b)); display: grid; gap: 10px; }
.sheet h3 { margin: 0; }
.plist { display: grid; gap: 6px; }
.plist .pl { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #0a2e1d; border-radius: 10px; padding: 6px 10px; }
.plist .pl .btn { min-height: 34px; font-size: 13px; }
#history { font-size: 13px; color: var(--muted); }
#history ol { margin: 4px 0; padding-left: 20px; }

.net-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 30; background: #ff9800; color: #111; text-align: center; font-weight: 800; padding: calc(env(safe-area-inset-top) + 6px) 8px 6px; }
.toasts { position: fixed; left: 0; right: 0; top: 56px; z-index: 25; display: grid; justify-items: center; gap: 6px; pointer-events: none; }
.toast { background: rgba(0,0,0,.8); padding: 5px 12px; border-radius: 99px; font-weight: 700; font-size: 13px; max-width: 92vw; animation: bannerIn .2s; }
.tap-audio { position: fixed; left: 50%; bottom: 40%; transform: translateX(-50%); z-index: 40; border: 0; border-radius: 99px; padding: 14px 22px; font-size: 18px; font-weight: 800; background: var(--us); color: #3b2a00; box-shadow: 0 4px 20px rgba(0,0,0,.5); }

/* Telas largas (tablet / paisagem / computador) */
@media (min-width: 700px) and (min-height: 600px) {
  :root { --card-w: min(110px, 14dvh); }
  .arena { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); max-width: 900px; margin: 0 auto; width: 100%; }
  .tile { max-height: 24dvh; }
}

/* ---------- Conta, avisos ---------- */
#home { position: relative; }
.home-top { position: absolute; top: max(env(safe-area-inset-top), 8px); right: 10px; display: flex; gap: 6px; align-items: center; z-index: 2; }
.user-btn { border: 0; border-radius: 99px; background: rgba(0,0,0,.35); color: var(--ink); font-weight: 700; padding: 8px 14px; font-size: 14px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bell { position: relative; font-size: 22px; background: rgba(0,0,0,.35); border-radius: 50%; }
.bell .count { position: absolute; top: 2px; right: 0; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; border-radius: 99px; padding: 1px 5px; }
.btn.champ { background: #7a3e00; color: #ffe0a3; text-decoration: none; }
.notes { display: grid; gap: 6px; max-height: 50dvh; overflow-y: auto; }
.note { display: grid; gap: 2px; text-align: left; border: 0; border-radius: 10px; background: #0a2e1d; color: var(--ink); padding: 8px 10px; font-size: 14px; }
.note.unread { border-left: 4px solid var(--us); }
.note span { color: #d7e6dc; }

/* ---------- Páginas (campeonatos, conta) ---------- */
.page { display: flex; flex-direction: column; background: var(--felt-dark); overflow: hidden; }
.page-top { display: flex; align-items: center; gap: 6px; padding: max(env(safe-area-inset-top), 6px) 8px 6px; background: var(--chrome); min-height: 52px; }
.page-top h2 { flex: 1; margin: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-top .icon-btn { text-decoration: none; display: grid; place-items: center; }
.page-body { flex: 1; overflow-y: auto; padding: 14px 14px calc(24px + var(--safe-b)); display: grid; gap: 12px; align-content: start; max-width: 760px; width: 100%; margin: 0 auto; }
.form { display: grid; gap: 8px; }
.form label { font-weight: 700; font-size: 14px; color: var(--muted); }
.form label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-weight: 600; }
.form label.check input { width: 22px; min-height: 22px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.panel { background: rgba(4, 30, 17, .75); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; }
.panel h3, .panel h4 { margin: 0; }
.panel p { margin: 0; }
.panel input { min-height: 48px; }
.panel summary { font-weight: 800; cursor: pointer; }
h3.sec { margin: 6px 0 0; }
.badge.st-open { background: #2e7d32; } .badge.st-checkin { background: #f57c00; } .badge.st-running { background: #c62828; }
.badge.st-finished { background: #455a64; } .badge.st-cancelled { background: #616161; }
.panel > .badge { justify-self: start; }
.big-date { font-size: 18px; font-weight: 800; }
.champion { font-size: 18px; font-weight: 900; color: var(--us); }
.ok { color: #9be7a6; font-weight: 700; }
.out { color: #ff8a80; font-weight: 700; }
.tcards { display: grid; gap: 8px; }
.tcard { display: grid; gap: 3px; background: rgba(4, 30, 17, .75); border-radius: 14px; padding: 12px 14px; color: var(--ink); text-decoration: none; }
.tcard b { font-size: 17px; }
.tcard .badge { justify-self: start; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pteam { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.pplayer { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.pplayer span { flex: 1; }
.mini { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; background: #1f4d36; color: #fff; text-decoration: none; display: inline-grid; place-items: center; border: 0; }
.btn.mini { min-height: 32px; justify-self: start; }
#adm-users .pl span { flex: 1; }

/* ---------- Chave ---------- */
.bracket-wrap { min-width: 0; }
.bracket { overflow-x: auto; overflow-y: hidden; padding: 4px 2px 12px; border-radius: 14px;
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 210, 63, .10), transparent 60%), rgba(4, 30, 17, .5); }
/* Chave estilo Copa do Mundo: esquerda → final ← direita */
.wc { display: flex; align-items: stretch; min-width: max-content; padding: 8px 4px; }
.wc-col { position: relative; width: 132px; display: flex; flex-direction: column; justify-content: space-around; padding: 24px 12px 6px; }
.wc-col > .round-name { position: absolute; top: 2px; left: 0; right: 0; text-align: center; }
.wc-pair { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 10px; padding: 6px 0; }
/* linhas da chave: une os dois jogos do par e leva ao próximo */
.wc-col.left .wc-pair:not(.single)::after, .wc-col.right .wc-pair:not(.single)::after {
  content: ""; position: absolute; top: 25%; bottom: 25%; width: 12px; border: 2px solid rgba(255, 210, 63, .45); }
.wc-col.left .wc-pair:not(.single)::after { right: -12px; border-left: 0; border-radius: 0 6px 6px 0; }
.wc-col.right .wc-pair:not(.single)::after { left: -12px; border-right: 0; border-radius: 6px 0 0 6px; }
.wc-col.left .wc-pair::before, .wc-col.right .wc-pair::before { content: ""; position: absolute; top: 50%; width: 12px; border-top: 2px solid rgba(255, 210, 63, .45); }
.wc-col.left .wc-pair::before { right: -24px; }
.wc-col.right .wc-pair::before { left: -24px; }
.wc-col.left .wc-pair.single::before { right: -12px; }
.wc-col.right .wc-pair.single::before { left: -12px; }
.wc-col.final { width: 160px; justify-content: center; gap: 8px; align-items: stretch; }
.wc-cup { width: 70px; margin: 0 auto; }
.wc-cup svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 12px rgba(0,0,0,.5)); }
.wc-col.final .match { border: 2px solid #d4a017; box-shadow: 0 0 18px rgba(255, 210, 63, .25); }
.wc-champ { text-align: center; font-weight: 900; color: #ffd23f; min-height: 20px; }
.wc .match { padding: 4px 7px; }
.wc .tm { font-size: 13px; min-height: 22px; align-items: center; }
.wc .tm .nm:empty { flex: 1; border-bottom: 1px dashed rgba(255,255,255,.25); height: 12px; }
.wc .mfoot { font-size: 11px; }
.round-name { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--muted); letter-spacing: .5px; }
.match { background: rgba(4, 30, 17, .85); border-radius: 10px; padding: 6px 8px; display: grid; gap: 2px; border: 1px solid rgba(255,255,255,.06); }
.match.st-ready { border-color: rgba(255, 82, 82, .55); }
.tm { display: flex; justify-content: space-between; gap: 6px; font-size: 14px; padding: 2px 0; }
.tm .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm .sc { font-weight: 800; min-width: 18px; text-align: right; }
.tm.win { font-weight: 800; color: var(--us); }
.tm.lose { opacity: .5; }
.tm.mine .nm::before { content: '★ '; color: var(--them); }
.mfoot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.mfoot:empty { display: none; }
.tag { background: rgba(255,255,255,.12); border-radius: 99px; padding: 1px 7px; }
.live { color: #ff6e6e; font-weight: 900; }
.watch { background: var(--danger); color: #fff; text-decoration: none; border-radius: 99px; padding: 3px 10px; font-weight: 800; }
.fix { font-size: 12px; border-radius: 6px; padding: 2px; max-width: 100%; }

/* ---------- Mesa de campeonato e torcida ---------- */
.match-bar { background: #3d1f00; color: #ffe0a3; font-size: 12px; font-weight: 700; text-align: center; padding: 4px 8px; white-space: nowrap; overflow: hidden; }
.match-bar.scroll { text-align: left; padding-left: 0; padding-right: 0; }
.mb-text { display: inline-block; }
.mb-track { display: inline-flex; animation: mbSlide linear infinite; will-change: transform; }
.mb-track .mb-text { padding-right: 48px; }
@keyframes mbSlide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .mb-track { animation: none; } }
.prompt .timer { background: #000; border-radius: 99px; padding: 2px 9px; font-variant-numeric: tabular-nums; }
.prompt .timer.low { background: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.watch-ctl { background: var(--chrome); padding: 8px 10px calc(10px + var(--safe-b)); display: grid; gap: 8px; }
.watch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#fan-mic.on { background: var(--ok); }

/* Torcida: o jogador "de baixo" fica embaixo da mesa (não há faixa de controles) */
.pos-bottom { display: none; }
.arena.watching { grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: ". top ." "left table right" ". bottom ."; }
.arena.watching .pos-bottom { display: block; grid-area: bottom; }

.liverow { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.08); }
.liveinfo { flex: 1; display: grid; }
.liverow .watch { padding: 8px 14px; font-size: 14px; }

.link-danger { display: block; margin: 14px auto 0; background: none; border: 0; color: #ff8a80; font-size: 13px; text-decoration: underline; cursor: pointer; }

/* Partida Ranking */
.btn.ranked { background: linear-gradient(180deg, #7e57c2, #5e35b1); color: #fff; }
.mode-help { margin: -2px 0 2px; text-align: center; }
.ranked-badge { margin: 0; padding: 6px 10px; border-radius: 10px; background: #5e35b1; color: #fff; font-size: 13px; font-weight: 700; text-align: center; }
.ranked-result { font-weight: 800; padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.08); }
.ranked-result.win { color: #b9f6ca; }
.ranked-result.loss { color: #ffccbc; }
.rk-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.rk-table th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 700; padding: 4px 6px; }
.rk-table td { padding: 8px 6px; border-top: 1px solid rgba(255,255,255,.08); }
.rk-table td:nth-child(n+3), .rk-table th:nth-child(n+3) { text-align: right; }
.rk-table tr.me td { background: rgba(126, 87, 194, .35); font-weight: 800; }
.pf-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pf-stat { display: grid; gap: 2px; background: rgba(255,255,255,.06); border-radius: 10px; padding: 10px; }
.pf-stat b { font-size: 22px; }
.pf-match { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.05); color: var(--ink); text-decoration: none; border-left: 4px solid transparent; }
.pf-match.win { border-left-color: #69f0ae; }
.pf-match.loss { border-left-color: #ff8a65; }

.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 14px; padding: 6px; cursor: pointer; justify-self: center; }

/* Foto dos campeões */
.photo-moment { display: grid; gap: 10px; justify-items: center; margin: 8px 0; }
.photo-title { font-size: 20px; color: #ffd23f; }
.photo-frame { position: relative; display: flex; align-items: center; gap: 6px; padding: 10px; border-radius: 18px;
  background: radial-gradient(circle at 50% 40%, #1d7a48, #06281a); border: 4px solid #d4a017; box-shadow: 0 0 0 6px #6b3f1d; }
.photo-cam { width: min(52vw, 220px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 5px solid #ffd23f; background: #174a31; display: grid; place-items: center; color: #fff; }
.photo-cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.photo-trophy { width: min(26vw, 110px); }
.photo-trophy svg, .cp-trophy svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.photo-count { position: absolute; inset: 0; display: grid; place-items: center; font-size: 96px; font-weight: 900; color: #fff;
  text-shadow: 0 4px 18px rgba(0,0,0,.7); pointer-events: none; animation: countPop .25s ease-out; }
@keyframes countPop { from { transform: scale(1.4); opacity: .4; } }
body.flash::after { content: ""; position: fixed; inset: 0; background: #fff; z-index: 9999; animation: flash .45s ease-out forwards; pointer-events: none; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
.champ-photo { position: relative; display: grid; gap: 10px; justify-items: center; padding: 18px 12px 14px; border-radius: 16px; text-align: center;
  background: radial-gradient(circle at 50% 45%, #1d7a48, #06281a); border: 4px solid #d4a017; box-shadow: 0 0 0 6px #6b3f1d; }
.cp-title { display: grid; gap: 2px; }
.cp-title small { color: #ffd23f; font-weight: 800; letter-spacing: 2px; }
.cp-title b { font-size: 24px; }
.cp-title span { color: var(--muted); font-size: 13px; }
.cp-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; width: 100%; }
.cp-face { display: grid; gap: 4px; justify-items: center; font-weight: 800; font-size: 28px; color: #fff; }
.cp-face img, .cp-init { display: grid; place-items: center; background: #174a31; width: min(34vw, 150px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; border: 4px solid #ffd23f; }
.cp-face span { font-size: 15px; }
.cp-trophy { width: min(20vw, 90px); }
.cp-brand { color: #ffd23f; font-family: Georgia, serif; font-weight: 700; font-size: 14px; }

#rk-season { width: 100%; min-height: 44px; border-radius: 10px; background: #0c3a24; color: var(--ink); border: 1px solid rgba(255,255,255,.15); padding: 0 10px; font-size: 15px; }
#rk-season.hidden, #rk-me.hidden { display: none; }
.rk-name { display: grid; }
.rk-honors { font-size: 12px; }
.pf-medals { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-medal { background: rgba(255,210,63,.15); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.pf-achv { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.achv { display: grid; gap: 2px; justify-items: center; text-align: center; padding: 10px 6px; border-radius: 12px; background: rgba(255,255,255,.04); opacity: .55; }
.achv.on { opacity: 1; background: linear-gradient(180deg, rgba(255,210,63,.18), rgba(255,210,63,.04)); border: 1px solid rgba(255,210,63,.4); }
.achv-icon { font-size: 28px; }
.achv small { color: var(--muted); font-size: 11px; }

/* Mesas e baralhos para escolher (menu ☰ da mesa) */
:root[data-mesa="azul"] { --felt: #14507a; --felt-dark: #0b3350; --felt-hi: #1d6fa5; }
:root[data-mesa="vinho"] { --felt: #6d1b2b; --felt-dark: #470f1b; --felt-hi: #8e2a3e; }
:root[data-mesa="grafite"] { --felt: #2f3a3f; --felt-dark: #1c2427; --felt-hi: #43525a; }
:root[data-baralho="azul"] { --back1: #1565c0; --back2: #0d47a1; }
:root[data-baralho="preto"] { --back1: #37474f; --back2: #1c262b; }
:root[data-baralho="verde"] { --back1: #2e7d32; --back2: #1b5e20; }

/* Embaralhar e distribuir */
.deal-layer { position: fixed; inset: 0; pointer-events: none; z-index: 7; }
.deal-layer .card { position: absolute; --w: 46px; transform: translate(-50%, -50%); box-shadow: 0 4px 10px rgba(0,0,0,.45); }
.hand .card.undealt { visibility: hidden; }
.hand .card.dealt-in { animation: dealtIn .28s ease-out; }
@keyframes dealtIn { from { transform: translateY(-30px) scale(.8) rotateY(90deg); } }
.vira.dealing #vira-card { visibility: hidden; }
.vira .flip-in { animation: viraFlip .45s ease-out; }
@keyframes viraFlip { from { transform: rotate(-8deg) rotateY(90deg); } }

/* TRUCO! com impacto */
.banner.stamp { animation: stamp .42s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes stamp { 0% { transform: translateX(-50%) scale(2.4) rotate(-6deg); opacity: 0; } 60% { transform: translateX(-50%) scale(.92) rotate(2deg); opacity: 1; } 100% { transform: translateX(-50%) scale(1) rotate(0); } }
body.truco-flash::before { content: ""; position: fixed; inset: 0; z-index: 6; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(229, 57, 53, 0) 30%, rgba(229, 57, 53, .55) 100%); animation: trucoFlash .6s ease-out forwards; }
@keyframes trucoFlash { from { opacity: 1; } to { opacity: 0; } }

.round.knife:active { transform: rotate(-25deg) scale(1.1); }
.photo-title.anthem { font-size: 22px; animation: anthemPulse 1.2s ease-in-out infinite; }
@keyframes anthemPulse { 50% { transform: scale(1.06); text-shadow: 0 0 18px rgba(255, 210, 63, .7); } }

/* liga a final às semifinais */
.wc-col.final .match { position: relative; }
.wc-col.final .match::before, .wc-col.final .match::after { content: ""; position: absolute; top: 50%; width: 12px; border-top: 2px solid rgba(255, 210, 63, .45); }
.wc-col.final .match::before { left: -14px; }
.wc-col.final .match::after { right: -14px; }
.center { text-align: center; }
@media (max-width: 480px) { .wc-col { width: 118px; } .wc-col.final { width: 140px; } }
/* final no centro exato (alinhada com as semifinais); taça acima e campeã abaixo */
.wc { min-height: 300px; }
.wc-col.final { justify-content: center; }
.wc-col.final .wc-cup { position: absolute; left: 50%; bottom: calc(50% + 38px); transform: translateX(-50%); width: 62px; margin: 0; }
.wc-col.final .wc-champ { position: absolute; left: 0; right: 0; top: calc(50% + 40px); }

/* Cena da foto dos campeões (tela cheia, todos veem) */
.photo-stage { position: fixed; inset: 0; z-index: 30; display: grid; grid-template-rows: auto 1fr auto auto; justify-items: center; align-items: center;
  padding: calc(18px + env(safe-area-inset-top)) 12px calc(18px + var(--safe-b)); text-align: center;
  background: radial-gradient(ellipse at 50% 45%, rgba(255, 210, 63, .25), transparent 65%), rgba(4, 16, 10, .97); animation: stageIn .4s ease-out; }
.photo-stage.out { animation: stageOut .45s ease-in forwards; }
@keyframes stageIn { from { opacity: 0; } }
@keyframes stageOut { to { opacity: 0; } }
.ps-title { font-size: 26px; font-weight: 900; color: #ffd23f; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.ps-row { display: flex; align-items: center; justify-content: center; width: 100%; }
.ps-face { display: grid; justify-items: center; gap: 6px; z-index: 2; }
.ps-face video, .ps-init { width: min(40vw, 230px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; border: 6px solid #ffd23f;
  box-shadow: 0 0 0 6px #6b3f1d, 0 10px 40px rgba(0,0,0,.6); background: #174a31; display: grid; place-items: center; color: #fff; font-size: 54px; font-weight: 900; }
.ps-face video.mirror { transform: scaleX(-1); }
.ps-name { font-size: 18px; color: #fff; }
/* os rostos começam pequenos, longe, e vão crescendo e se aproximando da taça */
.ps-face.l { animation: approachL 2.6s cubic-bezier(.2, .7, .25, 1) both; margin-right: -14px; }
.ps-face.r { animation: approachR 2.6s cubic-bezier(.2, .7, .25, 1) both; margin-left: -14px; }
@keyframes approachL { from { transform: translateX(-38vw) scale(.35); opacity: .2; } }
@keyframes approachR { from { transform: translateX(38vw) scale(.35); opacity: .2; } }
.ps-cup { width: min(22vw, 120px); z-index: 1; animation: cupIn 1.4s .8s ease-out both; }
.ps-cup svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 18px rgba(0,0,0,.6)); }
@keyframes cupIn { from { transform: translateY(30px) scale(.6); opacity: 0; } }
.ps-count { font-size: 110px; font-weight: 900; color: #fff; line-height: 1; min-height: 110px; text-shadow: 0 6px 24px rgba(0,0,0,.7); }
.ps-count.pop { animation: countPop .35s ease-out; }
.ps-foot { min-height: 48px; display: grid; place-items: center; }
.ps-saved { color: #ffd23f; font-size: 18px; }

/* ---------- Chave estilo Copa (v3.1) ---------- */
.sec-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bracket { background: radial-gradient(ellipse at 50% 35%, rgba(255, 210, 63, .14), transparent 55%), linear-gradient(180deg, #0a2f1e, #061d12); border: 1px solid rgba(212, 160, 23, .35); }
.wc-col > .round-name { display: block; width: max-content; margin: 0 auto; left: 50%; right: auto; transform: translateX(-50%); padding: 2px 10px; border-radius: 99px;
  background: rgba(212, 160, 23, .16); color: #ffd23f; font-size: 10px; letter-spacing: .8px; white-space: nowrap; }
.wc .match { position: relative; background: none; border: 0; padding: 0; gap: 3px; }
.wc .tm { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 6px; min-height: 26px; padding: 2px 4px 2px 3px; border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,.10), rgba(255,255,255,.04)); border: 1px solid rgba(255,255,255,.08); font-size: 12.5px; }
.wc .tm .bd { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; font-weight: 900; color: #fff; background: rgba(255,255,255,.08); }
.wc .tm .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.wc .tm .sc { min-width: 22px; height: 20px; border-radius: 5px; display: grid; place-items: center; font-weight: 900; background: rgba(0,0,0,.35); font-size: 12px; }
.wc .tm .sc:empty { background: rgba(0,0,0,.18); }
.wc .tm.win { border-color: rgba(255, 210, 63, .8); background: linear-gradient(90deg, rgba(255, 210, 63, .28), rgba(255, 210, 63, .08)); color: #fff; }
.wc .tm.win .sc { background: #ffd23f; color: #3a2400; }
.wc .tm.lose { opacity: .45; }
.wc .tm.mine { box-shadow: 0 0 0 2px var(--them); }
.wc .tm.mine .nm::before { content: none; }
.wc .tm.empty { background: none; border: 1px dashed rgba(255,255,255,.18); }
.wc .tm.empty .bd { background: none; }
.wc .match.live .tm { border-color: rgba(255, 82, 82, .6); }
.wc .m-live { position: absolute; top: -9px; right: 4px; z-index: 2; background: #e53935; color: #fff; font-size: 8px; font-weight: 900; letter-spacing: .5px; padding: 1px 5px; border-radius: 4px; animation: livePulse 1.4s infinite; }
@keyframes livePulse { 50% { opacity: .55; } }
.wc .mfoot { justify-content: center; }
.wc .watch { font-size: 10px; padding: 1px 8px; }
.wc .watch:not([href]) { background: none; color: var(--muted); font-weight: 600; }
.wc-col.final .match { border: 0; box-shadow: none; padding: 6px; border-radius: 12px; background: linear-gradient(180deg, rgba(255, 210, 63, .18), rgba(255, 210, 63, .04));
  outline: 2px solid #d4a017; box-shadow: 0 0 24px rgba(255, 210, 63, .3); }
.wc-col.final .tm { font-size: 13.5px; min-height: 30px; }
.wc-champ { display: grid; gap: 0; }
.wc-champ small { font-size: 9px; letter-spacing: 2px; color: #ffd23f; }
.wc-champ b { font-size: 15px; color: #fff; background: linear-gradient(90deg, #b8860b, #ffd23f, #b8860b); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
/* chave inteira em tela cheia (deitada no celular) */
.bk-full { position: fixed; inset: 0; z-index: 40; background: radial-gradient(ellipse at 50% 45%, #124a30, #041a10 75%); overflow: hidden; }
.bk-stage { position: absolute; left: 50%; top: 50%; transform-origin: center center; }
.bk-close { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 22px; }
/* comemoração: chamada para a transmissão */
.celebrate-go { position: fixed; inset: 0; z-index: 45; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 20px;
  background: radial-gradient(ellipse at 50% 45%, rgba(255, 210, 63, .3), #041a10 70%); animation: stageIn .35s ease-out; }
.celebrate-go b { font-size: 24px; color: #ffd23f; }
.cg-cup { width: 110px; animation: cupIn 1s ease-out both; }
.cg-cup svg { width: 100%; height: auto; }
/* painel do organizador: partidas ao vivo */
.live-admin { display: grid; gap: 8px; }
.la-card { display: grid; gap: 6px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.la-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.la-team { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.06); }
.la-team > b { grid-column: 1; }
.la-players { grid-column: 1; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; }
.la-p.off { color: #ff8a80; }
.la-team .btn.mini { grid-column: 2; grid-row: 1 / span 2; }
.fix-box summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.fix-row { display: grid; gap: 4px; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.06); font-size: 13px; }

/* durante a cena da foto, o "toque para ouvir" vai para baixo e não cobre os campeões */
body:has(.photo-stage) .tap-audio { bottom: 4%; z-index: 41; }
/* nomes das duplas com mais espaço na chave */
.wc-col { width: 156px; }
.wc-col.final { width: 176px; }
@media (max-width: 480px) { .wc-col { width: 146px; } .wc-col.final { width: 166px; } }
.wc .tm .sc:empty { visibility: hidden; }
.wc.big .tm { font-size: 14px; }
/* a página nunca fica mais larga que a tela (a chave rola por dentro) */
.page-body { grid-template-columns: minmax(0, 1fr); }
.wc-col.final .wc-champ { top: calc(50% + 54px); }
.wc-col.final .wc-cup { bottom: calc(50% + 50px); }
.panel { grid-template-columns: minmax(0, 1fr); }
.cp-face img, .cp-init { width: min(27vw, 150px); }
.cp-trophy { width: min(15vw, 90px); }
.champ-photo { padding: 14px 8px 12px; }

/* ---------- Chave v3.2: cada jogo é uma caixa com as duas duplas ---------- */
.wc-col { width: 172px; }
.wc-col.final { width: 186px; }
@media (max-width: 480px) { .wc-col { width: 164px; } .wc-col.final { width: 180px; } }
.wc .match { gap: 0; border-radius: 10px; overflow: visible; background: #0b2619; border: 1px solid rgba(255, 210, 63, .35); box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.wc .match > .tm { border: 0; border-radius: 0; background: none; box-shadow: none; min-height: 30px; padding: 3px 6px; grid-template-columns: 20px minmax(0, 1fr) auto; }
.wc .match > .tm:first-of-type { border-radius: 10px 10px 0 0; }
.wc .match > .tm + .tm { border-top: 1px solid rgba(255, 255, 255, .09); border-radius: 0 0 10px 10px; }
.wc .tm .bd { width: 20px; height: 20px; font-size: 8.5px; }
.wc .tm .nm { font-size: 12.5px; }
.wc .match.noscore .tm { grid-template-columns: 20px minmax(0, 1fr); }
.wc .match.noscore .tm .sc { display: none; }
/* vaga ainda vazia: linha limpa, sem tracejado */
.wc .tm.empty { border: 0; background: none; }
.wc .match > .tm.empty + .tm.empty, .wc .match > .tm + .tm.empty, .wc .match > .tm.empty + .tm { border-top: 1px solid rgba(255, 255, 255, .06); }
.wc .tm.empty .bd { background: rgba(255,255,255,.06); }
.wc .match:not(:has(.tm:not(.empty))) { background: rgba(11, 38, 25, .55); border-color: rgba(255, 210, 63, .14); box-shadow: none; }
/* quem venceu: faixa dourada dentro da caixa */
.wc .match > .tm.win { background: linear-gradient(90deg, rgba(255, 210, 63, .26), rgba(255, 210, 63, .06)); }
.wc .match > .tm.mine { box-shadow: inset 3px 0 0 var(--them); }
.wc .match.live { border-color: rgba(255, 82, 82, .7); }
.wc .match.live .tm { border-color: transparent; }
.wc-col.final .match { outline: 2px solid #d4a017; padding: 0; background: linear-gradient(180deg, rgba(255, 210, 63, .16), rgba(11, 38, 25, .9)); }
.wc-col.final .match > .tm { min-height: 34px; }
.wc-pair { gap: 14px; }
.wc .mfoot { position: absolute; left: 0; right: 0; top: 100%; margin-top: 3px; }
.wc .match { margin-bottom: 0; }
.wc .tm .nm:empty { border-bottom: 0; height: auto; }
.wc .tm.empty .bd { visibility: hidden; }
/* nomes compridos quebram em até 2 linhas (não corta "Fogo no…") */
.wc .tm .nm { white-space: normal; line-height: 1.12; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

/* Chave sem barra de rolagem: arrasta com o dedo ou com o mouse */
.bracket { scrollbar-width: none; cursor: grab; }
.bracket::-webkit-scrollbar { display: none; }
.bracket.dragging { cursor: grabbing; user-select: none; }
/* No computador a página do campeonato fica larga para a chave caber */
@media (min-width: 900px) { #tdetail .page-body { max-width: min(1400px, 96vw); } }
.bracket { display: flex; }
.bracket > .wc { margin: 0 auto; }
/* festa desde o fim da final: os rostos vão crescendo devagar e indo para o meio durante a música */
.ps-face.l { animation: approachL 6s cubic-bezier(.25, .6, .3, 1) both; }
.ps-face.r { animation: approachR 6s cubic-bezier(.25, .6, .3, 1) both; }
.ps-cup { animation: cupIn 2.4s 2.5s ease-out both; }
.ps-hint { min-height: 22px; color: var(--muted); font-size: 15px; }
.photo-stage { grid-template-rows: auto 1fr auto auto auto; }
.wc-champ { pointer-events: none; }
.wc-champ:empty { display: none; }

/* Organizador falando com a mesa */
.admin-ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
#admin-mic.on { background: #e53935; color: #fff; animation: livePulse 1.4s infinite; }
.admin-talk { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 9; pointer-events: none; white-space: nowrap;
  background: #5e35b1; color: #fff; font-weight: 800; font-size: 14px; padding: 6px 14px; border-radius: 99px; box-shadow: 0 4px 16px rgba(0,0,0,.45); animation: livePulse 1.6s infinite; }
.banner { white-space: normal; max-width: 92vw; }

.banner.admin-b { background: #5e35b1; font-size: 19px; font-weight: 800; padding: 12px 18px; max-width: 88vw; }
.banner.admin-b small { opacity: .85; font-size: 12px; }

/* Barra de baixo: com o botão da faca são 4 botões redondos + TRUCO; tudo cabe na tela */
.controls { gap: 6px; }
.media-ctl { gap: 5px; min-width: 0; flex: 1 1 auto; }
.media-ctl .round { flex: 0 1 auto; width: clamp(38px, 11vw, 52px); height: clamp(38px, 11vw, 52px); font-size: clamp(17px, 5vw, 24px); }
.me-wrap { width: clamp(50px, 15vw, 62px); }
.game-ctl { flex: 0 0 auto; }
.btn.truco { min-width: 0; padding: 0 clamp(10px, 3.5vw, 18px); font-size: clamp(15px, 4.6vw, 19px); white-space: nowrap; }

/* ícones de microfone e câmera (estilo chamada de vídeo) */
.round .ic { width: 60%; height: 60%; fill: #fff; stroke: none; display: block; }
.round .ic .s { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Lobby do campeonato ---------- */
#tlobby { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr auto; background: #041a10; }
#tlobby.hidden { display: none; }
.lb-top { display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 6px) 10px 6px; background: var(--chrome); z-index: 3; }
.lb-top h2 { flex: 1; margin: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-badge { background: #e53935; color: #fff; font-size: 11px; font-weight: 900; letter-spacing: 1px; padding: 3px 8px; border-radius: 6px; }
.lb-grid { display: grid; gap: 4px; padding: 4px; align-content: center; min-height: 0; overflow: hidden; }
.lb-tile { position: relative; height: var(--tile-h, 120px); border-radius: 10px; overflow: hidden; background: #0b2e1d; border: 2px solid rgba(255,255,255,.08); }
.lb-tile.me { border-color: rgba(255, 210, 63, .6); }
.lb-tile.speaking { border-color: #69f0ae; box-shadow: 0 0 0 2px #69f0ae; }
.lb-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.lb-tile.has-video video { opacity: 1; }
.lb-tile.me video { transform: scaleX(-1); }
.lb-ini { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(16px, 5vw, 34px); font-weight: 900; color: #fff; opacity: .7; }
.lb-name { position: absolute; left: 4px; bottom: 3px; right: 4px; font-size: 11px; color: #fff; text-shadow: 0 1px 3px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* avisos e chave por cima das câmeras, com fundo para dar leitura */
.lb-notice { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; max-width: 88vw; text-align: center;
  background: rgba(4, 20, 12, .88); border: 2px solid rgba(255, 210, 63, .7); color: #fff; font-size: clamp(20px, 6vw, 30px); font-weight: 900;
  padding: 16px 22px; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.6); animation: stageIn .35s ease-out; }
.lb-notice.admin { background: rgba(70, 30, 140, .92); border-color: #b39ddb; }
.lb-bracket { position: fixed; left: 0; top: 50%; z-index: 4; transform-origin: center center; background: rgba(4, 20, 12, .9); border: 2px solid rgba(255, 210, 63, .55);
  border-radius: 16px; padding: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.6); will-change: transform; }
.lb-bracket.center { left: 50%; }
.lb-bracket .wc { min-height: 0; }
.lb-count { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 110px); transform: translateX(-50%); z-index: 6; min-width: 120px; text-align: center;
  font-size: 72px; font-weight: 900; color: #fff; line-height: 1; padding: 8px 18px; border-radius: 18px; background: rgba(4, 20, 12, .85); border: 2px solid #ffd23f; text-shadow: 0 4px 16px rgba(0,0,0,.6); }
.lb-count.pop { animation: countPop .35s ease-out; }
/* Campeonato de teste */
.test-note { margin: 6px 0; padding: 6px 10px; border-radius: 8px; background: rgba(212, 160, 23, .15); border: 1px solid #d4a017; font-size: 13px; }
.lb-tile.bot .lb-ini { opacity: 1; }

/* Apresentação da final no lobby */
#tlobby.final { grid-template-rows: auto auto minmax(0, 1fr) auto; background: radial-gradient(ellipse at 50% 30%, #1d5a3a 0%, #041a10 70%); }
.lb-final { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 8px 0; min-height: 0; }
.lb-final.hidden { display: none; }
.lf-title { font-family: Georgia, serif; font-size: clamp(36px, 11vw, 60px); font-weight: 900; letter-spacing: 8px; line-height: 1; color: #ffd23f;
  text-shadow: 0 3px 0 #8a5a00, 0 0 22px rgba(255, 210, 63, .55); animation: lfIn .8s ease-out; }
.lf-names { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; width: 100%; }
.lf-names b { text-align: center; font-size: clamp(15px, 4.6vw, 22px); font-weight: 900; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(0, 0, 0, .35); border: 2px solid rgba(255, 210, 63, .6); border-radius: 10px; padding: 4px 6px; }
.lf-vs { font-size: clamp(20px, 6vw, 30px); font-weight: 900; font-style: italic; color: #ff5252; text-shadow: 0 2px 0 #000, 0 0 10px rgba(255, 82, 82, .6); }
.lf-stage { display: grid; grid-template-columns: minmax(0, 1fr) clamp(70px, 21vw, 120px) minmax(0, 1fr); align-items: center; gap: 6px; width: 100%; }
.lf-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lf-side .lb-tile { height: var(--lf-tile-h, 24vh); width: 100%; }
.lb-tile.finalist { border-color: #ffd23f; box-shadow: 0 0 14px rgba(255, 210, 63, .35); }
.lb-tile.finalist.speaking { border-color: #69f0ae; box-shadow: 0 0 0 3px #69f0ae; }
.lb-tile.finalist .lb-name { font-size: 13px; font-weight: 800; }
.lf-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.lf-cup { width: 100%; }
.lf-cup svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 0 14px rgba(255, 210, 63, .55)); animation: cupGlow 2.4s ease-in-out infinite; }
.lf-count { text-align: center; line-height: 1; }
.lf-count.hidden { display: none; }
.lf-count small { display: block; font-size: 10px; font-weight: 700; color: #cfe8d8; margin-bottom: 4px; }
.lf-count b { font-size: clamp(38px, 12vw, 64px); font-weight: 900; color: #fff; text-shadow: 0 2px 0 #000, 0 0 16px rgba(255, 210, 63, .7); }
.lf-count.pop b { display: inline-block; animation: countPop .35s ease-out; }
.lf-msg { width: 100%; display: flex; flex-direction: column; gap: 3px; text-align: center; background: rgba(6, 24, 15, .94); border: 2px solid #ffd23f;
  border-radius: 14px; padding: 8px 12px; font-size: 14px; color: #fff; animation: lfIn .5s ease-out; }
.lf-msg.hidden { display: none; }
.lf-msg b { color: #ffd23f; font-size: 18px; }
.lf-msg .luck { font-size: 21px; }
@keyframes lfIn { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes cupGlow { 50% { filter: drop-shadow(0 0 26px rgba(255, 210, 63, .9)); transform: scale(1.04); } }
.lb-admin { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px 8px calc(6px + var(--safe-b)); background: var(--chrome); z-index: 3; }
/* fundo sólido: a chave e os avisos ficam legíveis por cima das câmeras */
.lb-bracket { background: #06180f; border-color: #d4a017; }
.lb-bracket .bracket, .lb-bracket .wc { background: #06180f; }
.lb-bracket .wc .match { background: #0b2619; }
.lb-notice { background: #06180f; }
.lb-notice.admin { background: #3d1f7a; }
.lb-count { top: calc(env(safe-area-inset-top) + 100px); background: #06180f; }

/* Jogando agora (organizador) */
.adm-live { display: grid; gap: 8px; }
.now-card { display: grid; gap: 4px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.05); border-left: 4px solid #69f0ae; }
.now-card.st-esperando { border-left-color: #ffd23f; }
.now-card.st-terminou { border-left-color: #90a4ae; opacity: .8; }
.now-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.now-status { color: var(--muted); }
.now-players { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; }
.now-p.off { color: #ff8a80; }
.now-p.empty { color: var(--muted); font-style: italic; }
.now-card .btn.mini { justify-self: start; }
.nick-me { padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .06); font-size: 15px; }
.nick-me a { margin-left: 6px; font-size: 13px; color: var(--gold, #ffd23f); }
#fan-bracket { display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 6px; }
#fan-bracket.hidden { display: none; }
/* Partidas abertas */
.ab-h { margin: 6px 0 0; font-size: 15px; }
.ab-list { display: grid; gap: 8px; }
.ab-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel, rgba(0, 0, 0, .25)); }
.ab-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ab-info b { font-size: 16px; }
.ab-people { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-row .btn { flex: 0 0 auto; min-width: 86px; }
/* Moderação: menu de cada câmera */
.tile-more { position: absolute; right: 4px; bottom: 4px; z-index: 3; width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 15px; line-height: 26px; text-align: center; cursor: pointer; }
.tile.cam-hidden video, .lb-tile.cam-hidden video { visibility: hidden; }
.tile.cam-hidden .avatar { display: grid !important; }
.lb-tile.cam-hidden .lb-ini { opacity: .7; }
.mod-sheet { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; }
.mod-box { width: min(480px, 100%); background: #0b2619; border-radius: 16px 16px 0 0; padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.mod-box h3 { margin: 0 0 4px; }
.mod-box .btn { width: 100%; }
.mod-list { display: grid; gap: 10px; }
.mod-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mod-head b { font-size: 17px; }
.mod-tag { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, .1); }
.mod-tag.bad { background: #b71c1c; color: #fff; }
.mod-rep { padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.mod-rep.done { opacity: .6; }
.mod-rep summary { cursor: pointer; }
.mod-text { margin: 6px 0; font-style: italic; }
.mod-diary { font: 12px/1.4 ui-monospace, monospace; background: rgba(0, 0, 0, .3); border-radius: 8px; padding: 6px 8px; max-height: 220px; overflow: auto; }
.regras ul { padding-left: 18px; display: grid; gap: 6px; }
label.check { display: flex; align-items: center; gap: 8px; }
label.check input[type='checkbox'] { width: 20px; height: 20px; min-height: 0; flex: 0 0 auto; margin: 0; padding: 0; }
/* Baralho patrocinado: verso com a imagem do patrocinador */
html[data-patrocinio] .card.back { background: #fff var(--deck-back) center / cover no-repeat; border-color: #fff; }
html[data-patrocinio] .tile .cnt i { background: #fff var(--deck-back) center / cover no-repeat; }
.sponsor-tag { position: absolute; right: 8px; bottom: 6px; z-index: 2; font-size: 11px; font-weight: 800; color: #fff; opacity: .85;
  background: rgba(0, 0, 0, .35); padding: 2px 8px; border-radius: 99px; pointer-events: none; }
.sponsor-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; }
.sp-opt { display: grid; justify-items: center; gap: 4px; padding: 6px; border-radius: 10px; border: 2px solid transparent; background: rgba(0, 0, 0, .25); color: inherit; font: inherit; cursor: pointer; }
.sp-opt.on { border-color: #ffd23f; }
.sp-back { width: 46px; height: 66px; border-radius: 6px; border: 2px solid #fff; background: center / cover no-repeat; display: block; }
.sp-back.plain { background: repeating-linear-gradient(45deg, #b71c1c 0 4px, #8e1515 4px 8px); }
.sponsor-note { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.sponsor-note .sp-back { width: 28px; height: 40px; }
html[data-patrocinio] { --back1: #111; --back2: #111; } /* camadas do monte combinando com o verso patrocinado */
/* Botão Campeonatos em destaque: inscrições abertas (luz dourada girando + selo) e ao vivo (selo + luz vermelha) */
@property --giro { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes giro { to { --giro: 360deg; } }
@keyframes pisca { 50% { opacity: .25; } }
#champ-btn { position: relative; overflow: visible; isolation: isolate; }
#champ-btn.aberto, #champ-btn.ao-vivo { margin-top: 14px; }
#champ-btn.aberto::before, #champ-btn.ao-vivo::before { content: ''; position: absolute; inset: -4px; border-radius: inherit; padding: 4px; z-index: -1;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
#champ-btn.aberto { box-shadow: 0 0 18px rgba(255, 179, 0, .55); }
#champ-btn.aberto::before { background: conic-gradient(from var(--giro), transparent 0 55%, #ffb300 70%, #fff6c2 78%, #ffb300 86%, transparent 100%); animation: giro 1.8s linear infinite; }
#champ-btn.ao-vivo { box-shadow: 0 0 20px rgba(255, 23, 68, .55); }
#champ-btn.ao-vivo::before { background: conic-gradient(from var(--giro), transparent 0 50%, #ff1744 66%, #ffd6dd 75%, #ff1744 84%, transparent 100%); animation: giro 1.4s linear infinite; }
.champ-selo { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); z-index: 2; white-space: nowrap; display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 900; letter-spacing: .5px; padding: 3px 10px; border-radius: 99px; box-shadow: 0 2px 8px rgba(0, 0, 0, .45); pointer-events: none; }
.champ-selo.aberto { background: #ffb300; color: #3b2a00; }
.champ-selo.vivo { background: #e53935; color: #fff; letter-spacing: 1px; }
.champ-selo.vivo i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pisca 1s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) { #champ-btn.aberto::before, #champ-btn.ao-vivo::before, .champ-selo.vivo i { animation: none; } }
/* Modo História */
.story-list { display: grid; gap: 14px; }
.story-card { border-radius: 16px; overflow: hidden; background: rgba(0, 0, 0, .3); border: 2px solid rgba(255, 210, 63, .35); }
.story-card.locked { opacity: .6; filter: grayscale(.6); }
.story-cover { display: block; width: 100%; height: auto; max-height: 70dvh; object-fit: cover; object-position: top; }
.story-body { padding: 12px 14px 14px; display: grid; gap: 10px; }
.story-body h3 { margin: 0; }
.story-who { display: flex; align-items: flex-start; justify-content: center; gap: 8px; flex-wrap: wrap; }
.story-face { display: grid; justify-items: center; gap: 2px; width: 72px; text-align: center; }
.story-face img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid #ffd23f; }
.story-face b { font-size: 13px; line-height: 1.1; }
.story-face small { font-size: 11px; }
.story-vs { align-self: center; font-weight: 900; color: #ff5252; font-style: italic; font-size: 18px; }
.tile .avatar.photo { background: center / cover no-repeat; font-size: 0; }
/* Modo História: capa e fala do parceiro antes da partida */
.story-intro { position: fixed; inset: 0; z-index: 70; background: #0b0703; display: grid; place-items: center; cursor: pointer; animation: lfIn .4s ease-out; }
.story-intro picture, .story-intro picture img { display: block; width: 100%; height: 100%; object-fit: contain; }
.story-title { position: absolute; left: 50%; bottom: calc(56px + env(safe-area-inset-bottom)); transform: translateX(-50%); white-space: nowrap;
  background: rgba(0, 0, 0, .75); color: #ffd23f; font-weight: 900; font-size: clamp(16px, 4.5vw, 24px); padding: 8px 16px; border-radius: 12px; }
.story-tap { position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); color: #fff; font-size: 14px; opacity: .85; animation: pisca 1.6s ease-in-out infinite; }
.story-skip { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; border: 0; border-radius: 99px; padding: 6px 12px; background: rgba(0, 0, 0, .6); color: #fff; font-weight: 700; }
.story-talk { width: min(520px, 92vw); display: grid; gap: 14px; justify-items: center; padding: 16px; cursor: default; }
.story-talk img { width: min(320px, 70vw); aspect-ratio: 1; object-fit: cover; border-radius: 20px; border: 4px solid #ffd23f; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.story-bubble { position: relative; background: #fff8e1; color: #2b1a00; border-radius: 18px; padding: 14px 16px; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
.story-bubble::before { content: ''; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); border: 12px solid transparent; border-top: 0; border-bottom-color: #fff8e1; }
.story-bubble b { display: block; color: #b26a00; margin-bottom: 4px; }
.story-bubble p { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.35; }
.story-talk .btn { width: 100%; }
/* Modo História: botão da música (sempre à vista) */
.music-btn { position: fixed; z-index: 75; right: 10px; top: calc(env(safe-area-inset-top) + 64px); border: 0; border-radius: 99px; padding: 6px 12px;
  background: rgba(0, 0, 0, .6); color: #fff; font-weight: 800; font-size: 13px; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); cursor: pointer; }
.music-btn.off { opacity: .75; }
.music-btn.hidden { display: none; }
.btn.story { background: linear-gradient(135deg, #1d3557, #0b1d33); color: #ffd23f; border: 1px solid rgba(255, 210, 63, .5); }
/* Chave com zoom na dupla (depois de cada confronto) */
.bk-banner { position: absolute; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 3; max-width: 92vw; text-align: center;
  background: rgba(0, 0, 0, .8); color: #ffd23f; font-weight: 900; font-size: clamp(15px, 4.2vw, 22px); padding: 10px 16px; border-radius: 14px; border: 2px solid rgba(255, 210, 63, .6); animation: lfIn .5s ease-out; }
.match.zoom-me { box-shadow: 0 0 0 3px #ffd23f, 0 0 26px rgba(255, 210, 63, .8); animation: zoomMe 1.2s ease-in-out infinite; }
@keyframes zoomMe { 50% { box-shadow: 0 0 0 4px #ffd23f, 0 0 40px rgba(255, 210, 63, 1); } }
.story-hero { position: relative; border-radius: 16px; overflow: hidden; border: 2px solid rgba(255, 210, 63, .45); }
.story-hero img { display: block; width: 100%; height: auto; max-height: 78dvh; object-fit: cover; object-position: top; }
.story-start { position: absolute; z-index: 2; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(320px, 80%); box-shadow: 0 6px 24px rgba(0, 0, 0, .6); }
.story-h { margin: 8px 0 0; }
.story-hero { cursor: pointer; }
/* Modo História: mesa da fase (imagem no lugar do feltro) */
.arena.mesa-fase { background: #2e5d1f var(--mesa-fase) center / cover no-repeat; }
.arena.mesa-fase::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, .35)); pointer-events: none; }
.story-loading { color: #ffd23f; font-weight: 900; font-size: 20px; animation: pisca 1.2s ease-in-out infinite; }
.story-admin { margin-top: 10px; display: grid; gap: 6px; }
.story-admin-row { display: flex; flex-wrap: wrap; gap: 6px; }
.story-hist { margin-top: 6px; background: rgba(0, 0, 0, .25); border-radius: 12px; padding: 8px 12px; }
.story-hist summary { cursor: pointer; font-weight: 800; }
.story-hist-row { display: grid; gap: 2px; padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.btn.complete { background: #5d4037; color: #ffe082; border: 1px solid #ffb300; font-size: 14px; }
label.check span { line-height: 1.35; }
.regras a, label.check a { color: #ffd23f; text-decoration: underline; }
/* Modo História, Fase 5: o garçom no canto da mesa com a dica da mão */
.waiter { position: absolute; top: 12px; right: 12px; z-index: 6; display: flex; align-items: flex-start; gap: 6px; max-width: min(300px, 62%); cursor: pointer; }
.waiter-face { width: 54px; height: 54px; border-radius: 50%; border: 3px solid #ffd23f; box-shadow: 0 3px 10px rgba(0, 0, 0, .5); flex: none; object-fit: cover; }
.waiter-bubble { background: #fffdf3; color: #2a1d05; border-radius: 12px; padding: 6px 9px; font-size: 12.5px; line-height: 1.25; box-shadow: 0 3px 10px rgba(0, 0, 0, .45); display: grid; gap: 2px; }
.waiter-bubble b { font-size: 10.5px; color: #8a5a00; text-transform: uppercase; letter-spacing: .03em; }
.waiter.them .waiter-bubble { background: #ffe3e0; }
.waiter.them .waiter-bubble b { color: #a3261b; }
.waiter .card.waiter-card { --w: 38px; flex: none; margin-top: 2px; }
.waiter.played .card.waiter-card { opacity: .45; filter: grayscale(.6); }
.waiter.min .waiter-bubble { display: none; }
.waiter.pop { animation: waiter-pop .5s ease-out; }
@keyframes waiter-pop { 0% { transform: translateY(-14px) scale(.85); opacity: 0; } 100% { transform: none; opacity: 1; } }
@media (max-width: 760px) { .waiter { top: auto; right: auto; bottom: 8px; left: 8px; max-width: 78%; align-items: flex-end; } .waiter-face { width: 42px; height: 42px; } .waiter-bubble { font-size: 11.5px; } }
.waiter.to-right { flex-direction: row-reverse; }
.tile.waiter-ear { box-shadow: 0 0 0 3px #ff8a7a, 0 0 18px 4px rgba(255, 110, 90, .75) !important; animation: waiter-ear 1.1s ease-in-out infinite; }
@keyframes waiter-ear { 50% { box-shadow: 0 0 0 3px #ff8a7a, 0 0 6px 1px rgba(255, 110, 90, .4); } }
.waiter-tag { position: absolute; left: 6px; bottom: 26px; z-index: 3; background: #fffdf3; color: #2a1d05; font: 800 13px system-ui; padding: 2px 7px; border-radius: 99px; box-shadow: 0 2px 6px rgba(0, 0, 0, .45); pointer-events: none; }
.card .waiter-tag.eye { left: 50%; bottom: auto; top: -12px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; background: #ffe3e0; color: #a3261b; }
@media (max-width: 760px) { .waiter.them .waiter-card { display: none; } }
/* Modo História: 1 ou 2 jogadores; mesa em dupla (online) */
.story-modes { position: absolute; z-index: 2; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(340px, 86%); display: grid; gap: 10px; }
.story-modes .btn { box-shadow: 0 6px 24px rgba(0, 0, 0, .6); }
.story-modes .btn:not(.primary) { background: rgba(10, 30, 20, .88); color: #fff; border: 2px solid #ffd23f; }
.story-admin-duo { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.story-lobby { display: grid; gap: 10px; justify-items: center; margin-top: 8px; text-align: center; }
.story-lobby-wait { color: #ffd23f; font-weight: 700; animation: pisca 1.6s ease-in-out infinite; }
.story-lobby-ok { color: #8ef0a0; font-weight: 800; }
.story-gone { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(0, 0, 0, .6); }
.story-gone-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.story-gone .box { background: #0f2a1d; border: 2px solid #ffd23f; border-radius: 18px; padding: 20px 18px; max-width: min(380px, 92vw); box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.story-gone .box h2 { margin: 0; }
/* Modo História em dupla: tela de convite antes da abertura */
.story-wait { position: fixed; inset: 0; z-index: 68; background: #0b0703; display: grid; place-items: center; padding: 16px; }
.story-wait > picture { position: absolute; inset: 0; }
.story-wait > picture img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.45); }
.story-wait-card { position: relative; width: min(420px, 100%); display: grid; gap: 12px; text-align: center; background: rgba(12, 32, 22, .92); border: 2px solid #ffd23f; border-radius: 18px; padding: 20px 18px; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.story-wait-card h2 { margin: 0; color: #ffd23f; font-size: clamp(18px, 5vw, 24px); }
.story-wait-card p { margin: 0; }
.story-wait-kicker { font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.story-wait-card .btn.mini { justify-self: center; }
