/* ===================== Bingão ===================== */
:root {
  --bg1: #2a1257;
  --bg2: #120a2e;
  --panel: rgba(255, 255, 255, 0.07);
  --panel-b: rgba(255, 255, 255, 0.12);
  --text: #fff8ff;
  --muted: #c9b8ec;
  --pink: #ff4d8d;
  --yellow: #ffd23f;
  --green: #3ee0a1;
  --blue: #4dabff;
  --purple: #b36bff;
  --orange: #ff8a3d;
  --red: #ff4d5e;
  --radius: 18px;
  --c0: #3f8cff; --c1: #ff4d5e; --c2: #f4f1ff; --c3: #2fcf86; --c4: #ffc42e;
  font-family: 'Fredoka', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255, 77, 141, 0.25), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, rgba(77, 171, 255, 0.22), transparent 60%),
    linear-gradient(160deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
  min-height: 100vh;
  font-size: 16px;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: #ff9aa6; min-height: 1.2em; margin: .6rem 0 0; text-align: center; }

/* ---------- botões ---------- */
.btn {
  border: 0; border-radius: 999px; padding: .65rem 1.2rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  text-decoration: none; transition: transform .12s, filter .12s, box-shadow .12s; white-space: nowrap;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--pink), var(--orange)); color: #fff; box-shadow: 0 6px 20px rgba(255, 77, 141, .35); }
.btn-secondary { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2); }
.btn-ghost { background: transparent; border: 1px dashed rgba(255, 255, 255, .3); color: var(--muted); }
.btn-whats { background: #25d366; color: #06301a; }
.btn-lg { padding: .9rem 1.6rem; font-size: 1.15rem; }
.btn-xl { padding: 1.1rem 2.4rem; font-size: 1.4rem; }
.small { font-size: .85rem; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--panel-b);
  background: var(--panel); font-size: 1.15rem; transition: .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .16); }
.icon-btn.off { opacity: .45; }
.icon-btn.on { background: var(--green); border-color: var(--green); }

