/* Estilos comunes: tema, barra de navegación, botones, avisos y efectos. */
:root {
  --bg: #15110c;
  --bg-2: #1e1811;
  --panel: #2a2117;
  --panel-2: #33281b;
  --slot: #3b2f22;
  --slot-border: #5a4630;
  --slot-hover: #c9a45c;
  --text: #eadcc0;
  --muted: #a8977a;
  --accent: #e0b35a;
  --accent-2: #ffd98a;
  --good: #8fcf6a;
  --bad: #e07a5a;
  --even: #2f6fc4;
  --odd: #b8322f;
  --discord: #5865f2;
  --nav-h: 60px;
  --display: "Cinzel", Georgia, serif;
}

* { box-sizing: border-box; }
/* Las sacudidas de pantalla no deben provocar desplazamiento horizontal */
html { overflow-x: clip; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -10%, #3a2a16 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.5 system-ui, "Segoe UI", sans-serif;
}

a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); }

/* ---------- Barra de navegación ---------- */
#topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  background: linear-gradient(#2b2015, #1d160e);
  border-bottom: 2px solid var(--slot-border);
  box-shadow: 0 4px 16px #0008;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.brand img { width: 38px; height: 38px; border-radius: 8px; border: 1px solid #d9a44188; }
.nav-links { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav-links a {
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nav-links a:hover { background: #ffffff10; }
.nav-links a.active { background: #e0b35a22; color: var(--accent-2); }
.nav-user { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.nav-user .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--slot); object-fit: cover; }

.balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 6px;
  border-radius: 20px;
  background: #00000055;
  border: 1px solid var(--slot-border);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #e6e9ee;
}
button.balance { font: inherit; font-weight: 700; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
button.balance:hover { border-color: var(--accent); box-shadow: 0 0 12px #e0b35a55; }
button.balance:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.balance.bump { animation: bump .5s; }
@keyframes bump { 40% { transform: scale(1.15); box-shadow: 0 0 14px var(--accent); } }

/* Saldo con el botón "+" para pedir un depósito y el aviso de depósito pendiente */
.balance-group { display: inline-flex; align-items: center; gap: 6px; }
.balance-group [hidden] { display: none !important; }
/* Fichas fantasma (incluidas en el saldo): chapa espectral dentro del botón del saldo */
.phantom-chip {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 2px; padding: 1px 7px 1px 5px; border-radius: 12px;
  font-style: normal; font-size: 12px; color: #c9f4ff; background: rgba(120, 220, 255, 0.14);
  border: 1px solid rgba(140, 230, 255, 0.45); box-shadow: 0 0 8px rgba(120, 220, 255, 0.25) inset;
  animation: phantom-glow 2.6s ease-in-out infinite;
}
@keyframes phantom-glow { 50% { box-shadow: 0 0 12px rgba(120, 220, 255, 0.55) inset, 0 0 8px rgba(120, 220, 255, 0.35); } }
.wallet-phantom { display: grid; gap: 6px; margin: -6px 0 14px; }
.wallet-phantom > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 8px 10px; border-radius: 10px; background: #00000033; }
.wallet-phantom > span:last-child { border: 1px solid rgba(140, 230, 255, 0.45); background: rgba(120, 220, 255, 0.08); color: #c9f4ff; }
.wallet-phantom small { flex-basis: 100%; }
@media (max-width: 520px) { .phantom-chip { font-size: 11px; padding: 1px 5px 1px 3px; } }
.deposit-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #f7dc9c;
  background: radial-gradient(circle at 35% 30%, #fff3c4 0 18%, transparent 19%), linear-gradient(#f3cd7a, #c08a2e);
  color: #2a1a05;
  cursor: pointer;
  box-shadow: 0 0 0 2px #00000066, 0 0 10px #e0b35a55;
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s, filter .2s;
}
.deposit-btn svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; fill: none; }
.deposit-btn:hover { transform: scale(1.14) rotate(90deg); filter: brightness(1.08); box-shadow: 0 0 0 2px #00000066, 0 0 16px #ffd98aaa; }
.deposit-btn:active { transform: scale(.94); }
.deposit-btn:focus-visible, .deposit-pending:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.deposit-pending {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 7px;
  border-radius: 20px;
  border: 1px dashed var(--accent);
  background: rgba(224, 179, 90, 0.14);
  color: var(--accent-2);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  animation: pending-glow 2.4s ease-in-out infinite;
}
.deposit-pending i { font-style: normal; display: inline-block; animation: hourglass 2.4s ease-in-out infinite; }
.deposit-pending small { color: #d8c8a8; font-weight: 600; font-size: 11px; }
@keyframes pending-glow { 50% { box-shadow: 0 0 12px #e0b35a77; background: rgba(224, 179, 90, 0.24); } }
@keyframes hourglass { 0%, 40% { transform: rotate(0); } 50%, 90% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }

/* Ficha de oro dibujada con CSS (canto con muescas y centro dorado) */
.coin {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff6c2 0 12%, transparent 13%),
    radial-gradient(circle, #ffd24a 0 46%, #a8741c 47% 52%, transparent 53%),
    repeating-conic-gradient(#e0a12a 0 15deg, #fff2a8 15deg 30deg);
  border: 1px solid #7a5210;
  box-shadow: inset 0 0 0 1px #ffffff55, 0 0 6px #ffd24a55;
  flex: none;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--slot-border);
  border-radius: 8px;
  background: var(--slot);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .1s, filter .15s;
}
.btn:hover { filter: brightness(1.2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; transform: none; }
.btn-gold {
  background: linear-gradient(#f3cd7a, #c08a2e);
  border-color: #f7dc9c;
  color: #2a1a05;
  text-shadow: 0 1px 0 #fff6;
}
.btn-discord { background: var(--discord); border-color: #7983f5; color: #fff; }
.btn-ghost { background: transparent; }
.btn-lg { padding: 14px 28px; font-size: 17px; border-radius: 10px; }

/* ---------- Paneles y avisos ---------- */
.panel {
  background: linear-gradient(var(--panel), var(--bg-2));
  border: 1px solid var(--slot-border);
  border-radius: 12px;
  padding: 20px;
}
.disclaimer {
  margin: 32px auto 24px;
  max-width: 900px;
  padding: 12px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--slot-border);
}
.disclaimer strong { color: var(--accent); }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--slot-border);
  box-shadow: 0 6px 20px #000a;
  animation: toast-in .25s ease-out;
}
.toast.error { border-color: var(--bad); color: #ffc9b8; }
.toast.win { border-color: var(--good); color: #d8ffc4; }
@keyframes toast-in { from { transform: translateY(20px); opacity: 0; } }

.pos { color: var(--good); }
.neg { color: var(--bad); }
.muted { color: var(--muted); }

/* ---------- Efectos de celebración ---------- */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  animation: fall linear forwards;
}
.fx-coin {
  position: absolute;
  top: -40px;
  width: 30px;
  height: 30px;
  animation: fall linear forwards;
}
.fx-coin.gold {
  width: var(--size, 28px);
  height: var(--size, 28px);
  background: radial-gradient(circle at 35% 30%, #fffbe0, #ffd84a 35%, #e0a21c 70%, #9a6408 100%);
  border: 1px solid #8a5a06;
  box-shadow: inset 0 0 0 3px #f6c33a, inset 0 0 0 4px #b07a10, 0 0 8px #ffcf4a88;
}
.fx-coin.fountain { top: auto; bottom: -36px; animation: none; filter: drop-shadow(0 0 6px #ffcf4acc); }
.fx-spark {
  position: absolute; bottom: -8px; width: 6px; height: 6px; border-radius: 50%;
  background: #fffbe0; box-shadow: 0 0 8px 3px #ffd84a, 0 0 16px 6px #ff9f1c88;
}
.fx-burst {
  position: absolute; bottom: 0; width: var(--burst, 400px); height: var(--burst, 400px);
  margin-left: calc(var(--burst, 400px) / -2); transform: translateY(50%) scale(.1);
  border-radius: 50%;
  background: radial-gradient(circle, #fffbe0 0%, #ffd84aee 20%, #ff9f1c88 45%, transparent 70%);
  animation: burst .7s ease-out forwards;
}
@keyframes burst {
  25% { opacity: 1; }
  to { transform: translateY(50%) scale(1); opacity: 0; }
}
@keyframes fall {
  to { transform: translate(var(--dx, 0), 110vh) rotate(var(--rot, 720deg)); }
}
.shake { animation: shake .5s; }
@keyframes shake {
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* Menú de hamburguesa: se activa (#topnav.compact, desde common.js) cuando los enlaces no caben en
   la barra, en el móvil y también en pantallas medianas. */
.nav-toggle, .menu-only { display: none; }
.nav-toggle {
  flex: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--slot-border);
  background: var(--slot);
  cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; border-radius: 2px; background: var(--accent-2); transition: transform .2s, opacity .2s; }
#topnav.open .nav-toggle { border-color: var(--accent); box-shadow: 0 0 10px #e0b35a55; }
#topnav.open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
#topnav.open .nav-toggle span:nth-child(2) { opacity: 0; }
#topnav.open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } }

#topnav.compact .nav-toggle { display: inline-flex; }
#topnav.compact .nav-links {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  z-index: 70;
  width: min(320px, 100%);
  flex-direction: column;
  gap: 2px;
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  padding: 10px 12px 14px;
  background: linear-gradient(#2b2015, #1d160e);
  border: 2px solid var(--slot-border);
  border-top: 0;
  border-radius: 0 0 12px 0;
  box-shadow: 0 14px 28px #000c;
  animation: menu-in .18s ease-out;
}
#topnav.compact.open .nav-links { display: flex; }
#topnav.compact .nav-links a { padding: 12px 14px; font-size: 16px; border-radius: 8px; }
#topnav.compact .nav-links a.active { box-shadow: inset 3px 0 0 var(--accent); }
#topnav.compact .nav-user { margin-left: auto; }
.nav-menu-foot { align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 10px 4px 0 14px;
  border-top: 1px solid var(--slot-border); color: var(--muted); }
.nav-menu-foot .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.nav-menu-foot .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; }

@media (max-width: 760px) {
  #topnav { gap: 8px; padding: 0 10px; }
  #topnav.compact .nav-links { width: auto; right: 0; border-left: 0; border-right: 0; border-radius: 0; }
  /* En el móvil el avatar, el nombre, el sonido y "Salir" van al pie del menú. */
  #topnav.compact .menu-only { display: flex; }
  .nav-user #logout, .nav-user .avatar, .nav-user .sound-btn, .nav-user .topup { display: none; }
  .nav-user { gap: 6px; }
  .brand span { display: none; }
  .nav-user .name { display: none; }
  .guild-btn span { display: none; }
  .guild-menu { position: fixed; left: 16px; right: 16px; top: var(--nav-h); min-width: 0; }
  .deposit-pending small { display: none; }
}
/* El selector de servidor solo si se juega en más de uno */
body:not(.multi-guild) .multi-guild-only { display: none; }

/* ---------- Aviso de primera visita y cookies ---------- */
body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #000b;
  backdrop-filter: blur(4px);
  animation: fade-in .25s ease-out;
}
.modal {
  width: min(480px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  text-align: center;
  border-radius: 16px;
  border: 2px solid #d9a441;
  background: linear-gradient(var(--panel), var(--bg-2));
  box-shadow: 0 0 60px #e0b35a44, 0 20px 50px #000;
  animation: modal-in .35s cubic-bezier(.3, 1.4, .5, 1);
}
.modal-logo { width: 96px; height: 96px; border-radius: 16px; }
.modal h2 { margin: 10px 0; color: var(--accent); }
.modal p { margin: 0 0 10px; }
.modal ul { margin: 0 0 18px; padding-left: 20px; text-align: left; color: #d8c8a8; display: grid; gap: 6px; }
.modal b { color: var(--accent-2); }
/* Ventana de depósito y resultado de las solicitudes */
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.modal-actions.center { justify-content: center; }
.modal-error { color: var(--bad); margin: 8px 0 0; }
.deposit-modal { text-align: left; }
.deposit-title { display: flex; align-items: center; gap: 10px; margin-top: 0 !important; }
.coin-lg { width: 30px; height: 30px; }
.deposit-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 16px 0 14px; }
.deposit-presets button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px;
  border-radius: 10px; border: 1px solid var(--slot-border); background: var(--slot); color: var(--text);
  font: inherit; cursor: pointer; transition: transform .1s, border-color .15s, background .15s, box-shadow .15s;
}
.deposit-presets button b { font-family: var(--display); font-size: 18px; color: var(--accent-2); }
.deposit-presets button small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.deposit-presets button:hover { border-color: var(--slot-hover); transform: translateY(-1px); }
.deposit-presets button.selected { border-color: var(--accent); background: rgba(224, 179, 90, 0.18); box-shadow: inset 0 0 0 1px var(--accent), 0 0 14px #e0b35a44; }
.deposit-custom { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); }
.deposit-custom input {
  width: 96px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--slot-border); background: #0006;
  color: var(--text); font: inherit; font-weight: 700; text-align: right;
}
.deposit-custom input:focus { outline: none; border-color: var(--accent); }
.deposit-range { width: 100%; margin: 12px 0; accent-color: var(--accent); }
.deposit-summary { padding: 12px; border-radius: 10px; border: 1px solid var(--slot-border); background: #0005; text-align: center; }
.deposit-summary .arrow { color: var(--accent); margin: 0 4px; }
.deposit-summary .modal-error { margin: 0; }
.deposit-limits { margin: 12px 0 0 !important; text-align: center; font-size: 12px; }
.deposit-status { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 12px; border: 1px dashed var(--accent); background: rgba(224, 179, 90, 0.1); }
.deposit-status .hourglass { font-size: 30px; line-height: 1; animation: hourglass 2.4s ease-in-out infinite; }
.deposit-status p { margin: 6px 0 0 !important; }
.deposit-warning { margin: 12px 0 0 !important; padding: 10px 12px; border-radius: 10px; background: rgba(224, 122, 90, 0.14); border: 1px solid rgba(224, 122, 90, 0.5); }
/* Ventana del saldo: últimas jugadas y botones de depositar / retirar */
.withdraw-icon { font-size: 26px; line-height: 1; }
.wallet-balance { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 4px 0 14px; }
.wallet-balance b { font-family: var(--display); font-size: 28px; color: var(--accent-2); }
.wallet-sub { margin: 14px 0 8px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.wallet-pending, .wallet-bets { list-style: none; padding: 0 !important; margin: 0 !important; display: grid; gap: 6px; color: var(--text) !important; }
.wallet-pending li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--accent); background: rgba(224, 179, 90, 0.1); }
.wallet-pending .hourglass { display: inline-block; font-size: 16px; animation: hourglass 2.4s ease-in-out infinite; }
.wallet-bets li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 10px; background: #0004; border-left: 3px solid var(--slot-border); }
.wallet-bets li.win { border-left-color: var(--good); }
.wallet-bets li.loss { border-left-color: var(--bad); }
.w-game { display: flex; flex-direction: column; font-weight: 600; }
.w-game small { color: var(--muted); font-weight: 400; font-size: 12px; }
.w-net { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wallet-bets li.win .w-net, .w-pos { color: var(--good) !important; }
.wallet-bets li.loss .w-net, .w-neg { color: var(--bad) !important; }
.wallet-totals { display: grid; gap: 2px; margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--slot-border); background: #0005; font-size: 13px; }
.wallet-actions { justify-content: stretch; }
.wallet-actions .btn { flex: 1; }
.credit-result .result-icon { font-size: 56px; line-height: 1; animation: modal-in .5s cubic-bezier(.3, 1.6, .5, 1); }
.credit-result.ok h2 { color: var(--good); }
.credit-result.bad { border-color: var(--bad); box-shadow: 0 0 60px #e07a5a44, 0 20px 50px #000; }
.credit-result.bad h2 { color: var(--bad); }
@media (max-width: 560px) {
  .deposit-presets { grid-template-columns: repeat(3, 1fr); }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
  /* En la ventana del saldo, Retirar y Depositar siguen uno al lado del otro */
  .wallet-actions { flex-direction: row; }
  .wallet-actions .btn { width: auto; padding-left: 8px; padding-right: 8px; }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(20px) scale(.95); } }

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 150;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--slot-border);
  background: var(--panel);
  box-shadow: 0 10px 30px #000c;
  animation: toast-in .3s ease-out;
}
.cookie-banner p { margin: 0; flex: 1; font-size: 13px; }
@media (max-width: 560px) { .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; } }
.sound-btn { padding: 4px 10px; font-size: 18px; }
/* Recarga de saldo del entorno de pruebas */
/* Selector del servidor de Discord en el que se juega */
.guild-switch { position: relative; }
.guild-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; max-width: 220px; }
.guild-btn span { overflow: hidden; text-overflow: ellipsis; }
.guild-btn b { font-size: 10px; opacity: 0.7; }
.guild-btn img, .guild-menu img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex: none; }
.guild-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; flex-direction: column; gap: 4px; min-width: 260px;
  padding: 6px; background: var(--panel); border: 1px solid var(--slot-border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); white-space: normal; }
.guild-switch.open .guild-menu { display: flex; }
.guild-menu > .muted { padding: 6px 10px; }
.guild-menu button { display: flex; align-items: center; gap: 10px; text-align: left; background: transparent; color: var(--text); border: 0;
  border-radius: 6px; padding: 8px 10px; cursor: pointer; font: inherit; }
.guild-menu button:hover { background: var(--slot); }
.guild-menu button.current { background: rgba(224, 179, 90, 0.15); box-shadow: inset 3px 0 0 var(--accent); }
.guild-menu small { display: block; color: var(--muted); font-size: 12px; }
.guild-menu button:disabled { opacity: 0.55; cursor: not-allowed; }
.guild-menu button:disabled:hover { background: transparent; }
.trial-badge { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #9fb4ff;
  border: 1px solid rgba(88, 101, 242, 0.6); background: rgba(88, 101, 242, 0.18); border-radius: 999px; padding: 1px 7px; }

.topup { position: relative; }
.topup-btn { padding: 4px 10px; color: #7ee787; border-color: rgba(126, 231, 135, 0.45); }
.topup-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; flex-direction: column; gap: 4px;
  padding: 6px; background: var(--panel, #1d1712); border: 1px solid rgba(126, 231, 135, 0.4); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.topup.open .topup-menu { display: flex; }
.topup-menu button { background: rgba(126, 231, 135, 0.12); color: #c6f6cb; border: 0; border-radius: 6px; padding: 6px 14px; font-weight: 700; cursor: pointer; }
.topup-menu button:hover { background: rgba(126, 231, 135, 0.25); }

/* Pantallas anchas: los juegos se amplían para aprovechar los márgenes (todo crece en proporción).
   Las animaciones que calculan posiciones lo tienen en cuenta con App.scaleOf(). */
@media (min-width: 1500px) { main.wide-zoom { zoom: 1.12; } }
@media (min-width: 1680px) { main.wide-zoom { zoom: 1.24; } }
@media (min-width: 1860px) { main.wide-zoom { zoom: 1.36; } }
@media (min-width: 2100px) { main.wide-zoom { zoom: 1.5; } }
@media (min-width: 2500px) { main.wide-zoom { zoom: 1.75; } }


/* Espectadores de las salas multijugador (Arena, Blackjack y Ruleta): quien tiene la sala abierta sin jugar */
.spectators { margin-top: 12px; padding-top: 10px; border-top: 1px solid #ffffff1a; }
.spectators h3 { margin: 0 0 8px; font-size: 14px; color: var(--accent-2); }
.spectators h3 small { font: 600 12px system-ui; }
.spec-list { display: flex; flex-wrap: wrap; gap: 6px; }
.spec { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 10px 3px 3px; border-radius: 999px; background: #00000040;
  border: 1px solid #ffffff1f; font-size: 12px; font-weight: 600; }
.spec.me { border-color: var(--spec-c, #e0b35a); box-shadow: 0 0 8px color-mix(in srgb, var(--spec-c, #e0b35a) 40%, transparent); }
.spec img, .spec .av { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex: none; background: var(--spec-c, #e0b35a); color: #000;
  display: grid; place-items: center; font-weight: 800; font-size: 11px; }
.spec .sn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spec .sn small { color: var(--muted); font-weight: 600; }

/* Imagen del usuario en la barra: lleva a /cuenta */
.avatar-link { display: inline-flex; border-radius: 50%; transition: box-shadow .2s, transform .15s; }
.avatar-link:hover { box-shadow: 0 0 0 2px var(--accent); transform: scale(1.06); }
.avatar.avatar-ph { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(#5a3a18, #2e1c0b); color: var(--accent-2); font-weight: 800; border: 1px solid var(--slot-border); }
.nav-menu-foot a.who { text-decoration: none; }

/* Confirmación de apuestas grandes (App.confirmBet) */
.bet-confirm { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 16px; background: #000b; animation: bet-confirm-in .15s; }
@keyframes bet-confirm-in { from { opacity: 0; } }
.bet-confirm-box {
  width: min(420px, 100%); padding: 20px; border-radius: 16px; text-align: center;
  background: linear-gradient(#2a2117, #1d160e); border: 2px solid #e0a12a; box-shadow: 0 20px 50px #000c, 0 0 30px #e0a12a44;
  animation: bet-confirm-pop .25s cubic-bezier(.2, 1.5, .4, 1);
}
@keyframes bet-confirm-pop { from { transform: scale(.85); } }
.bet-confirm-icon { font-size: 34px; }
.bet-confirm-box h3 { margin: 6px 0; color: var(--accent-2); }
.bet-confirm-box p { margin: 0 0 12px; }
.bet-confirm-box p b { color: #ffe7a3; }
.bet-confirm-skip { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; font-size: 13px; cursor: pointer; }
.bet-confirm-skip small { color: var(--muted); }
.bet-confirm-skip input { accent-color: #e0a12a; width: 16px; height: 16px; }
.bet-confirm-actions { display: flex; gap: 10px; justify-content: center; }
.bet-confirm-actions .btn { min-width: 120px; }

/* ---------- Ficha de un jugador (al pulsar su imagen en las salas multijugador) ---------- */
[data-player-id] { cursor: pointer; }
img[data-player-id], .av[data-player-id], .seat-avatar[data-player-id] { transition: transform .12s, box-shadow .15s; }
img[data-player-id]:hover, .av[data-player-id]:hover, .seat-avatar[data-player-id]:hover, .spec[data-player-id]:hover img, .spec[data-player-id]:hover .av {
  transform: scale(1.12); box-shadow: 0 0 0 2px var(--accent), 0 0 12px #e0b35a88; }
[data-player-id]:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.player-modal { text-align: left; }
.pf-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.pf-head h2 { margin: 0 0 4px !important; }
.pf-avatar { width: 64px; height: 64px; flex: none; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font: 800 26px var(--display);
  background: var(--slot); color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent), 0 6px 16px #000a; }
.pf-tag { display: inline-block; margin-right: 8px; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(224, 179, 90, 0.18); border: 1px solid var(--accent); color: var(--accent-2); }
.pf-balance { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--accent); background: rgba(224, 179, 90, 0.1); }
.pf-balance div { display: flex; flex-direction: column; }
.pf-balance b { font-family: var(--display); font-size: 26px; color: var(--accent-2); }
.pf-row { display: flex; justify-content: space-between; margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: #0004; }
.pf-sub { margin: 16px 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pf-stats div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: #0004; border: 1px solid var(--slot-border); }
.pf-stats span { font-size: 12px; }
.pf-stats b { font-variant-numeric: tabular-nums; }
.pf-stats b.pos { color: var(--good); }
.pf-stats b.neg { color: var(--bad); }
.pf-last { margin: 10px 0 0 !important; }
@media (max-width: 560px) { .pf-stats { grid-template-columns: repeat(2, 1fr); } }

/* Ficha de jugador: puesto en el servidor, juegos favoritos y transferencias (página Social) */
.pf-rank { display: inline-grid; place-items: center; min-width: 34px; height: 24px; margin-right: 8px; padding: 0 8px; border-radius: 999px;
  font: 800 13px var(--display); color: #e6e9ee; background: #ffffff14; border: 1px solid #ffffff33; vertical-align: middle; }
.pf-rank.rank-1 { color: #3a2500; background: linear-gradient(135deg, #fff2b0, #ffcf3a 45%, #c98a00); border-color: #fff4c2; box-shadow: 0 0 12px #ffcf3a99; }
.pf-rank.rank-2 { color: #23272e; background: linear-gradient(135deg, #ffffff, #c9d1dc 50%, #8b96a5); border-color: #eef2f7; box-shadow: 0 0 8px #c9d1dc66; }
.pf-rank.rank-3 { color: #2b1405; background: linear-gradient(135deg, #ffd2a6, #cd7f32 55%, #8a4b17); border-color: #f0b27a; }
.pf-favs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pf-favs li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; background: #0004; border: 1px solid var(--slot-border); }
.pf-favs li small { margin-left: auto; }
.pf-fav-n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font: 800 12px var(--display); background: var(--slot); color: var(--accent-2); }
.pf-favs li:first-child .pf-fav-n { background: linear-gradient(135deg, #ffe58a, #c98a00); color: #3a2500; }
.transfer-modal { text-align: left; }
.transfer-summary { display: grid; gap: 4px; margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--slot-border); background: #0005; }
.transfer-summary > div { display: flex; justify-content: space-between; gap: 10px; }
.transfer-summary .total { padding-top: 6px; margin-top: 2px; border-top: 1px dashed var(--slot-border); font-size: 16px; }
.transfer-summary .total b { color: var(--accent-2); }

/* Salas extra (/bdo sala crear): cartel bajo el título con quién la abrió y cuándo se cierra. */
.room-banner {
  display: inline-block;
  margin: 2px 0 10px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid #e0b35a66;
  background: #e0b35a1a;
  color: var(--accent-2);
  font-size: 13px;
}
.r-tag.extra { color: #aab4ff; }

/* Fichas recibidas de otro jugador */
.received-modal { text-align: center; overflow: visible; }
.received-burst { position: relative; width: 96px; height: 96px; margin: -54px auto 6px; display: grid; place-items: center; }
.received-burst::before { content: ""; position: absolute; inset: -30px; border-radius: 50%;
  background: conic-gradient(from 0deg, #ffd98a00, #ffd98a66, #ffd98a00 25%, #ffd98a66 50%, #ffd98a00 75%, #ffd98a66);
  animation: received-spin 6s linear infinite; mask: radial-gradient(circle, #000 35%, transparent 70%); }
.received-avatar { position: relative; width: 84px; height: 84px; border-radius: 50%; border: 3px solid #ffd98a; box-shadow: 0 0 24px #ffd98aaa;
  animation: received-pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.received-icon { position: absolute; right: -6px; bottom: -4px; font-size: 34px; animation: received-pop .6s .15s cubic-bezier(.2, 1.6, .4, 1) both; }
.received-burst:not(:has(img)) .received-icon { position: relative; right: auto; bottom: auto; font-size: 64px; }
.received-amount { display: inline-flex; align-items: center; gap: 10px; margin: 6px 0 4px; font-family: var(--display);
  font-size: 46px; color: var(--accent-2); text-shadow: 0 0 18px #ffcf3a99; animation: received-glow 1.6s ease-in-out infinite alternate; }
.received-amount .coin { width: 40px; height: 40px; }
.received-amount small { font-size: 18px; color: var(--muted); }
.received-list { list-style: none; padding: 0; margin: 6px auto 0; max-width: 300px; text-align: left; }
.received-list li { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-bottom: 1px solid #ffffff12; }
.received-list li span { flex: 1; }
.received-list li b { color: var(--good); }
.received-list img, .received-list .ri-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
@keyframes received-spin { to { transform: rotate(1turn); } }
@keyframes received-pop { from { transform: scale(0) rotate(-20deg); } to { transform: scale(1) rotate(0); } }
@keyframes received-glow { to { text-shadow: 0 0 30px #ffcf3a, 0 0 4px #fff; } }
@media (prefers-reduced-motion: reduce) { .received-burst::before, .received-amount { animation: none; } }

/* Web cerrada por mantenimiento: franja para los administradores, que entran igual */
.maintenance-strip { position: relative; z-index: 60; padding: 8px 16px; text-align: center; font-size: 14px; line-height: 1.4;
  background: repeating-linear-gradient(-45deg, #3a2a08, #3a2a08 14px, #2c2006 14px, #2c2006 28px); color: #ffe6a8;
  border-bottom: 1px solid #e0b35a88; overflow-wrap: anywhere; }
/* Lluvia del evento de suerte (tréboles) o de mala suerte (gotas), y el trébol grande del centro. */
.luck-fx { z-index: 95; }
.fx-clover { position: absolute; top: -60px; font-style: normal; font-size: var(--size, 28px); line-height: 1;
  filter: drop-shadow(0 0 6px #6fe08a99); animation: clover-fall linear forwards; will-change: transform; }
@keyframes clover-fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 0; }
  8% { opacity: 1; }
  30% { transform: translate(var(--sway), 32vh) rotate(calc(var(--rot) * 0.3)); }
  60% { transform: translate(calc(var(--sway) * -0.6), 66vh) rotate(calc(var(--rot) * 0.65)); }
  100% { transform: translate(calc(var(--sway) * 0.4), 112vh) rotate(var(--rot)); opacity: 0.9; }
}
.fx-drop { position: absolute; top: -40px; width: var(--size, 3px); height: 26px; border-radius: 3px;
  background: linear-gradient(#cfe3ff00, #9fc3ffcc); animation: drop-fall linear forwards; }
@keyframes drop-fall { to { transform: translate(calc(var(--sway) * 0.15), 112vh); } }
.luck-burst { position: absolute; left: 50%; top: 42%; display: flex; flex-direction: column; align-items: center; gap: 6px;
  transform: translate(-50%, -50%); text-align: center; animation: luck-burst 3.4s ease-out forwards; }
.luck-burst-icon { font-size: clamp(90px, 22vw, 180px); line-height: 1; }
.luck-burst b { font-family: Cinzel, Georgia, serif; font-size: clamp(22px, 5vw, 38px); letter-spacing: .04em; padding: 4px 18px;
  border-radius: 999px; background: #000a; }
.luck-burst.good .luck-burst-icon { filter: drop-shadow(0 0 28px #6fe08a) drop-shadow(0 0 60px #2fbf55aa); }
.luck-burst.good b { color: #c9ffd0; text-shadow: 0 0 12px #3fd06a; border: 1px solid #6fe08a88; }
.luck-burst.bad .luck-burst-icon { filter: drop-shadow(0 0 24px #8ea2d8); }
.luck-burst.bad b { color: #dbe4ff; border: 1px solid #8ea2d888; }
@keyframes luck-burst {
  0% { transform: translate(-50%, -50%) scale(0.2) rotate(-25deg); opacity: 0; }
  14% { transform: translate(-50%, -50%) scale(1.18) rotate(8deg); opacity: 1; }
  24% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  78% { transform: translate(-50%, -50%) scale(1.04); opacity: 1; }
  100% { transform: translate(-50%, -62%) scale(0.9); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .luck-burst { animation-duration: 2.5s; } }

/* Día de suerte / de mala suerte (/bdo suerte). */
.luck-strip { position: relative; z-index: 59; padding: 7px 16px; text-align: center; font-size: 14px; line-height: 1.4; overflow: hidden; overflow-wrap: anywhere; }
.luck-strip.good { background: linear-gradient(90deg, #0d3b1e, #1f6b35 50%, #0d3b1e); color: #d9ffd9; border-bottom: 1px solid #6fe08a88; }
.luck-strip.bad { background: linear-gradient(90deg, #1b2030, #2e3650 50%, #1b2030); color: #d5ddf5; border-bottom: 1px solid #8ea2d888; }
.luck-strip.good::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, #ffffff2a 50%, transparent 70%); animation: luck-shine 4s ease-in-out infinite; }
.luck-strip .luck-icon { display: inline-block; animation: luck-bob 2.4s ease-in-out infinite; }
.luck-strip.bad .luck-icon { animation-duration: 3.6s; }
@keyframes luck-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes luck-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2px) rotate(-12deg); } }
@media (prefers-reduced-motion: reduce) { .luck-strip::after, .luck-strip .luck-icon { animation: none; } }
.maintenance-strip code { background: #0006; padding: 1px 6px; border-radius: 6px; font-size: 13px; }

/* Precio fijo por encima de la apuesta máxima del servidor (sobres, Asalto, Arena): no se puede comprar */
.over-max { opacity: .45; filter: grayscale(.6); }
.over-max.active { opacity: .7; }
.over-tag { display: block; margin-top: 2px; font-size: 11px; font-weight: 700; color: #ff9b8a; }

/* Juego desactivado en este servidor (/bdo configurar juegos) */
.game-off { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px; background: #000b; backdrop-filter: blur(3px); }
.game-off-card { max-width: 420px; text-align: center; padding: 24px; border-radius: 16px; background: #1d1710; border: 1px solid #e0b35a66; color: #f3e6c8; }
.game-off-icon { font-size: 44px; }
.game-off-card h2 { margin: 6px 0 8px; color: #ffd76a; }
.game-off-card p { margin: 8px 0; }

