:root {
  --bg-deep: #0c1a17;
  --bg-mid: #123028;
  --felt: #1a4a3a;
  --felt-light: #246b52;
  --ink: #f2efe6;
  --muted: #a8bdb4;
  --wood: #2a1f14;
  --wood-edge: #5c4030;
  --red: #e23d3d;
  --red-deep: #9e1f1f;
  --green: #2f9e5b;
  --green-deep: #1a6b3a;
  --yellow: #e8c547;
  --yellow-deep: #b0891a;
  --blue: #3a7fd4;
  --blue-deep: #1f4f96;
  --safe: #f7f3e8;
  --path: #efe9dc;
  --path-line: #d4cbb8;
  --shadow: rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font-display: "Bricolage Grotesque", sans-serif;
  --font-body: "DM Sans", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-deep);
  overflow: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1200px 700px at 15% 10%, #1e4d3d 0%, transparent 55%),
    radial-gradient(900px 600px at 90% 80%, #1a3550 0%, transparent 50%),
    linear-gradient(160deg, #0b1613 0%, #122820 45%, #0e1c28 100%);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: drift 18s ease-in-out infinite alternate;
}

.glow-a {
  width: 42vw;
  height: 42vw;
  left: -8%;
  top: -10%;
  background: #2d8f6f;
}

.glow-b {
  width: 36vw;
  height: 36vw;
  right: -6%;
  bottom: -8%;
  background: #2f6aa8;
  animation-delay: -7s;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(4%, 6%) scale(1.08); }
}

.app {
  position: relative;
  z-index: 1;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: clamp(0.6rem, 1.4vw, 1.1rem) clamp(0.8rem, 1.8vw, 1.4rem);
  gap: 0.4rem;
}

.topbar {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(120deg, #f6f1e4 10%, #7fd9b0 55%, #6eb0e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.75rem, 1.2vw, 0.95rem);
  max-width: 36rem;
}

.room-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

.room-line .tagline {
  max-width: none;
}

.room-line #shareGameBtn {
  flex-shrink: 0;
}

.players-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
  overflow-y: auto;
}

.chat-banner {
  position: absolute;
  top: 4.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  max-width: min(92vw, 420px);
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 24, 20, 0.88);
  backdrop-filter: blur(10px);
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.25;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  animation: chatBannerIn 0.28s ease;
}

.chat-banner strong {
  color: #9ed9c0;
  margin-right: 0.35rem;
}