.panel {
  background: var(--panel); border: 1px solid var(--panel-b); border-radius: var(--radius);
  backdrop-filter: blur(10px); padding: 1rem;
}
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .9rem; }
.field > span { font-size: .9rem; color: var(--muted); font-weight: 500; }
.field.check { flex-direction: row; align-items: center; gap: .6rem; }
input:not([type=range]):not([type=checkbox]), select {
  background: rgba(0, 0, 0, .25); border: 1px solid var(--panel-b); border-radius: 12px;
  padding: .7rem .9rem; outline: none; width: 100%;
}
input:focus, select:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 210, 63, .2); }
select option { background: #241048; }
input[type=range] { accent-color: var(--pink); width: 100%; }
input[type=checkbox] { accent-color: var(--green); width: 18px; height: 18px; }

/* ---------- bolas ---------- */
.ball, .mini-ball {
  display: inline-grid; place-items: center; border-radius: 50%; font-weight: 700; color: #1b1033;
  background: radial-gradient(circle at 32% 28%, #fff 0 12%, var(--bc, #fff) 45%, color-mix(in srgb, var(--bc, #ccc) 70%, #000) 100%);
  box-shadow: inset -4px -6px 10px rgba(0, 0, 0, .25), 0 6px 14px rgba(0, 0, 0, .35);
}
.c0 { --bc: var(--c0); } .c1 { --bc: var(--c1); } .c2 { --bc: var(--c2); } .c3 { --bc: var(--c3); } .c4 { --bc: var(--c4); }

/* ---------- HOME ---------- */
.home-wrap { max-width: 980px; margin: 0 auto; padding: 2rem 1rem 3rem; display: flex; flex-direction: column; align-items: center; }
.logo { text-align: center; margin-bottom: 1.4rem; }
.logo h1 {
  font-size: clamp(3rem, 10vw, 5.5rem); margin: .3rem 0 0; line-height: 1; letter-spacing: 1px;
  background: linear-gradient(90deg, var(--yellow), var(--pink), var(--purple), var(--blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 18px rgba(255, 77, 141, .35));
}
.tagline { color: var(--muted); font-size: 1.15rem; margin: .6rem 0 0; }
.logo-balls { display: flex; gap: .5rem; justify-content: center; }
.logo-balls .ball { width: 54px; height: 54px; font-size: 1.5rem; animation: bounce 1.6s infinite ease-in-out; }
.logo-balls .ball:nth-child(2) { animation-delay: .12s; } .logo-balls .ball:nth-child(3) { animation-delay: .24s; }
.logo-balls .ball:nth-child(4) { animation-delay: .36s; } .logo-balls .ball:nth-child(5) { animation-delay: .48s; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-16px) rotate(-8deg); } }

.home-card { width: min(460px, 100%); padding: 1.5rem; }
.avatar-picker { display: grid; grid-template-columns: repeat(9, 1fr); gap: .35rem; }
.avatar-opt { aspect-ratio: 1; border-radius: 12px; border: 2px solid transparent; background: rgba(255, 255, 255, .06); font-size: 1.35rem; padding: 0; transition: .12s; }
.avatar-opt:hover { transform: scale(1.1); }
.avatar-opt.sel { border-color: var(--yellow); background: rgba(255, 210, 63, .18); transform: scale(1.08); }
.home-actions { display: flex; flex-direction: column; gap: .9rem; margin-top: .6rem; }
.divider { text-align: center; color: var(--muted); font-size: .85rem; position: relative; }
.divider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--panel-b); }
.divider span { position: relative; background: #2a1a50; padding: 0 .7rem; border-radius: 6px; }
.join-row { display: flex; gap: .5rem; }
.join-row input { text-transform: uppercase; letter-spacing: .35em; text-align: center; font-weight: 700; font-size: 1.2rem; }
.join-row.highlight input { border-color: var(--yellow); }

.modes-showcase { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; margin-top: 2rem; width: 100%; }
.showcase-card { background: var(--panel); border: 1px solid var(--panel-b); border-radius: var(--radius); padding: 1rem; transition: transform .2s; }
.showcase-card:hover { transform: translateY(-4px) rotate(-.5deg); }
.showcase-card p { color: var(--muted); font-size: .9rem; margin: .3rem 0 0; }
.sc-icon { font-size: 2rem; }
.foot { margin-top: 2rem; color: var(--muted); font-size: .85rem; }

/* salas recentes */
.recent-rooms { display: flex; flex-direction: column; gap: .45rem; margin-top: .4rem; }
.recent-rooms:empty { display: none; }
.recent-rooms .divider { margin: .4rem 0; }
.recent-room {
  display: flex; align-items: center; gap: .7rem; text-align: left; padding: .6rem .8rem; border-radius: 14px;
  border: 1px solid var(--panel-b); background: rgba(255, 255, 255, .05); transition: .15s;
}
.recent-room:hover { background: rgba(255, 210, 63, .12); border-color: rgba(255, 210, 63, .5); }
.rr-icon { font-size: 1.5rem; }
.rr-main { flex: 1; display: flex; flex-direction: column; }
.rr-main b { letter-spacing: .15em; }
.rr-main small { color: var(--muted); font-size: .8rem; }
.rr-go { color: var(--yellow); font-weight: 600; font-size: .9rem; }

/* ---------- SALA ---------- */
.topbar {
  display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; flex-wrap: wrap;
  background: rgba(0, 0, 0, .2); border-bottom: 1px solid var(--panel-b); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px);
}
.brand { font-size: 1.2rem; }
.room-code { background: rgba(255, 210, 63, .15); border: 1px solid rgba(255, 210, 63, .4); color: var(--yellow); border-radius: 999px; padding: .35rem .9rem; }
.room-code b { letter-spacing: .15em; }
.mode-badge { background: var(--panel); border-radius: 999px; padding: .35rem .8rem; font-size: .9rem; }
.top-actions { margin-left: auto; display: flex; gap: .4rem; }

.room-grid {
  display: grid; grid-template-columns: 280px minmax(0, 1fr) 300px; gap: 1rem; padding: 1rem;
  max-width: 1500px; margin: 0 auto; align-items: start;
}
.col-left, .col-right { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; }
.col-center { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }

