:root {
  /* paleta tirada das duas referências */
  --night: #082239; --deep: #0a3168; --glow: #48e8ff;
  --orange: #f58041; --peach: #efba8a; --bark: #79412d;
  --star: #ffe94f; --ink: #1a1320; --mute: #7d8087;
  /* fundo: tema claro = arena acesa (ref. do ringue); tema escuro = arena à noite (ref. do botão) */
  --bg-top: #47d2fb; --bg-mid: #2f8fe6; --bg-low: #0c3d8c; --bg-edge: #072650;
  --scrim: rgba(7, 38, 80, .55);
  --f-ui: 'Bebas Neue', 'Arial Narrow', 'Roboto Condensed', Impact, sans-serif;
  --f-display: 'Bungee', 'Arial Black', Impact, sans-serif;
  --f-script: 'Mr Dafoe', 'Brush Script MT', 'Segoe Script', cursive;
  --pill-h: clamp(38px, 6.2vmin, 54px);
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg-top: #14467f; --bg-mid: #0d3466; --bg-low: #082239; --bg-edge: #04142a; --scrim: rgba(4, 16, 36, .6); }
}
:root[data-theme="dark"] { --bg-top: #14467f; --bg-mid: #0d3466; --bg-low: #082239; --bg-edge: #04142a; --scrim: rgba(4, 16, 36, .6); }
*, *::before, *::after { box-sizing: inherit; }
html { height: 100%; background: var(--bg-edge); scroll-padding-top: env(safe-area-inset-top, 0px); }
body { height: 100%; margin: 0; background: var(--bg-edge); color: #fff; font-family: var(--f-ui); overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
button:focus-visible { outline: 3px solid var(--star); outline-offset: 4px; }

#app { position: relative; height: 100%; overflow: hidden; user-select: none; -webkit-user-select: none;
  background: radial-gradient(42% 30% at 16% 10%, rgba(255, 255, 255, .2), transparent 70%), radial-gradient(38% 28% at 86% 14%, rgba(255, 255, 255, .14), transparent 70%),
    radial-gradient(120% 92% at 50% 36%, var(--bg-top) 0%, var(--bg-mid) 34%, var(--bg-low) 68%, var(--bg-edge) 100%); }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; opacity: 0; transition: opacity .7s; }