.chat-banner[data-color="red"] strong { color: #ff7a7a; }
.chat-banner[data-color="green"] strong { color: #6fd99a; }
.chat-banner[data-color="yellow"] strong { color: #f0d56a; }
.chat-banner[data-color="blue"] strong { color: #7eb6ff; }

@keyframes chatBannerIn {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.chat-shell {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 12;
  width: var(--side);
  max-height: min(36%, 280px);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.22));
  backdrop-filter: blur(12px);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.chat-shell[hidden] {
  display: none !important;
}

.chat-handle {
  display: none;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.chat-head {
  padding: 0.55rem 0.7rem 0.2rem;
}

.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.35rem 0.7rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.chat-line {
  display: grid;
  gap: 0.1rem;
  font-size: 0.78rem;
  line-height: 1.25;
}

.chat-author {
  font-weight: 700;
  font-size: 0.7rem;
  color: #9ed9c0;
}

.chat-line[data-color="red"] .chat-author { color: #ff7a7a; }
.chat-line[data-color="green"] .chat-author { color: #6fd99a; }
.chat-line[data-color="yellow"] .chat-author { color: #f0d56a; }
.chat-line[data-color="blue"] .chat-author { color: #7eb6ff; }

.chat-text {
  color: var(--ink);
  word-break: break-word;
}

.chat-line.is-mine .chat-text {
  opacity: 0.95;
}

.chat-line.is-system {
  text-align: center;
  opacity: 0.85;
  padding: 0.15rem 0;
}

.chat-line.is-system .chat-text {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: italic;
}

.chat-line.is-system[data-color="red"] .chat-text { color: color-mix(in srgb, #ff7a7a 70%, var(--muted)); }
.chat-line.is-system[data-color="green"] .chat-text { color: color-mix(in srgb, #6fd99a 70%, var(--muted)); }
.chat-line.is-system[data-color="yellow"] .chat-text { color: color-mix(in srgb, #f0d56a 70%, var(--muted)); }
.chat-line.is-system[data-color="blue"] .chat-text { color: color-mix(in srgb, #7eb6ff 70%, var(--muted)); }

.chat-banner.is-system {
  font-style: italic;
}

.chat-banner.is-join {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-style: normal;
  border-color: color-mix(in srgb, var(--accent, #7fd9b0) 45%, rgba(255, 255, 255, 0.14));
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.28),
    0 0 0 1px color-mix(in srgb, var(--accent, #7fd9b0) 25%, transparent);
  animation: joinBannerPop 0.4s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.chat-banner.is-join .join-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent, #7fd9b0);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent, #7fd9b0) 55%, transparent);
  animation: joinDotPulse 1.2s ease-out 2;
}

.chat-banner[data-color="red"].is-join { --accent: #ff7a7a; }
.chat-banner[data-color="green"].is-join { --accent: #6fd99a; }
.chat-banner[data-color="yellow"].is-join { --accent: #f0d56a; }
.chat-banner[data-color="blue"].is-join { --accent: #7eb6ff; }

.chat-line.is-system.is-join {
  opacity: 1;
  padding: 0.35rem 0.45rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent, #7fd9b0) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #7fd9b0) 28%, transparent);
}

.chat-line.is-system.is-join .chat-text {
  color: var(--ink);
  font-style: normal;
  font-weight: 600;
  font-size: 0.78rem;
}

.chat-line.is-system.is-join[data-color="red"] { --accent: #ff7a7a; }
.chat-line.is-system.is-join[data-color="green"] { --accent: #6fd99a; }
.chat-line.is-system.is-join[data-color="yellow"] { --accent: #f0d56a; }
.chat-line.is-system.is-join[data-color="blue"] { --accent: #7eb6ff; }

.join-banner {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.7rem;
  row-gap: 0.15rem;
  align-items: center;
  max-width: min(92vw, 420px);
  padding: 0.85rem 1.15rem;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent, #7fd9b0) 40%, rgba(255, 255, 255, 0.12));
  background:
    linear-gradient(160deg, rgba(18, 36, 30, 0.96), rgba(8, 18, 14, 0.94));
  backdrop-filter: blur(14px);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.38),
    0 0 0 1px color-mix(in srgb, var(--accent, #7fd9b0) 18%, transparent);
  animation: joinBannerPop 0.42s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.join-banner[hidden] {
  display: none !important;
}

.join-banner[data-color="red"] { --accent: #ff7a7a; }
.join-banner[data-color="green"] { --accent: #6fd99a; }
.join-banner[data-color="yellow"] { --accent: #f0d56a; }
.join-banner[data-color="blue"] { --accent: #7eb6ff; }

.join-banner-dot {
  grid-row: 1 / span 2;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--accent, #7fd9b0);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent, #7fd9b0) 50%, transparent);
  animation: joinDotPulse 1.15s ease-out 3;
}

.join-banner-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--ink);
}

.join-banner-copy strong {
  color: var(--accent, #9ed9c0);
  font-family: var(--font-display);
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.join-banner-sub {
  grid-column: 2;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.25;
}

@keyframes joinBannerPop {
  from {
    opacity: 0;
    transform: translate(-50%, -14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes joinDotPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent, #7fd9b0) 55%, transparent); }
  70% { box-shadow: 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.chat-form input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  padding: 0.45rem 0.6rem;
  font: inherit;
  font-size: 0.82rem;
  pointer-events: auto;
}

.chat-form input:focus {
  outline: 1px solid color-mix(in srgb, #7fd9b0 50%, white);
}

.chat-form button[type="submit"] {
  pointer-events: auto;
  cursor: pointer;
}

.stage {
  --side: clamp(200px, 18vw, 260px);
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  height: 100%;
  /* Para o tabuleiro caber no espaço real (abaixo do topbar) */
  container-type: size;
}

.panel {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: var(--side);
  max-height: min(92%, 920px);
  height: auto;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  min-width: 0;
}

.panel-left {
  left: 0;
  top: 0;
  bottom: calc(min(36%, 280px) + 0.7rem);
  transform: none;
  height: auto;
  max-height: none;
  justify-content: flex-start;
  gap: 0.5rem;
  overflow: hidden;
}

.panel-right {
  right: 0;
  align-items: stretch;
}

.player-card {
  position: relative;
  padding: 0.8rem 0.9rem 0.75rem;
  border-radius: 12px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid color-mix(in srgb, var(--accent) 75%, transparent);
  backdrop-filter: blur(10px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  overflow: visible;
}

.player-card.active {
  border-color: color-mix(in srgb, var(--accent) 55%, rgba(255, 255, 255, 0.2));
  border-left-color: var(--accent);
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--accent) 14%, rgba(255, 255, 255, 0.05)), rgba(255, 255, 255, 0.02));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.player-card.is-you {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}

.player-card.is-next {
  border-color: rgba(255, 255, 255, 0.16);
}

.player-card.is-next .player-rank {
  color: #e8c48a;
}

.player-card[data-color="red"] { --accent: var(--red); }
.player-card[data-color="green"] { --accent: var(--green); }
.player-card[data-color="yellow"] { --accent: var(--yellow); }
.player-card[data-color="blue"] { --accent: var(--blue); }

.player-rank {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--accent) 70%, white);
  opacity: 0.9;
}

.player-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.6rem;
  padding-right: 1.7rem;
}

.player-avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid color-mix(in srgb, var(--accent) 65%, white);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.25),
    0 3px 10px rgba(0, 0, 0, 0.28);
  background: color-mix(in srgb, var(--accent) 40%, #141414);
  display: grid;
  place-items: center;
  position: relative;
  z-index: 3;
}

.player-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.player-avatar-fallback {
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
}

.player-id {
  min-width: 0;
}

.player-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-meta {
  margin: 0.12rem 0 0;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.score-bar {
  height: 0.32rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  margin-bottom: 0.55rem;
}

.score-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, white));
  transition: width 0.35s ease;
}

.score-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
}

.score-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.28rem 0.2rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  line-height: 1.15;
}

.score-pill em {
  font-style: normal;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.score-pill.done em { color: color-mix(in srgb, var(--accent) 75%, white); }

.react-slot {
  position: absolute;
  left: 50%;
  top: -0.2rem;
  width: 0;
  height: 0;
  pointer-events: none;
}

.react-bubble {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 1.45rem;
  transform: translate(-50%, -50%) scale(0.35);
  opacity: 0;
  pointer-events: none;
  z-index: 40;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  line-height: 1;
}

.react-bubble.show {
  animation: reactPopOut 1.55s cubic-bezier(0.2, 1.15, 0.3, 1) forwards;
}

.react-bubble.big {
  font-size: 1.9rem;
}

.react-bubble.mood-cry { filter: drop-shadow(0 4px 8px rgba(80, 140, 220, 0.45)); }
.react-bubble.mood-angry { filter: drop-shadow(0 4px 8px rgba(220, 60, 40, 0.5)); }
.react-bubble.mood-smile { filter: drop-shadow(0 4px 8px rgba(255, 200, 60, 0.45)); }
.react-bubble.mood-taunt { filter: drop-shadow(0 4px 8px rgba(255, 120, 80, 0.45)); }

@keyframes reactPopOut {
  0% {
    opacity: 0;
    transform: translate(-50%, -30%) scale(0.3);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -120%) scale(1.2);
  }
  35% {
    transform: translate(-50%, -145%) scale(1);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -175%) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -220%) scale(0.85);
  }
}

.react-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 35;
  overflow: visible;
}

.board-react {
  position: absolute;
  font-size: clamp(1.35rem, 3.2vmin, 2rem);
  line-height: 1;
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
  will-change: transform, opacity;
}

.board-react.big {
  font-size: clamp(1.7rem, 4vmin, 2.45rem);
}

.board-react.show {
  animation: meetReact 1.7s cubic-bezier(0.18, 1.15, 0.28, 1) forwards;
}

.board-react.mood-cry,
.board-react.mood-stuck,
.board-react.mood-noMove { filter: drop-shadow(0 4px 10px rgba(70, 140, 230, 0.45)); }
.board-react.mood-angry { filter: drop-shadow(0 4px 10px rgba(230, 60, 40, 0.5)); }
.board-react.mood-smile,
.board-react.mood-six,
.board-react.mood-leaveYard,
.board-react.mood-high { filter: drop-shadow(0 4px 10px rgba(255, 200, 70, 0.45)); }
.board-react.mood-taunt { filter: drop-shadow(0 4px 10px rgba(255, 120, 80, 0.45)); }
.board-react.mood-win,
.board-react.mood-finish { filter: drop-shadow(0 4px 12px rgba(255, 215, 80, 0.55)); }

@keyframes meetReact {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.15) rotate(0deg);
  }
  14% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(var(--scale, 1.1)) rotate(calc(var(--rot, 0deg) * 0.4));
  }
  35% {
    opacity: 1;
    transform: translate(calc(-50% + var(--dx, 0px) * 0.45), calc(-50% + var(--dy, -40px) * 0.45))
      scale(var(--scale, 1)) rotate(var(--rot, 0deg));
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -80px)))
      scale(0.7) rotate(calc(var(--rot, 0deg) * 1.2));
  }
}

.player-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent);
}

.token-dots {
  display: none;
}

.token-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--accent) 55%, white 20%);
}

.token-dot.home { opacity: 0.35; }
.token-dot.track { background: var(--accent); opacity: 1; }
.token-dot.done {
  background: transparent;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.board-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  /* Quadrado limitado pela largura entre painéis E pela altura do stage */
  width: min(
    calc(100% - (2 * var(--side)) - 1.5rem),
    calc(100cqb - 12px),
    100cqi
  );
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  height: auto;
}

.react-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  overflow: visible;
}

.token-fly {
  position: absolute;
  z-index: 80;
  width: 0;
  height: 0;
  pointer-events: none;
  left: 0;
  top: 0;
}

.token-fly .token {
  width: clamp(16px, 2.8vmin, 28px);
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 0;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  transition: none;
  /* tamanho e movimento vêm do JS (rAF + easing) */
  box-sizing: border-box;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
  z-index: 25;
}

.token-fly .token.is-mesh,
.token-fly .token.is-flying {
  max-width: none;
  animation: none;
}

.token.moving-hide {
  opacity: 0 !important;
  pointer-events: none;
}

.board-shadow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  background: radial-gradient(circle at 50% 55%, rgba(0, 0, 0, 0.55), transparent 70%);
  filter: blur(18px);
  transform: translateY(18px) scale(0.96);
  pointer-events: none;
}

.board {
  --cell: calc(100% / 15);
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
  border-radius: 22px;
  /* visible: peões podem sobrepor casas sem serem cortados */
  overflow: visible;
  isolation: auto;
  background:
    linear-gradient(145deg, #4a3422, #23170e 42%, #3a2618);
  box-shadow:
    0 0 0 2px #6a4a32,
    0 0 0 8px #2a1b12,
    0 2px 0 #7a5638,
    0 28px 70px rgba(0, 0, 0, 0.6),
    inset 0 2px 0 rgba(255, 255, 255, 0.12),
    inset 0 -8px 20px rgba(0, 0, 0, 0.35);
  animation: boardIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
  transform: perspective(900px) rotateX(4deg);
  transform-style: preserve-3d;
}

@keyframes boardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.cell {
  position: relative;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  overflow: visible;
  z-index: 0;
}

.cell.path {
  z-index: 1;
  background:
    linear-gradient(160deg, #f7f1e4 0%, #ebe2d0 48%, #ddd2bc 100%);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.65),
    inset -1px -1px 0 rgba(80, 55, 30, 0.12),
    inset 0 -3px 6px rgba(0, 0, 0, 0.06);
}

.cell.safe {
  background:
    linear-gradient(160deg, #fff6d6 0%, #f0dfb0 50%, #e2cb8a 100%);
}

.cell.safe::after {
  content: "";
  position: absolute;
  inset: 22%;
  background: conic-gradient(from 20deg, #c9a227, #f5e6a3, #c9a227);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  opacity: 0.9;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
  z-index: 0;
  pointer-events: none;
}

.cell.yard {
  border: none;
  overflow: visible;
  z-index: 2;
  box-shadow:
    inset 0 2px 8px rgba(255, 255, 255, 0.25),
    inset 0 -10px 20px rgba(0, 0, 0, 0.18);
}

/* Célula/slot com peão sobe acima de qualquer casa vizinha */
.cell:has(.token),
.cell.center:has(.token) {
  z-index: 40;
}

.yard-slot:has(.token) {
  z-index: 42;
}

.cell.yard:has(.token) {
  z-index: 44;
}

/* Cantos do tabuleiro arredondados (acompanha .board) */
.cell.yard.yard-green {
  border-top-left-radius: 20px;
}
.cell.yard.yard-yellow {
  border-top-right-radius: 20px;
}
.cell.yard.yard-red {
  border-bottom-left-radius: 20px;
}
.cell.yard.yard-blue {
  border-bottom-right-radius: 20px;
}

.cell.stretch {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.35),
    inset -1px -2px 4px rgba(0, 0, 0, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.15);
}

.cell.center {
  overflow: visible;
  z-index: 2;
  background:
    radial-gradient(circle at 50% 40%, #fffaf0, #e8d7a8 55%, #cbb57a);
  border: none;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.35),
    inset 0 8px 20px rgba(0, 0, 0, 0.12);
}

.yard-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 14%;
  padding: 16%;
  width: 100%;
  height: 100%;
  overflow: visible;
  place-items: center;
}

.yard-slot {
  position: relative;
  width: 64%;
  height: 64%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: visible;
  z-index: 3;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 50%),
    rgba(0, 0, 0, 0.18);
  box-shadow:
    inset 0 3px 8px rgba(0, 0, 0, 0.35),
    inset 0 -2px 3px rgba(255, 255, 255, 0.15),
    0 1px 0 rgba(255, 255, 255, 0.2);
}

.center-star {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.center-diamond {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.center-diamond span {
  display: block;
}

.center-diamond .c-red { background: var(--red); }
.center-diamond .c-green { background: var(--green); }
.center-diamond .c-yellow { background: var(--yellow); }
.center-diamond .c-blue { background: var(--blue); }

.token {
  position: absolute;
  box-sizing: border-box;
  width: 68%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  --stack-x: 0%;
  --stack-y: 0%;
  --piece-glow: #ffffff;
  transform: translate(calc(-50% + var(--stack-x)), calc(-50% + var(--stack-y)));
  z-index: 50;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4),
    0 3px 0 rgba(0, 0, 0, 0.16),
    0 7px 0 rgba(0, 0, 0, 0.14),
    0 12px 18px rgba(0, 0, 0, 0.3),
    inset 0 -7px 12px rgba(0, 0, 0, 0.3),
    inset 0 5px 8px rgba(255, 255, 255, 0.48);
  transition: box-shadow 0.2s ease, filter 0.2s ease;
}

/* Peão 3D (sprite Three.js) — na trilha um pouco maior */
.token.is-mesh {
  border: none;
  background: transparent !important;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
  width: 92%;
  max-width: none;
  transition: transform 0.2s ease;
  z-index: 55;
}

/* Enquanto o sprite 3D carrega — spinner, sem peão CSS/fallback */
.token.is-loading {
  border: none;
  background: transparent !important;
  box-shadow: none;
  overflow: visible;
  width: 92%;
  max-width: none;
  z-index: 55;
  pointer-events: none;
}

.token.is-loading::before,
.token.is-loading::after {
  display: none !important;
}

.token.is-loading.in-yard {
  width: 118%;
}

.token-loading {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  box-sizing: border-box;
  border: 2.5px solid color-mix(in srgb, var(--piece-glow, #fff) 22%, transparent);
  border-top-color: color-mix(in srgb, var(--piece-glow, #fff) 92%, white);
  animation: tokenSpin 0.65s linear infinite;
  z-index: 2;
}

.token.red.is-loading { --piece-glow: var(--red); }
.token.green.is-loading { --piece-glow: var(--green); }
.token.yellow.is-loading { --piece-glow: var(--yellow); }
.token.blue.is-loading { --piece-glow: var(--blue); }

@keyframes tokenSpin {
  to { transform: rotate(360deg); }
}

/* Na base: peão compacto, levemente sobre o círculo */
.token.is-mesh.in-yard {
  width: 118%;
  max-width: none;
  aspect-ratio: 1 / 1;
  z-index: 60;
  overflow: visible;
}

.token.selectable,
.token.threatened {
  z-index: 65;
}

.token.in-yard:not(.is-mesh):not(.is-loading) {
  width: 100%;
}

.token.is-mesh.in-yard .token-mesh {
  object-fit: contain;
  object-position: center bottom;
}

.token.is-mesh:not(.selectable):not(.threatened)::before,
.token.is-mesh:not(.selectable):not(.threatened)::after {
  display: none;
}

.token-mesh {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  object-fit: contain;
  object-position: center bottom;
  z-index: 1;
}

.token::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -12%;
  height: 24%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.26);
  filter: blur(3.5px);
  z-index: -1;
}

.token::after {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.8), transparent 48%),
    radial-gradient(circle at 70% 78%, rgba(0, 0, 0, 0.16), transparent 55%);
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.token.red { --piece-glow: #ff7a7a; background: linear-gradient(155deg, #ff9b9b, #e23d3d 42%, #9a1c1c 78%, #5c0f0f); }
.token.green { --piece-glow: #6fd99a; background: linear-gradient(155deg, #8ef0ba, #2f9e5b 42%, #176b38 78%, #0c3a1f); }
.token.yellow { --piece-glow: #f0d56a; background: linear-gradient(155deg, #fff0b0, #e8c547 42%, #b08a18 78%, #6a520c); }
.token.blue { --piece-glow: #7eb6ff; background: linear-gradient(155deg, #aed2ff, #3a7fd4 42%, #1f5aa8 78%, #12325c); }

.token.is-mesh .token-sword {
  z-index: 5;
}

.token-sword {
  position: absolute;
  left: -20%;
  top: -24%;
  font-size: clamp(0.7rem, 1.8vmin, 1.05rem);
  z-index: 4;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
  animation: swordWiggle 0.55s ease-in-out infinite;
  transform-origin: 70% 80%;
  line-height: 1;
  pointer-events: none;
}

@keyframes swordWiggle {
  0%, 100% { transform: rotate(-18deg) translateY(0); }
  50% { transform: rotate(12deg) translateY(-2px); }
}

.token-face {
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  overflow: hidden;
  z-index: 2;
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.25);
  background: #1a1a1a;
}

.token-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Foto já vai no sprite 3D (cabeça) — overlay CSS desalinha */
.token.is-mesh .token-face {
  display: none !important;
}

.token.has-face:not(.is-mesh)::after {
  inset: 8%;
  opacity: 0.3;
  background: radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.55), transparent 52%);
}

.token.threatened {
  animation: threatPulse 0.7s ease-in-out infinite;
  z-index: 65;
  filter: saturate(1.2);
}

.token.threatened::after {
  box-shadow: 0 0 0 3px rgba(220, 40, 40, 0.45);
}

@keyframes threatPulse {
  0%, 100% { filter: brightness(1) saturate(1.2); }
  50% { filter: brightness(1.25) saturate(1.4); }
}

.token.killer {
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.2),
    0 6px 0 rgba(0, 0, 0, 0.16),
    0 0 0 3px rgba(220, 50, 50, 0.55),
    0 0 16px rgba(220, 40, 40, 0.4),
    inset 0 -6px 10px rgba(0, 0, 0, 0.28),
    inset 0 4px 6px rgba(255, 255, 255, 0.4);
}

.kill-mark {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 2px dashed rgba(200, 40, 40, 0.75);
  background: rgba(220, 50, 50, 0.18);
  z-index: 2;
  pointer-events: none;
  animation: killMark 0.9s ease-in-out infinite;
}

@keyframes killMark {
  0%, 100% { transform: scale(0.92); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
}

.token.finished {
  z-index: 6;
  cursor: default;
  transform: translate(calc(-50% + var(--ox, 0%)), calc(-50% + var(--oy, 0%)));
}

.token.bouncing {
  animation: centerBounce 1.15s ease-in-out infinite;
}

@keyframes centerBounce {
  0%, 100% {
    transform: translate(calc(-50% + var(--ox, 0%)), calc(-50% + var(--oy, 0%)));
  }
  45% {
    transform: translate(calc(-50% + var(--ox, 0%)), calc(-50% + var(--oy, 0%) - 22%));
  }
  65% {
    transform: translate(calc(-50% + var(--ox, 0%)), calc(-50% + var(--oy, 0%) - 8%));
  }
}

.death-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}

.death-layer .token {
  width: clamp(18px, 3.2vmin, 34px);
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 0;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  transition: left 0.55s cubic-bezier(0.4, 0, 0.6, 1), top 0.55s cubic-bezier(0.4, 0, 0.6, 1), opacity 0.55s ease, filter 0.55s ease;
}

.death-layer .token.death-fly {
  opacity: 0.15;
  filter: grayscale(0.6) brightness(1.3);
  animation: deathSpin 0.55s linear;
}

@keyframes deathSpin {
  from { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  to { transform: translate(-50%, -50%) rotate(420deg) scale(0.4); }
}

.token.selectable {
  animation: softPieceGlow 1.6s ease-in-out infinite;
  cursor: pointer;
  z-index: 65;
  transition: transform 0.2s ease;
}

.token.selectable.killer {
  animation: softPieceGlow 1.2s ease-in-out infinite, threatPulse 0.85s ease-in-out infinite;
}

/* Peão 3D jogável: anel + brilho + leve escala (box-shadow do CSS antigo não aparece no mesh) */
.token.is-mesh.selectable {
  animation: meshPiecePulse 1.35s ease-in-out infinite;
  z-index: 66;
}

.token.is-mesh.selectable.killer {
  animation: meshPiecePulse 1.1s ease-in-out infinite;
}

.token.is-mesh.selectable::before {
  content: "";
  display: block;
  position: absolute;
  left: 8%;
  right: 8%;
  top: 18%;
  bottom: 2%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--piece-glow) 55%, transparent) 0%,
    color-mix(in srgb, var(--piece-glow) 22%, transparent) 45%,
    transparent 70%
  );
  filter: blur(2px);
  z-index: 0;
  pointer-events: none;
  animation: meshHaloPulse 1.35s ease-in-out infinite;
}

.token.is-mesh.selectable::after {
  content: "";
  display: block;
  position: absolute;
  left: 18%;
  right: 18%;
  top: 28%;
  bottom: 12%;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--piece-glow) 70%, white);
  box-shadow:
    0 0 10px 2px color-mix(in srgb, var(--piece-glow) 55%, transparent),
    inset 0 0 8px color-mix(in srgb, var(--piece-glow) 35%, transparent);
  background: transparent;
  z-index: 0;
  pointer-events: none;
  animation: meshRingPulse 1.35s ease-in-out infinite;
}

.token.is-mesh.threatened {
  animation: threatMeshPulse 0.7s ease-in-out infinite;
}

.token.is-mesh.threatened::before {
  content: "";
  display: block;
  position: absolute;
  inset: 10% 8% 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 40, 40, 0.45), transparent 68%);
  z-index: 0;
  pointer-events: none;
}

@keyframes meshPiecePulse {
  0%, 100% {
    filter:
      drop-shadow(0 4px 5px rgba(0, 0, 0, 0.35))
      drop-shadow(0 0 6px color-mix(in srgb, var(--piece-glow) 45%, transparent))
      brightness(1.05);
    transform: translate(calc(-50% + var(--stack-x)), calc(-50% + var(--stack-y))) scale(1);
  }
  50% {
    filter:
      drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4))
      drop-shadow(0 0 16px color-mix(in srgb, var(--piece-glow) 80%, transparent))
      brightness(1.18);
    transform: translate(calc(-50% + var(--stack-x)), calc(-50% + var(--stack-y) - 4%)) scale(1.08);
  }
}

@keyframes meshHaloPulse {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.12); }
}

@keyframes meshRingPulse {
  0%, 100% {
    opacity: 0.65;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes threatMeshPulse {
  0%, 100% {
    filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.35)) brightness(1);
  }
  50% {
    filter: drop-shadow(0 4px 12px rgba(220, 40, 40, 0.65)) brightness(1.2);
  }
}

.token.selectable:hover {
  transform: translate(calc(-50% + var(--stack-x)), calc(-50% + var(--stack-y) - 6%)) scale(1.08);
}

.token.is-mesh.selectable:hover {
  animation: none;
  filter:
    drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4))
    drop-shadow(0 0 18px color-mix(in srgb, var(--piece-glow) 85%, transparent))
    brightness(1.2);
}

.token:disabled,
.token.locked {
  cursor: default;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25), 0 0 0 0 color-mix(in srgb, white 40%, transparent); }
  50% { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25), 0 0 0 8px color-mix(in srgb, white 0%, transparent); }
}

@keyframes softPieceGlow {
  0%, 100% {
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.4),
      0 3px 0 rgba(0, 0, 0, 0.16),
      0 7px 0 rgba(0, 0, 0, 0.14),
      0 12px 18px rgba(0, 0, 0, 0.3),
      inset 0 -7px 12px rgba(0, 0, 0, 0.3),
      inset 0 5px 8px rgba(255, 255, 255, 0.48),
      0 0 0 1px color-mix(in srgb, var(--piece-glow) 28%, transparent),
      0 0 8px 1px color-mix(in srgb, var(--piece-glow) 22%, transparent);
  }
  50% {
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.4),
      0 3px 0 rgba(0, 0, 0, 0.16),
      0 7px 0 rgba(0, 0, 0, 0.14),
      0 12px 18px rgba(0, 0, 0, 0.3),
      inset 0 -7px 12px rgba(0, 0, 0, 0.3),
      inset 0 5px 8px rgba(255, 255, 255, 0.48),
      0 0 0 3px color-mix(in srgb, var(--piece-glow) 18%, transparent),
      0 0 12px 2px color-mix(in srgb, var(--piece-glow) 32%, transparent);
  }
}

