:root {
  --bg: #081223;
  --bg2: #0f1f38;
  --panel: #152847;
  --panel2: #1e3760;
  --border: #2e4d7d;
  --text: #f2f6ff;
  --muted: #98b0d4;
  --gold: #ffcc33;
  --gold-dark: #c98a00;
  --red: #ff5252;
  --red-dark: #b32424;
  --green: #2ed573;
  --green-dark: #169649;
  --blue: #3b82f6;
  --blue-dark: #1d4ed8;
  --font-ui: 'Outfit', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Fredoka', 'Outfit', system-ui, sans-serif;
  --tilt: 20deg; /* inclinação 3D do tabuleiro (0 no celular) */
  --par-x: 0deg; /* parallax do mouse (rotateY) */
  --par-y: 0deg; /* parallax do mouse (rotateX extra) */
  --hud-h: 58px;
  --bar-h: 62px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; width: 100%; }
body {
  font-family: var(--font-ui);
  background: radial-gradient(1300px 800px at 50% -10%, #1d3b6b 0%, var(--bg) 65%);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.spacer { flex: 1; }
.muted { color: var(--muted); }

/* ================= BOTÕES TÁTEIS 3D (ESTILO BUSINESS TOUR) ================= */
.btn {
  font-family: var(--font-display);
  border: 1px solid rgba(255, 255, 255, .18);
  background: linear-gradient(180deg, #274472 0%, #1a3054 100%);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .2px;
  box-shadow: 0 3px 0 #0d1a30, 0 6px 14px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .12s cubic-bezier(.34, 1.56, .64, 1), filter .15s, box-shadow .12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  filter: brightness(1.14);
  transform: translateY(-1px);
}
.btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #0d1a30, 0 2px 6px rgba(0, 0, 0, .3);
}
.btn:disabled {
  opacity: .42;
  cursor: not-allowed;
  filter: saturate(.5);
}
.btn.primary {
  background: linear-gradient(180deg, #4da3ff 0%, #2563eb 100%);
  border-color: #7cc0ff;
  box-shadow: 0 3px 0 #153e99, 0 6px 16px rgba(37, 99, 235, .4), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn.success {
  background: linear-gradient(180deg, #3ae374 0%, #1ea84f 100%);
  border-color: #7bed9f;
  color: #062812;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
  box-shadow: 0 3px 0 #106930, 0 6px 16px rgba(46, 213, 115, .4), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn.gold {
  background: linear-gradient(180deg, #ffdd59 0%, #f59e0b 100%);
  border-color: #fff2a6;
  color: #2b1800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .4);
  box-shadow: 0 3px 0 #b45309, 0 6px 18px rgba(245, 158, 11, .42), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.btn.danger {
  background: linear-gradient(180deg, #ff6b6b 0%, #dc2626 100%);
  border-color: #ffa8a8;
  box-shadow: 0 3px 0 #991b1b, 0 6px 16px rgba(220, 38, 38, .4), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn.danger-ghost {
  background: rgba(220, 38, 38, .2);
  border-color: rgba(255, 107, 107, .55);
  color: #ffc9c9;
  box-shadow: none;
}
.btn.ghost {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .15);
  box-shadow: none;
}
.btn.glass {
  background: rgba(14, 26, 48, .78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(120, 165, 235, .32);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn.small { padding: 6px 11px; font-size: 12.5px; border-radius: 10px; }
.btn.big { padding: 14px 36px; font-size: 18px; border-radius: 16px; }
.btn.big-cta { padding: 12px 20px; font-size: 16px; border-radius: 14px; margin-top: 4px; }

input {
  width: 100%;
  font-family: var(--font-ui);
  background: rgba(9, 18, 34, .85);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 500;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .25);
}
.error { color: #ff7b7b; min-height: 20px; margin-top: 10px; font-size: 13.5px; font-weight: 600; }
.hint { color: var(--muted); font-size: 13px; }
.mini { color: var(--muted); font-size: 12px; }

.badge {
  font-family: var(--font-display);
  background: rgba(14, 26, 48, .82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(120, 165, 235, .35);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}
.user-pill {
  background: linear-gradient(135deg, rgba(37, 99, 235, .28), rgba(15, 31, 56, .85));
  border-color: rgba(96, 165, 250, .45);
  color: #dbeafe;
}

/* ================= LOGIN SCREEN ================= */
.screen { height: 100vh; height: var(--app-h, 100dvh); display: flex; flex-direction: column; position: relative; }
#screen-login { align-items: center; justify-content: center; overflow: hidden; }

.bg-decor { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(75px); opacity: .45;
  animation: floatOrb 12s infinite alternate ease-in-out;
}
.orb-1 { width: 420px; height: 420px; background: #2563eb; top: -120px; left: -100px; }
.orb-2 { width: 360px; height: 360px; background: #f59e0b; bottom: -110px; right: -80px; animation-delay: -4s; }
.orb-3 { width: 280px; height: 280px; background: #10b981; top: 40%; left: 65%; animation-delay: -8s; opacity: .28; }
@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -25px) scale(1.1); }
}

.login-box {
  position: relative; z-index: 1;
  background: linear-gradient(180deg, rgba(25, 45, 78, .92) 0%, rgba(16, 30, 54, .95) 100%);
  backdrop-filter: blur(18px);
  border: 2px solid rgba(110, 160, 235, .35);
  border-radius: 26px;
  padding: 36px 38px 30px;
  width: min(410px, calc(100vw - 28px));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .2);
  text-align: center;
}
.brand-emblem {
  width: 64px; height: 64px; margin: 0 auto 8px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffdd59, #f59e0b);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  box-shadow: 0 8px 24px rgba(245, 158, 11, .45), inset 0 2px 0 rgba(255, 255, 255, .6);
}
.logo {
  font-family: var(--font-display);
  font-size: 38px;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #fff5c0 0%, #ffca3a 55%, #e08e00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .45));
}
.logo span {
  font-size: .52em;
  letter-spacing: 2px;
  display: inline-block;
  vertical-align: middle;
  background: linear-gradient(180deg, #93c5fd, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo.small { font-size: 20px; letter-spacing: 1.5px; }
.tagline { color: var(--muted); margin: 6px 0 22px; font-size: 14px; line-height: 1.4; }
.tabs {
  display: flex; gap: 6px; margin-bottom: 18px;
  background: rgba(8, 16, 30, .65);
  padding: 5px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
}
.tab {
  flex: 1; padding: 9px 6px; background: transparent; border: none;
  color: var(--muted); border-radius: 10px; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  transition: background .15s, color .15s;
}
.tab.active {
  background: linear-gradient(180deg, #2b4c7e, #1d3559);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.tabpane { display: flex; flex-direction: column; gap: 11px; }

/* ================= LOBBY & SALA DE ESPERA ================= */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(100, 150, 225, .22);
  background: rgba(10, 19, 36, .88);
  backdrop-filter: blur(12px);
}
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-mini-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #ffdd59, #f59e0b);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 3px 10px rgba(245, 158, 11, .35);
}

.lobby-main, .room-main {
  flex: 1; display: grid; gap: 22px; padding: 26px; overflow: auto;
  max-width: 1240px; width: 100%; margin: 0 auto;
}
.lobby-main { grid-template-columns: 1fr 360px; align-content: start; }

.panel {
  background: linear-gradient(180deg, rgba(23, 42, 74, .92) 0%, rgba(15, 29, 52, .94) 100%);
  border: 1.5px solid rgba(95, 145, 220, .32);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.panel h2 {
  font-family: var(--font-display);
  margin-bottom: 14px; font-size: 18px; color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.create-room-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.howto-box {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-top: 16px;
}
.room-list { display: flex; flex-direction: column; gap: 10px; }
.room-item {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: rgba(11, 22, 42, .85);
  border: 1.5px solid rgba(85, 130, 200, .3);
  border-radius: 16px;
  padding: 14px 18px;
  transition: transform .15s, border-color .15s;
}
.room-item:hover {
  transform: translateY(-2px);
  border-color: rgba(120, 175, 255, .55);
}
.room-item-info { display: flex; flex-direction: column; gap: 4px; }
.room-item .rname { font-family: var(--font-display); font-weight: 700; font-size: 16.5px; color: #fff; }
.room-item .rplayers { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rstatus-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.rstatus-dot.open { background: #2ed573; box-shadow: 0 0 8px #2ed573; }
.rstatus-dot.playing { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }
.room-item-actions { display: flex; align-items: center; gap: 8px; }

.empty {
  color: var(--muted); padding: 36px 20px; text-align: center;
  background: rgba(9, 18, 34, .45); border-radius: 16px;
  border: 1px dashed rgba(120, 165, 235, .25);
}
.empty-icon { font-size: 36px; margin-bottom: 8px; }
.rules-mini { color: #bdd0ee; font-size: 13.5px; padding-left: 18px; display: grid; gap: 8px; line-height: 1.4; }

/* quick solo */
.quick-solo-card { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.qs-info { flex: 1 1 300px; }
.qs-kicker { font-family: var(--font-display); font-size: 11.5px; letter-spacing: 1.5px; color: var(--gold); margin-bottom: 4px; }
.qs-info h2 { margin-bottom: 4px; }
.qs-info p { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.qs-controls { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.qs-size-group { display: flex; gap: 6px; background: rgba(8, 16, 30, .6); padding: 5px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .08); }
.qs-size-btn {
  flex: 1; padding: 8px 10px; border: none; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--muted);
  font-family: var(--font-display); font-weight: 600; font-size: 12.5px;
  transition: background .15s, color .15s;
}
.qs-size-btn.active { background: linear-gradient(180deg, #2b4c7e, #1d3559); color: #fff; }
.qs-launch-btn { padding: 12px 20px; font-size: 15.5px; }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { margin-bottom: 0; }
.room-filters { display: flex; align-items: center; gap: 6px; }
.rf-btn {
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14);
  color: var(--muted); font-family: var(--font-display); font-size: 12px; font-weight: 600;
}
.rf-btn.active { background: linear-gradient(180deg, #ffdd59, #f59e0b); color: #2b1800; border-color: #fff2a6; }

/* career / leaderboard */
.career-card { margin-bottom: 16px; }
.career-title { font-family: var(--font-display); font-size: 15px; color: var(--gold); margin-bottom: 8px; }
.career-stats { display: flex; gap: 10px; }
.career-stat {
  flex: 1; text-align: center; padding: 10px 6px; border-radius: 14px;
  background: rgba(9, 18, 34, .6); border: 1px solid rgba(120, 165, 235, .25);
}
.career-stat b { font-family: var(--font-display); font-size: 20px; display: block; color: #fff; }
.career-stat span { font-size: 11px; color: var(--muted); }
.lobby-leaderboard { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; }
.lb-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  background: rgba(9, 18, 34, .55); border-radius: 12px; font-size: 13px;
}
.lb-pos { font-family: var(--font-display); font-weight: 700; color: var(--gold); min-width: 26px; }
.lb-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------- Sala de espera ---------- */
.room-main { justify-items: center; align-content: center; }
.room-stage {
  background: linear-gradient(180deg, rgba(23, 42, 74, .92), rgba(14, 26, 48, .95));
  border: 2px solid rgba(105, 155, 230, .35);
  border-radius: 26px;
  padding: 28px 32px;
  width: min(820px, 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
  text-align: center;
}
.stage-title {
  font-family: var(--font-display);
  font-size: 22px; margin-bottom: 20px; color: var(--gold);
}
.room-slots {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.slot {
  border: 2px solid rgba(90, 135, 205, .32);
  border-radius: 18px;
  padding: 16px;
  display: flex; align-items: center; gap: 14px;
  background: rgba(10, 20, 38, .85);
  text-align: left;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.slot.occupied {
  border-color: var(--slot-color, var(--border));
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
}
.slot.empty-slot { opacity: .62; border-style: dashed; }
.slot-avatar {
  position: relative;
  width: 48px; height: 48px; border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, .4);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
  flex: 0 0 auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .4);
}
.slot-avatar .peao-ico { font-size: 24px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.slot-crown {
  position: absolute; top: -10px; right: -8px;
  font-size: 16px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.6));
}
.slot .sname { font-family: var(--font-display); font-weight: 700; font-size: 15.5px; color: #fff; }
.slot .scolor { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.swatch-inline { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 1px solid rgba(255,255,255,.5); }
.slot-meta { min-width: 0; }
.slot-you-tag, .slot-bot-tag {
  font-family: var(--font-display); font-size: 9.5px; font-weight: 700; letter-spacing: .5px;
  padding: 2px 6px; border-radius: 999px; margin-left: 5px; vertical-align: middle;
}
.slot-you-tag { background: rgba(46, 213, 115, .25); color: #7bed9f; border: 1px solid rgba(46, 213, 115, .5); }
.slot-bot-tag { background: rgba(96, 165, 250, .22); color: #93c5fd; border: 1px solid rgba(96, 165, 250, .5); }
.slot-pick-hint { font-size: 11px; color: #7fa4d8; margin-top: 3px; }
.slot-bot-btn { margin-left: auto; }
.room-actions { margin-top: 26px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.room-actions-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* =============== TELA DO JOGO (TABULEIRO 3D) =============== */
.game-screen { position: relative; }
.board-wrap {
  position: absolute; inset: 0;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  /* mesa de feltro azul com iluminação de palco */
  background:
    radial-gradient(rgba(255, 255, 255, .07) 1.2px, transparent 1.7px),
    radial-gradient(1000px 560px at 50% 16%, rgba(255, 255, 240, .20), transparent 58%),
    radial-gradient(1500px 950px at 50% 44%, #4aa9ec 0%, #2f86c9 42%, #1f67a4 68%, #154d7e 100%);
  background-size: 18px 18px, auto, auto;
  padding-top: calc(var(--hud-h) + 4px);
  padding-bottom: calc(var(--bar-h) + 4px);
}
/* foco nas bordas: cantos levemente mais escuros para destacar a mesa */
.board-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(120% 95% at 50% 42%, transparent 58%, rgba(5, 26, 48, .38) 100%);
  pointer-events: none;
}

.board-3d {
  position: relative;
  z-index: 1;
  perspective: 1900px;
  perspective-origin: 50% 30%;
  height: 100%;
  width: 100%;
  display: flex; align-items: center; justify-content: center;
  transform-style: preserve-3d;
}
/* halo de luz quente atrás da mesa (iluminação de palco) */
.board-3d::before {
  content: '';
  position: absolute;
  width: min(96vh, 100vw); height: min(70vh, 66vw);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 244, 180, .30), rgba(255, 244, 180, .10) 52%, transparent 74%);
  transform: translateY(-2%);
  pointer-events: none;
}
.board {
  /* tabuleiro RETANGULAR com moldura externa: os peões andam PELA MOLDURA,
     nunca em cima das casas (nome/preço sempre visíveis) */
  --bh: min(calc(100dvh - var(--hud-h) - var(--bar-h) - 12px), 600px);
  --bw: min(calc(100vw - 20px), calc(var(--bh) * 1.5), 1240px);
  --frame: calc(var(--bh) * 0.062);
  width: var(--bw);
  height: var(--bh);
  padding: var(--frame);
  transform: translateY(-1%) rotateX(calc(var(--tilt) + var(--par-y))) rotateY(var(--par-x)) scale(.9);
  transform-style: preserve-3d;
  display: grid;
  grid-template-columns: 13fr repeat(9, 7.4fr) 13fr;
  grid-template-rows: 12fr repeat(9, 6.5fr) 12fr;
  /* a moldura é a parte exposta do fundo do tabuleiro */
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.02) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, #12456e 0%, #0c3355 55%, #092842 100%);
  border: 3px solid #0a2338;
  outline: 2px solid rgba(5, 20, 35, .45);
  border-radius: 18px;
  box-shadow:
    0 26px 50px rgba(8, 35, 60, .35),
    0 12px 0 -2px #0d2c47,
    0 15px 0 -1px #081d31,
    inset 0 2px 0 rgba(255, 255, 255, .18);
  transition: transform .45s cubic-bezier(.2, .8, .3, 1);
}
/* filete dourado entre a moldura e as casas */
.board::after {
  content: '';
  position: absolute;
  inset: var(--frame);
  border: 2px solid rgba(255, 214, 100, .55);
  border-radius: 8px;
  pointer-events: none;
  z-index: 5;
}
body.flat-board .board { transform: none; }
/* animação de entrada: a mesa "desce" para a posição */
.board-3d.enter .board { animation: boardDrop .85s cubic-bezier(.2, .9, .3, 1.08); }
@keyframes boardDrop {
  from { transform: translateY(-2%) rotateX(calc(var(--tilt) + 26deg)) scale(.9); opacity: .25; }
  to { transform: translateY(-2%) rotateX(calc(var(--tilt) + var(--par-y))) rotateY(var(--par-x)) scale(.96); opacity: 1; }
}

/* ---------- células ---------- */
.cell {
  position: relative;
  transform: translateZ(2px); /* ladrilho levemente erguido do taco do tabuleiro */
  transform-style: preserve-3d;
  background: linear-gradient(180deg, #fffef8 0%, #f9f4e3 100%);
  border: 1px solid #d8cdb0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .65),
    inset 0 -2px 4px rgba(120, 100, 60, .06);
  cursor: pointer;
  overflow: visible;
  transition: transform .18s cubic-bezier(.34, 1.3, .64, 1), box-shadow .18s;
}
.cell:hover {
  z-index: 3;
  transform: translateZ(12px); /* o ladrilho levanta — estilo Business Tour */
  box-shadow:
    inset 0 0 0 2px rgba(255, 204, 51, .9),
    inset 0 1px 0 rgba(255, 255, 255, .65),
    0 10px 18px rgba(10, 40, 70, .30);
}
.cell .s-name {
  position: absolute; inset: 22% 3% 7% 3%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--nfs, clamp(8px, calc(var(--bh) / 42), 14.5px));
  line-height: 1.1;
  text-align: center;
  color: #1d1505;
  text-transform: uppercase;
  letter-spacing: 0;
  word-break: break-word;
  hyphens: manual;
  overflow: hidden;
}
/* preço vira etiqueta no canto da faixa de cor — livre o centro p/ o peão */
.cell .s-price {
  position: absolute; top: 2px; right: 3px;
  text-align: center;
  font-weight: 800;
  font-size: clamp(7.5px, calc(var(--bh) / 50), 12.5px);
  color: #3a2d10;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(90, 70, 30, .25);
  border-radius: 5px;
  padding: 0 4px;
  box-shadow: 0 1px 2px rgba(60, 45, 15, .15);
  z-index: 2;
}
.cell.side-top .s-price { top: auto; bottom: 2px; }
.cell .s-icon {
  position: absolute; top: 11%; left: 0; right: 0; height: 36%;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--bh) / 30);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .22));
}
.cell .s-icon + .s-name { top: 48%; bottom: 3%; font-size: clamp(7.5px, calc(var(--bh) / 48), 12px); }
/* propriedades: nome logo abaixo da faixa de cor */
.cell .s-bar ~ .s-name { inset: 22% 3% 7% 3%; }
.cell .s-bar ~ .s-icon + .s-name,
.cell .s-icon + .s-name { top: 60%; }

/* ---------- colunas laterais: conteúdo em PILHA (ícone, nome, preço) ----------
   a faixa de cor fica na borda INTERNA; nada de absoluto sobreposto */
.cell.side-left, .cell.side-right {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0;
}
.cell.side-left .s-bar, .cell.side-right .s-bar { top: 0; bottom: 0; height: auto; width: 12%; }
.cell.side-left .s-bar { right: 0; border-radius: 0; }
.cell.side-right .s-bar { left: 0; border-radius: 0; }
/* laterais: sem ícone — nome + preço empilhados cabem com folga */
.cell.side-left .s-icon, .cell.side-right .s-icon { display: none; }
.cell.side-left .s-name, .cell.side-right .s-name {
  position: static; inset: auto; flex: 0 1 auto;
  padding: 0 13%;
  text-align: center; line-height: 1;
  font-size: var(--nfs, clamp(7px, calc(var(--bh) / 60), 10.5px));
  overflow: hidden;
  max-height: 58%;
}
.cell.side-left .s-price, .cell.side-right .s-price {
  position: static; inset: auto; top: auto; bottom: auto; left: auto; right: auto;
  flex: 0 0 auto;
  font-size: clamp(6px, calc(var(--bh) / 70), 9.5px);
  padding: 0 4px;
  margin-top: 1px;
}

/* faixa de cor do grupo — brilho de bala/jujuba */
.cell .s-bar {
  position: absolute;
  background-color: var(--bar-color, #ccc);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, .08) 42%, rgba(0, 0, 0, .10));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .5),
    inset 0 -1px 2px rgba(0, 0, 0, .12);
}
.cell.side-bottom .s-bar { top: 2px; left: 2px; right: 2px; height: 20%; border-radius: 3px 3px 0 0; }
.cell.side-top .s-bar { bottom: 2px; left: 2px; right: 2px; height: 20%; border-radius: 0 0 3px 3px; }
.cell.side-left .s-bar { right: 0; top: 0; bottom: 0; width: 13%; }
.cell.side-right .s-bar { left: 0; top: 0; bottom: 0; width: 13%; }

/* casas/hotel na faixa — casinhas 3D em CSS que ficam em pé */
.cell .s-houses {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 2px;
  pointer-events: none;
  z-index: 2;
  transform-style: preserve-3d;
}
.cell.side-bottom .s-houses, .cell.side-top .s-houses { flex-direction: row; }
.cell.side-left .s-houses, .cell.side-right .s-houses { flex-direction: column; }
/* as casinhas ficam sobre a faixa de cor */
.cell.side-bottom .s-houses { inset: 2px 2px auto 2px; height: 18%; }
.cell.side-top .s-houses { inset: auto 2px 2px 2px; height: 18%; }
.cell.side-left .s-houses { inset: 2px 2px 2px auto; width: 13%; }
.cell.side-right .s-houses { inset: 2px auto 2px 2px; width: 13%; }
.h3d {
  position: relative;
  width: calc(var(--bh) / 52);
  height: calc(var(--bh) / 52);
  transform: rotateX(calc(-1 * (var(--tilt) + var(--par-y)))) rotateY(calc(-1 * var(--par-x))) translateZ(calc(var(--bh) / 80));
  transform-origin: 50% 100%;
  animation: housePop .3s cubic-bezier(.34, 1.56, .64, 1);
  filter: drop-shadow(0 calc(var(--bh) / 170) calc(var(--bh) / 150) rgba(10, 40, 70, .30));
}
.h3d::before { /* telhado */
  content: '';
  position: absolute; top: -52%; left: -10%; right: -10%; height: 58%;
  background: linear-gradient(180deg, #e74c3c, #a82315);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.h3d::after { /* corpo */
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #fdf8ea 0%, #e6d6ae 100%);
  border: 1px solid #8a7248;
  border-radius: 0 0 1.5px 1.5px;
}
.h3d.hotel {
  width: calc(var(--bh) / 34);
  height: calc(var(--bh) / 34);
}
.h3d.hotel::before {
  background: linear-gradient(180deg, #8e1b10, #5c0c04);
  top: -62%; height: 66%;
}
.h3d.hotel::after {
  background: linear-gradient(180deg, #fff3d6 0%, #d9c290 100%);
}
.h3d .h3d-window {
  position: absolute; left: 22%; right: 22%; top: 38%; height: 26%;
  background: rgba(70, 50, 20, .55);
  border-radius: 1px;
}
@keyframes housePop { from { transform: scale(0); } to { transform: scale(1); } }

/* dono da propriedade */
.cell.owned::after {
  content: '';
  position: absolute; inset: 0;
  background: var(--owner-color, transparent);
  opacity: .16;
  pointer-events: none;
}
.cell .s-flag {
  position: absolute;
  width: calc(var(--bh) / 46); height: calc(var(--bh) / 46);
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .95);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4), inset 0 1px 1px rgba(255, 255, 255, .4);
  z-index: 3;
}
/* a bandeirinha fica sobre a faixa de cor, no canto externo */
.cell.side-bottom .s-flag { top: 1px; left: 2px; }
.cell.side-top .s-flag { bottom: 1px; left: 2px; }
.cell.side-left .s-flag { right: 1px; top: 2px; }
.cell.side-right .s-flag { left: 1px; top: 2px; }
.cell.mortgaged::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(110, 115, 135, .22);
  pointer-events: none;
  z-index: 1;
}
.cell.mortgaged .s-name::after { content: ' 💤'; }
.cell.jail-here .s-icon { filter: drop-shadow(0 0 8px rgba(255, 80, 80, .8)); }

/* cantos */
.cell.corner {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2%;
  background: linear-gradient(180deg, #fbf7ec 0%, #efe8d4 100%);
}
.cell.corner .s-icon { position: static; font-size: calc(var(--bh) / 18); }
.cell.corner .s-name { position: static; inset: auto; max-height: 34%; font-size: clamp(7px, calc(var(--bh) / 58), 11.5px); }
.cell.corner.partida { background: linear-gradient(135deg, #fdf3d3 0%, #f3e2a6 100%); }
.cell.corner.partida .s-name { color: #b32424; }
.cell.corner.cadeia { background: linear-gradient(135deg, #fbe9c8 0%, #f2cf8e 100%); }
.cell.corner.cadeia .s-name { color: #8a5a00; }
.cell.corner.parada { background: linear-gradient(135deg, #fbdcd2 0%, #f0a78e 100%); }
.cell.corner.parada .s-icon { color: #b32424; }
.cell.corner.vaPrisao { background: linear-gradient(135deg, #d5e6f7 0%, #a6c4e8 100%); }
.cell.corner.vaPrisao .s-name { color: #1d4e89; }
.cell.corner::before {
  content: '';
  position: absolute; inset: 7%;
  border: 1.5px dashed rgba(0, 0, 0, .18);
  border-radius: 8px;
  pointer-events: none;
}
.cell.corner .s-go-arrow { font-size: calc(var(--bh) / 24); color: #b32424; font-weight: 800; }

/* destaque quando é a propriedade em jogo (compra/aluguel) */
.cell.spotlight {
  animation: spotPulse 1.2s ease-in-out infinite;
  z-index: 4;
}
@keyframes spotPulse {
  0%, 100% { box-shadow: inset 0 0 0 2.5px #ffcc33, 0 0 14px rgba(255, 204, 51, .55); }
  50% { box-shadow: inset 0 0 0 2.5px #ffe98a, 0 0 22px rgba(255, 204, 51, .95); }
}

/* ---------- centro do tabuleiro ---------- */
.board-center {
  grid-area: 2 / 2 / 11 / 11;
  position: relative;
  transform-style: preserve-3d;
  background:
    radial-gradient(60% 60% at 50% 42%, rgba(255, 224, 130, .18), transparent 70%),
    repeating-linear-gradient(90deg, rgba(0,0,0,.012) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, #f6f1e3 0%, #e9e2cd 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border-radius: 8px;
}
/* moldura do centro — leve e limpa */
.board-center::before {
  content: '';
  position: absolute; inset: 3.5%;
  border: 2px solid rgba(140, 30, 20, .15);
  outline: 1px solid rgba(140, 30, 20, .09);
  outline-offset: 3px;
  border-radius: 12px;
  pointer-events: none;
}
.bc-logo {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: calc(var(--bh) / 11);
  letter-spacing: 4px;
  color: transparent;
  background: linear-gradient(180deg, rgba(179, 36, 36, .17), rgba(120, 20, 12, .08));
  -webkit-background-clip: text;
  background-clip: text;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .55));
}
.bc-dice-tray {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -58%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 5;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .5), transparent 85%);
  border-radius: 26px;
  padding: 12px 20px 6px;
  min-width: calc(var(--bh) / 4.4);
  min-height: calc(var(--bh) / 6.2);
  justify-content: center;
}
.bc-dice-row { display: flex; gap: 12px; }
.bc-roll-info {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: calc(var(--bh) / 25);
  color: #2f2306;
  text-align: center;
  min-height: 1.2em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .65);
}
.bc-roll-info.win { color: #1a7a3c; }
.bc-roll-info.bad { color: #b32424; }
.bc-piles {
  position: absolute;
  display: flex; gap: 14px;
  z-index: 4;
}
.bc-piles.piles-top { top: 12%; left: 50%; transform: translateX(-50%); }
.bc-piles.piles-bottom { bottom: 12%; left: 50%; transform: translateX(-50%); }
.pile-card {
  width: calc(var(--bh) / 8.5);
  aspect-ratio: 1.55;
  border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: calc(var(--bh) / 42);
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #fff;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, .65);
  box-shadow: 0 5px 10px rgba(10, 40, 70, .22), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .15s cubic-bezier(.34, 1.56, .64, 1);
  text-align: center;
  padding: 4px;
}
.pile-card:hover { transform: translateY(-3px) rotate(-2deg); }
.pile-card .pile-ico { font-size: calc(var(--bh) / 22); }
.pile-card.sorte { background: linear-gradient(150deg, #f7941d, #d9481c); }
.pile-card.cofre { background: linear-gradient(150deg, #2f80ed, #1b4f9c); }
.pile-card .pile-count { font-size: calc(var(--bh) / 54); opacity: .9; font-weight: 600; }

/* ---------- peões 3D (peça clássica: base, corpo e cabeça) ---------- */
.tokens {
  /* a camada dos peões cobre só a área do grid (dentro da moldura) */
  position: absolute;
  inset: var(--frame);
  pointer-events: none;
  z-index: 6;
  transform-style: preserve-3d;
}
.token {
  position: absolute;
  width: calc(var(--bh) / 15);
  height: calc(var(--bh) / 15);
  transform: translate(-50%, -50%) rotateX(calc(-1 * (var(--tilt) + var(--par-y)))) rotateY(calc(-1 * var(--par-x))) translateZ(calc(var(--bh) / 55));
  transform-origin: 50% 100%;
  transition: left .26s ease-in-out, top .26s ease-in-out;
  z-index: 1;
}
.token.active-turn { animation: tokenBob 1.1s ease-in-out infinite; z-index: 2; }
@keyframes tokenBob {
  0%, 100% { transform: translate(-50%, -50%) rotateX(calc(-1 * (var(--tilt) + var(--par-y)))) rotateY(calc(-1 * var(--par-x))) translateZ(calc(var(--bh) / 46)); }
  50% { transform: translate(-50%, -50%) rotateX(calc(-1 * (var(--tilt) + var(--par-y)))) rotateY(calc(-1 * var(--par-x))) translateZ(calc(var(--bh) / 30)); }
}
.token.jumping { animation: tokenHop .26s ease-in-out; }
@keyframes tokenHop {
  0%, 100% { transform: translate(-50%, -50%) rotateX(calc(-1 * (var(--tilt) + var(--par-y)))) rotateY(calc(-1 * var(--par-x))) translateZ(calc(var(--bh) / 46)); }
  50% { transform: translate(-50%, -80%) rotateX(calc(-1 * (var(--tilt) + var(--par-y)))) rotateY(calc(-1 * var(--par-x))) translateZ(calc(var(--bh) / 22)) scale(1.15); }
}
/* sombra elíptica no tabuleiro, sob o peão */
.token .tk-shadow {
  position: absolute; bottom: -4%; left: 50%;
  width: 110%; height: 30%;
  transform: translateX(-50%) rotateX(calc(var(--tilt) + var(--par-y))) scale(1, .9);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .22), transparent 75%);
  pointer-events: none;
}
/* a peça em si (fica de pé, virada para a câmera) */
.pawn3d {
  position: absolute; inset: 0;
  transform-origin: 50% 100%;
}
.pw-base {
  position: absolute; bottom: 0; left: 50%;
  width: 92%; height: 17%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--tk-fill, #888);
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--tk-fill), #fff 40%), color-mix(in srgb, var(--tk-fill), #000 42%));
  box-shadow: 0 2px 3px rgba(0, 0, 0, .3);
}
.pw-body {
  position: absolute; bottom: 12%; left: 50%;
  width: 52%; height: 55%;
  transform: translateX(-50%);
  border-radius: 50% 50% 44% 44% / 66% 66% 26% 26%;
  background: var(--tk-fill, #888);
  background: linear-gradient(100deg,
    color-mix(in srgb, var(--tk-fill), #fff 50%) 0%,
    var(--tk-fill) 48%,
    color-mix(in srgb, var(--tk-fill), #000 32%) 100%);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .22), inset 0 2px 3px rgba(255, 255, 255, .35);
}
.pw-head {
  position: absolute; top: 0; left: 50%;
  width: 46%; height: 36%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--tk-fill, #888);
  background: radial-gradient(circle at 35% 30%,
    color-mix(in srgb, var(--tk-fill), #fff 60%),
    var(--tk-fill) 58%,
    color-mix(in srgb, var(--tk-fill), #000 28%));
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .18);
}
.pw-badge {
  position: absolute; top: 32%; left: 50%;
  transform: translate(-50%, 0);
  font-size: calc(var(--bh) / 40);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .45));
}
.token .tk-name {
  position: absolute; bottom: 92%; left: 50%; transform: translateX(-50%);
  background: rgba(8, 16, 32, .92);
  border: 1px solid var(--tk-stroke, #333);
  color: #fff;
  font-family: var(--font-display);
  font-size: 10.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}
.token:hover .tk-name { opacity: 1; }
/* o peão da vez mostra o nome sempre */
.token.active-turn .tk-name { opacity: 1; border-color: var(--gold); box-shadow: 0 0 8px rgba(255, 204, 51, .4); }
/* anel de brilho sob o peão da vez */
.token.active-turn .tk-shadow {
  background: radial-gradient(closest-side, rgba(255, 214, 80, .55), transparent 75%);
}

/* dinheiro flutuante (+/-) */
.money-float {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  pointer-events: none;
  z-index: 50;
  animation: moneyUp 1.5s ease-out forwards;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .6);
}
@keyframes moneyUp {
  0% { opacity: 0; transform: translateY(6px) scale(.7); }
  15% { opacity: 1; transform: translateY(0) scale(1.1); }
  100% { opacity: 0; transform: translateY(-46px) scale(1); }
}

/* =============== DADOS 3D (do War) =============== */
.die3d { width: 48px; height: 48px; perspective: 280px; --die-z: 24px; }
.die3d .cube {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: translateZ(calc(-1 * var(--die-z)));
}
.die3d .face {
  position: absolute; inset: 0;
  border-radius: 8px;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 15%;
  backface-visibility: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38);
}
.die3d.white .face { background: linear-gradient(145deg, #ffffff, #cbd5e1); border: 1.5px solid #64748b; }
.die3d.white .pip { background: #0f172a; }
.die3d.red .face { background: linear-gradient(145deg, #ff6b6b, #c92a2a); border: 1.5px solid #8a1515; }
.die3d.red .pip { background: #fff; }
.pip { border-radius: 50%; align-self: center; justify-self: center; width: 7px; height: 7px; }
.pip.p1 { grid-area: 1 / 1; } .pip.p2 { grid-area: 1 / 3; }
.pip.p3 { grid-area: 2 / 2; }
.pip.p4 { grid-area: 3 / 1; } .pip.p5 { grid-area: 3 / 3; }
.pip.p6 { grid-area: 2 / 1; } .pip.p7 { grid-area: 2 / 3; }
.die3d .cube.rolling { animation: tumble .48s linear infinite; }
@keyframes tumble {
  0% { transform: translateZ(calc(-1 * var(--die-z))) rotateX(0deg) rotateY(0deg); }
  100% { transform: translateZ(calc(-1 * var(--die-z))) rotateX(360deg) rotateY(360deg); }
}

.pulse-cta {
  animation: pulseBtn 1.8s infinite ease-in-out;
}
@keyframes pulseBtn {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.15); transform: scale(1.03); }
}

/* =============== HUD SUPERIOR =============== */
.hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  height: var(--hud-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  z-index: 20;
  background: linear-gradient(180deg, rgba(8, 16, 32, .92), rgba(8, 16, 32, .55) 78%, transparent);
  pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.hud-left-meta { display: flex; align-items: center; gap: 6px; }
.round-badge { color: var(--gold); }
.timer-badge { color: #dbeafe; }
.timer-badge.mine { color: #7bed9f; border-color: rgba(46, 213, 115, .55); }
.timer-badge.danger { color: #ff8787; border-color: rgba(255, 107, 107, .6); animation: pulseBadge 1s infinite; }
@keyframes pulseBadge { 50% { filter: brightness(1.35); } }
.phase-badge { color: #ffd98a; }
.turn-badge { color: #fff; }
.hud-players {
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto; overflow-y: hidden;
  max-width: min(46vw, 620px);
  padding: 4px 2px;
  scrollbar-width: none;
}
.hud-players::-webkit-scrollbar { display: none; }
.turn-order-arrow { color: rgba(152, 176, 212, .5); font-weight: 800; }

.pcard {
  position: relative;
  display: flex; align-items: center; gap: 7px;
  background: rgba(12, 22, 42, .90);
  border: 1.5px solid var(--p-stroke, rgba(120, 165, 235, .35));
  border-radius: 13px;
  padding: 6px 11px 7px 7px;
  min-width: 142px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
  transition: transform .15s, box-shadow .15s;
}
.pcard.turn {
  border-color: var(--gold);
  box-shadow: 0 0 0 1.5px rgba(255, 204, 51, .45), 0 6px 16px rgba(0, 0, 0, .45);
  transform: translateY(-1px);
}
.pcard.dead { opacity: .45; filter: grayscale(.8); }
.pcard-avatar {
  position: relative;
  width: 34px; height: 34px; border-radius: 10px;
  border: 2px solid var(--p-stroke);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex: 0 0 auto;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .4);
}
.pcard-order-num {
  position: absolute; top: -7px; left: -7px;
  background: rgba(8, 16, 32, .92);
  border: 1px solid rgba(148, 184, 245, .55);
  color: #dbeafe;
  font-family: var(--font-display);
  font-size: 8.5px; font-weight: 800;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .5);
}
.pcard.turn .pcard-order-num { background: var(--gold); color: #1a1000; border-color: #fff3b0; }
.pcard-turn-badge {
  position: absolute; top: -8px; right: -6px;
  font-size: 12px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .7));
  animation: pulseBadge 1.2s infinite;
}
.pcard-body { min-width: 0; }
.pcard-name-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.pcard .pname {
  font-family: var(--font-display); font-weight: 700; font-size: 13px; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 96px;
}
.pme-tag, .pbot-tag, .poff-tag, .pjail-tag {
  font-family: var(--font-display); font-size: 8.5px; font-weight: 800;
  padding: 1.5px 5px; border-radius: 999px; letter-spacing: .4px;
}
.pme-tag { background: rgba(46, 213, 115, .25); color: #7bed9f; border: 1px solid rgba(46, 213, 115, .5); }
.pbot-tag { background: rgba(96, 165, 250, .22); color: #93c5fd; border: 1px solid rgba(96, 165, 250, .5); }
.poff-tag { background: rgba(255, 107, 107, .22); color: #ffb8b8; border: 1px solid rgba(255, 107, 107, .5); }
.pjail-tag { background: rgba(255, 204, 51, .18); color: #ffe08a; border: 1px solid rgba(255, 204, 51, .45); }
.pcard-money {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14.5px;
  color: #7bed9f;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.pcard-money.neg { color: #ff8787; }
.pcard-stats {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: #b9cce8;
  white-space: nowrap;
}
.pcard-stats b { color: #eaf2ff; font-weight: 700; }
.pcard-timer {
  position: absolute; left: 8px; right: 8px; bottom: 2px;
  height: 3px; border-radius: 2px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}
.pcard-timer-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #4da3ff, #7cc0ff);
  transition: width .25s linear;
}
.pcard-timer-fill.warn { background: linear-gradient(90deg, #f59e0b, #ffdd59); }
.pcard-timer-fill.danger { background: linear-gradient(90deg, #dc2626, #ff6b6b); }

.hud-right-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.hud-btn { position: relative; }
.hud-Notification {
  position: absolute; top: -6px; right: -6px;
  min-width: 17px; height: 17px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffdd59, #f59e0b);
  color: #2b1800;
  font-family: var(--font-display);
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}
.hud-Notification.has-cards { background: linear-gradient(180deg, #3ae374, #1ea84f); color: #062812; }

/* =============== BARRA DE AÇÕES =============== */
.actionbar {
  position: absolute; left: 50%; bottom: 8px;
  transform: translateX(-50%);
  width: min(980px, calc(100vw - 16px));
  min-height: var(--bar-h);
  border-radius: 18px;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px;
  z-index: 25;
  background: linear-gradient(180deg, rgba(16, 30, 56, .94), rgba(10, 19, 36, .96));
  backdrop-filter: blur(14px);
  border: 2px solid rgba(110, 160, 235, .55);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.action-info {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 600;
  color: #e6efff;
  line-height: 1.32;
  flex: 1;
  min-width: 0;
}
.action-info b { color: #fff; }
.action-info .ai-big { font-size: 17px; color: var(--gold); }
.action-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.debt-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(220, 38, 38, .22);
  border: 1px solid rgba(255, 107, 107, .6);
  color: #ffb8b8;
  font-family: var(--font-display);
  font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  animation: pulseBadge 1.4s infinite;
}

/* =============== GAVETA LATERAL (TÍTULOS) =============== */
.side {
  position: absolute; top: calc(var(--hud-h) + 4px); right: 10px; bottom: calc(var(--bar-h) + 12px);
  width: 340px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 30;
  transition: transform .28s cubic-bezier(.16, 1, .3, 1), opacity .28s;
}
.side.hidden-side { transform: translateX(112%); opacity: 0; pointer-events: none; }
.side-cards { flex: 1 1 55%; display: flex; flex-direction: column; min-height: 0; padding: 14px 16px; }
.side-log-panel { flex: 1 1 45%; display: flex; flex-direction: column; min-height: 0; padding: 14px 16px; }
.side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.side-head h3 { font-family: var(--font-display); font-size: 15px; color: #fff; }

.props-list {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  padding: 2px;
}
.prop-group-label {
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  color: var(--muted);
  margin-top: 4px;
  display: flex; align-items: center; gap: 6px;
}
.prop-group-label .pgl-dot { width: 11px; height: 11px; border-radius: 4px; box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.prop-row {
  display: flex; align-items: center; gap: 8px;
  background: rgba(9, 18, 34, .6);
  border: 1px solid rgba(85, 130, 200, .3);
  border-radius: 12px;
  padding: 7px 9px;
}
.prop-row .pr-dot { width: 12px; height: 12px; border-radius: 4px; flex: 0 0 auto; box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.prop-row .pr-info { flex: 1; min-width: 0; }
.prop-row .pr-name { font-family: var(--font-display); font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prop-row .pr-sub { font-size: 10.5px; color: var(--muted); }
.prop-row .pr-actions { display: flex; gap: 4px; }
.prop-row .pr-actions .btn { padding: 4px 7px; font-size: 11px; border-radius: 8px; }
.props-foot { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.jail-card-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: linear-gradient(180deg, #ffdd59, #f59e0b);
  color: #2b1800;
  font-family: var(--font-display); font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 3px 8px rgba(245, 158, 11, .4);
}

.action-log {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 5px;
  font-size: 12px;
}
.log-line {
  background: rgba(9, 18, 34, .5);
  border-radius: 8px;
  padding: 5px 9px;
  color: #c9d8f2;
  line-height: 1.35;
  border-left: 2.5px solid rgba(120, 165, 235, .4);
}
.log-line:last-child { border-left-color: var(--gold); }

/* =============== TOOLTIP DO TABULEIRO =============== */
.tooltip {
  position: absolute;
  z-index: 45;
  background: rgba(8, 16, 32, .94);
  border: 1px solid rgba(120, 165, 235, .5);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 12.5px;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .55);
  max-width: 240px;
}
.tooltip b { color: var(--gold); }

/* =============== MODAL DE TÍTULO DE POSSE =============== */
.deed-overlay, .auction-overlay, .card-overlay {
  position: absolute; inset: 0;
  background: rgba(5, 10, 22, .72);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 40;
  animation: fadeIn .22s ease;
}
@keyframes fadeIn { from { opacity: 0; } }

.deed-box { width: 300px; max-width: calc(100vw - 24px); animation: deedIn .3s cubic-bezier(.16, 1, .3, 1); }
@keyframes deedIn { from { opacity: 0; transform: translateY(24px) scale(.92); } }

.deed-card {
  background: linear-gradient(180deg, #fcf6e8 0%, #efe5cc 100%);
  color: #241707;
  border-radius: 16px;
  border: 2.5px solid #17120a;
  overflow: hidden;
  box-shadow: 0 22px 55px rgba(0, 0, 0, .7);
}
.deed-head {
  background: var(--deed-color, #333);
  color: var(--deed-text, #fff);
  text-align: center;
  padding: 10px 12px 8px;
  border-bottom: 2.5px solid #17120a;
}
.deed-head .dh-title {
  font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  opacity: .85;
}
.deed-head .dh-name {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700;
  line-height: 1.15;
}
.deed-body { padding: 12px 18px 14px; }
.deed-rent-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px;
  padding: 3.5px 0;
  border-bottom: 1px dotted rgba(36, 23, 7, .25);
}
.deed-rent-row b { font-family: var(--font-display); font-size: 12.5px; }
.deed-rent-row.hot b { color: #b32424; }
.deed-foot {
  margin-top: 8px; padding-top: 8px;
  border-top: 2px solid rgba(36, 23, 7, .35);
  font-size: 11.5px;
  display: flex; flex-direction: column; gap: 3px;
}
.deed-owner-line {
  margin-top: 10px;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}
.deed-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; justify-content: center; }
.deed-actions .btn { font-size: 12px; padding: 7px 10px; }

.help-box { width: min(560px, calc(100vw - 24px)); background: linear-gradient(180deg, #1b335c, #10203b); border: 2px solid var(--gold); border-radius: 20px; padding: 16px 20px; color: #dbeafe; max-height: calc(100dvh - 80px); overflow: auto; }
.help-box h3 { font-family: var(--font-display); color: #fff; }
.help-body { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; line-height: 1.45; margin-top: 8px; }

.glass-strong {
  background: linear-gradient(180deg, rgba(20, 36, 66, .96), rgba(12, 22, 42, .98));
  backdrop-filter: blur(16px);
  border: 2px solid rgba(120, 175, 255, .5);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .18);
}

/* =============== LEILÃO =============== */
.auction-box {
  width: min(420px, calc(100vw - 24px));
  border-radius: 22px;
  padding: 18px 20px;
  text-align: center;
  animation: deedIn .3s cubic-bezier(.16, 1, .3, 1);
}
.auction-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
  text-shadow: 0 2px 10px rgba(245, 158, 11, .4);
}
.auction-prop { margin-bottom: 10px; }
.auction-highbid {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 800;
  color: #7bed9f;
}
.auction-highbid .ab-label { font-size: 12px; color: var(--muted); font-weight: 600; display: block; }
.auction-turn {
  margin: 10px 0 12px;
  font-family: var(--font-display);
  font-size: 14.5px; font-weight: 600;
  color: #fff;
  min-height: 20px;
}
.auction-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.auction-waiting { color: var(--muted); font-size: 13px; font-style: italic; }

/* =============== CARTA SORTE/COFRE =============== */
.lucky-card {
  width: min(330px, calc(100vw - 40px));
  min-height: 380px;
  border-radius: 20px;
  border: 3px solid #17120a;
  padding: 26px 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  text-align: center;
  color: #fff;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .75);
  animation: cardFlipIn .55s cubic-bezier(.2, 1.4, .4, 1);
  transform-style: preserve-3d;
  cursor: pointer;
}
@keyframes cardFlipIn {
  from { opacity: 0; transform: perspective(900px) rotateY(95deg) scale(.8); }
  to { opacity: 1; transform: perspective(900px) rotateY(0deg) scale(1); }
}
.lucky-card.sorte { background: linear-gradient(160deg, #f7941d 0%, #c22e12 100%); }
.lucky-card.cofre { background: linear-gradient(160deg, #2f80ed 0%, #173e7c 100%); }
.lucky-card .lc-kind {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 800; letter-spacing: 3px;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .28);
  border: 1.5px solid rgba(255, 255, 255, .5);
}
.lucky-card .lc-icon { font-size: 54px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .4)); }
.lucky-card .lc-text {
  font-family: var(--font-display);
  font-size: 17.5px; font-weight: 600;
  line-height: 1.4;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.lucky-card .lc-player { font-size: 12.5px; opacity: .85; }

/* =============== VITÓRIA / BANNER / TOAST =============== */
.win-overlay {
  position: absolute; inset: 0;
  background: rgba(5, 10, 22, .85);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  z-index: 60;
}
.win-box {
  text-align: center;
  background: linear-gradient(180deg, #1b335c, #10203b);
  border: 2px solid var(--gold);
  border-radius: 26px;
  padding: 30px 40px;
  width: min(520px, calc(100vw - 24px));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 60px rgba(255, 204, 51, .18);
  animation: deedIn .4s cubic-bezier(.16, 1, .3, 1);
}
.win-header { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 10px; }
.win-trophy { font-size: 58px; filter: drop-shadow(0 6px 16px rgba(255, 204, 51, .5)); animation: trophyPop .7s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes trophyPop { from { transform: scale(0) rotate(-30deg); } }
.win-title-block h1 {
  font-family: var(--font-display);
  font-size: 30px;
  background: linear-gradient(180deg, #fff5c0, #ffca3a 55%, #e08e00);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.win-summary { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.win-body { color: #c9d8f2; font-size: 14px; line-height: 1.5; margin: 10px 0 18px; }
.win-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }

.turn-banner {
  position: absolute; top: 34%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 44;
  pointer-events: auto;
  cursor: pointer;
}
.turn-banner-inner {
  background: linear-gradient(180deg, rgba(255, 221, 89, .97), rgba(245, 158, 11, .97));
  color: #2b1800;
  border-radius: 20px;
  padding: 16px 42px;
  text-align: center;
  border: 2.5px solid #fff2a6;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6), 0 0 50px rgba(255, 204, 51, .4);
  animation: bannerIn .38s cubic-bezier(.34, 1.56, .64, 1);
}
.turn-banner.out { animation: bannerOut .32s ease forwards; }
@keyframes bannerIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.6); } }
@keyframes bannerOut { to { opacity: 0; transform: translate(-50%, -80%) scale(.85); } }
.tb-title { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.tb-sub { font-size: 13.5px; font-weight: 600; margin-top: 3px; }

.battle-intro {
  position: absolute; inset: 0;
  background: rgba(5, 10, 22, .82);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 58;
  cursor: pointer;
}
.battle-intro.out { opacity: 0; transition: opacity .3s; }
.bi-card {
  text-align: center;
  background: linear-gradient(180deg, rgba(23, 42, 74, .97), rgba(13, 25, 47, .98));
  border: 2px solid rgba(120, 175, 255, .5);
  border-radius: 26px;
  padding: 30px 44px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
  animation: deedIn .45s cubic-bezier(.16, 1, .3, 1);
  max-width: min(560px, calc(100vw - 24px));
}
.bi-emblem { font-size: 54px; margin-bottom: 4px; filter: drop-shadow(0 4px 14px rgba(255, 204, 51, .4)); }
.bi-kicker { font-family: var(--font-display); font-size: 12px; letter-spacing: 3px; color: var(--gold); margin-bottom: 4px; }
.bi-title { font-family: var(--font-display); font-size: 30px; margin-bottom: 16px; }
.bi-order { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 16px; }
.bi-pchip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(9, 18, 34, .8);
  border: 1.5px solid var(--c-stroke, rgba(120, 165, 235, .4));
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  font-size: 13px;
}
.bi-pchip.me { border-color: var(--gold); box-shadow: 0 0 12px rgba(255, 204, 51, .35); }
.bi-pnum { font-family: var(--font-display); font-weight: 700; font-size: 11px; color: #9fb3d1; }
.bi-pdot { width: 11px; height: 11px; border-radius: 50%; background: var(--c-fill, #fff); border: 1.5px solid rgba(255, 255, 255, .6); }
.bi-mission { font-size: 13.5px; color: #c9d8f2; display: grid; gap: 5px; }
.bi-my-army { display: flex; align-items: center; gap: 6px; justify-content: center; }
.bi-my-obj { line-height: 1.45; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--bar-h) + 22px);
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(20, 36, 66, .97), rgba(12, 22, 42, .97));
  border: 1.5px solid rgba(120, 175, 255, .55);
  color: #e8f0ff;
  border-radius: 14px;
  padding: 11px 20px;
  font-size: 14px; font-weight: 600;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .6);
  animation: toastIn .25s cubic-bezier(.34, 1.56, .64, 1);
  max-width: min(480px, calc(100vw - 30px));
  text-align: center;
}
.toast.err { border-color: rgba(255, 107, 107, .65); color: #ffc9c9; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(.94); } }

/* aviso girar celular */
.rotate-hint {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(5, 10, 22, .92);
  display: flex; align-items: center; justify-content: center;
}
body.rotate-dismissed .rotate-hint { display: none; }
body.in-game .rotate-hint { display: none; }
.rotate-card {
  text-align: center;
  background: linear-gradient(180deg, rgba(25, 45, 78, .97), rgba(14, 26, 48, .98));
  border: 2px solid rgba(110, 160, 235, .4);
  border-radius: 22px;
  padding: 26px 32px;
  display: grid; gap: 12px; justify-items: center;
  max-width: min(380px, calc(100vw - 24px));
}
.rotate-phone { font-size: 44px; animation: rotatePhone 2.2s ease-in-out infinite; display: inline-block; }
@keyframes rotatePhone {
  0%, 25% { transform: rotate(0deg); }
  55%, 80% { transform: rotate(-90deg); }
  100% { transform: rotate(-90deg); }
}

/* =============== RESPONSIVO =============== */
@media (max-width: 1100px) {
  .side { width: 300px; }
}
@media (max-width: 960px), (max-height: 560px) {
  :root { --tilt: 0deg; --par-x: 0deg; --par-y: 0deg; --hud-h: 52px; --bar-h: 56px; }
  .board-3d { perspective: none; }
  .board-3d::before { display: none; }
  .board { transform: none; animation: none; }
  .lobby-main { grid-template-columns: 1fr; }
  .room-slots { grid-template-columns: repeat(2, 1fr); }
  .hud-players { max-width: 40vw; }
  .side { left: 8px; right: 8px; width: auto; top: auto; bottom: 8px; max-height: 62dvh; }
  .side.hidden-side { transform: translateY(112%); }
  .actionbar { bottom: 4px; }
  .pcard { min-width: 104px; }
  .pcard .pname { max-width: 62px; }
  .die3d { width: 32px; height: 32px; --die-z: 16px; }
}
@media (max-width: 560px) {
  .hb-text { display: none; }
  .actionbar { width: calc(100vw - 8px); }
  .room-slots { grid-template-columns: 1fr; }
}

/* rótulo flutuante: nome da casa onde o peão acabou de parar */
.land-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  background: var(--ll-color, #333);
  border: 1.5px solid rgba(255, 255, 255, .75);
  border-radius: 999px;
  padding: 3px 12px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 55;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .4);
  animation: landPop 1.6s ease forwards;
}
.land-label small { font-weight: 600; opacity: .85; font-size: .75em; margin-left: 4px; }
@keyframes landPop {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); }
  14% { opacity: 1; transform: translate(-50%, -55%) scale(1.06); }
  22% { transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; transform: translate(-50%, -58%); }
  100% { opacity: 0; transform: translate(-50%, -84%); }
}

/* =============== FAIXA DE PAGAMENTO (recibo do dinheiro) =============== */
.money-strip {
  position: absolute; left: 50%; bottom: calc(var(--bar-h) + 12px);
  transform: translateX(-50%) translateY(14px) scale(.92);
  background: linear-gradient(180deg, rgba(20, 36, 66, .97), rgba(12, 22, 42, .97));
  border: 2px solid rgba(120, 175, 255, .55);
  color: #e8f0ff;
  border-radius: 14px;
  padding: 9px 18px;
  font-family: var(--font-display);
  font-size: 14.5px; font-weight: 600;
  z-index: 26;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s cubic-bezier(.34, 1.56, .64, 1);
  max-width: min(640px, calc(100vw - 24px));
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.money-strip.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.money-strip b { font-weight: 800; }
.money-strip.pay { border-color: rgba(255, 107, 107, .7); }
.money-strip.pay b { color: #ff9b9b; }
.money-strip.recv { border-color: rgba(46, 213, 115, .7); }
.money-strip.recv b { color: #7bed9f; }
.money-strip.neutro { border-color: rgba(150, 170, 200, .5); }
.money-strip.neutro b { color: #cdd9ec; }
.money-strip span { color: var(--muted); font-weight: 500; font-size: .85em; }
@media (max-width: 960px) {
  .money-strip { font-size: 12.5px; bottom: calc(var(--bar-h) + 8px); }
}