.ball-stage { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.big-ball {
  width: 150px; height: 150px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #1b1033; font-weight: 700;
  background: radial-gradient(circle at 32% 28%, #fff 0 14%, var(--bc, #fff) 50%, color-mix(in srgb, var(--bc, #aaa) 65%, #000) 100%);
  box-shadow: inset -10px -14px 24px rgba(0, 0, 0, .25), 0 14px 40px rgba(0, 0, 0, .45), 0 0 0 6px rgba(255, 255, 255, .06);
}
.big-ball::after { content: ''; position: absolute; }
.big-ball .bb-top { font-size: 1.6rem; line-height: 1; min-height: 1.6rem; }
.big-ball .bb-main { font-size: 3.6rem; line-height: 1; }
.big-ball.emoji .bb-main { font-size: 4.6rem; }
.big-ball.idle { --bc: #8f7bc4; color: rgba(27, 16, 51, .6); }
.big-ball.roll { animation: roll .8s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes roll {
  0% { transform: translateX(-120%) rotate(-360deg) scale(.4); opacity: 0; }
  70% { transform: translateX(6%) rotate(10deg) scale(1.08); opacity: 1; }
  100% { transform: none; }
}
.ball-count { color: var(--muted); font-size: .9rem; }
.next-bar { width: 100%; height: 6px; background: rgba(255, 255, 255, .1); border-radius: 99px; overflow: hidden; }
.next-bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--yellow)); border-radius: 99px; }
.recent { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: center; min-height: 38px; }
.mini-ball { width: 36px; height: 36px; font-size: .95rem; }
.host-controls { margin: .9rem 0; display: flex; flex-direction: column; gap: .5rem; }
.host-controls:empty { display: none; }
.hc-row { display: flex; gap: .5rem; align-items: center; }
.hc-row .btn { flex: 1; }
.hc-int { min-width: 2.5em; text-align: right; color: var(--muted); }
.hc-info { text-align: center; color: var(--muted); margin: 0; font-size: .9rem; }
.check { display: flex; align-items: center; gap: .35rem; }

.board-wrap summary { cursor: pointer; color: var(--muted); font-weight: 600; margin: .4rem 0; }
.board { display: flex; flex-direction: column; gap: .3rem; }
.board-row { display: flex; gap: .4rem; align-items: flex-start; }
.br-label { width: 3.4em; flex: none; font-size: .7rem; color: var(--muted); padding-top: .25rem; text-align: right; }
.board-classico .br-label, .board-padroes .br-label, .board-caos .br-label { font-size: 1rem; font-weight: 700; color: var(--yellow); width: 1.2em; }
.br-nums { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; flex: 1; }
.board-bingo90 .br-nums, .board-relampago .br-nums { grid-template-columns: repeat(10, 1fr); }
.bn { font-size: .7rem; text-align: center; padding: .18rem 0; border-radius: 6px; background: rgba(255, 255, 255, .05); color: rgba(255, 255, 255, .35); transition: .3s; }
.board-emoji .bn { font-size: .95rem; filter: grayscale(1); opacity: .35; }
.bn.on { background: var(--pink); color: #fff; font-weight: 700; filter: none; opacity: 1; }
.board-emoji .bn.on { background: rgba(255, 77, 141, .45); }
.bn.last { background: var(--yellow); color: #1b1033; animation: pulse 1s infinite; }

/* ---------- LOBBY ---------- */
#lobbyPanel { padding: 1.4rem; }
.lobby-head h2 { margin: 0 0 .3rem; }
.lobby-head p { color: var(--muted); margin: 0 0 .7rem; }
.code-pill { background: var(--yellow); color: #1b1033; border-radius: 10px; padding: .1rem .6rem; letter-spacing: .15em; font-size: 1.2rem; vertical-align: middle; }
.invite { display: flex; gap: .5rem; flex-wrap: wrap; }
.invite input { flex: 1; min-width: 200px; font-size: .9rem; }
#lobbyPanel h3 { margin: 1.4rem 0 .7rem; }
#lobbyPanel h3 small { color: var(--muted); font-weight: 400; font-size: .85rem; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; }
.mode-card {
  text-align: left; display: flex; flex-direction: column; gap: .2rem; padding: .9rem; border-radius: 16px;
  border: 2px solid var(--panel-b); background: rgba(255, 255, 255, .05); transition: .15s;
}
.mode-card:hover:not(:disabled) { transform: translateY(-3px); border-color: rgba(255, 255, 255, .35); }
.mode-card:disabled { cursor: default; }
.mode-card.sel { border-color: var(--yellow); background: rgba(255, 210, 63, .12); box-shadow: 0 0 0 4px rgba(255, 210, 63, .12); }
.mode-card small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.mc-icon { font-size: 1.8rem; }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; margin-top: 1.2rem; }
.lobby-foot { text-align: center; margin-top: 1rem; }
.waiting { color: var(--muted); font-size: 1.1rem; }

/* ---------- OBJETIVO ---------- */
.objective { padding: .7rem 1rem; }
.obj-chips { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.chip { background: rgba(255, 255, 255, .06); border: 1px solid var(--panel-b); border-radius: 12px; padding: .35rem .7rem; display: flex; flex-direction: column; line-height: 1.2; }
.chip small { color: var(--muted); font-size: .75rem; }
.chip.cur { border-color: var(--yellow); background: rgba(255, 210, 63, .15); }
.chip.done { border-color: var(--green); background: rgba(62, 224, 161, .12); }
.chip-arrow { color: var(--muted); }
.obj-desc { display: flex; align-items: center; gap: .8rem; color: var(--muted); margin-top: .5rem; font-size: .9rem; }
.obj-desc:has(span:empty):not(:has(.mini-pattern)) { display: none; }
.mini-pattern { display: grid; grid-template-columns: repeat(5, 10px); gap: 2px; flex: none; }
.mini-pattern i { width: 10px; height: 10px; border-radius: 2px; background: rgba(255, 255, 255, .12); }
.mini-pattern i.x { background: var(--pink); }

/* ---------- CARTELAS ---------- */
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.cards.n1 { grid-template-columns: minmax(0, 520px); justify-content: center; }
.cards.mode-bingo90 { grid-template-columns: minmax(0, 1fr); }
.cards.mode-bingo90.n1 { grid-template-columns: minmax(0, 760px); }
.no-cards { text-align: center; color: var(--muted); padding: 2rem; }
.bcard {
  background: #fffaf0; color: #24133f; border-radius: 20px; padding: .8rem; position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 0 0 4px #ffe3f0; transition: box-shadow .3s, transform .3s;
}
.bcard.hot { box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 0 0 4px var(--orange), 0 0 24px rgba(255, 138, 61, .5); }
.bcard.ready { box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 0 0 4px var(--green), 0 0 34px rgba(62, 224, 161, .75); transform: scale(1.01); }
.bcard-head, .bcard-grid { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 6px; }
.bcard-head span {
  text-align: center; font-weight: 700; font-size: 1.7rem; color: #fff; border-radius: 10px; padding: .1rem 0; margin-bottom: 6px;
}
.bcard-head span:nth-child(1) { background: var(--c0); } .bcard-head span:nth-child(2) { background: var(--c1); }
.bcard-head span:nth-child(3) { background: #9b7bff; } .bcard-head span:nth-child(4) { background: var(--c3); }
.bcard-head span:nth-child(5) { background: #f2a900; }
.bcard-title { font-weight: 700; color: #8a5cc9; margin-bottom: 6px; font-size: .9rem; }
.cell {
  aspect-ratio: 1; border: 0; border-radius: 12px; background: #f1e9ff; color: #24133f;
  font-size: clamp(1.1rem, 3.2vw, 1.75rem); font-weight: 600; display: grid; place-items: center; padding: 0;
  position: relative; transition: transform .1s, background .2s; user-select: none; -webkit-tap-highlight-color: transparent;
}
button.cell:hover { transform: scale(1.05); background: #e4d6ff; }
.mode-bingo90 .cell { aspect-ratio: 1 / 1.05; font-size: clamp(.95rem, 2.6vw, 1.5rem); border-radius: 9px; }
.mode-emoji .cell { font-size: clamp(1.5rem, 4.5vw, 2.3rem); }
.mode-relampago .cell { font-size: clamp(1.6rem, 6vw, 2.6rem); }
.cell.empty { background: repeating-linear-gradient(45deg, #f6eefc, #f6eefc 6px, #efe5f8 6px, #efe5f8 12px); }
.cell.free { background: linear-gradient(135deg, var(--yellow), var(--orange)); font-size: 1.6rem; }
.cell.target { box-shadow: inset 0 0 0 3px #ff8ab7; }
.cell.marked { color: #fff; }
.cell.marked::before {
  content: ''; position: absolute; inset: 6%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9ac0, var(--pink) 60%, #c71f5f);
  box-shadow: 0 3px 8px rgba(199, 31, 95, .5); animation: dab .25s ease-out; z-index: 0;
}
.cell.marked.bonus::before { background: radial-gradient(circle at 35% 30%, #c7f9e4, var(--green) 60%, #13a86c); }
.cell.bonus::after { content: '🃏'; position: absolute; top: -6px; right: -4px; font-size: .9rem; z-index: 2; }
.cell { z-index: 0; }
.cell > * { position: relative; }
.cell.marked { text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.cell.marked { isolation: isolate; }
.cell.marked::before { z-index: -1; }
@keyframes dab { 0% { transform: scale(1.6); opacity: 0; } 100% { transform: scale(1); opacity: .95; } }
.cell.shake { animation: shake .35s; }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px) rotate(-3deg); } 75% { transform: translateX(5px) rotate(3deg); } }
.bcard-foot { text-align: center; font-size: .9rem; color: #7a5aa8; margin-top: .55rem; min-height: 1.2em; font-weight: 500; }
.bcard.hot .bcard-foot { color: #d85a00; }
.bcard.ready .bcard-foot { color: #0c9a62; font-weight: 700; }

.bingo-dock { position: sticky; bottom: 12px; text-align: center; z-index: 10; padding-top: .5rem; }
.bingo-btn {
  border: 0; border-radius: 999px; padding: 1rem 3.4rem; font-size: 2rem; font-weight: 700; letter-spacing: 2px; color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--purple)); box-shadow: 0 10px 0 #7b2a8f, 0 18px 30px rgba(0, 0, 0, .4);
  transition: transform .08s, box-shadow .08s;
}
.bingo-btn:active:not(:disabled) { transform: translateY(8px); box-shadow: 0 2px 0 #7b2a8f, 0 6px 12px rgba(0, 0, 0, .4); }
.bingo-btn:disabled { filter: grayscale(.8); opacity: .5; cursor: not-allowed; }
.bingo-btn.ready { background: linear-gradient(135deg, var(--green), #15b97a); box-shadow: 0 10px 0 #0b7a50, 0 0 40px rgba(62, 224, 161, .8); animation: pulse .8s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.bingo-hint { color: var(--muted); font-size: .85rem; margin: .7rem 0 0; min-height: 1em; }

/* ---------- RESULTADO ---------- */
#resultPanel { text-align: center; padding: 1.4rem; }
#resultPanel h2 { margin: 0 0 .4rem; font-size: 1.8rem; }
.result-log { list-style: none; padding: 0; margin: 1rem auto; max-width: 480px; display: flex; flex-direction: column; gap: .4rem; }
.result-log li { display: flex; gap: .6rem; align-items: center; background: rgba(62, 224, 161, .12); border-radius: 12px; padding: .5rem .8rem; }
.result-log li span { flex: 1; text-align: left; }
.result-log em { color: var(--green); font-style: normal; font-weight: 700; }
.podium { list-style: none; padding: 0; margin: .6rem auto 1.2rem; max-width: 420px; display: flex; flex-direction: column; gap: .3rem; }
.podium li { display: flex; gap: .5rem; align-items: center; padding: .45rem .8rem; background: rgba(255, 255, 255, .05); border-radius: 12px; }
.podium li b { margin-left: auto; color: var(--yellow); }
.podium li:first-child { background: rgba(255, 210, 63, .18); font-size: 1.15rem; }
.podium li.me { outline: 2px solid var(--pink); }
.result-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

/* ---------- JOGADORES / CHAT ---------- */
.side-title { margin: .2rem 0 .6rem; font-size: 1rem; }
.side-title span { color: var(--muted); font-weight: 400; }
.players { list-style: none; padding: 0; margin: 0 0 .8rem; display: flex; flex-direction: column; gap: .3rem; }
.players li { display: flex; align-items: center; gap: .5rem; padding: .4rem .55rem; border-radius: 12px; background: rgba(255, 255, 255, .04); }
.players li.me { background: rgba(255, 77, 141, .14); }
.players li.off { opacity: .45; }
.p-av { font-size: 1.4rem; }
.p-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.p-name small { color: var(--muted); }
.p-score { background: var(--yellow); color: #1b1033; font-weight: 700; border-radius: 99px; min-width: 1.9em; text-align: center; padding: 0 .4rem; font-size: .85rem; }
.p-actions { display: none; gap: 2px; }
.players li:hover .p-actions { display: flex; }
.p-actions button { background: rgba(255, 255, 255, .1); border: 0; border-radius: 8px; width: 26px; height: 26px; font-size: .8rem; }
.badge { font-size: .7rem; border-radius: 99px; padding: .1rem .45rem; white-space: nowrap; font-weight: 600; }
.badge.hot { background: var(--orange); color: #2b1000; animation: pulse 1s infinite; }
.badge.warm { background: rgba(255, 138, 61, .25); }
.badge.zero { background: var(--green); color: #002b1a; }
.badge.win { background: var(--pink); }
.reactions { display: flex; gap: .2rem; flex-wrap: wrap; margin-bottom: .8rem; }
.reactions button { flex: 1; background: rgba(255, 255, 255, .06); border: 0; border-radius: 10px; font-size: 1.2rem; padding: .3rem 0; transition: transform .1s; }
.reactions button:hover { transform: scale(1.2); }
.reactions button:active { transform: scale(.9); }
.chat { height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: .3rem; padding-right: .2rem; font-size: .9rem; }
.msg { background: rgba(255, 255, 255, .05); border-radius: 10px; padding: .35rem .55rem; word-wrap: break-word; }
.msg b { color: var(--yellow); font-weight: 600; }
.msg.mine { background: rgba(255, 77, 141, .15); }
.msg.sys { background: transparent; color: var(--muted); font-size: .8rem; padding: .1rem .3rem; }
.chat-form { display: flex; gap: .4rem; margin-top: .5rem; }

/* ---------- OVERLAYS / FX ---------- */
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
#overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(10, 4, 30, .55); backdrop-filter: blur(3px); animation: fade .2s; cursor: pointer; padding: 1rem; }
@keyframes fade { from { opacity: 0; } }
.ov-box { text-align: center; animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.ov-bingo, .ov-count, .ov-fake, .ov-event {
  font-size: clamp(3.5rem, 14vw, 8rem); font-weight: 700; line-height: 1;
  background: linear-gradient(90deg, var(--yellow), var(--pink), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 8px 24px rgba(255, 77, 141, .5));
}
.ov-fake { background: linear-gradient(90deg, #ff6b6b, #ffa94d); -webkit-background-clip: text; background-clip: text; font-size: clamp(2.5rem, 10vw, 5.5rem); }
.ov-event { font-size: clamp(2.5rem, 10vw, 5rem); }
.ov-count { font-size: clamp(5rem, 22vw, 11rem); }
.ov-trophy { font-size: 6rem; animation: bounce 1s infinite; }
.ov-name { font-size: clamp(1.6rem, 6vw, 2.6rem); font-weight: 700; margin-top: .4rem; }
.ov-small { color: var(--muted); font-size: 1.2rem; margin-top: .4rem; }
.ov-small b { color: var(--text); }
.ov-me { font-size: 2rem; color: var(--green); font-weight: 700; margin-top: .4rem; animation: pulse .6s infinite; }
#floaters { position: fixed; inset: 0; pointer-events: none; z-index: 55; overflow: hidden; }
.floater { position: absolute; bottom: -60px; display: flex; flex-direction: column; align-items: center; animation: floatUp 2.6s ease-out forwards; }
.floater .fe { font-size: 2.6rem; }
.floater small { font-size: .75rem; background: rgba(0, 0, 0, .45); border-radius: 99px; padding: 0 .4rem; }
@keyframes floatUp { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-15vh) scale(1.1); } 100% { transform: translateY(-85vh) translateX(30px) scale(1); opacity: 0; } }
#toasts { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: .4rem; align-items: center; pointer-events: none; }
.toast { background: rgba(20, 10, 45, .92); border: 1px solid var(--panel-b); padding: .55rem 1rem; border-radius: 999px; animation: pop .3s; transition: opacity .4s, transform .4s; font-size: .95rem; }
.toast.bad { border-color: var(--red); }
.toast.out { opacity: 0; transform: translateY(-10px); }

/* ---------- RESPONSIVO ---------- */
@media (max-width: 1150px) {
  .room-grid { grid-template-columns: 250px minmax(0, 1fr); }
  .col-right { grid-column: 1 / -1; position: static; max-height: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
  .col-right > * { grid-column: auto; }
  .col-right .side-title:nth-of-type(1), .col-right .players, .col-right .reactions { grid-column: 1; }
  .col-right .side-title:nth-of-type(2), .col-right .chat, .col-right .chat-form { grid-column: 2; }
  .col-right .side-title:nth-of-type(2) { grid-row: 1; }
  .col-right .chat { grid-row: 2 / span 2; }
}
@media (max-width: 760px) {
  .room-grid { grid-template-columns: minmax(0, 1fr); padding: .6rem; gap: .6rem; }
  .col-left { position: static; max-height: none; }
  .ball-stage { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .big-ball { width: 96px; height: 96px; }
  .big-ball .bb-main { font-size: 2.3rem; } .big-ball .bb-top { font-size: 1rem; min-height: 1rem; }
  .big-ball.emoji .bb-main { font-size: 3rem; }
  .ball-stage .recent { flex: 1; justify-content: flex-start; }
  .next-bar { order: 5; }
  .board-wrap:not([open]) { margin: 0; }
  .col-right { display: block; }
  .chat { height: 180px; }
  .topbar { gap: .5rem; padding: .5rem .6rem; }
  .brand { display: none; }
  .mode-badge { font-size: .8rem; }
  .bingo-btn { padding: .8rem 2.6rem; font-size: 1.7rem; }
  .avatar-picker { grid-template-columns: repeat(6, 1fr); }
  #room[data-state="playing"] .col-left { order: 0; }
  #room[data-state="playing"] .board-wrap { display: none; }
  .cell { border-radius: 9px; }
  .bcard { padding: .55rem; border-radius: 16px; }
  .bcard-head span { font-size: 1.3rem; }
  .bcard-head, .bcard-grid { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* modo Memória: números não marcados viram "?" */
.cards.memory-hidden .cell[data-v]:not(.marked) { color: transparent; background: linear-gradient(135deg, #d9c6ff, #c4a8ff); }
.cards.memory-hidden .cell[data-v]:not(.marked)::after { content: '?'; position: absolute; inset: 0; display: grid; place-items: center; color: #7a52c7; }

/* ajustes */
.logo h1 { line-height: 1.2; padding-bottom: .05em; }
#gamePanel { display: flex; flex-direction: column; gap: 1rem; }
.bingo-dock { pointer-events: none; padding-bottom: 14px; }
.bingo-dock .bingo-btn { pointer-events: auto; }
@media (min-width: 761px) { .cards.n1:not(.mode-bingo90) { grid-template-columns: minmax(0, min(520px, max(300px, calc(100vh - 430px)))); } }
@media (max-width: 760px) { #room[data-state="lobby"] .col-left { display: none; } }
#resultPanel { order: -1; }
#room[data-state="finished"] .bingo-dock { display: none; }