.token-stack {
  position: absolute;
  inset: 0;
}

.token-stack .token {
  width: 48%;
  height: auto;
  aspect-ratio: 1 / 1;
}

.token-stack .token:nth-child(1) { transform: translate(-70%, -70%); }
.token-stack .token:nth-child(2) { transform: translate(-30%, -70%); }
.token-stack .token:nth-child(3) { transform: translate(-70%, -30%); }
.token-stack .token:nth-child(4) { transform: translate(-30%, -30%); }
.token-stack .token.selectable:hover {
  transform: translate(-50%, -60%) scale(1.15);
}

.panel-right .side-stack {
  width: 100%;
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
}

.dice-card,
.turn-card,
.you-card {
  padding: 0.95rem 1rem;
  border-radius: 12px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  text-align: center;
}

.dice-card {
  --dice-accent: #9ed9c0;
  position: relative;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.dice-card[data-color="red"] { --dice-accent: #ff7a7a; }
.dice-card[data-color="green"] { --dice-accent: #6fd99a; }
.dice-card[data-color="yellow"] { --dice-accent: #f0d56a; }
.dice-card[data-color="blue"] { --dice-accent: #7eb6ff; }

/* Cor de quem está na vez — sempre visível no card do dado */
.dice-card[data-color]:not([data-color=""]) {
  border-color: color-mix(in srgb, var(--dice-accent) 50%, rgba(255, 255, 255, 0.18));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--dice-accent) 28%, transparent),
    0 10px 24px rgba(0, 0, 0, 0.22),
    0 0 18px color-mix(in srgb, var(--dice-accent) 16%, transparent);
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--dice-accent) 16%, rgba(255, 255, 255, 0.06)), rgba(255, 255, 255, 0.02));
}