#app.ready #gl { opacity: 1; }
.vignette { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 50%, transparent 26%, rgba(2, 10, 28, .86) 100%); }
.flash { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 45%, rgba(255, 233, 79, .5), rgba(255, 154, 85, .22) 45%, transparent 75%); }
.flash.go { animation: flash .9s ease-out; }
.star { width: 1em; height: 1em; flex: none; fill: var(--star); filter: drop-shadow(0 .07em 0 #d9911a) drop-shadow(0 .14em .08em rgba(3, 14, 38, .5)); }

/* ── peças da HUD: pílula branca + disco laranja com profundidade (como o "Fight" da referência) ── */
.pill { display: inline-flex; align-items: center; gap: .35em; height: var(--pill-h); padding: 0 calc(var(--pill-h) * .5); border-radius: 999px; background: #fff; color: var(--mute);
  font-size: calc(var(--pill-h) * .52); letter-spacing: .03em; line-height: 1; white-space: nowrap;
  box-shadow: 0 calc(var(--pill-h) * .09) 0 rgba(4, 22, 58, .28), 0 calc(var(--pill-h) * .3) calc(var(--pill-h) * .45) rgba(4, 22, 58, .3); }
.disc { --d: calc(var(--pill-h) * 1.16); flex: none; display: grid; place-items: center; width: var(--d); height: var(--d); border: 0; border-radius: 50%; padding: 0; color: #fff;
  font-size: calc(var(--d) * .56); line-height: 1; background: linear-gradient(180deg, var(--orange) 20%, var(--peach) 110%);
  box-shadow: inset 0 0 0 2px rgba(255, 216, 180, .8), 0 calc(var(--d) * .1) 0 var(--bark), 0 calc(var(--d) * .2) calc(var(--d) * .26) rgba(4, 22, 58, .42); }

.hud { position: absolute; left: 0; right: 0; z-index: 3; display: flex; justify-content: space-between; gap: 12px; padding: clamp(10px, 2.4vmin, 24px) clamp(10px, 2.8vmin, 30px); pointer-events: none; opacity: 0; transition: opacity .4s; }
.hud > * { pointer-events: auto; }
.hud-top { top: 0; align-items: flex-start; }
.hud-bottom { bottom: 0; align-items: flex-end; padding-bottom: clamp(16px, 3vmin, 30px); }
#app.playing .hud, #app.playing .clock { opacity: 1; }

.score { position: relative; padding-left: 0; }
.score .disc { margin-left: calc(var(--pill-h) * -.08); }
.score .disc .star { width: .9em; height: .9em; fill: #fff; filter: drop-shadow(0 .06em 0 rgba(121, 65, 45, .5)); }
.score b { min-width: 1.7em; text-align: center; font-weight: 400; font-size: 1.3em; color: var(--deep); padding-top: .06em; }
.delta { position: absolute; left: 58%; top: 100%; font-size: 1.2em; opacity: 0; pointer-events: none; text-shadow: 0 2px 0 rgba(4, 22, 58, .55); }
.delta[data-sign="plus"] { color: var(--star); }
.delta[data-sign="minus"] { color: #ffd3c2; }
.delta.go { animation: delta 1.4s cubic-bezier(.2, .8, .3, 1) both; }

.toggles { display: flex; gap: clamp(8px, 1.6vmin, 14px); }
.toggle { --d: var(--pill-h); cursor: pointer; transition: transform .12s, filter .2s; -webkit-tap-highlight-color: transparent; }
.toggle svg { width: 54%; height: 54%; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.toggle .fill { fill: #fff; stroke: none; }
.toggle .slash { display: none; stroke-width: 2.6; }
.toggle[aria-pressed="false"] { filter: saturate(.12) brightness(.9); }
.toggle[aria-pressed="false"] .slash { display: block; }
.toggle:active { transform: translateY(calc(var(--d) * .07)); }

/* relógio: disco com anel que esvazia + legenda em néon */
.clock { position: absolute; z-index: 3; top: clamp(8px, 2vmin, 18px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: clamp(10px, 2vmin, 20px); pointer-events: none; opacity: 0; transition: opacity .4s; }
.dial { --d: clamp(54px, 9.6vmin, 80px); position: relative; flex: none; display: grid; place-items: center; width: var(--d); height: var(--d); border-radius: 50%; font-size: calc(var(--d) * .62); line-height: 1;
  background: linear-gradient(180deg, var(--orange) 20%, var(--peach) 110%); box-shadow: 0 calc(var(--d) * .09) 0 var(--bark), 0 calc(var(--d) * .2) calc(var(--d) * .28) rgba(4, 22, 58, .45); transition: background .3s; }
.dial svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.dial circle { fill: none; stroke-width: 6; }
.dial .track { stroke: rgba(255, 255, 255, .28); }
.dial .prog { stroke: #fff; stroke-linecap: round; stroke-dasharray: 289.03; stroke-dashoffset: 0; transition: opacity .2s; }
.dial span { position: relative; padding-top: .08em; text-shadow: 0 .05em 0 rgba(121, 65, 45, .55); }
.dial.tick span { animation: tick .32s cubic-bezier(.3, 1.6, .5, 1); }
.dial[data-mode="hot"] span { color: var(--star); }
.dial[data-mode="hot"] .prog { stroke: var(--star); }
.dial:not([data-mode="count"]):not([data-mode="hot"]) .prog { opacity: 0; }
.dial[data-mode="win"] { background: linear-gradient(180deg, #ffe94f 20%, #ffc93a 110%); box-shadow: 0 calc(var(--d) * .09) 0 #b9801a, 0 calc(var(--d) * .2) calc(var(--d) * .28) rgba(4, 22, 58, .45); }
.dial[data-mode="win"] span { color: var(--ink); text-shadow: none; }
.dial[data-mode="lose"] { background: linear-gradient(180deg, #7f97bd 20%, #a9bedd 110%); box-shadow: 0 calc(var(--d) * .09) 0 #3d5278, 0 calc(var(--d) * .2) calc(var(--d) * .28) rgba(4, 22, 58, .45); }
.neon { margin: 0; font-family: var(--f-script); font-weight: 400; color: #fff; white-space: nowrap;
  text-shadow: 0 0 .06em #fff, 0 0 .22em var(--glow), 0 0 .55em var(--glow), 0 0 1.1em rgba(72, 232, 255, .55), 0 .08em .1em rgba(4, 22, 58, .5); }
.caption { font-size: clamp(22px, 4vmin, 36px); transform: rotate(-3deg); }

.last { display: flex; align-items: center; gap: .55em; font-size: clamp(15px, 2.3vmin, 20px); letter-spacing: .08em; color: rgba(255, 255, 255, .85); text-shadow: 0 1px 2px rgba(4, 22, 58, .6); }
.last[hidden] { visibility: hidden; }
.chips { display: flex; align-items: center; gap: .3em; }
.chip { display: grid; place-items: center; min-width: 1.8em; height: 1.8em; padding: .08em .3em 0; border-radius: 999px; background: rgba(8, 34, 57, .66); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .32); color: #fff; letter-spacing: 0; text-shadow: none; }
.chip.hit { background: var(--star); color: var(--ink); box-shadow: 0 2px 0 #c89a12; }
.chip:last-child { transform: scale(1.2); margin-left: .2em; }
.pick { display: flex; align-items: center; }
.pick .pill { min-width: 9.6em; justify-content: center; padding-right: calc(var(--pill-h) * .95); }
.pick .disc { position: relative; margin-left: calc(var(--pill-h) * -.62); padding-top: .06em; transition: background .2s, color .2s; }
.pick[data-state="empty"] .disc { filter: saturate(.4) brightness(1.06); }
.pick[data-state="picked"] .disc, .pick[data-state="locked"] .disc { color: var(--ink); background: linear-gradient(180deg, #ffe94f 20%, #ffc93a 110%);
  box-shadow: inset 0 0 0 2px rgba(255, 250, 205, .9), 0 calc(var(--d) * .1) 0 #b9801a, 0 calc(var(--d) * .2) calc(var(--d) * .26) rgba(4, 22, 58, .42); }
.pick.pop .disc { animation: pop .36s cubic-bezier(.3, 1.7, .5, 1); }

/* ── letreiros em bloco (extrusão em camadas, como o "MERCY") ── */
.chunk { position: relative; display: inline-block; margin: 0; font-family: var(--f-display); font-weight: 400; line-height: 1; letter-spacing: .01em; white-space: nowrap; color: #ff8c45;
  text-shadow: 0 .012em 0 #e56f2c, 0 .03em 0 #c95c28, 0 .05em 0 var(--bark), 0 .07em 0 var(--bark), 0 .09em 0 var(--bark), 0 .11em 0 #5f3122, 0 .2em .22em rgba(3, 14, 38, .55); }
.chunk::after { content: attr(data-text); position: absolute; left: 0; top: 0; right: 0; color: transparent; text-shadow: none; pointer-events: none;
  background: linear-gradient(180deg, #ffc27e 8%, #ff9443 48%, #f2762f 92%); -webkit-background-clip: text; background-clip: text; }
.banner { position: absolute; z-index: 4; left: 50%; top: 27%; display: flex; flex-direction: column; align-items: center; width: max-content; max-width: 98vw; text-align: center; pointer-events: none;
  opacity: 0; transform: translate(-50%, -50%) scale(.5); transition: opacity .25s, transform .25s; }
.banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); transition: opacity .2s, transform .5s cubic-bezier(.2, 1.7, .4, 1); }
.banner-row { display: flex; align-items: center; gap: .3em; font-size: clamp(34px, 11vmin, 104px); }
.banner-row .star { font-size: .36em; }
.banner .neon { margin-top: .05em; font-size: clamp(22px, 4.8vmin, 46px); transform: rotate(-3deg); }
.banner[data-kind="lose"] .chunk { color: #a9c0de; text-shadow: 0 .012em 0 #8ea7c9, 0 .03em 0 #6f89ae, 0 .05em 0 #3d5278, 0 .07em 0 #3d5278, 0 .09em 0 #3d5278, 0 .11em 0 #2a3a58, 0 .2em .22em rgba(3, 14, 38, .55); }
.banner[data-kind="lose"] .chunk::after { background-image: linear-gradient(180deg, #eef5ff 8%, #b3c8e4 50%, #8aa3c8 92%); }
.banner[data-kind="none"] .chunk { color: #ffe9d2; text-shadow: 0 .012em 0 #efc9a4, 0 .03em 0 #d3a57d, 0 .05em 0 var(--bark), 0 .07em 0 var(--bark), 0 .09em 0 var(--bark), 0 .11em 0 #5f3122, 0 .2em .22em rgba(3, 14, 38, .55); }
.banner[data-kind="none"] .chunk::after { background-image: linear-gradient(180deg, #fff 8%, #ffe9d2 55%, #f4cfa6 92%); }
.banner:not([data-kind="win"]) .star { display: none; }

/* ── telas (início, fim de jogo) ── */
.screen { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(16px, 4vmin, 40px); padding: 20px; text-align: center; overflow: hidden;
  background: radial-gradient(circle at 50% 42%, rgba(8, 34, 57, .22), var(--scrim) 75%); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: opacity .5s, visibility .5s; }
.screen[hidden] { display: flex; opacity: 0; visibility: hidden; pointer-events: none; }
.logo { display: flex; flex-direction: column; align-items: center; margin: 0; font-weight: 400; transform: perspective(900px) rotateX(14deg); }
.logo-top { display: flex; align-items: center; gap: .4em; font-size: clamp(24px, 6.4vmin, 62px); }
.logo-top .star { font-size: .62em; margin: 0 .04em; }
.logo-big { font-size: clamp(76px, 25vmin, 250px); margin-top: -.02em; }
.tagline { position: relative; z-index: 1; margin: -.4em 0 0 26%; font-size: clamp(30px, 8.4vmin, 84px); transform: rotate(-7deg); }
.over-title { font-size: clamp(34px, 11vmin, 110px); }
.over-sub { margin-top: -.3em; font-size: clamp(26px, 6vmin, 58px); transform: rotate(-4deg); }
.rules { margin: 0; max-width: 34em; font-size: clamp(15px, 2.5vmin, 22px); letter-spacing: .05em; line-height: 1.4; color: rgba(255, 255, 255, .9); text-shadow: 0 1px 2px rgba(4, 22, 58, .6); }
.rules b { font-weight: 400; color: var(--star); }

/* botão da referência: face que levanta no hover, afunda no clique e inclina pro cursor */
.arena-btn { --lift: 0px; --base: 11px; --rx: 0deg; --ry: 0deg; position: relative; border: 0; margin: 0; padding: 0 0 calc(var(--base) + 6px); background: none; color: #fff; font-size: clamp(20px, 4.4vmin, 34px); cursor: pointer; perspective: 800px; -webkit-tap-highlight-color: transparent; }
.arena-btn .face { display: flex; flex-direction: column; align-items: center; padding: .42em 2.3em .5em; border-radius: 999px; background: linear-gradient(180deg, var(--orange) 34%, var(--peach) 118%);
  box-shadow: inset 0 0 0 .1em rgba(240, 191, 146, .95), 0 calc((var(--base) + var(--lift)) / 2) 0 var(--bark), 0 calc(var(--base) + var(--lift)) 0 var(--bark), 0 calc(var(--base) + var(--lift) + 16px) 24px rgba(2, 12, 30, .5);
  transform: translateY(calc(var(--lift) * -1)) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .2s cubic-bezier(.3, 1.5, .5, 1), box-shadow .2s cubic-bezier(.3, 1.5, .5, 1); }
.arena-btn:hover { --lift: 10px; }
.arena-btn:active { --lift: -8px; }
.arena-btn .script { margin-bottom: -.14em; font-family: var(--f-script); font-size: 1.05em; line-height: 1; color: var(--ink); transform: rotate(-4deg); }
.arena-btn .row { display: flex; align-items: center; gap: .7em; font-size: 1.7em; line-height: 1; letter-spacing: .02em; text-shadow: 0 .04em 0 rgba(121, 65, 45, .45); }
.arena-btn .row b { font-weight: 400; padding-top: .06em; }
.arena-btn .row .star { font-size: .34em; fill: #fff; filter: none; }

@keyframes flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tick { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
@keyframes pop { 0% { transform: scale(.6); } 100% { transform: scale(1); } }
@keyframes delta { 0% { opacity: 0; transform: translateY(-8px) scale(.6); } 14% { opacity: 1; transform: translateY(6px) scale(1.25); } 70% { opacity: 1; transform: translateY(12px) scale(1); } 100% { opacity: 0; transform: translateY(26px) scale(1); } }

/* tela em pé (ou quase quadrada): relógio empilha e o chute vai pro centro embaixo */
@media (max-aspect-ratio: 23/20) {
  .clock { flex-direction: column; gap: 6px; }
  .hud-bottom { flex-direction: column-reverse; align-items: center; gap: 12px; }
}
@media (max-width: 430px) { .score .unit { display: none; } }

/* O saldo real já aparece na pílula da carteira (#wallet); o placar interno do
   jogo fica escondido p/ não sobrepor o header de saldo dentro da arena. */
.score { display: none; }

/* ── Ajustes de mobile ── */
@media (max-width: 640px) {
  /* Título não pode vazar da tela (nowrap): dimensiona pela LARGURA. */
  .logo-big { font-size: clamp(44px, 20vw, 130px); }
  .logo-top { font-size: clamp(16px, 5.2vw, 40px); }
  .tagline { font-size: clamp(22px, 7.2vw, 60px); margin-left: 18%; }
  .rules { font-size: clamp(13px, 3.4vw, 18px); }

  /* Relógio/contador sai do centro (onde fica o header) p/ o canto esquerdo. */
  .clock {
    top: clamp(64px, 16vw, 92px); left: 10px; transform: none;
    flex-direction: row; align-items: center; gap: 8px;
  }
  .clock .caption { font-size: 15px; }

  /* Histórico (últimos) e o card "seu chute" saem de trás do painel: ficam na
     lateral esquerda, em fileiras abaixo do contador. */
  .hud-bottom {
    top: clamp(118px, 30vw, 160px); bottom: auto; left: 10px; right: auto;
    flex-direction: column; align-items: flex-start; gap: 8px; padding: 0;
    width: auto;
  }
  .hud-bottom .last { font-size: 12px; }
  .hud-bottom .pick .pill { min-width: 0; font-size: calc(var(--pill-h) * .42); }
}
@media (prefers-reduced-motion: reduce) {
  .banner, .banner.show, .arena-btn .face { transition-duration: .01s; }
  .dial.tick span, .pick.pop .disc, .flash.go { animation: none; }
}

/* casca do SPA */
#root { height: 100%; }
/* ── Carteira/conta — mesmo design system do jogo (.pill/.disc/.arena-btn/.chunk/.neon). ──
   Posição no canto sup. esq. é provisória; a HUD é reorganizada na Fase 2. */
#wallet {
  position: fixed; z-index: 60;
  top: clamp(10px, 2.4vmin, 24px); left: clamp(10px, 2.8vmin, 30px);
  display: flex; align-items: center; gap: clamp(8px, 1.6vmin, 14px);
}
#wallet-chip { display: flex; align-items: center; gap: clamp(8px, 1.6vmin, 14px); }

/* saldo numa pílula igual à do placar (padding-left:0 evita a "borda" branca à esq.) */
.wallet-pill { gap: .4em; padding-left: 0; padding-right: calc(var(--pill-h) * .7); }
.wallet-pill .disc { margin-left: calc(var(--pill-h) * -.08); }
.wallet-pill .disc .star { width: .9em; height: .9em; fill: #fff; filter: drop-shadow(0 .06em 0 rgba(121, 65, 45, .5)); }
.wallet-pill b { min-width: 1.6em; font-weight: 400; font-size: 1.2em; color: var(--deep); padding-top: .06em; }

/* botão laranja com profundidade (mesma linguagem do "NA ARENA") */
.w-btn {
  cursor: pointer; border: 0; border-radius: 999px; height: var(--pill-h);
  padding: 0 calc(var(--pill-h) * .6); color: #fff;
  font-family: var(--f-ui); font-size: calc(var(--pill-h) * .42); letter-spacing: .05em; text-transform: uppercase;
  background: linear-gradient(180deg, var(--orange) 34%, var(--peach) 118%);
  box-shadow: inset 0 0 0 2px rgba(255, 216, 180, .55),
              0 calc(var(--pill-h) * .12) 0 var(--bark),
              0 calc(var(--pill-h) * .26) calc(var(--pill-h) * .4) rgba(4, 22, 58, .38);
  transition: transform .1s, filter .15s; -webkit-tap-highlight-color: transparent;
}
.w-btn:active { transform: translateY(calc(var(--pill-h) * .06)); }
.w-btn-ghost {
  background: rgba(8, 34, 57, .72); color: #fff;
  box-shadow: inset 0 0 0 1.6px rgba(255, 255, 255, .28), 0 4px 10px rgba(4, 22, 58, .3);
}
.w-btn-block { width: 100%; display: inline-flex; align-items: center; justify-content: center; }

/* modal com a mesma cara dos painéis do jogo */
.w-scrim {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: var(--scrim); backdrop-filter: blur(4px);
}
.w-scrim[hidden] { display: none; }
.w-card {
  position: relative; width: min(92vw, 360px);
  max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: clamp(24px, 4vmin, 36px) clamp(20px, 3.4vmin, 28px) clamp(20px, 3.2vmin, 26px);
  border-radius: 24px; text-align: center; color: #fff;
  background: radial-gradient(120% 100% at 50% 0%, var(--deep), var(--night));
  box-shadow: 0 24px 60px rgba(2, 10, 28, .6), inset 0 0 0 2px rgba(72, 232, 255, .16);
}
.w-card-wide { width: min(94vw, 460px); }
.w-card .chunk { font-size: clamp(26px, 6vmin, 40px); margin-bottom: .1em; }
.w-x {
  position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%;
  cursor: pointer; color: #fff; font-size: 20px; line-height: 1; background: rgba(255, 255, 255, .12);
}
.w-hint { margin: .2em auto 1.1em; }

.w-tabs { display: flex; gap: 8px; margin: .6em 0 1.1em; }
.w-tabs button {
  flex: 1; cursor: pointer; border: 0; border-radius: 999px; height: calc(var(--pill-h) * .9);
  font-family: var(--f-ui); font-size: calc(var(--pill-h) * .36); letter-spacing: .05em; text-transform: uppercase;
  color: rgba(255, 255, 255, .72); background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 0 0 1.4px rgba(255, 255, 255, .12);
}
.w-tabs button.active {
  color: var(--ink); background: linear-gradient(180deg, var(--star) 20%, #ffc93a 110%); box-shadow: 0 4px 0 #b9801a;
}

.w-form { display: flex; flex-direction: column; gap: 12px; }
.w-input {
  width: 100%; height: var(--pill-h); border: 0; border-radius: 999px; padding: 0 calc(var(--pill-h) * .55);
  font-family: var(--f-ui); font-size: calc(var(--pill-h) * .42); color: var(--deep); background: #fff;
  box-shadow: inset 0 2px 6px rgba(4, 22, 58, .18);
}
.w-input::placeholder { color: var(--mute); }
.w-input:focus { outline: 3px solid var(--star); outline-offset: 2px; }
/* Erros de validação: destacados e centralizados (só aparecem quando há texto). */
.w-err { margin: .5em 0 0; min-height: 0; text-align: center; font-family: var(--f-ui); font-weight: 700; font-size: 14px; letter-spacing: .02em; color: #fff; }
.w-err:empty { margin: 0; }
.w-err:not(:empty) {
  padding: 10px 14px; border-radius: 13px; color: #fff;
  background: linear-gradient(180deg, #e2563f, #c0402e);
  box-shadow: 0 8px 20px rgba(226, 86, 63, .4), inset 0 0 0 1.5px rgba(255, 220, 210, .35);
  animation: w-err-pop .18s ease-out;
}
@keyframes w-err-pop { from { transform: scale(.96); opacity: .25; } to { transform: scale(1); opacity: 1; } }
.w-err.w-ok:not(:empty) {
  background: linear-gradient(180deg, #34d399, #0ea371); color: #04281b;
  box-shadow: 0 8px 20px rgba(16, 185, 129, .4), inset 0 0 0 1.5px rgba(210, 255, 238, .5);
}

/* Campos de KYC do depósito (nome + CPF), só na 1ª vez. */
.w-kyc-fields { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

/* KYC só leitura no saque (titular do depósito). */
.w-kyc-ro { margin: .1em 0 .3em; padding: 10px 14px; border-radius: 14px; background: rgba(8, 34, 57, .5); box-shadow: inset 0 0 0 1.4px rgba(255, 255, 255, .12); }
.w-kyc-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-family: var(--f-ui); font-size: 14px; }
.w-kyc-row span { color: rgba(255, 255, 255, .55); }
.w-kyc-row b { color: #fff; letter-spacing: .02em; }

/* botão perigo (sair da conta) */
.w-btn-danger {
  background: linear-gradient(180deg, #e2563f 34%, #b23a2a 118%);
  box-shadow: inset 0 0 0 2px rgba(255, 200, 180, .4), 0 calc(var(--pill-h) * .1) 0 #7c2417, 0 calc(var(--pill-h) * .22) calc(var(--pill-h) * .36) rgba(4, 22, 58, .34);
  margin-top: 14px;
}

/* botão avatar (abre o perfil) */
.w-avatar {
  --d: var(--pill-h); cursor: pointer; font-family: var(--f-ui); font-weight: 700;
  font-size: calc(var(--pill-h) * .5); color: #fff; text-transform: uppercase;
  background: linear-gradient(180deg, var(--orange) 34%, var(--peach) 118%);
  box-shadow: inset 0 0 0 2px rgba(255, 216, 180, .55), 0 calc(var(--pill-h) * .1) 0 var(--bark), 0 calc(var(--pill-h) * .2) calc(var(--pill-h) * .34) rgba(4, 22, 58, .34);
  transition: transform .1s, filter .15s;
}
.w-avatar:active { transform: translateY(2px); }

/* ícones de som sempre visíveis (fixos no topo direito) */
.toggles-float {
  position: fixed; z-index: 61; top: clamp(10px, 2.4vmin, 24px); right: clamp(10px, 2.8vmin, 30px);
  display: flex; gap: clamp(8px, 1.6vmin, 14px); opacity: 1; pointer-events: auto;
}

/* perfil */
.prof { text-align: left; }
.prof-stats { display: flex; gap: 8px; margin: .2em 0 1em; }
.prof-stat {
  flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; border-radius: 12px;
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1.3px rgba(72, 232, 255, .12);
}
.prof-stat span { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.prof-stat b { font-size: 16px; font-weight: 700; color: #fff; }
.prof-sec { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .5); margin: 1em 0 .4em; }
.prof-list { display: flex; flex-direction: column; gap: 5px; max-height: 24vh; overflow-y: auto; }
.prof-item {
  display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 7px 9px; border-radius: 9px;
  background: rgba(255, 255, 255, .05);
}
.prof-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; color: var(--star); }
.prof-mid { flex: 1; color: rgba(255, 255, 255, .8); }
.prof-status { font-size: 11px; color: rgba(255, 255, 255, .5); }
.prof-win { color: var(--glow); font-weight: 700; }
.prof-loss { color: #ffb0a0; }

/* toggle público/privado com a cara do HUD */
.w-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; margin: .2em 0; }
.w-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.w-toggle-track {
  flex: none; width: 46px; height: 26px; border-radius: 999px; position: relative;
  background: rgba(8, 34, 57, .72); box-shadow: inset 0 0 0 1.6px rgba(255, 255, 255, .18); transition: background .18s;
}
.w-toggle-thumb {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 5px rgba(4, 22, 58, .4); transition: transform .18s;
}
.w-toggle input:checked + .w-toggle-track { background: linear-gradient(180deg, var(--orange), var(--peach)); box-shadow: inset 0 0 0 1.6px rgba(255, 216, 180, .5); }
.w-toggle input:checked + .w-toggle-track .w-toggle-thumb { transform: translateX(20px); }
.w-toggle-label { font-size: 14px; color: #fff; }
.w-toggle-label small { display: block; font-size: 11px; color: rgba(255, 255, 255, .55); }

/* perfil: cabeçalho com badge de rank + abas */
.prof-head { display: flex; align-items: center; gap: 12px; text-align: left; margin-bottom: .6em; }
.rank-badge { display: inline-block; flex: none; filter: drop-shadow(0 3px 6px rgba(4, 22, 58, .5)); }
.rank-badge svg { width: 100%; height: 100%; display: block; }
.prof-tabs { margin: .2em 0 1em; }
.rank-line { display: flex; justify-content: space-between; align-items: baseline; text-align: left; }
.rank-line b { color: var(--star); font-size: 16px; }
.rank-line span { font-size: 12px; color: rgba(255, 255, 255, .7); }
.rank-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; margin: 6px 0; box-shadow: inset 0 0 0 1.4px rgba(72, 232, 255, .18); }
.rank-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--orange), var(--star)); transition: width .4s; }

/* cosméticos */
.cosm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: .4em; }
.cosm-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1.3px rgba(72, 232, 255, .1); }
.cosm-item.cosm-locked { opacity: .55; }
.cosm-sw { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .3); }
.cosm-name { flex: 1; font-size: 13px; color: #fff; }
.cosm-lock { font-size: 10px; color: rgba(255, 255, 255, .6); white-space: nowrap; }
.cosm-eq { font-size: 11px; color: var(--glow); font-weight: 700; }
.cosm-btn { cursor: pointer; border: 0; border-radius: 8px; padding: 4px 9px; font-family: var(--f-ui); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: linear-gradient(180deg, var(--orange), var(--peach)); }
.cosm-btn:disabled { opacity: .5; cursor: default; }
.cosm-sw.cosm-bg-azul { background: radial-gradient(circle at 40% 30%, #47d2fb, #0c3d8c); }
.cosm-sw.cosm-bg-noite { background: radial-gradient(circle at 40% 30%, #14467f, #04142a); }
.cosm-sw.cosm-bg-roxo { background: radial-gradient(circle at 40% 30%, #7b4bd6, #120a2e); }
.cosm-sw.cosm-bg-verde { background: radial-gradient(circle at 40% 30%, #4bd38a, #0a2e1c); }
.cosm-sw.cosm-bg-dourado { background: radial-gradient(circle at 40% 30%, #ffcf6a, #4a2f08); }
.cosm-sw.cosm-bg-vulcao { background: radial-gradient(circle at 40% 30%, #ff8a4b, #2e0f0a); }

/* convite / afiliados */
.conv-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1.4px rgba(255, 233, 79, .25); }

/* ── Mobile: header centralizado; ícones de som pequenos no canto ── */
@media (max-width: 640px) {
  /* #wallet é centralizado em lobby.css (carregado depois). */
  #wallet-chip { gap: 6px; }
  /* Ícones de som numa 2ª linha à direita (não colidem com o header central). */
  .toggles-float { top: calc(var(--pill-h) + 16px); right: 8px; gap: 8px; }
  .toggles-float .toggle { --d: 36px; }
  .w-card-wide { width: 94vw; }
}

/* ─────────────── carteira: bolsos + saque (mock) ─────────────── */
.wallet-buckets .prof-stat { display: flex; flex-direction: column; gap: 2px; }
.wallet-buckets .prof-stat small { font-size: 9px; line-height: 1.1; color: rgba(255, 255, 255, .45); }
.wallet-withdrawable {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7em 1em; margin: 0 0 1em; border-radius: 14px;
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.wallet-withdrawable span { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.wallet-withdrawable b { font-size: 22px; }

.saque-anim { display: flex; flex-direction: column; align-items: center; gap: 1em; padding: 1.4em 0; }
.saque-msg { font-family: var(--f-ui); font-size: 16px; color: #fff; margin: 0; }
.saque-msg.saque-ok { color: var(--glow); }
.saque-spin {
  width: 48px; height: 48px; border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .15); border-top-color: var(--star);
  animation: saque-rot .8s linear infinite;
}
@keyframes saque-rot { to { transform: rotate(360deg); } }
.saque-check svg { width: 64px; height: 64px; }
.saque-check circle { stroke: var(--glow); stroke-width: 3; stroke-dasharray: 160; stroke-dashoffset: 160; animation: saque-circle .5s ease forwards; }
.saque-check path { stroke: var(--glow); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: saque-tick .35s .45s ease forwards; }
@keyframes saque-circle { to { stroke-dashoffset: 0; } }
@keyframes saque-tick { to { stroke-dashoffset: 0; } }

/* ─────────────── cartão público do jogador (chat/lista) ─────────────── */
/* Mobile: tamanho padrão (compacto). Desktop: MAIOR e mais legível. */
.w-card-profile { width: min(92vw, 400px); }
.pc-head { display: flex; align-items: center; gap: 16px; text-align: left; margin-bottom: 18px; }
.pc-badge { flex: none; }
.pc-name { font: 700 18px/1.1 var(--f-ui); color: #fff; margin: .25em 0 .15em; }
.pc-meta { font-size: 13px; color: rgba(255, 255, 255, .6); margin: .12em 0; }
.pc-kpis { display: flex; gap: 10px; }
.pc-kpi {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; align-items: center;
  padding: 14px 8px; border-radius: 14px;
  background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.pc-kpi span { font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: rgba(255, 255, 255, .55); text-align: center; }
.pc-kpi b { font-size: 18px; color: #fff; }
.pc-win { color: var(--glow) !important; }
.pc-loss { color: #ff6b8a !important; }

@media (min-width: 768px) {
  .w-card-profile { width: 560px; padding: 34px 40px; }
  .w-card-profile .chunk { font-size: 42px; }
  .pc-head { gap: 20px; margin-bottom: 24px; }
  .pc-name { font-size: 22px; }
  .pc-meta { font-size: 15px; }
  .pc-kpis { gap: 14px; }
  .pc-kpi { padding: 22px 12px; gap: 8px; }
  .pc-kpi span { font-size: 12px; }
  .pc-kpi b { font-size: 28px; }
}

/* ─────────────── barras de rollover (metas por depósito) ─────────────── */
.roll-sec { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: rgba(255, 255, 255, .5); text-align: left; margin: .4em 0 .6em; }
.roll-bar { margin-bottom: 10px; }
.roll-bar-top { display: flex; justify-content: space-between; font-size: 12px; color: rgba(255, 255, 255, .75); margin-bottom: 4px; }
.roll-track { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.roll-track span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--star, #ffcf3a), var(--glow, #7ee8fa)); transition: width .4s ease; }

/* ─────────────── perfil próprio: mais largo + históricos lado a lado ─────────────── */
.w-card-prof-own { width: min(92vw, 400px); } /* mobile: compacto (sem mudar) */
.prof-cols { display: block; } /* mobile: empilhado (original) */
@media (min-width: 768px) {
  .w-card-prof-own { width: 720px; padding: 32px 36px; }
  .w-card-prof-own .chunk { font-size: 40px; }
  .prof-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  .prof-cols .prof-list { max-height: 300px; overflow-y: auto; } /* evita esconder o botão Sair */
}

/* saldo do header clicável → abre modal de saldo/saque */
.wallet-pill[role="button"] { cursor: pointer; }
.wallet-pill[role="button"]:hover { filter: brightness(1.08); }
/* lista de rollovers com rolagem (não estoura o modal) */
.roll-wrap { max-height: 240px; overflow-y: auto; margin: .2em 0 1em; }
.roll-bar.roll-done { opacity: .6; }
.roll-bar.roll-done .roll-track span { background: var(--glow, #7ee8fa); }
/* ── Lobby e sala — mesmo design system do jogo. ── */

/* lista de arenas */
.arena-list { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow-y: auto; margin: 4px 0 2px; }
.arena-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1.4px rgba(255, 255, 255, .1); text-align: left;
}
.arena-row .ar-main { flex: 1; min-width: 0; }
.arena-row .ar-name { font-size: calc(var(--pill-h) * .42); letter-spacing: .02em; }
.arena-row .ar-sub { font-size: 12px; color: rgba(255, 255, 255, .6); letter-spacing: .03em; }
.arena-row .ar-lock { opacity: .8; }
.arena-empty { padding: 20px 6px; color: rgba(255, 255, 255, .6); font-size: 14px; }

.lobby-menu { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.w-field { display: flex; flex-direction: column; gap: 6px; text-align: left; margin-bottom: 10px; }
.w-field label { font-size: 13px; letter-spacing: .05em; color: rgba(255, 255, 255, .72); text-transform: uppercase; }
.w-field .w-hintline { font-size: 12px; color: var(--glow); }
.w-row { display: flex; gap: 10px; }
.w-row > * { flex: 1; }
.w-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: rgba(255, 255, 255, .85); }

/* painel da sala (lado direito): lista de jogadores + mesa + chute + sair */
#room-panel {
  position: fixed; z-index: 55; top: 50%; right: clamp(8px, 1.6vmin, 18px); transform: translateY(-50%);
  width: min(78vw, 230px); display: none; flex-direction: column; gap: 8px; color: #fff;
}
#room-panel.show { display: flex; }
.rp-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 14px; border-radius: 18px;
  background: radial-gradient(120% 100% at 50% 0%, rgba(13, 52, 102, .92), rgba(8, 34, 57, .92));
  box-shadow: 0 16px 40px rgba(2, 10, 28, .5), inset 0 0 0 1.6px rgba(72, 232, 255, .16);
}
.rp-handle { display: none; } /* alça de recolher: só no mobile */
/* Ações FORA do card (menores). */
#room-actions { display: flex; gap: 8px; }
.rp-act {
  flex: 1; height: 30px; padding: 0 10px; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 700; letter-spacing: .03em; color: #fff;
  border: 1.6px solid; border-radius: 10px;
  transition: filter .15s, transform .1s;
}
.rp-act:hover { filter: brightness(1.15); }
.rp-act:active { transform: translateY(1px); }
/* Jogo justo: destaque ciano (combina com o escudo). */
.rp-act.rp-fair {
  color: #d6f7ff; border-color: rgba(72, 232, 255, .65);
  background: linear-gradient(180deg, rgba(72, 232, 255, .26), rgba(72, 232, 255, .08));
  box-shadow: 0 2px 10px rgba(72, 232, 255, .22), inset 0 0 0 1px rgba(72, 232, 255, .15);
}
/* Sair: destaque laranja/quente. */
.rp-act.rp-leave {
  color: #ffdccb; border-color: rgba(245, 128, 65, .75);
  background: linear-gradient(180deg, rgba(245, 128, 65, .3), rgba(245, 128, 65, .1));
  box-shadow: 0 2px 10px rgba(245, 128, 65, .22), inset 0 0 0 1px rgba(245, 128, 65, .15);
}
.rp-title { font-family: var(--f-display); font-size: 16px; color: var(--orange); margin: 0; }
.rp-table {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border-radius: 12px; background: rgba(255, 233, 79, .14); box-shadow: inset 0 0 0 1.4px rgba(255, 233, 79, .3);
}
.rp-table .rp-lbl { font-size: 11px; letter-spacing: .06em; color: rgba(255, 255, 255, .7); text-transform: uppercase; }
.rp-table .rp-val { font-size: 18px; font-weight: 700; color: var(--star); }
.rp-players { display: flex; flex-direction: column; gap: 5px; max-height: 32vh; overflow-y: auto; }
.rp-sec { font-size: 11px; letter-spacing: .08em; color: rgba(255, 255, 255, .5); text-transform: uppercase; }
.rp-player { display: flex; align-items: center; gap: 6px; font-size: 14px; padding: 5px 8px; border-radius: 9px; background: rgba(255, 255, 255, .06); }
.rp-player .rp-crown { color: var(--star); }
.rp-stake { display: flex; align-items: center; gap: 8px; }
.rp-stake button {
  width: 34px; height: 34px; border: 0; border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1;
  color: #fff; background: linear-gradient(180deg, var(--orange), var(--peach)); box-shadow: 0 3px 0 var(--bark);
}
.rp-stake .rp-stake-val { flex: 1; text-align: center; font-weight: 700; }
.rp-hint { font-size: 11px; color: rgba(255, 255, 255, .55); text-align: center; }

#rato-toast {
  position: fixed; z-index: 200; left: 50%; top: 11%; transform: translate(-50%, -14px) scale(.96);
  padding: 15px 26px; border-radius: 16px; max-width: 90vw; text-align: center;
  font-family: var(--f-ui); font-size: 19px; font-weight: 700; letter-spacing: .03em; color: #fff;
  background: linear-gradient(180deg, #e2563f, #b23a2c);
  box-shadow: 0 16px 40px rgba(4, 22, 58, .55), inset 0 0 0 2px rgba(255, 220, 210, .45);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s cubic-bezier(.2, .9, .3, 1.3);
}
#rato-toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* card de criação mais largo (cabe criar + lista) */
.w-card-wide { width: min(94vw, 400px); }
.lobby-create { margin-bottom: 6px; }

/* slider: trilho + thumb laranja que dá zoom ao arrastar */
.w-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1.4px rgba(255, 255, 255, .12); outline: none; margin: 8px 0 2px; }
.w-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; border-radius: 50%;
  cursor: grab; background: linear-gradient(180deg, var(--orange), var(--peach)); box-shadow: 0 3px 0 var(--bark), 0 6px 10px rgba(4, 22, 58, .4);
  transition: transform .12s cubic-bezier(.3, 1.6, .5, 1); }
.w-slider::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; cursor: grab;
  background: linear-gradient(180deg, var(--orange), var(--peach)); box-shadow: 0 3px 0 var(--bark); }
.w-slider:active::-webkit-slider-thumb { transform: scale(1.55); cursor: grabbing; }
.w-slider:active::-moz-range-thumb { transform: scale(1.55); }
.w-slider-val { color: var(--star); font-weight: 700; }

/* badge de aposta ao lado do nome; nome clicável */
.rp-player { justify-content: space-between; }
.rp-name { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.rp-name:hover { color: var(--star); }
.rp-bet { font-size: 12px; color: var(--star); white-space: nowrap; }

/* lista de canos com apostas */
.rp-sec-pipes { margin-top: 2px; }
.rp-pipes { display: flex; flex-direction: column; gap: 5px; max-height: 24vh; overflow-y: auto; }
.rp-pipe { padding: 6px 9px; border-radius: 9px; background: rgba(255, 255, 255, .05); }
.rp-pipe.mine { background: rgba(255, 233, 79, .14); box-shadow: inset 0 0 0 1.3px rgba(255, 233, 79, .35); }
.rp-pipe-h { font-size: 12px; font-weight: 700; color: var(--orange); }
.rp-pipe-u { font-size: 12px; color: rgba(255, 255, 255, .8); }
.rp-win { font-size: 12px; color: var(--star); margin-top: 2px; }

/* footer fixo com a versão da release */
/* modal de jogo justo */
.fair-box { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; text-align: left; }
.fair-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.fair-k { color: rgba(255, 255, 255, .6); white-space: nowrap; }
.fair-v { color: #fff; text-align: right; }
.fair-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10px; word-break: break-all; max-width: 62%; }
.fair-vtitle { margin: 14px 0 2px; font-family: var(--f-display); font-size: 14px; color: var(--orange); text-align: left; }
.fair-input {
  width: 100%; box-sizing: border-box; margin: 4px 0; padding: 8px 10px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: #fff;
  background: rgba(3, 18, 36, .6); border: 1.4px solid rgba(72, 232, 255, .18); border-radius: 10px; resize: vertical;
}
.fair-input::placeholder { color: rgba(255, 255, 255, .35); }
.fair-input:focus { outline: none; border-color: rgba(72, 232, 255, .5); }
.fair-inline { display: flex; gap: 8px; align-items: center; }
.fair-inline .fair-input { margin: 4px 0; }
.w-btn-soft { height: 34px; padding: 0 12px; font-size: 12px; white-space: nowrap; }
#fair-result { white-space: pre-line; text-align: left; }

#version-badge {
  position: fixed; z-index: 40; right: 10px; bottom: 8px;
  padding: 3px 9px; border-radius: 999px; font-family: var(--f-ui); font-size: 12px; letter-spacing: .06em;
  color: rgba(255, 255, 255, .6); background: rgba(4, 16, 36, .5);
  cursor: pointer; transition: color .15s, background .15s;
}
#version-badge:hover { color: rgba(255, 255, 255, .95); background: rgba(4, 16, 36, .75); }

/* ── modal de créditos (clique no selo de versão) ── */
#credits-ov {
  position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center;
  background: rgba(4, 12, 28, .55); backdrop-filter: blur(3px); animation: cr-fade .18s ease;
}
@keyframes cr-fade { from { opacity: 0; } to { opacity: 1; } }
.credits-card {
  position: relative; width: min(300px, 86vw); padding: 26px 24px 22px; text-align: center;
  background: rgba(10, 22, 46, .98);
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5); color: #fff; font-family: var(--f-ui);
  animation: cr-pop .2s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes cr-pop { from { transform: scale(.92); opacity: .4; } to { transform: scale(1); opacity: 1; } }
.credits-x {
  position: absolute; top: 10px; right: 12px; background: none; border: 0; color: rgba(255, 255, 255, .5);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px;
}
.credits-x:hover { color: #fff; }
.credits-logo { font-size: 40px; margin-bottom: 4px; }
.credits-card h3 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: .02em; }
.credits-ver { margin: 2px 0 0; font-size: 12px; color: rgba(255, 255, 255, .55); letter-spacing: .05em; }
.credits-sep { height: 1px; margin: 16px auto; width: 60%; background: rgba(255, 255, 255, .12); }
.credits-by { margin: 0 0 4px; font-size: 12px; color: rgba(255, 255, 255, .55); text-transform: uppercase; letter-spacing: .08em; }
.credits-brand {
  display: inline-block; font-size: 15px; font-weight: 700; color: var(--orange, #ff8c42); text-decoration: none;
}
.credits-brand:hover { text-decoration: underline; }

/* ── loading: botões em processamento + ratinho correndo em listas ── */
.w-btn.is-loading, .is-loading {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; opacity: .92; cursor: progress;
}
.btn-spin { width: 1.15em; height: 1.15em; display: inline-block; flex: none; }
.loading-rat {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 6px;
  color: rgba(255, 255, 255, .7); font-size: 13px; letter-spacing: .03em;
}
.loading-rat img { width: min(140px, 60%); height: auto; }

/* ── desktop: modal de arenas em 2 colunas (criar à esquerda, lista à direita) ── */
.lobby-grid { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 760px) {
  #lobby-modal .w-card-wide { width: min(94vw, 760px); }
  .lobby-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
  .lobby-grid .arena-list { max-height: 52vh; }
}

/* ── mobile: painel da sala vai para baixo; chip e textos sem sobreposição ── */
@media (max-width: 640px) {
  #room-panel {
    top: auto; bottom: 0; left: 0; right: 0; transform: none; width: 100%;
    max-height: 52vh; overflow-y: auto; gap: 8px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  #room-panel.show { display: flex; }
  .rp-card { border-radius: 16px 16px 0 0; }
  .rp-players, .rp-pipes { max-height: 16vh; }
  /* Alça p/ recolher/expandir o painel e liberar os canos de baixo p/ clicar.
     Vira um botão com texto (ninguém adivinha uma barrinha). */
  .rp-handle {
    display: block; width: 100%; margin: 0 0 6px; padding: 7px 10px;
    border: 0; border-radius: 10px; cursor: pointer;
    background: rgba(72, 232, 255, .16); box-shadow: inset 0 0 0 1.4px rgba(72, 232, 255, .3);
    color: rgba(255, 255, 255, .9); font-family: var(--f-ui); font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  }
  .rp-handle::after { content: '▼ Recolher'; }
  #room-panel.rp-collapsed .rp-handle::after { content: '▲ Ver jogadores e detalhes'; }
  #room-panel.rp-collapsed { max-height: none; }
  #room-panel.rp-collapsed .rp-card > *:not(.rp-handle):not(.rp-table):not(.rp-stake) { display: none; }

  /* header centralizado no topo (não ocupa a largura toda). */
  #wallet { gap: 6px; top: 8px; left: 50%; right: auto; transform: translateX(-50%); flex-wrap: nowrap; }
  .wallet-pill b { font-size: 1em; }
  .w-btn { height: calc(var(--pill-h) * .82); font-size: calc(var(--pill-h) * .36); padding: 0 calc(var(--pill-h) * .5); }
}
/* Chat da sala — canto esquerdo (desktop aberto; mobile botão flutuante). */
.chat { position: fixed; z-index: 60; left: clamp(8px, 1.6vmin, 18px); bottom: clamp(8px, 1.6vmin, 18px); }
/* display:grid/flex sobrepõem o [hidden] do navegador — força esconder de verdade. */
.chat-fab[hidden], .chat-panel[hidden] { display: none !important; }

/* ---- botão flutuante (estado recolhido) ---- */
.chat-fab {
  position: relative; display: grid; place-items: center;
  width: 54px; height: 54px; border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, var(--orange, #ff7a2f) 34%, var(--peach, #ff9d5c) 118%);
  box-shadow: inset 0 0 0 2px rgba(255, 216, 180, .55), 0 6px 0 var(--bark, #7c2417), 0 10px 18px rgba(4, 22, 58, .34);
}
.chat-fab svg { width: 26px; height: 26px; }
.chat-fab:active { transform: translateY(3px); }
.chat-badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 999px;
  background: #ff2d55; color: #fff; font: 700 11px/1 var(--f-ui, system-ui);
  box-shadow: 0 0 0 2px var(--deep, #10132a);
}
/* pisca destacado quando há mensagem nova */
.chat-fab.has-unread { animation: chat-pulse 1.1s ease-in-out infinite; }
.chat-fab.has-unread .chat-badge { animation: chat-blink 1s step-start infinite; }
@keyframes chat-pulse {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(255, 216, 180, .55), 0 6px 0 var(--bark, #7c2417), 0 0 0 0 rgba(255, 45, 85, .55); }
  50%      { box-shadow: inset 0 0 0 2px rgba(255, 216, 180, .55), 0 6px 0 var(--bark, #7c2417), 0 0 0 10px rgba(255, 45, 85, 0); }
}
@keyframes chat-blink { 50% { opacity: .35; } }

/* ---- painel (estado aberto) ---- */
.chat-panel {
  width: min(320px, 86vw); height: min(380px, 56vh);
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 16px; background: rgba(12, 16, 38, .92); backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 14px 40px rgba(4, 22, 58, .5);
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; background: rgba(255, 255, 255, .05); border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.chat-title { display: flex; align-items: center; gap: 7px; color: #fff; font: 700 13px/1 var(--f-ui, system-ui); letter-spacing: .03em; }
.chat-title svg { width: 16px; height: 16px; color: var(--star, #ffcf3a); }
.chat-min { width: 28px; height: 28px; border: 0; border-radius: 8px; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .08); font-size: 18px; line-height: 1; }
.chat-min:hover { background: rgba(255, 255, 255, .16); }

.chat-msgs { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.chat-msg { font: 400 13px/1.35 var(--f-ui, system-ui); color: #e9ecf5; word-break: break-word; }
.chat-name { color: var(--star, #ffcf3a); font-weight: 700; margin-right: 6px; }
.chat-msg.mine .chat-name { color: var(--glow, #7ee8fa); }
.chat-msgs::-webkit-scrollbar { width: 7px; }
.chat-msgs::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 999px; }

.chat-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid rgba(255, 255, 255, .08); }
.chat-input {
  flex: 1; min-width: 0; height: 36px; padding: 0 12px; border: 0; border-radius: 999px;
  background: #fff; color: var(--deep, #10132a); font: 400 14px/1 var(--f-ui, system-ui);
}
.chat-input:disabled { background: rgba(255, 255, 255, .5); }
.chat-input:focus { outline: 2px solid var(--star, #ffcf3a); outline-offset: 1px; }
.chat-send {
  width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, var(--orange, #ff7a2f) 34%, var(--peach, #ff9d5c) 118%);
}
.chat-send svg { width: 17px; height: 17px; }
.chat-send:active { transform: translateY(1px); }

/* Mobile: o painel da sala ocupa o rodapé → sobe o chat p/ não colidir. */
@media (max-width: 767px) {
  .chat { bottom: 92px; }
  .chat-panel { width: calc(100vw - 20px); height: 50vh; }
}

/* nome clicável no chat → abre o cartão do jogador */
.chat-name-link { cursor: pointer; }
.chat-name-link:hover { text-decoration: underline; }

/* aviso do filtro (link/arquivo, rate limit) */
.chat-hint { margin: 0; padding: 4px 12px 0; font: 500 11px/1.3 var(--f-ui, system-ui); color: #ff9db0; }
.chat-hint[hidden] { display: none; }