.dice-card[data-color]:not([data-color=""]) .side-label {
  color: color-mix(in srgb, var(--dice-accent) 72%, white);
}

.dice-card[data-color]:not([data-color=""]) .dice-hint {
  color: color-mix(in srgb, var(--dice-accent) 78%, white);
}

.dice-card.is-my-turn {
  border-color: color-mix(in srgb, var(--dice-accent) 62%, rgba(255, 255, 255, 0.22));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--dice-accent) 35%, transparent),
    0 12px 28px rgba(0, 0, 0, 0.24),
    0 0 26px color-mix(in srgb, var(--dice-accent) 22%, transparent);
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--dice-accent) 20%, rgba(255, 255, 255, 0.06)), rgba(255, 255, 255, 0.02));
}

.dice-card.can-roll {
  animation: diceCardPulse 1.4s ease-in-out infinite;
}

.dice-card.can-roll .dice:not(:disabled) {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 8px 20px rgba(0, 0, 0, 0.22),
    0 0 0 2px color-mix(in srgb, var(--dice-accent) 40%, transparent),
    0 0 18px 2px color-mix(in srgb, var(--dice-accent) 30%, transparent);
}

.dice-card.can-pick {
  border-color: color-mix(in srgb, var(--dice-accent) 55%, rgba(255, 255, 255, 0.18));
}

.dice-turn-badge {
  margin: -0.15rem 0 0.45rem;
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #101814;
  background: color-mix(in srgb, var(--dice-accent) 82%, white);
}

.dice-card:not(.is-my-turn) .dice-turn-badge {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.01em;
}

@keyframes diceCardPulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--dice-accent) 22%, transparent),
      0 10px 24px rgba(0, 0, 0, 0.22);
  }
  50% {
    box-shadow:
      0 0 0 2px color-mix(in srgb, var(--dice-accent) 45%, transparent),
      0 12px 28px rgba(0, 0, 0, 0.26),
      0 0 22px color-mix(in srgb, var(--dice-accent) 18%, transparent);
  }
}

.side-label {
  margin: 0 0 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--muted);
}

.dice-card.is-my-turn .dice-hint {
  font-weight: 600;
}

.dice {
  --size: clamp(86px, 9.5vw, 112px);
  --cube-ratio: 0.74;
  --face-z: calc(var(--size) * var(--cube-ratio) * 0.5);
  --pip: #1c1712;
  --face: linear-gradient(148deg, #fffef9 0%, #f4ebe0 46%, #dccfbf 100%);
  --face-border: rgba(40, 28, 16, 0.14);
  --spin-x: 1080deg;
  --spin-y: 1440deg;
  --spin-z: 360deg;
  --land-x: -18deg;
  --land-y: 28deg;
  --land-z: -8deg;
  --roll-ms: 1200ms;
  position: relative;
  width: var(--size);
  height: var(--size);
  margin: 0 auto;
  border: none;
  border-radius: 18px;
  background:
    radial-gradient(ellipse 70% 40% at 50% 88%, rgba(0, 0, 0, 0.38), transparent 70%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.2));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 10px 24px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  display: grid;
  place-items: center;
  perspective: 860px;
  overflow: visible;
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.dice-mount {
  display: none;
  position: absolute;
  inset: 10%;
  z-index: 2;
  pointer-events: none;
}

.dice.is-webgl .dice-mount {
  display: block;
}

.dice.is-webgl {
  background:
    radial-gradient(ellipse 75% 45% at 50% 90%, rgba(0, 0, 0, 0.28), transparent 72%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.14));
}

.dice.is-webgl .dice-scene {
  visibility: hidden;
  pointer-events: none;
}

.dice.is-webgl .dice-floor {
  display: none;
}

.dice-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  pointer-events: none;
}

.dice-floor {
  display: block;
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: 7%;
  height: 16%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.42), transparent 72%);
  filter: blur(5px);
  z-index: 0;
  pointer-events: none;
  transform: scaleX(1);
  opacity: 0.7;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.dice.rolling .dice-floor {
  animation: diceFloorPulse var(--roll-ms, 1.2s) ease-in-out;
}

.dice:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 14px 30px rgba(0, 0, 0, 0.3);
}

.dice:not(:disabled):active {
  transform: translateY(1px) scale(0.98);
}

.dice:disabled {
  cursor: not-allowed;
  filter: grayscale(0.15) brightness(0.94);
  opacity: 0.88;
}

.dice-scene {
  width: calc(var(--cube-ratio) * 100%);
  height: calc(var(--cube-ratio) * 100%);
  perspective: 980px;
  perspective-origin: 50% 42%;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  transform-style: preserve-3d;
}

.dice-cube {
  --s: 100%;
  width: var(--s);
  height: var(--s);
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(var(--land-x)) rotateY(var(--land-y)) rotateZ(var(--land-z));
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
  /* NÃO usar filter aqui — achata o preserve-3d e some com as faces laterais */
}

.dice.rolling .dice-cube {
  transition: none !important;
  animation: diceTumblePro var(--roll-ms, 1.2s) cubic-bezier(0.16, 0.72, 0.18, 1) forwards;
}

.dice.dice-land .dice-cube {
  animation: diceSettle 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dice-side {
  position: absolute;
  inset: 0;
  background: var(--face);
  border-radius: 16%;
  border: 1.5px solid var(--face-border);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.85),
    inset 0 -10px 16px rgba(40, 28, 16, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.28);
  display: grid;
  place-items: center;
  backface-visibility: hidden;
}

.dice-side::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 12%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  pointer-events: none;
}

.dice-side::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 45%, rgba(0, 0, 0, 0.08) 100%);
  pointer-events: none;
}

.dice-side .pip {
  width: 15.5%;
  height: 15.5%;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #4a3a2e, var(--pip) 58%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.28),
    0 1.5px 2px rgba(0, 0, 0, 0.28);
  opacity: 1;
  z-index: 1;
}

.dice-side[data-face="1"] {
  transform: translateZ(var(--face-z));
}
.dice-side[data-face="1"] .pip {
  width: 22%;
  height: 22%;
}

.dice-side[data-face="2"] {
  transform: rotateY(180deg) translateZ(var(--face-z));
}
.dice-side[data-face="2"] .pip:nth-child(1) { position: absolute; top: 16%; left: 16%; }
.dice-side[data-face="2"] .pip:nth-child(2) { position: absolute; bottom: 16%; right: 16%; }

.dice-side[data-face="3"] {
  transform: rotateY(90deg) translateZ(var(--face-z));
}
.dice-side[data-face="3"] .pip:nth-child(1) { position: absolute; top: 14%; left: 14%; }
.dice-side[data-face="3"] .pip:nth-child(2) { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.dice-side[data-face="3"] .pip:nth-child(3) { position: absolute; bottom: 14%; right: 14%; }

.dice-side[data-face="4"] {
  transform: rotateY(-90deg) translateZ(var(--face-z));
}
.dice-side[data-face="4"] .pip:nth-child(1) { position: absolute; top: 16%; left: 16%; }
.dice-side[data-face="4"] .pip:nth-child(2) { position: absolute; top: 16%; right: 16%; }
.dice-side[data-face="4"] .pip:nth-child(3) { position: absolute; bottom: 16%; left: 16%; }
.dice-side[data-face="4"] .pip:nth-child(4) { position: absolute; bottom: 16%; right: 16%; }

.dice-side[data-face="5"] {
  transform: rotateX(90deg) translateZ(var(--face-z));
}
.dice-side[data-face="5"] .pip:nth-child(1) { position: absolute; top: 14%; left: 14%; }
.dice-side[data-face="5"] .pip:nth-child(2) { position: absolute; top: 14%; right: 14%; }
.dice-side[data-face="5"] .pip:nth-child(3) { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.dice-side[data-face="5"] .pip:nth-child(4) { position: absolute; bottom: 14%; left: 14%; }
.dice-side[data-face="5"] .pip:nth-child(5) { position: absolute; bottom: 14%; right: 14%; }

.dice-side[data-face="6"] {
  transform: rotateX(-90deg) translateZ(var(--face-z));
}
.dice-side[data-face="6"] .pip:nth-child(1) { position: absolute; top: 12%; left: 18%; }
.dice-side[data-face="6"] .pip:nth-child(2) { position: absolute; top: 12%; right: 18%; }
.dice-side[data-face="6"] .pip:nth-child(3) { position: absolute; top: 50%; left: 18%; transform: translateY(-50%); }
.dice-side[data-face="6"] .pip:nth-child(4) { position: absolute; top: 50%; right: 18%; transform: translateY(-50%); }
.dice-side[data-face="6"] .pip:nth-child(5) { position: absolute; bottom: 12%; left: 18%; }
.dice-side[data-face="6"] .pip:nth-child(6) { position: absolute; bottom: 12%; right: 18%; }

.dice-cube[data-value="1"] { transform: rotateX(-18deg) rotateY(28deg) rotateZ(-8deg); }
.dice-cube[data-value="2"] { transform: rotateX(-18deg) rotateY(208deg) rotateZ(6deg); }
.dice-cube[data-value="3"] { transform: rotateX(-22deg) rotateY(-62deg) rotateZ(-4deg); }
.dice-cube[data-value="4"] { transform: rotateX(-16deg) rotateY(118deg) rotateZ(10deg); }
.dice-cube[data-value="5"] { transform: rotateX(-108deg) rotateY(32deg) rotateZ(-6deg); }
.dice-cube[data-value="6"] { transform: rotateX(72deg) rotateY(22deg) rotateZ(8deg); }

.dice-hint {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  min-height: 1.2em;
}

/* —— Dados premium —— */
.dice[data-style="studio"] {
  --cube-ratio: 0.72;
  --pip: #1a2740;
  --face: linear-gradient(145deg, #ffffff 0%, #f3f6fb 42%, #d9e0ea 100%);
  --face-border: rgba(30, 45, 70, 0.16);
}

.dice[data-style="studio"] .dice-side {
  border-radius: 18%;
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.95),
    inset 0 -10px 16px rgba(40, 60, 90, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.35);
}

.dice[data-style="studio"] .dice-side .pip {
  width: 15%;
  height: 15%;
  background: radial-gradient(circle at 35% 30%, #3a4f73, var(--pip) 60%);
}

.dice[data-style="onyx"] {
  --cube-ratio: 0.72;
  --pip: #e8c36a;
  --face: linear-gradient(150deg, #3a3a42 0%, #1c1c22 48%, #0e0e12 100%);
  --face-border: rgba(232, 195, 106, 0.28);
}

.dice[data-style="onyx"] .dice-side {
  border-radius: 16%;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.12),
    inset 0 -12px 18px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(232, 195, 106, 0.08);
}

.dice[data-style="onyx"] .dice-side::before {
  border-color: rgba(232, 195, 106, 0.16);
}

.dice[data-style="onyx"] .dice-side .pip {
  width: 14.5%;
  height: 14.5%;
  background: radial-gradient(circle at 32% 28%, #ffe7a8, var(--pip) 55%, #b8892e);
  box-shadow:
    0 0 6px rgba(232, 195, 106, 0.45),
    inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

@keyframes diceTumblePro {
  0% {
    transform:
      rotateX(calc(var(--land-x) - 40deg))
      rotateY(calc(var(--land-y) - 30deg))
      rotateZ(var(--land-z))
      translateY(0) scale(1);
  }
  12% {
    transform:
      rotateX(calc(var(--spin-x) * 0.18))
      rotateY(calc(var(--spin-y) * -0.12))
      rotateZ(calc(var(--spin-z) * 0.2))
      translateY(-28px) scale(1.1);
  }
  28% {
    transform:
      rotateX(calc(var(--spin-x) * 0.38))
      rotateY(calc(var(--spin-y) * 0.28))
      rotateZ(calc(var(--spin-z) * -0.15))
      translateY(-10px) scale(1.02);
  }
  46% {
    transform:
      rotateX(calc(var(--spin-x) * 0.62))
      rotateY(calc(var(--spin-y) * 0.55))
      rotateZ(calc(var(--spin-z) * 0.35))
      translateY(-36px) scale(1.12);
  }
  64% {
    transform:
      rotateX(calc(var(--spin-x) * 0.82))
      rotateY(calc(var(--spin-y) * 0.78))
      rotateZ(calc(var(--spin-z) * -0.1))
      translateY(-6px) scale(0.97);
  }
  82% {
    transform:
      rotateX(calc(var(--spin-x) * 0.94))
      rotateY(calc(var(--spin-y) * 0.92))
      rotateZ(calc(var(--spin-z) * 0.08))
      translateY(-18px) scale(1.05);
  }
  100% {
    transform:
      rotateX(calc(var(--spin-x) + var(--land-x)))
      rotateY(calc(var(--spin-y) + var(--land-y)))
      rotateZ(calc(var(--spin-z) + var(--land-z)))
      translateY(0) scale(1);
  }
}

@keyframes diceSettle {
  0% {
    transform:
      rotateX(var(--land-x)) rotateY(var(--land-y)) rotateZ(var(--land-z))
      translateY(-4px) scale(1.05);
  }
  55% {
    transform:
      rotateX(var(--land-x)) rotateY(var(--land-y)) rotateZ(var(--land-z))
      translateY(2px) scale(0.97);
  }
  100% {
    transform:
      rotateX(var(--land-x)) rotateY(var(--land-y)) rotateZ(var(--land-z))
      translateY(0) scale(1);
  }
}

@keyframes diceFloorPulse {
  0%, 100% { transform: scaleX(1); opacity: 0.7; }
  18% { transform: scaleX(0.68); opacity: 0.28; }
  42% { transform: scaleX(0.88); opacity: 0.45; }
  62% { transform: scaleX(0.64); opacity: 0.24; }
  100% { transform: scaleX(1); opacity: 0.7; }
}

.turn-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.turn-next {
  margin: 0.2rem 0 0;
  color: color-mix(in srgb, var(--muted) 88%, #e8c48a);
  font-size: 0.78rem;
  line-height: 1.25;
}

.turn-timer {
  margin: 0.25rem 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: #9ed9c0;
}

.turn-card.timer-urgent .turn-timer {
  color: #ff8f6b;
}

.turn-card.timer-pulse {
  animation: turnUrgentPulse 0.55s ease-in-out infinite;
}

@keyframes turnUrgentPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 120, 80, 0.0);
    border-color: rgba(255, 143, 107, 0.55);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 120, 80, 0.18);
    border-color: rgba(255, 143, 107, 0.95);
    background: color-mix(in srgb, #ff8f6b 12%, rgba(0, 0, 0, 0.18));
  }
}

.dice.timer-urgent {
  animation: diceUrgentPulse 0.55s ease-in-out infinite;
}

@keyframes diceUrgentPulse {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.18); transform: scale(1.04); }
}

.turn-card[data-color="red"] .turn-name { color: #ff7a7a; }
.turn-card[data-color="green"] .turn-name { color: #6fd99a; }
.turn-card[data-color="yellow"] .turn-name { color: #f0d56a; }
.turn-card[data-color="blue"] .turn-name { color: #7eb6ff; }

.turn-msg {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #3ecf8e, #2a9f6a);
  color: #062015;
  box-shadow: 0 10px 24px rgba(46, 180, 120, 0.28);
}

.btn-primary:not(:disabled):hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-ghost:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.1);
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 55;
  overflow: hidden;
  opacity: 0;
}

.confetti-layer.is-active {
  opacity: 1;
}

.confetti-piece {
  position: absolute;
  display: block;
  background: var(--c, #fff);
  width: 8px;
  height: 12px;
  border-radius: 1px;
  transform: translate3d(0, 0, 0) rotate(0deg) scale(var(--s, 1));
  animation: confettiFall var(--t, 2s) var(--d, 0s) cubic-bezier(0.16, 0.7, 0.3, 1) forwards;
  will-change: transform, opacity;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.confetti-piece.shape-circle {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.confetti-piece.shape-ribbon {
  width: 3px;
  height: 14px;
  border-radius: 2px;
}

@keyframes confettiFall {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(var(--s, 1));
  }
  8% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--x), var(--y), 0) rotate(var(--r)) scale(calc(var(--s, 1) * 0.75));
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  background: rgba(12, 24, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  font-size: 0.9rem;
  z-index: 40;
  animation: toastIn 0.35s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 10, 8, 0.72);
  backdrop-filter: blur(8px);
  z-index: 50;
}

.modal[hidden],
.toast[hidden] {
  display: none !important;
}

.modal-card {
  width: min(92vw, 420px);
  padding: 2rem 1.6rem;
  border-radius: 22px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(62, 207, 142, 0.18), transparent 55%),
    linear-gradient(180deg, #1a2e28, #101c18);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  animation: boardIn 0.45s ease;
}

.modal-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: var(--muted);
}

.modal-title {
  margin: 0.5rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.modal-text {
  margin: 0 0 1.4rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  body { overflow: auto; }

  .app {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
    padding:
      max(0.45rem, env(safe-area-inset-top))
      max(0.55rem, env(safe-area-inset-right))
      max(0.7rem, env(safe-area-inset-bottom))
      max(0.55rem, env(safe-area-inset-left));
    gap: 0.4rem;
    grid-template-rows: auto auto;
  }

  .topbar {
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
  }

  .topbar-left {
    min-width: 0;
    flex: 1 1 auto;
  }

  .brand {
    font-size: clamp(1.4rem, 6.5vw, 1.85rem);
  }

  .tagline {
    font-size: 0.72rem;
  }

  .topbar-actions {
    flex-shrink: 1;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.28rem;
  }

  .topbar-actions .btn-sm {
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
  }

  .music-volume-game {
    max-width: 4.2rem;
  }

  .stage {
    --side: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    height: auto;
    min-height: 0;
    /* Sem container query: no mobile a altura é auto */
    container-type: normal;
    /* Espaço para a aba do chat fixa embaixo */
    padding-bottom: calc(2.85rem + env(safe-area-inset-bottom, 0px));
  }

  .panel {
    position: static;
    transform: none;
    width: 100%;
    max-height: none;
    height: auto;
    overflow: visible;
  }

  /* Sem placar no mobile — mais espaço para o tabuleiro */
  .panel-left {
    display: none !important;
  }

  .chat-banner {
    top: max(3.8rem, calc(env(safe-area-inset-top) + 3.2rem));
    max-width: min(94vw, 360px);
    font-size: 0.8rem;
  }

  .join-banner {
    top: max(0.75rem, env(safe-area-inset-top));
    width: min(94vw, 380px);
    padding: 0.75rem 0.95rem;
  }

  .join-banner-copy {
    font-size: 0.95rem;
  }

  .join-banner-copy strong {
    font-size: 1rem;
  }

  .chat-shell {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: min(58dvh, 420px);
    border-radius: 18px 18px 0 0;
    transform: translateY(calc(100% - 2.35rem));
    transition: transform 0.28s ease;
    z-index: 80;
    box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.35);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .chat-shell.is-open {
    transform: translateY(0);
  }

  .chat-handle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.45rem 0.75rem 0.35rem;
    cursor: grab;
    touch-action: none;
    user-select: none;
  }

  .chat-handle-bar {
    width: 2.6rem;
    height: 0.28rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
  }

  .chat-handle-label {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .chat-log {
    max-height: 34dvh;
  }

  .chat-form {
    padding-bottom: max(0.45rem, env(safe-area-inset-bottom, 0px));
  }

  .chat-form input {
    font-size: 16px; /* evita zoom automático no iOS */
  }

  .board-wrap {
    order: 1;
    /* Cabe na tela com topbar + dado/turno + aba do chat */
    width: min(
      100%,
      calc(100vw - 0.9rem),
      calc(100dvh - 15.5rem)
    );
    max-width: 100%;
    max-height: none;
    margin-inline: auto;
    aspect-ratio: 1;
    overflow: visible;
  }

  .board {
    width: 100%;
    height: 100%;
    overflow: visible;
  }

  /* Toque mais confortável nos peões (só mobile) */
  .token.is-mesh {
    width: 96%;
  }

  .token.is-mesh.in-yard,
  .token.is-loading.in-yard {
    width: 124%;
  }

  .token.selectable,
  .token.is-mesh.selectable {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .panel-right {
    order: 2;
    flex-direction: column;
    align-items: stretch;
    /* Acima da aba do chat */
    margin-bottom: 0.15rem;
  }

  .side-stack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
  }

  .you-card {
    display: none !important;
  }

  /* Vez de — faixa compacta */
  .turn-card {
    padding: 0.28rem 0.6rem 0.32rem;
    text-align: center;
    border-radius: 10px;
  }

  .turn-card .side-label {
    margin: 0 0 0.05rem;
    font-size: 0.54rem;
    letter-spacing: 0.1em;
  }

  .turn-name {
    margin: 0;
    font-size: clamp(0.82rem, 3.4vw, 0.98rem);
    font-weight: 700;
    line-height: 1.1;
  }

  .turn-next {
    margin: 0.06rem 0 0;
    font-size: 0.62rem;
    line-height: 1.15;
  }

  .turn-timer {
    margin: 0.05rem 0 0;
    font-size: 0.9rem;
  }

  .turn-msg {
    margin: 0.08rem 0 0;
    font-size: 0.68rem;
    line-height: 1.2;
  }

  /* Dado: estável no mobile, animação suave */
  .dice-card {
    padding: 0.55rem 0.65rem 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-radius: 12px;
    overflow: visible;
  }

  .dice-card .side-label {
    margin: 0 0 0.25rem;
    font-size: 0.54rem;
  }

  .dice-card .dice {
    --size: clamp(78px, 21vw, 96px);
    --cube-ratio: 0.74;
    margin: 0;
    border-radius: 15px;
    perspective: 640px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    overflow: visible;
  }

  .dice-card .dice.is-webgl .dice-mount {
    inset: 8%;
  }

  .dice-card .dice-scene {
    perspective: 720px;
  }

  .dice-card .dice-floor {
    display: block;
    bottom: 6%;
    height: 14%;
    opacity: 0.65;
  }

  .dice-card .dice:not(:disabled) {
    animation: none;
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.12),
      0 8px 16px rgba(0, 0, 0, 0.24);
  }

  .dice-card .dice:not(:disabled):active {
    transform: scale(0.96);
  }

  .dice-card .dice.rolling {
    animation: none;
  }

  .dice-card .dice.rolling .dice-cube {
    animation: diceTumblePro var(--roll-ms, 1.05s) cubic-bezier(0.18, 0.72, 0.2, 1) forwards;
  }

  .dice-card .dice.dice-land .dice-cube {
    animation: diceSettle 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .dice-card .dice:disabled {
    opacity: 0.78;
    filter: grayscale(0.15) brightness(0.94);
  }

  .dice-hint {
    margin: 0.3rem 0 0;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--ink);
    min-height: 1em;
  }

  .toast {
    /* Acima da aba do chat */
    bottom: max(3.4rem, calc(env(safe-area-inset-bottom, 0px) + 3rem));
    max-width: calc(100vw - 2rem);
    text-align: center;
    z-index: 90;
  }

  .modal-card {
    width: min(100%, 420px);
    margin: 0.75rem;
    padding: 1.25rem 1.1rem;
  }
}

/* Landscape no celular: tabuleiro não estoura a altura */
@media (max-width: 900px) and (orientation: landscape) {
  .board-wrap {
    width: min(
      52dvh,
      calc(100vw - 12rem),
      calc(100dvh - 2.2rem)
    );
  }

  .stage {
    padding-bottom: calc(2.4rem + env(safe-area-inset-bottom, 0px));
  }

  .panel-right {
    max-width: min(100%, 20rem);
    margin-inline: auto;
  }
}

@keyframes diceInvite {
  0%, 100% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.14),
      0 10px 24px rgba(0, 0, 0, 0.28),
      0 0 0 0 rgba(127, 217, 176, 0);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.18),
      0 12px 28px rgba(0, 0, 0, 0.32),
      0 0 0 6px rgba(127, 217, 176, 0.18);
  }
}

@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .dice-card .dice:not(:disabled) {
    animation: none;
  }
  .dice-card .dice.rolling .dice-cube {
    animation: none;
  }
  .dice-card .dice.dice-land .dice-cube {
    animation: none;
  }
}

@media (max-width: 700px) {
  .board-wrap {
    width: min(
      100%,
      calc(100vw - 0.7rem),
      calc(100dvh - 14.8rem)
    );
  }

  .dice-card .dice {
    --size: clamp(76px, 20vw, 92px);
  }

  .topbar-actions .btn-sm {
    padding: 0.4rem 0.55rem;
    font-size: 0.74rem;
  }
}

@media (max-width: 380px) {
  .topbar-actions #leaveGameBtn {
    padding-inline: 0.55rem;
  }

  .turn-name {
    font-size: 0.8rem;
  }

  .dice-hint {
    font-size: 0.72rem;
  }
}

/* —— Menu & Lobby —— */
.screen {
  position: relative;
  z-index: 1;
}

.screen[hidden] {
  display: none !important;
}

#screenMenu,
#screenLobby {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 2rem);
}

#screenMenu[hidden],
#screenLobby[hidden] {
  display: none !important;
}

.menu-shell {
  width: min(100%, 520px);
  display: grid;
  gap: 1.6rem;
  animation: boardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.menu-hero {
  text-align: center;
}

.menu-eyebrow {
  margin: 0 0 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--muted);
}

.menu-brand {
  font-size: clamp(3.4rem, 12vw, 5.5rem) !important;
  margin-bottom: 0.55rem;
}

.menu-lead {
  margin: 0 auto;
  max-width: 34rem;
  color: var(--muted);
  line-height: 1.5;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
}

.menu-panel {
  padding: 1.35rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.avatar-picker {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar-preview {
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.12), transparent 50%),
    rgba(0, 0, 0, 0.3);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-preview span {
  font-size: 1.4rem;
}

.avatar-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
}

.avatar-hint {
  margin: 0.15rem 0 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.avatar-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.avatar-upload-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.seat-avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--accent) 55%, white);
  flex-shrink: 0;
}

.seat-avatar-empty {
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 40%, #111);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
}

.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.field.grow {
  flex: 1;
  margin-bottom: 0;
}

.field span {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  border-color: color-mix(in srgb, #3ecf8e 60%, white);
  box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.18);
}

#roomCode {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-align: center;
}

.dice-picker {
  margin: 0 0 0.85rem;
  padding: 0;
  border: none;
  min-width: 0;
}

.dice-picker legend {
  padding: 0;
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.dice-picker-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.dice-option {
  cursor: pointer;
  min-width: 0;
}

.dice-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dice-option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.4rem 0.55rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  text-align: center;
  min-height: 100%;
}

.dice-option input:checked + .dice-option-card {
  border-color: color-mix(in srgb, #7fd9b0 65%, white);
  background: rgba(127, 217, 176, 0.1);
  box-shadow: 0 0 0 1px rgba(127, 217, 176, 0.2);
}

.dice-option:hover .dice-option-card {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
}

.dice-option-copy {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.dice-option-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: -0.01em;
}

.dice-option-desc {
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.2;
}

.dice-mini {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.55rem;
  display: grid;
  place-items: center;
  transform: rotateX(18deg) rotateY(-22deg);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.28);
}

.dice-mini-face {
  width: 78%;
  height: 78%;
  border-radius: 22%;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.dice-mini-face::before,
.dice-mini-face::after {
  content: "";
  position: absolute;
  width: 18%;
  height: 18%;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.dice-mini[data-preview="classic"] {
  background: linear-gradient(145deg, #4a3422, #23170e);
}

.dice-mini[data-preview="classic"] .dice-mini-face {
  background: linear-gradient(145deg, #fffdf8, #e7ddd0);
}

.dice-mini[data-preview="classic"] .dice-mini-face::before {
  background: #1c1712;
}

.dice-mini[data-preview="studio"] {
  background: linear-gradient(145deg, #2a3548, #121820);
}

.dice-mini[data-preview="studio"] .dice-mini-face {
  background: linear-gradient(145deg, #ffffff, #d9e0ea);
  border-radius: 28%;
}

.dice-mini[data-preview="studio"] .dice-mini-face::before {
  background: #1a2740;
  box-shadow:
    calc(-28%) calc(-28%) 0 #1a2740,
    calc(28%) calc(28%) 0 #1a2740;
  width: 16%;
  height: 16%;
}

.dice-mini[data-preview="onyx"] {
  background: linear-gradient(145deg, #2a2418, #0c0c10);
}

.dice-mini[data-preview="onyx"] .dice-mini-face {
  background: linear-gradient(150deg, #3a3a42, #0e0e12);
  box-shadow: inset 0 0 0 1px rgba(232, 195, 106, 0.25);
}

.dice-mini[data-preview="onyx"] .dice-mini-face::before {
  background: radial-gradient(circle at 30% 30%, #ffe7a8, #e8c36a);
  box-shadow: 0 0 6px rgba(232, 195, 106, 0.5);
}

.menu-actions {
  display: grid;
  gap: 0.55rem;
}

.lobby-local {
  display: flex;
  gap: 0.65rem;
  align-items: end;
  margin: 0 0 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.lobby-local .field {
  margin: 0;
}

.seat-remove {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.72rem;
  padding: 0.28rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
}

.seat-remove:hover {
  color: #ffb0b0;
  background: rgba(255, 80, 80, 0.12);
}

.menu-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin: 1.1rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.open-rooms {
  margin: 0 0 0.9rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.open-rooms-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.open-rooms-title {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.open-rooms-list {
  display: grid;
  gap: 0.4rem;
}

.open-room-card {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.open-room-card:hover {
  border-color: color-mix(in srgb, #7fd9b0 55%, white);
  background: rgba(127, 217, 176, 0.08);
  transform: translateY(-1px);
}

.open-room-card.is-playing {
  border-color: rgba(232, 176, 92, 0.35);
}

.open-room-card.is-playing:hover {
  border-color: color-mix(in srgb, #e8b05c 60%, white);
  background: rgba(232, 176, 92, 0.1);
}

.open-room-card.is-playing .open-room-code {
  color: #e8c48a;
}

.open-room-card.is-playing .open-room-cta {
  color: #e8c48a;
}

.open-room-code {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
  color: #9ed9c0;
}

.open-room-meta {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.open-room-host {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.open-room-seats {
  font-size: 0.72rem;
  color: var(--muted);
}

.open-room-cta {
  font-size: 0.75rem;
  font-weight: 700;
  color: #7fd9b0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.menu-divider::before,
.menu-divider::after {
  content: "";
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.join-row {
  display: flex;
  gap: 0.65rem;
  align-items: end;
}

.menu-status {
  margin: 0.9rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: #9ed9c0;
}

.menu-status.error {
  color: #ff8f8f;
}

.menu-audio {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin-top: 0.75rem;
}

.music-volume {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.music-volume input[type="range"] {
  width: 7.5rem;
  accent-color: #7fd9b0;
  cursor: pointer;
}

.music-volume-game {
  margin: 0;
}

.music-volume-game input[type="range"] {
  width: 4.8rem;
}

.btn-lg {
  padding: 1rem 1.2rem;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
}

.lobby-shell {
  width: min(100%, 720px);
  animation: boardIn 0.55s ease both;
}

.lobby-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.lobby-code {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  letter-spacing: 0.22em;
  font-weight: 800;
  background: linear-gradient(120deg, #f6f1e4 10%, #7fd9b0 55%, #6eb0e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lobby-top-actions {
  display: flex;
  gap: 0.5rem;
}

.lobby-hint {
  margin: 0 0 1.2rem;
  color: var(--muted);
}

.lobby-seats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.3rem;
}

.seat {
  position: relative;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.seat[data-color="red"] { --accent: var(--red); }
.seat[data-color="green"] { --accent: var(--green); }
.seat[data-color="yellow"] { --accent: var(--yellow); }
.seat[data-color="blue"] { --accent: var(--blue); }

.seat.you {
  border-color: color-mix(in srgb, var(--accent) 65%, white);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

.seat.seat-just-joined {
  border-color: color-mix(in srgb, var(--accent) 75%, white);
  background: color-mix(in srgb, var(--accent) 16%, rgba(255, 255, 255, 0.05));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent),
    0 10px 28px color-mix(in srgb, var(--accent) 22%, transparent);
  animation: seatJoinFlash 1.8s ease-out 1;
}

.seat.empty {
  opacity: 0.55;
  border-style: dashed;
}

@keyframes seatJoinFlash {
  0% {
    transform: scale(1.03);
    box-shadow:
      0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent),
      0 10px 28px color-mix(in srgb, var(--accent) 22%, transparent);
  }
  100% {
    transform: scale(1);
  }
}

.seat-swatch {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 55%, transparent);
  flex-shrink: 0;
}

.seat-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.seat-meta {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.lobby-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 0 0;
}

.lobby-role {
  margin: 0;
  color: var(--muted);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.topbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn[aria-pressed="true"] {
  opacity: 0.65;
}

.you-card[data-color="red"] { --accent: var(--red); }
.you-card[data-color="green"] { --accent: var(--green); }
.you-card[data-color="yellow"] { --accent: var(--yellow); }
.you-card[data-color="blue"] { --accent: var(--blue); }

.you-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.you-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent),
    0 2px 6px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.you-color {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

@media (max-width: 700px) {
  .dice-picker-options {
    grid-template-columns: 1fr;
  }

  .dice-option-card {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    padding: 0.55rem 0.7rem;
    gap: 0.7rem;
  }

  .dice-option-copy {
    gap: 0.05rem;
  }

  .lobby-local {
    flex-direction: column;
    align-items: stretch;
  }

  .lobby-seats {
    grid-template-columns: 1fr;
  }

  .join-row {
    flex-direction: column;
    align-items: stretch;
  }

  .lobby-top {
    align-items: start;
  }

  .lobby-top-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .lobby-top-actions .btn {
    flex: 1 1 auto;
  }

  .lobby-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .lobby-code {
    letter-spacing: 0.14em;
    font-size: clamp(2rem, 11vw, 2.8rem);
  }

  .menu-actions {
    gap: 0.45rem;
  }

  .menu-panel {
    padding: 1.1rem;
  }

  .btn-lg {
    padding: 0.95rem 1rem;
    font-size: 1rem;
  }
}
