* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  font-family: 'Fredoka', sans-serif;
  background: radial-gradient(ellipse at 50% -10%, #17436c 0%, #0b2239 48%, #071628 100%) fixed;
  background-color: #0b2239;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  color: #333;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px;
  padding-top: max(8px, env(safe-area-inset-top));
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  padding-left: max(8px, env(safe-area-inset-left));
  padding-right: max(8px, env(safe-area-inset-right));
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.screen {
  border-radius: 24px;
  padding: 16px 14px;
  text-align: center;
  animation: popIn 0.35s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.screen:not(.menu-modern) {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

@keyframes popIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.hidden { display: none !important; }



/* LOGO */
.logo {
  width: 150px;
  max-width: 65%;
  margin: 0 auto 8px;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}
.logo-sm { width: 100px; }

h1 {
  font-size: 1.65rem;
  color: #12b76a;
  margin-bottom: 4px;
  text-shadow: 2px 2px 0 #ffd54a;
}

.subtitle {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 14px;
}

.welcome { font-size: 1.1rem; margin-bottom: 10px; }

/* FORMULARIOS */
.form-box {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 8px;
}

.form-box input[type="text"],
.form-box input[type="password"],
.form-box input[type="number"] {
  padding: 13px 15px;
  border: 3px solid #f7b500;
  border-radius: 14px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.05rem;
  outline: none;
  background: #fffef5;
}

.form-box input:focus { border-color: #12b76a; }
.form-box label { font-size: 0.95rem; color: #555; text-align: left; }

.switch-form {
  margin-top: 12px;
  font-size: 0.9rem;
  color: #555;
}
.switch-form a { color: #12b76a; font-weight: 600; text-decoration: none; }

/* BOTONES */
.btn {
  border: none;
  border-radius: 50px;
  padding: 12px 26px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 5px 3px;
  box-shadow: 0 5px 0 rgba(0,0,0,0.12);
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,0.12); }
.btn-primary { background: linear-gradient(to bottom, #12b76a, #0e9f5c); color: white; }
.btn-secondary { background: linear-gradient(to bottom, #4ecdc4, #3dbdb5); color: white; }
.btn-outline { background: white; color: #555; border: 3px solid #ddd; box-shadow: none; }

/* MENÚ */
.tickets-box {
  background: #fff8e7;
  border: 3px dashed #f7b500;
  border-radius: 16px;
  padding: 12px;
  margin: 14px 0 18px;
  font-size: 1.2rem;
}
.menu-buttons { display: flex; flex-direction: column; gap: 8px; }
.menu-buttons .btn { width: 100%; margin: 0; }

/* DIFICULTAD */
.diff-buttons { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.btn-diff {
  background: white;
  border: 3px solid #f7b500;
  border-radius: 16px;
  padding: 13px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}
.btn-diff:hover { background: #fff8e7; transform: scale(1.02); }
.diff-title { display: block; font-size: 1.2rem; font-weight: 700; color: #12b76a; }
.diff-info { font-size: 0.9rem; color: #666; }
.ticket-cost { margin: 10px 0; font-size: 0.9rem; color: #555; }

/* TIENDA */
.total-price { font-size: 1.3rem; color: #12b76a; margin: 6px 0; }
.payment-info {
  background: #f0f9ff;
  border: 2px solid #74b9ff;
  border-radius: 14px;
  padding: 14px;
  margin-top: 12px;
  text-align: left;
}
.payment-info h3 { color: #0984e3; margin-bottom: 8px; font-size: 1.05rem; }
.payment-info p { margin: 4px 0; font-size: 0.95rem; }
.note-small { font-size: 0.8rem; color: #777; margin-top: 6px; }
.file-label {
  display: block;
  background: #fff8e7;
  border: 2px dashed #f7b500;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  font-size: 0.95rem;
  color: #555;
}
.file-name { font-size: 0.85rem; color: #0fae67; margin-top: -4px; }

/* RANKING */
.ranking-list { max-height: 320px; overflow-y: auto; margin: 14px 0; text-align: left; }
.rank-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 7px;
  background: #f8f9fa;
}
.rank-item:nth-child(1) { background: #fff3cd; }
.rank-item:nth-child(2) { background: #e9ecef; }
.rank-item:nth-child(3) { background: #e4f1ea; }
.rank-pos { font-weight: 700; font-size: 1.15rem; width: 34px; color: #12b76a; }
.rank-name { flex: 1; font-weight: 600; }
.rank-score { font-weight: 700; color: #0fae67; }

/* ===== HUD ===== */
/* ===== HUD DEL JUEGO ===== */
.hud {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #fffdf5 0%, #fff8e7 100%);
  border-radius: 18px;
  padding: 8px;
  border: 2px solid #ffd54a;
  box-shadow: 0 6px 0 rgba(255, 217, 61, 0.35);
  flex-wrap: nowrap;
  width: 100%;
  box-sizing: border-box;
}

.hud-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: white;
  border-radius: 14px;
  padding: 8px 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.hud-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hud-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.hud-time .hud-icon {
  background: linear-gradient(135deg, #e5f5ec, #ffcccc);
  color: #12b76a;
}
.hud-score .hud-icon {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  color: #d98a00;
}
.hud-pairs .hud-icon {
  background: linear-gradient(135deg, #d5f5ee, #a8e6cf);
  color: #0fae67;
}

.hud-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.hud-meta small {
  font-size: 0.65rem;
  font-weight: 600;
  color: #95a5a6;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hud-meta strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0b2239;
}

.hud-time .hud-meta strong { color: #12b76a; }
.hud-score .hud-meta strong { color: #d98a00; }
.hud-pairs .hud-meta strong { color: #0fae67; }


/* ===== TABLERO DE CARTAS ===== */
/* ===== TABLERO DE CARTAS (arreglado: siempre en cuadrícula, cartas pequeñas) ===== */
.game-board {
  display: grid !important;
  gap: 6px;
  margin: 0 auto 12px;
  width: 100%;
  /* Tablero compacto: no ocupa toda la pantalla */
  max-width: 280px;
  grid-template-columns: repeat(4, 1fr);
  justify-content: center;
  align-content: start;
}

.game-board.cols-3 {
  grid-template-columns: repeat(3, 1fr) !important;
  max-width: 240px;
}

.game-board.cols-4 {
  grid-template-columns: repeat(4, 1fr) !important;
  max-width: 280px;
}

.game-board.cols-5 {
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 5px;
  max-width: 300px;
}

.game-board.cols-6 {
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 4px;
  max-width: 310px;
}

.game-board.cols-8 {
  grid-template-columns: repeat(8, 1fr) !important;
  gap: 3px;
  max-width: 360px;
}

/* ===== CARTAS (estilo suave pastel) ===== */
.card {
  aspect-ratio: 1 / 1;
  width: 100%;
  height: auto;
  max-width: 64px;
  max-height: 64px;
  margin: 0 auto;
  /* Dorso: lavanda / rosa suave */
  background: linear-gradient(145deg, #c4b5fd 0%, #a78bfa 45%, #8b5cf6 100%);
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  user-select: none;
  position: relative;
  box-shadow:
    0 4px 0 rgba(109, 40, 217, 0.25),
    0 6px 14px rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:active {
  transform: scale(0.94);
  box-shadow: 0 2px 0 rgba(109, 40, 217, 0.2);
}

/* Signo ? del dorso */
.card::before {
  content: "?";
  font-size: 1.55rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 6px rgba(91, 33, 182, 0.35);
  font-family: 'Fredoka', sans-serif;
}

/* Brillo suave arriba */
.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(255,255,255,0.28), transparent);
  pointer-events: none;
  border-radius: 16px 16px 0 0;
}

/* Imagen oculta por defecto */
.card .card-img {
  display: none !important;
  width: 72%;
  height: 72%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  position: relative;
  z-index: 1;
}

/* Volteada: crema / blanco */
.card.flipped {
  background: linear-gradient(160deg, #ffffff 0%, #f5faf7 100%);
  box-shadow:
    0 3px 0 rgba(253, 203, 110, 0.45),
    0 6px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid #ffe8b8;
}

.card.flipped::before {
  display: none !important;
}

.card.flipped::after {
  display: none;
}

.card.flipped .card-img {
  display: block !important;
}

/* Match: menta suave */
.card.matched {
  background: linear-gradient(160deg, #ecfdf5 0%, #d1fae5 100%);
  box-shadow:
    0 3px 0 rgba(16, 185, 129, 0.3),
    0 6px 12px rgba(16, 185, 129, 0.12);
  border: 1px solid #a7f3d0;
  cursor: default;
  opacity: 0.95;
}

.card.matched::before {
  display: none !important;
}

.card.matched::after {
  display: none;
}

.card.matched .card-img {
  display: block !important;
}

/* Tamaños de ? y emoji según columnas (más pequeño en tableros densos) */
.game-board.cols-5 .card::before,
.game-board.cols-6 .card::before {
  font-size: 1.15rem;
}
.game-board.cols-5 .card .card-img,
.game-board.cols-6 .card .card-img {
  font-size: 1.2rem;
}

.game-board.cols-3 .card::before {
  font-size: 1.7rem;
}
.game-board.cols-3 .card .card-img {
  font-size: 1.8rem;
}

/* RESULTADOS */
.big-score {
  font-size: 3.2rem;
  color: #12b76a;
  font-weight: 700;
  margin: 6px 0;
  text-shadow: 3px 3px 0 #ffd54a;
}
#result-message, #result-pairs {
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: #555;
}

/* REFERIDOS */
.ref-code-box {
  background: #fff8e7;
  border: 3px dashed #f7b500;
  border-radius: 16px;
  padding: 16px;
  margin: 14px 0;
}
.ref-code {
  font-size: 1.6rem;
  font-weight: 700;
  color: #12b76a;
  letter-spacing: 2px;
  margin-top: 6px;
}
.ref-stats {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}
.ref-stat {
  flex: 1;
  background: #f0f9ff;
  border-radius: 14px;
  padding: 14px 10px;
  border: 2px solid #74b9ff;
}
.ref-stat-num {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: #0984e3;
}
.ref-stat-label { font-size: 0.85rem; color: #666; }
.ref-list {
  text-align: left;
  margin: 12px 0;
  max-height: 280px;
  overflow-y: auto;
}
.ref-item {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}
.ref-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.ref-item-name { font-weight: 600; font-size: 1.05rem; }
.ref-item-status { font-size: 0.85rem; color: #0fae67; font-weight: 600; }
.progress-bar {
  height: 12px;
  background: #e0e0e0;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(to right, #4ecdc4, #0fae67);
  border-radius: 20px;
  transition: width 0.4s ease;
}
.progress-text { font-size: 0.8rem; color: #666; }
.btn-claim {
  background: linear-gradient(to bottom, #ffd54a, #f7b500);
  color: #333;
  padding: 8px 16px;
  font-size: 0.9rem;
  margin-top: 8px;
  width: 100%;
}
.how-it-works {
  background: #f8f9fa;
  border-radius: 14px;
  padding: 14px;
  margin: 16px 0;
  text-align: left;
}
.how-it-works h3 { color: #12b76a; margin-bottom: 8px; font-size: 1.05rem; }
.how-it-works ol { padding-left: 20px; font-size: 0.9rem; color: #555; line-height: 1.5; }
.how-it-works li { margin-bottom: 4px; }

@media (max-width: 400px) {
  .game-board {
    gap: 5px;
    max-width: 260px !important;
  }
  .game-board.cols-3 { max-width: 220px !important; }
  .game-board.cols-4 { max-width: 260px !important; }
  .game-board.cols-5 { max-width: 280px !important; gap: 4px; }
  .game-board.cols-6 { max-width: 290px !important; gap: 3px; }
  .game-board.cols-5 .card::before,
  .game-board.cols-6 .card::before { font-size: 1rem; }
  .card {
    max-width: 58px !important;
    max-height: 58px !important;
  }
  .card::before { font-size: 1.2rem; }
  h1 { font-size: 1.45rem; }
}


/* ========== FONDO CON IMAGEN ========== */
.screen.menu-modern {
  background: transparent;
  box-shadow: none;
  padding: 12px 10px 20px;
}

/* ========== TOP BAR ========== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 10px;
}

.top-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.top-btn:active { transform: scale(0.96); }

.top-btn-canal {
  background: #fff9e6;
  color: #d98a00;
  border: 2px solid #ffeaa7;
}

.top-btn-soporte {
  background: #ffffff;
  color: #0984e3;
  border: 2px solid #dfe6e9;
}

/* ========== LOGO ========== */
.logo-wrap {
  text-align: center;
  margin: 6px 0 14px;
}

.logo-main {
  width: auto;
  height: auto;
  max-width: min(190px, 52vw);
  max-height: 110px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.18));
}

/* ========== STATS BAR (Tickets + Saldo) ========== */
.stats-bar {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.95);
  border-radius: 18px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  border: 2px solid rgba(255,255,255,0.8);
}

.stat-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-icon {
  font-size: 1.5rem;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: #888;
  font-weight: 500;
}

.stat-value {
  font-size: 1.15rem;
  color: #0b2239;
  font-weight: 700;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: #e0e0e0;
  margin: 0 12px;
}

/* ========== MENU BUTTONS ========== */
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.menu-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  text-align: left;
  font-family: 'Fredoka', sans-serif;
  box-shadow: 0 5px 0 rgba(0,0,0,0.12);
  transition: all 0.2s ease;
  color: white;
}

.menu-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.12);
}

.menu-btn-icon {
  font-size: 1.6rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.25);
  border-radius: 12px;
  flex-shrink: 0;
}

.menu-btn-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-btn-text strong {
  font-size: 1.1rem;
  font-weight: 700;
}

.menu-btn-text small {
  font-size: 0.78rem;
  opacity: 0.9;
  font-weight: 400;
}

.menu-btn-arrow {
  font-size: 1.6rem;
  font-weight: 700;
  opacity: 0.85;
}

/* Colores de cada botón */
.menu-btn-play {
  background: linear-gradient(135deg, #12b76a, #0e9f5c);
}

.menu-btn-shop {
  background: linear-gradient(135deg, #4ecdc4, #26a69a);
}

.menu-btn-ranking {
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
}

.menu-btn-ref {
  background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
  color: #0b2239;
}

.menu-btn-ref .menu-btn-icon {
  background: rgba(0,0,0,0.08);
}

.menu-btn-withdraw {
  background: linear-gradient(135deg, #74b9ff, #0984e3);
}

.menu-btn-logout {
  background: #ffffff;
  color: #51657a;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
  border: 2px solid #dfe6e9;
}

.menu-btn-logout .menu-btn-icon {
  background: #f1f2f6;
}

/* ========== PROMO CARD ========== */
.promo-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.95);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  text-align: left;
  border: 2px solid rgba(255,255,255,0.8);
}

.promo-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.promo-card strong {
  display: block;
  color: #12b76a;
  font-size: 1rem;
  margin-bottom: 3px;
}

.promo-card p {
  font-size: 0.8rem;
  color: #51657a;
  line-height: 1.35;
  margin: 0;
}

/* Ajustes para pantallas pequeñas */
@media (max-width: 380px) {
  .logo-main { max-width: 140px; width: auto; height: auto; }
  .menu-btn { padding: 12px 14px; }
  .menu-btn-text strong { font-size: 1.02rem; }
  .stat-value { font-size: 1.05rem; }
}


/* ========== LUCIDE ICONS ========== */
.menu-btn-icon svg,
.menu-btn-arrow svg,
.top-icon,
.stat-lucide,
.promo-lucide {
  width: 22px;
  height: 22px;
  stroke-width: 2.2;
}

.menu-btn-icon svg {
  width: 24px;
  height: 24px;
}

.menu-btn-arrow svg {
  width: 20px;
  height: 20px;
  opacity: 0.9;
}

.top-icon {
  width: 16px;
  height: 16px;
}

.stat-icon-wrap {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff8e7;
  border-radius: 12px;
  flex-shrink: 0;
}

.stat-lucide {
  width: 22px;
  height: 22px;
  color: #d98a00;
}
.stat-img-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}
.home-card .saldo-main {
  font-size: 0.82rem !important;
  line-height: 1.15;
}

.promo-icon-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff0f0;
  border-radius: 14px;
  flex-shrink: 0;
}

.promo-lucide {
  width: 26px;
  height: 26px;
  color: #12b76a;
}

/* Ajuste del icono dentro del botón */
.menu-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== TIENDA MODERNA (Comprar Tickets) ========== */
.shop-modern {
  background: rgba(255, 255, 255, 0.97) !important;
  box-shadow: 0 16px 50px rgba(0,0,0,0.12) !important;
  padding: 24px 18px 20px !important;
  position: relative;
}

.shop-header-icon {
  width: 56px;
  height: 56px;
  margin: -42px auto 10px;
  background: linear-gradient(135deg, #ffd54a, #f7b500);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(255, 217, 61, 0.45);
}

.shop-header-icon svg {
  width: 28px;
  height: 28px;
  color: #d98a00;
  stroke-width: 2.2;
}

.shop-title {
  font-size: 1.7rem !important;
  color: #12b76a !important;
  text-shadow: none !important;
  margin-bottom: 8px !important;
}

.shop-price-badge {
  display: inline-block;
  background: #e8f8f5;
  color: #0fae67;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 50px;
  margin-bottom: 18px;
}

.shop-label {
  font-size: 0.95rem;
  color: #51657a;
  margin-bottom: 10px;
}

.qty-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 8px;
}

.qty-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #e5f5ec;
  color: #12b76a;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 #ffd54a;
  transition: all 0.15s;
  font-family: 'Fredoka', sans-serif;
}

.qty-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #ffd54a;
}

.qty-value {
  font-size: 2rem;
  font-weight: 700;
  color: #0b2239;
  min-width: 48px;
  text-align: center;
}

.qty-max {
  display: inline-block;
  background: #fff8e7;
  color: #0ea5a5;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 16px;
}

.total-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f0faf8;
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 16px;
  text-align: left;
}

.total-icon {
  width: 52px;
  height: 52px;
  background: #d5f5ee;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.total-icon svg {
  width: 26px;
  height: 26px;
  color: #0fae67;
}

.total-label {
  display: block;
  font-size: 0.85rem;
  color: #51657a;
}

.total-amount {
  display: block;
  font-size: 1.45rem;
  color: #12b76a;
  font-weight: 700;
  line-height: 1.2;
}

.total-bs {
  display: block;
  font-size: 0.8rem;
  color: #95a5a6;
  margin-top: 2px;
}

.pay-data-box {
  background: #f0faf9;
  border: 2px dashed #a8e6cf;
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 16px;
  text-align: left;
}

.pay-data-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0fae67;
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 50px;
  margin-bottom: 12px;
}

.pay-data-header svg {
  width: 14px;
  height: 14px;
}

.pay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 0.9rem;
  color: #0b2239;
}

.pay-row:last-of-type {
  border-bottom: none;
}

.pay-row-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pay-row-icon {
  width: 16px;
  height: 16px;
  color: #0fae67;
  flex-shrink: 0;
}

.copy-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: white;
  color: #51657a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: all 0.2s;
}

.copy-btn svg {
  width: 15px;
  height: 15px;
}

.copy-btn:active,
.copy-btn.copied {
  background: #0fae67;
  color: white;
}

.pay-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #0fae67;
  margin-top: 10px;
  margin-bottom: 0;
}

.pay-hint .hint-icon,
.pay-hint svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.shop-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 2px solid #e5f5ec;
  border-radius: 14px;
  padding: 4px 4px 4px 12px;
  margin-bottom: 12px;
}

.shop-field .field-icon {
  width: 28px;
  height: 28px;
  background: #ffd54a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #d98a00;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.shop-field input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 8px;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  background: transparent;
}

.upload-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff5f0;
  border: 2px dashed #ffb8a8;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 16px;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.upload-box:hover {
  background: #ffeee8;
}

.upload-icon-wrap {
  width: 44px;
  height: 44px;
  background: #12b76a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}

.upload-icon-wrap svg {
  width: 22px;
  height: 22px;
}

.upload-box strong {
  display: block;
  color: #12b76a;
  font-size: 0.95rem;
}

.upload-box small {
  display: block;
  color: #95a5a6;
  font-size: 0.8rem;
  margin-top: 2px;
}

.btn-send-pay {
  width: 100%;
  border: none;
  border-radius: 50px;
  padding: 15px 20px;
  background: linear-gradient(135deg, #12b76a, #0e9f5c);
  color: white;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 0 #0a6b45;
  margin-bottom: 12px;
  transition: all 0.15s;
}

.btn-send-pay:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #0a6b45;
}

.btn-send-pay svg {
  width: 18px;
  height: 18px;
}

.btn-back-shop {
  width: 100%;
  border: 2px solid #dfe6e9;
  border-radius: 50px;
  padding: 12px;
  background: white;
  color: #51657a;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
}

.btn-back-shop:active {
  background: #f8f9fa;
}

/* ========== RANKING MODERNO ========== */
.ranking-modern {
  background: rgba(255,255,255,0.96) !important;
  box-shadow: 0 16px 50px rgba(0,0,0,0.12) !important;
  padding: 20px 14px 18px !important;
}

.rank-crown {
  width: 48px;
  height: 48px;
  margin: 0 auto 4px;
  background: linear-gradient(135deg, #ffd54a, #f7b500);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(255, 217, 61, 0.4);
}

.rank-crown svg {
  width: 24px;
  height: 24px;
  color: #d98a00;
}

.rank-title {
  font-size: 1.75rem !important;
  color: #12b76a !important;
  text-shadow: none !important;
  margin-bottom: 2px !important;
}

.rank-subtitle {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 18px;
}

/* Podio */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
  min-height: 200px;
}

.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 110px;
}

.podium-avatar-wrap {
  position: relative;
  margin-bottom: 6px;
}

.podium-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.podium-avatar.empty {
  background: #dfe6e9;
  color: #b2bec3;
  font-size: 1.2rem;
  font-weight: 700;
}

.podium-first .podium-avatar {
  width: 68px;
  height: 68px;
  font-size: 1.9rem;
  border-width: 4px;
  border-color: #ffd54a;
}

.podium-crown {
  margin-bottom: 2px;
  color: #f7b500;
}

.podium-crown svg {
  width: 28px;
  height: 28px;
  fill: #f7b500;
  stroke: #d98a00;
}

.podium-medal {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  z-index: 2;
}

.medal-silver { background: #b2bec3; }
.medal-bronze { background: #0ea5a5; }

.podium-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0b2239;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: white;
  padding: 3px 10px;
  border-radius: 50px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 4px;
}

.podium-score {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0fae67;
  background: #e8f8f5;
  padding: 2px 8px;
  border-radius: 50px;
  margin-bottom: 8px;
}

.podium-first .podium-score {
  color: #0ea5a5;
  background: #fff0eb;
}

.podium-block {
  width: 100%;
  border-radius: 12px 12px 6px 6px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  font-size: 1.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  box-shadow: 0 4px 0 rgba(0,0,0,0.1);
}

.podium-first .podium-block {
  height: 90px;
  background: linear-gradient(180deg, #ffd54a, #f9ca24);
}

.podium-second .podium-block {
  height: 70px;
  background: linear-gradient(180deg, #55efc4, #0fae67);
}

.podium-third .podium-block {
  height: 55px;
  background: linear-gradient(180deg, #12b76a, #0ea5a5);
}

/* Lista */
.rank-list-card {
  background: #fafbfc;
  border-radius: 18px;
  padding: 8px 10px;
  margin-bottom: 14px;
  max-height: 280px;
  overflow-y: auto;
  text-align: left;
}

.ranking-list-modern {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.rank-num {
  width: 22px;
  font-weight: 700;
  color: #b2bec3;
  font-size: 0.9rem;
  text-align: center;
}

.rank-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.rank-uname {
  flex: 1;
  font-weight: 600;
  color: #0b2239;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-pts {
  font-weight: 700;
  color: #0fae67;
  font-size: 0.9rem;
  white-space: nowrap;
}

.rank-empty {
  text-align: center;
  color: #b2bec3;
  padding: 20px;
  font-size: 0.95rem;
}

/* ========== REFERIDOS MODERNO ========== */
.ref-modern {
  background: rgba(255,255,255,0.97) !important;
  box-shadow: 0 16px 50px rgba(0,0,0,0.12) !important;
  padding: 22px 16px 18px !important;
}

.ref-header-icon {
  width: 56px;
  height: 56px;
  margin: -8px auto 8px;
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(108, 92, 231, 0.35);
  position: relative;
}

.ref-header-icon svg {
  width: 28px;
  height: 28px;
  color: white;
  stroke-width: 2.2;
}

.ref-title {
  font-size: 1.75rem !important;
  color: #12b76a !important;
  text-shadow: none !important;
  margin-bottom: 4px !important;
}

.ref-subtitle {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 16px;
}

.ref-code-card {
  background: #fff9e6;
  border: 2px dashed #f7b500;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
}

.ref-code-label {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 6px;
}

.ref-code-value {
  font-size: 2rem;
  font-weight: 700;
  color: #12b76a;
  letter-spacing: 3px;
  margin-bottom: 12px;
  text-shadow: 0 2px 0 rgba(255,107,107,0.15);
}

.btn-copy-ref {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #0fae67, #00a085);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 20px;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 0 #008f76;
  transition: all 0.15s;
}

.btn-copy-ref:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #008f76;
}

.btn-copy-ref svg {
  width: 16px;
  height: 16px;
}

.ref-stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.ref-stat-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
}

.ref-stat-people {
  background: #e8f8f5;
}

.ref-stat-money {
  background: #eaf4ff;
}

.ref-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ref-stat-people .ref-stat-icon {
  background: #55efc4;
  color: white;
}

.ref-stat-money .ref-stat-icon {
  background: #74b9ff;
  color: white;
}

.ref-stat-icon svg {
  width: 20px;
  height: 20px;
}

.ref-stat-card strong {
  display: block;
  font-size: 1.35rem;
  color: #0b2239;
  line-height: 1.1;
}

.ref-stat-card span {
  font-size: 0.8rem;
  color: #888;
}

.ref-milestone-box {
  background: linear-gradient(135deg, #fff8e7, #ffe8c2);
  border: 2px solid #f7b500;
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(253, 203, 110, 0.25);
}
.ref-milestone-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.ref-milestone-top strong {
  color: #0b2239;
  font-size: 0.95rem;
}
.ref-milestone-top span {
  background: #0fae67;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
}
#btn-claim-milestone {
  width: 100%;
  margin-top: 10px;
}

/* Empty state */
.ref-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff5f5;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
  text-align: left;
}

.ref-empty-icon {
  width: 48px;
  height: 48px;
  background: #12b76a;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.ref-empty-icon svg {
  width: 24px;
  height: 24px;
}

.ref-empty strong {
  display: block;
  color: #12b76a;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.ref-empty p {
  font-size: 0.82rem;
  color: #888;
  margin: 0;
}

/* Lista de referidos */
.ref-list-modern {
  margin-bottom: 14px;
  max-height: 200px;
  overflow-y: auto;
  text-align: left;
}

.ref-item-modern {
  background: #f8f9fa;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 8px;
}

.ref-item-modern .ref-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ref-item-modern .ref-item-name {
  font-weight: 600;
  font-size: 1rem;
  color: #0b2239;
}

.ref-item-modern .ref-item-status {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 50px;
}

.st-progress { background: #fff8e7; color: #0ea5a5; }
.st-ready { background: #e8f8f5; color: #0fae67; }
.st-claimed { background: #dfe6e9; color: #51657a; }

.btn-claim-modern {
  width: 100%;
  margin-top: 8px;
  border: none;
  border-radius: 50px;
  padding: 10px;
  background: linear-gradient(135deg, #ffd54a, #f7b500);
  color: #0b2239;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 3px 0 #e0c020;
}

.btn-claim-modern:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #e0c020;
}

/* Cómo funciona */
.ref-how {
  background: #fff5f5;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
  text-align: left;
}

.ref-how-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #12b76a;
}

.ref-how-header strong {
  flex: 1;
  font-size: 1rem;
}

.ref-how-badge,
.ref-how-medal {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ref-how-badge {
  background: #12b76a;
  color: white;
}

.ref-how-medal {
  background: #ffd54a;
  color: #d98a00;
}

.ref-how-badge svg,
.ref-how-medal svg {
  width: 14px;
  height: 14px;
}

.ref-steps {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ref-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: #555;
  margin-bottom: 10px;
  line-height: 1.4;
}

.ref-steps li:last-child {
  margin-bottom: 0;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-num.s1 { background: #12b76a; }
.step-num.s2 { background: #fdcb6e; }
.step-num.s3 { background: #0fae67; }
.step-num.s4 { background: #a29bfe; }

/* ========== MODAL INICIO PARTIDA ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

.modal-overlay.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: white;
  border-radius: 24px;
  padding: 28px 22px 22px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: popIn 0.3s ease;
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, #ffd54a, #f7b500);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(255, 217, 61, 0.4);
}

.modal-icon svg {
  width: 32px;
  height: 32px;
  color: #d98a00;
}

.modal-title {
  font-size: 1.4rem;
  color: #12b76a;
  margin-bottom: 12px;
  font-weight: 700;
}

.modal-text {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.45;
  margin-bottom: 8px;
}

.modal-sub {
  font-size: 0.88rem;
  color: #888;
  margin-bottom: 14px;
}

.modal-cost {
  font-size: 0.9rem;
  color: #0ea5a5;
  background: #fff8e7;
  display: inline-block;
  padding: 6px 14px;
  border-radius: 50px;
  margin-bottom: 18px;
  font-weight: 600;
}

.btn-start-game {
  width: 100%;
  border: none;
  border-radius: 50px;
  padding: 15px 20px;
  background: linear-gradient(135deg, #12b76a, #0e9f5c);
  color: white;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 0 #0a6b45;
  margin-bottom: 10px;
  transition: all 0.15s;
}

.btn-start-game:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #0a6b45;
}

.btn-start-game svg {
  width: 20px;
  height: 20px;
}

.btn-cancel-start {
  width: 100%;
  border: 2px solid #dfe6e9;
  border-radius: 50px;
  padding: 12px;
  background: white;
  color: #51657a;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-cancel-start:active {
  background: #f8f9fa;
}

/* ========== MÉTODO DE PAGO ========== */
.method-card {
  max-width: 360px;
}
.method-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 2px solid #eee;
  background: #fafafa;
  margin-bottom: 12px;
  cursor: pointer;
  text-align: left;
  font-family: 'Fredoka', sans-serif;
  transition: all 0.15s;
}
.method-option:hover {
  border-color: #12b76a;
  background: #fff5f5;
}
.method-opt-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.method-opt-icon svg {
  width: 24px;
  height: 24px;
}
.method-opt-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.method-opt-text strong {
  font-size: 1.05rem;
  color: #0b2239;
}
.method-opt-text small {
  font-size: 0.8rem;
  color: #888;
}


/* Selector de partidas */
.partida-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 2px solid #eee;
  background: #fafafa;
  margin-bottom: 10px;
  cursor: pointer;
  text-align: left;
  font-family: 'Fredoka', sans-serif;
  transition: all 0.15s;
}
.partida-option:hover {
  border-color: #a78bfa;
  background: #f5f3ff;
}
.partida-opt-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #c4b5fd, #a78bfa);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.partida-opt-icon svg { width: 22px; height: 22px; }
.partida-opt-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.partida-opt-text strong { font-size: 1.05rem; color: #0b2239; }
.partida-opt-text small { font-size: 0.8rem; color: #888; }

/* ===== PERFIL ===== */
.profile-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fffef5;
  border: 3px solid #f7b500;
  border-radius: 18px;
  padding: 12px 16px;
  margin: 0 0 14px 0;
}

.profile-photo-wrap {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  overflow: visible;
  background: #ffeaa7;
  border: 3px solid #12b76a;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.profile-photo-wrap .profile-photo,
.profile-photo-wrap .profile-placeholder {
  border-radius: 50%;
  overflow: hidden;
}
.profile-cam-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #12b76a, #0e9f5c);
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 2;
}
.profile-cam-badge i, .profile-cam-badge svg {
  width: 12px;
  height: 12px;
  color: #fff;
  stroke-width: 2.5;
}
.profile-photo-hint {
  font-size: 0.62rem;
  color: #51657a;
  margin-top: 2px;
}

.profile-photo-wrap:active {
  transform: scale(0.92);
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0ea5a5;
}

.profile-placeholder i {
  width: 26px;
  height: 26px;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-welcome {
  font-size: 0.82rem;
  color: #888;
  font-weight: 500;
}

.profile-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0b2239;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Banner de invitación */
.invite-banner {
  background: linear-gradient(135deg, #0b2239, #164a7a);
  color: white;
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-weight: 600;
  text-align: center;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(238, 90, 36, 0.3);
}

.invite-banner.hidden {
  display: none;
}

.ref-link-box {
  background: #f8f9fa;
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: #555;
  word-break: break-all;
  margin-bottom: 12px;
  text-align: left;
}

/* Asegurar email input */
.form-box input[type="email"] {
  padding: 13px 15px;
  border: 3px solid #f7b500;
  border-radius: 14px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.05rem;
  outline: none;
  background: #fffef5;
  width: 100%;
  box-sizing: border-box;
}

/* ===== COMPETENCIA / CONTADOR RANKING (estilo Games Win) ===== */
.comp-card {
  background: #fffef5;
  border: 3px solid #f7b500;
  border-radius: 18px;
  padding: 16px 18px;
  margin: 0 0 18px 0;
  text-align: center;
  box-shadow: 0 4px 0 rgba(0,0,0,0.06);
}

.comp-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff3cd;
  color: #d98a00;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 10px;
  border: 2px solid #f7b500;
}

.comp-label i { width: 14px; height: 14px; }

.comp-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: #12b76a;
  margin-bottom: 4px;
  font-family: 'Fredoka', sans-serif;
}

.comp-desc {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 14px;
}

.comp-timer-box {
  background: linear-gradient(135deg, #0b2239, #164a7a);
  border-radius: 14px;
  padding: 14px 12px;
  box-shadow: 0 4px 12px rgba(11, 34, 57, 0.3);
}

.comp-timer-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.9);
  margin-bottom: 4px;
}

.comp-timer {
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  font-family: 'Fredoka', sans-serif;
}

/* Foto en ranking */
.podium-avatar img,
.rank-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Premios en ranking */
.comp-prizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}
.comp-prize-chip {
  background: #fff;
  border: 2px solid #f7b500;
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0b2239;
}
.comp-prize-chip strong { color: #12b76a; }

/* Historial */
.history-panel {
  background: #fffef5;
  border: 3px solid #f7b500;
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
}
.history-panel.hidden { display: none; }
.history-title {
  font-size: 1.1rem;
  color: #12b76a;
  margin-bottom: 12px;
  text-align: center;
}
.history-item {
  background: #fff;
  border: 2px solid #ffeaa7;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
}
.history-item h4 {
  margin: 0 0 6px 0;
  color: #0b2239;
}
.history-item .hi-date {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 8px;
}
.history-winners {
  font-size: 0.85rem;
  color: #555;
}
.history-winners div {
  padding: 3px 0;
}

/* Premio debajo del tiempo en podio */
.podium-score {
  line-height: 1.25;
}
.podium-prize {
  display: block;
  margin-top: 8px;
  background: linear-gradient(135deg, #f7b500, #f6c90e);
  color: #5d4e00;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 14px;
  border: 2px solid #fff;
  box-shadow: 0 3px 0 rgba(0,0,0,0.1);
  font-family: 'Fredoka', sans-serif;
  letter-spacing: 0.3px;
}
.comp-prizes { display: none !important; }
.rank-prize {
  display: block;
  font-size: 0.72rem;
  color: #d98a00;
  font-weight: 600;
  margin-top: 2px;
}

/* Modal historial */
.history-modal-card {
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  text-align: left;
  padding: 18px 16px 16px;
}
.history-modal-header {
  text-align: center;
  margin-bottom: 14px;
}
.history-modal-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f7b500, #12b76a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.history-modal-icon i { width: 24px; height: 24px; }
.history-modal-header h2 {
  font-size: 1.2rem;
  color: #12b76a;
  margin: 0 0 4px;
  font-family: 'Fredoka', sans-serif;
}
.history-modal-header p {
  font-size: 0.85rem;
  color: #888;
  margin: 0;
}
.history-modal-list { margin-bottom: 12px; }

.hm-comp {
  background: #fffef5;
  border: 2px solid #f7b500;
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 12px;
}
.hm-comp-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}
.hm-comp-name {
  font-weight: 700;
  color: #0b2239;
  font-size: 0.95rem;
}
.hm-comp-badge {
  background: #ffeaa7;
  color: #d98a00;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.hm-comp-meta {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 10px;
}
.hm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid #f0e6c8;
}
.hm-place {
  width: 22px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #12b76a;
  text-align: center;
}
.hm-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: #ffeaa7;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
.hm-av img { width: 100%; height: 100%; object-fit: cover; }
.hm-info { flex: 1; min-width: 0; }
.hm-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #0b2239;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hm-right { text-align: right; flex-shrink: 0; }
.hm-time { font-weight: 700; font-size: 0.88rem; color: #0fae67; }
.hm-prize { font-size: 0.75rem; color: #d98a00; font-weight: 600; }


/* ===== PODIO ESTRUCTURA TIPO EJEMPLO ===== */
.podium {
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  gap: 10px !important;
  margin: 10px 0 16px !important;
  padding: 8px 4px 0 !important;
}

.podium-place {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  flex: 1 !important;
  max-width: 120px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.podium-place.podium-first {
  order: 2 !important;
  transform: translateY(-12px) !important;
  max-width: 130px !important;
}
.podium-place.podium-second { order: 1 !important; }
.podium-place.podium-third { order: 3 !important; }

.podium-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.pb-gold { background: linear-gradient(135deg, #f7b500, #f39c12); font-size: 0.95rem; width: 32px; height: 32px; }
.pb-silver { background: linear-gradient(135deg, #b2bec3, #51657a); }
.pb-bronze { background: linear-gradient(135deg, #d98a00, #b57300); }

.podium-avatar {
  width: 58px !important;
  height: 58px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 3px solid #f7b500 !important;
  margin-bottom: 6px !important;
  font-size: 1.4rem !important;
}
.podium-first .podium-avatar {
  width: 72px !important;
  height: 72px !important;
  border-color: #12b76a !important;
  border-width: 4px !important;
}
.podium-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
.podium-avatar.empty {
  background: #dfe6e9 !important;
  color: #51657a !important;
}

.podium-name {
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  color: #0b2239 !important;
  margin: 0 0 4px !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podium-first .podium-name {
  font-size: 0.92rem !important;
  color: #12b76a !important;
}

.podium-time {
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  color: #51657a !important;
  margin-bottom: 8px !important;
}
.podium-first .podium-time {
  color: #d98a00 !important;
  font-size: 0.88rem !important;
}

/* BARRA DE PREMIO ABAJO - GRANDE */
.podium-prize-bar {
  width: 100%;
  text-align: center;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 8px 6px;
  border-radius: 12px;
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  box-shadow: 0 3px 0 rgba(0,0,0,0.12);
  line-height: 1.2;
}
.podium-first .podium-prize-bar {
  font-size: 1.1rem;
  padding: 10px 8px;
}
.pp-1 {
  background: linear-gradient(135deg, #f7b500, #f39c12);
  color: #5d4e00 !important;
  border: 2px solid #fff;
}
.pp-2 {
  background: linear-gradient(135deg, #55efc4, #0fae67);
  color: #fff !important;
}
.pp-3 {
  background: linear-gradient(135deg, #2dd4a7, #6c5ce7);
  color: #fff !important;
}

/* Ocultar bloques viejos del podio si quedan */
.podium-block,
.podium-crown,
.podium-medal,
.podium-avatar-wrap,
.podium-score {
  display: none !important;
}

/* Lista 4+ */
.rank-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.rank-time-col {
  font-size: 0.82rem;
  color: #51657a;
  font-weight: 600;
  margin-left: auto;
  white-space: nowrap;
}
.rank-prize-col {
  font-size: 0.82rem;
  font-weight: 700;
  color: #d98a00;
  min-width: 64px;
  text-align: right;
  white-space: nowrap;
}
.rank-pts { display: none !important; }


/* =========================================================
   MOBILE / CELULAR — ajuste completo a pantallas chicas
   ========================================================= */

#game-screen {
  padding: 12px 10px 16px !important;
  max-height: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: min(100vh, 720px);
  box-sizing: border-box;
}
#game-screen:not(.hidden) {
  display: flex !important;
}
#game-screen.hidden {
  display: none !important;
}
#game-screen .hud {
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
}
#game-screen .game-board {
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 12px !important;
  margin-bottom: 12px !important;
  flex-shrink: 0;
}
#game-screen #btn-quit {
  margin-top: auto;
  margin-bottom: 8px;
  align-self: center;
  min-width: 140px;
}

#game-screen .hud-meta small {
  font-size: 0.58rem;
}

#game-screen .hud-meta strong {
  font-size: 0.95rem;
}

#game-screen .hud-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

#game-screen .hud-icon svg {
  width: 15px;
  height: 15px;
}

/* Botones menú a ancho completo */
.menu-modern .menu-btn,
.menu-btn {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.top-bar,
.menu-top,
.balance-bar,
.tickets-saldo-bar {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Formularios y campos no se salen */
input, select, textarea, button, .btn, .btn-primary, .btn-secondary, .btn-outline {
  max-width: 100%;
  box-sizing: border-box;
}

.form-box input {
  width: 100%;
}

/* Modales centrados y scrolleables en móvil */
.modal-overlay {
  align-items: flex-start !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px !important;
  padding-top: max(12px, env(safe-area-inset-top)) !important;
}

.modal-card {
  max-width: 100% !important;
  width: 100%;
  margin: 12px auto;
  max-height: none;
}

/* Shop / withdraw / referidos */
.shop-modern,
.ref-modern,
.ranking-modern {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.pay-row {
  flex-wrap: wrap;
  gap: 6px;
}

.pay-row-left {
  min-width: 0;
  flex: 1;
  word-break: break-word;
}

/* Ranking countdown banner */
.comp-card,
.countdown-box,
.rank-list-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.podium {
  gap: 4px !important;
  min-height: auto !important;
}

.podium-place {
  max-width: 33% !important;
}

/* Imágenes de logo en menú */
.menu-modern .logo,
.logo {
  max-width: min(180px, 55vw);
  height: auto;
}

/* Evitar zoom raro en inputs iOS */
@media (max-width: 480px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

@media (max-width: 400px) {
  body {
    padding: 4px;
    align-items: flex-start;
  }

  .container {
    max-width: 100%;
  }

  .screen {
    border-radius: 18px;
    padding: 12px 10px;
  }

  h1 {
    font-size: 1.4rem;
  }

  .hud {
    gap: 4px;
    padding: 6px;
  }

  .hud-item {
    padding: 6px 4px;
    gap: 4px;
    border-radius: 12px;
  }

  .hud-icon {
    width: 26px !important;
    height: 26px !important;
  }

  .hud-meta small {
    font-size: 0.55rem !important;
  }

  .hud-meta strong {
    font-size: 0.88rem !important;
  }

  .game-board {
    gap: 4px;
    max-width: 100%;
  }

  .card {
    border-radius: 12px;
  }

  .card::before {
    font-size: 1.15rem;
  }

  .menu-btn {
    padding: 12px 14px !important;
    font-size: 0.95rem !important;
  }

  .qty-control {
    gap: 12px;
  }

  .total-card,
  .pay-data-box,
  .ref-code-card {
    padding: 12px !important;
  }
}

/* Pantallas muy angostas */
@media (max-width: 360px) {
  .hud-meta small {
    display: none;
  }

  .hud-item {
    justify-content: center;
  }

  .card::before {
    font-size: 1rem;
  }

  .top-btn,
  .top-bar button {
    font-size: 0.75rem !important;
    padding: 6px 10px !important;
  }
}

/* Altura corta (celulares horizontales o pequeños) */
@media (max-height: 700px) {
  #game-screen {
    padding-top: 8px !important;
    padding-bottom: 10px !important;
  }

  #game-screen .hud {
    margin-bottom: 8px;
  }

  .logo {
    width: 110px !important;
  }

  .menu-modern {
    padding-top: 10px !important;
  }
}

/* Tablero: que quepa con HUD + salir en viewport */
@media (max-height: 780px) {
  .game-board {
    max-width: 260px !important;
  }
  .card {
    max-width: 56px !important;
    max-height: 56px !important;
  }
}

@media (max-height: 640px) {
  .game-board {
    max-width: 240px !important;
    gap: 4px !important;
  }
  .card {
    max-width: 52px !important;
    max-height: 52px !important;
  }
  .card::before {
    font-size: 1rem;
  }
}

/* Touch: áreas de clic cómodas */
.card,
.menu-btn,
.btn-start-game,
.btn-send-pay,
.qty-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}


/* === CARTAS PEQUEÑAS EN TELÉFONO (prioridad) === */
@media (max-width: 480px) {
  #game-screen {
    min-height: calc(100vh - 24px) !important;
    justify-content: flex-start !important;
    padding-top: 10px !important;
  }
  #game-screen .game-board {
    max-width: min(92vw, 320px) !important;
    width: min(92vw, 320px) !important;
    margin: 18px auto !important;
    gap: 8px !important;
    justify-items: center;
    align-items: center;
  }
  #game-screen .game-board.cols-3 {
    max-width: min(80vw, 280px) !important;
    width: min(80vw, 280px) !important;
  }
  #game-screen .game-board.cols-4 {
    max-width: min(92vw, 320px) !important;
    width: min(92vw, 320px) !important;
  }
  #game-screen .game-board.cols-5 {
    max-width: min(96vw, 340px) !important;
    width: min(96vw, 340px) !important;
    gap: 6px !important;
  }
  #game-screen .game-board.cols-6 {
    max-width: min(98vw, 360px) !important;
    width: min(98vw, 360px) !important;
    gap: 5px !important;
  }
  #game-screen .card {
    max-width: none !important;
    max-height: none !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 14px !important;
  }
  #game-screen .card::before {
    font-size: 1.35rem !important;
  }
  #game-screen .card .card-img {
    width: 72% !important;
    height: 72% !important;
  }
  #game-screen #btn-quit {
    margin-top: 16px !important;
  }
}

@media (max-width: 360px) {
  #game-screen .game-board {
    max-width: 240px !important;
    width: 240px !important;
    gap: 4px !important;
  }
  #game-screen .card {
    max-width: 52px !important;
    max-height: 52px !important;
  }
}


/* Modal estado / countdown compra */
.st-countdown-wrap {
  margin: 12px 0 18px;
  padding: 14px;
  background: #fff8e7;
  border-radius: 16px;
  border: 2px dashed #f7b500;
}
.st-countdown-label {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 6px;
}
.st-countdown {
  font-size: 2rem;
  font-weight: 700;
  color: #12b76a;
  font-family: 'Fredoka', sans-serif;
  letter-spacing: 2px;
}

/* Promo pack 5+2 */
.promo-pack-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin: 0 0 16px;
  border: 2px solid #f7b500;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff8e7, #ffe8c2);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  box-shadow: 0 4px 0 #f0c14b;
  transition: transform 0.12s, box-shadow 0.12s;
}
.promo-pack-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #f0c14b;
}
.promo-pack-btn.active {
  border-color: #0fae67;
  background: linear-gradient(135deg, #e8f8f5, #d1f2eb);
  box-shadow: 0 4px 0 #00a884;
}
.promo-pack-badge {
  background: linear-gradient(135deg, #12b76a, #0e9f5c);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 5px 8px;
  border-radius: 8px;
  flex-shrink: 0;
}
.promo-pack-btn.active .promo-pack-badge {
  background: linear-gradient(135deg, #0fae67, #00a884);
}
.promo-pack-main {
  flex: 1;
  min-width: 0;
}
.promo-pack-main strong {
  display: block;
  font-size: 0.98rem;
  color: #0b2239;
}
.promo-pack-main small {
  display: block;
  font-size: 0.82rem;
  color: #51657a;
  margin-top: 2px;
}
.promo-pack-main small b {
  color: #d98a00;
}
.promo-pack-btn.active .promo-pack-main small b {
  color: #0fae67;
}
.promo-pack-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.promo-pack-gift {
  font-size: 0.95rem;
  font-weight: 800;
  color: #d98a00;
}
.promo-pack-btn.active .promo-pack-gift {
  color: #0fae67;
}
.promo-pack-check {
  display: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0fae67;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  line-height: 22px;
  text-align: center;
}
.promo-pack-btn.active .promo-pack-check {
  display: flex;
}
.promo-gift-banner {
  background: linear-gradient(135deg, #e8f8f5, #d1f2eb);
  border: 2px dashed #0fae67;
  border-radius: 14px;
  padding: 10px 14px;
  margin: 0 0 12px;
  text-align: center;
  font-size: 0.88rem;
  color: #0fae67;
  font-weight: 600;
}
.promo-gift-banner strong {
  color: #008f72;
}
.promo-gift-banner span {
  color: #d98a00;
  font-weight: 700;
}

/* Retiro — badge mínimo y nota */
.withdraw-min-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #e8f4ff, #dfefff);
  color: #0984e3;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 50px;
  margin: 0 auto 14px;
  border: 1.5px solid #b2d7ff;
  box-shadow: 0 2px 8px rgba(9, 132, 227, 0.12);
}
.withdraw-min-badge strong {
  color: #0652dd;
  font-weight: 700;
}
.withdraw-note {
  font-size: 0.8rem;
  color: #888;
  text-align: center;
  margin: 4px 0 14px;
  line-height: 1.4;
  padding: 0 8px;
}
.withdraw-note svg {
  color: #74b9ff;
}


/* Paginación referidos */
.ref-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
  padding: 8px 0 4px;
}
.ref-pager-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #d7e8df;
  background: #fff;
  color: #12b76a;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  box-shadow: 0 3px 0 #ffd4b0;
}
.ref-pager-btn:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
}
.ref-pager-btn:not(:disabled):active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #ffd4b0;
}
.ref-pager-info {
  font-size: 0.9rem;
  font-weight: 700;
  color: #51657a;
  min-width: 48px;
  text-align: center;
}

.withdraw-fee-preview {
  margin: -4px 0 12px;
  padding: 0 4px;
  text-align: left;
  font-size: 0.8rem;
  color: #51657a;
  font-weight: 600;
}
.withdraw-fee-preview strong {
  color: #0ea5a5;
}
.withdraw-fee-preview strong { color: #d98a00; }


/* Tareas principales */
.tasks-box {
  background: #fff;
  border: 2px solid #d7e8df;
  border-radius: 18px;
  padding: 12px 14px;
  margin: 0 0 14px;
  box-shadow: 0 4px 14px rgba(255,107,107,0.08);
}
.tasks-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.tasks-header strong {
  color: #0b2239;
  font-size: 0.95rem;
}
.tasks-badge {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.tasks-badge i, .tasks-badge svg {
  width: 15px;
  height: 15px;
}
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f5faf7;
  border: 1.5px solid #d7e8df;
  border-radius: 12px;
  padding: 10px 12px;
}
.task-item.task-done {
  background: #e8f8f5;
  border-color: #55efc4;
}
.task-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c5ce7;
  flex-shrink: 0;
}
.task-done .task-icon {
  background: #0fae67;
  color: #fff;
}
.task-icon i, .task-icon svg {
  width: 16px;
  height: 16px;
}
.task-title {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  color: #0b2239;
  min-width: 0;
}
.task-status {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0fae67;
}
.task-btn {
  border: none;
  background: linear-gradient(135deg, #12b76a, #0e9f5c);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 2px 0 #0a6b45;
}
.task-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #0a6b45;
}


/* Piezas de tareas */
.pieces-progress-card {
  background: linear-gradient(135deg, #f3e8ff, #e8f4ff);
  border: 2px solid #a29bfe;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
  text-align: center;
}
.pieces-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #6c5ce7;
  margin-bottom: 10px;
}
.pieces-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}
.piece-slot, .piece-ticket {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 2px dashed #b2a0ff;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b2bec3;
}
.piece-slot.filled, .piece-ticket.filled {
  border-style: solid;
  border-color: #0fae67;
  background: #e8f8f5;
  color: #0fae67;
  box-shadow: 0 3px 0 #55efc4;
}
.piece-slot i, .piece-slot svg,
.piece-ticket i, .piece-ticket svg {
  width: 22px;
  height: 22px;
}
.piece-plus, .piece-eq {
  font-weight: 800;
  color: #51657a;
  font-size: 1.1rem;
}
.pieces-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0b2239;
}
.task-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.task-hint {
  font-size: 0.72rem;
  color: #888;
  font-weight: 500;
}
.menu-btn-tasks .menu-btn-icon {
  background: linear-gradient(135deg, #a29bfe, #6c5ce7) !important;
  color: #fff !important;
}

/* Compact mobile menu */
@media (max-width: 480px) {
  .logo-main {
    max-width: min(170px, 48vw) !important;
    max-height: 100px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
  }
  .logo-wrap { margin: 2px 0 6px !important; }
  .profile-bar {
    padding: 8px 12px;
    margin-bottom: 10px;
    border-width: 2px;
  }
  .profile-photo-wrap { width: 44px; height: 44px; }
  .profile-name { font-size: 1rem; }
  .profile-photo-hint { display: none; }
  .stats-bar { padding: 8px 10px; margin-bottom: 10px; }
  .stat-value { font-size: 1rem; }
  .menu-btn {
    padding: 10px 12px !important;
    margin-bottom: 8px !important;
  }
  .menu-btn-text strong { font-size: 0.92rem; }
  .menu-btn-text small { font-size: 0.72rem; }
  .menu-btn-icon {
    width: 38px !important;
    height: 38px !important;
  }
  .promo-card { display: none; }
}


/* ===== HOME GRID (mockup style) ===== */
.home-card {
  background: #fffef8;
  border: 2px solid #d7e8df;
  border-radius: 20px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(255,107,107,0.08);
}
.home-card .profile-bar {
  margin: 0 0 10px;
  border: none;
  background: transparent;
  padding: 4px 2px;
}
.home-card .stats-bar {
  margin: 0;
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #ffe8c2;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.grid-card {
  border: none;
  border-radius: 18px;
  padding: 14px 12px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 110px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.06);
  transition: transform 0.15s;
}
.grid-card:active { transform: scale(0.97); }
.grid-card strong {
  font-size: 0.95rem;
  margin-top: 4px;
}
.grid-card small {
  font-size: 0.72rem;
  opacity: 0.85;
  line-height: 1.25;
  font-weight: 500;
}
.grid-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.grid-icon i, .grid-icon svg { width: 22px; height: 22px; }

.grid-play { background: #ffe8ec; color: #e74c6f; }
.grid-play .grid-icon { background: linear-gradient(135deg,#12b76a,#0e9f5c); }
.grid-shop { background: #e6faf6; color: #0d9488; }
.grid-shop .grid-icon { background: linear-gradient(135deg,#2dd4bf,#14b8a6); }
.grid-rank { background: #f0e8ff; color: #7c3aed; }
.grid-rank .grid-icon { background: linear-gradient(135deg,#a78bfa,#8b5cf6); }
.grid-ref { background: #fff4e0; color: #d97706; }
.grid-ref .grid-icon { background: linear-gradient(135deg,#f59e0b,#f59e0b); }

.tasks-banner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 72px;
  box-shadow: 0 3px 0 #c7d2fe;
  text-align: left;
}
.tasks-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg,#818cf8,#6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tasks-banner-icon i, .tasks-banner-icon svg { width: 20px; height: 20px; }
.tasks-banner-text { flex: 1; min-width: 0; }
.tasks-banner-text strong { display: block; color: #312e81; font-size: 0.95rem; }
.tasks-banner-text small { color: #6366f1; font-size: 0.75rem; }
.tasks-banner-arrow { color: #818cf8; }

/* Bottom nav */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  width: min(420px, calc(100% - 24px));
  background: #fff;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 16px 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.12);
  z-index: 50;
  border: 2px solid #ffe8c2;
}
.bn-item {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  color: #b2bec3;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 12px;
}
.bn-item i, .bn-item svg { width: 22px; height: 22px; }
.bn-item.active { color: #12b76a; }
.bn-star { margin-top: -22px; }
.bn-star-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd54a, #fdcb6e);
  border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(253,203,110,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.bn-star-circle i, .bn-star-circle svg { width: 24px; height: 24px; fill: #fff; }

.profile-edit-photo {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 8px;
  border-radius: 50%;
  border: 3px solid #12b76a;
  background: #ffeaa7;
  cursor: pointer;
}
.profile-photo-lg, .profile-placeholder-lg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.profile-placeholder-lg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0ea5a5;
}
.profile-placeholder-lg i, .profile-placeholder-lg svg { width: 36px; height: 36px; }
.field-label {
  display: block;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: #888;
  margin: 6px 0 2px;
}
#menu-screen.menu-modern {
  padding-bottom: 88px;
}


/* Botón Volver arriba (móvil) */
.btn-back-top {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  margin: 0 0 10px 0;
  padding: 8px 14px;
  border-radius: 50px;
  border: 2px solid #d7e8df;
  background: #fff;
  color: #0ea5a5;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 2px 0 #ffd4b0;
  position: sticky;
  top: 0;
  z-index: 20;
}
.btn-back-top:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #ffd4b0;
}
.screen.shop-modern,
.screen.ref-modern,
.screen.ranking-modern {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.home-card {
  padding: 8px 10px !important;
  margin-bottom: 10px !important;
  border-radius: 16px !important;
}
.home-card .profile-bar {
  gap: 10px !important;
  margin-bottom: 6px !important;
}
.home-card .profile-photo-wrap {
  width: 40px !important;
  height: 40px !important;
}
.home-card .profile-name { font-size: 0.95rem !important; }
.home-card .profile-welcome { font-size: 0.72rem !important; }
.home-card .stats-bar {
  padding: 6px 8px !important;
}
.home-card .stat-value { font-size: 0.95rem !important; }
.home-card .stat-label { font-size: 0.68rem !important; }
.home-card .stat-icon-wrap {
  width: 28px !important;
  height: 28px !important;
}
.menu-grid {
  gap: 8px !important;
  margin-bottom: 10px !important;
}
.grid-card {
  min-height: 92px !important;
  padding: 10px 10px !important;
  border-radius: 14px !important;
}
.grid-card strong { font-size: 0.88rem !important; }
.grid-card small { font-size: 0.68rem !important; }
.grid-icon {
  width: 34px !important;
  height: 34px !important;
  border-radius: 12px !important;
}
.grid-icon i, .grid-icon svg { width: 18px !important; height: 18px !important; }
.tasks-banner {
  padding: 10px 12px !important;
  margin-bottom: 8px !important;
  border-radius: 14px !important;
}
.tasks-banner:last-of-type { margin-bottom: 72px !important; }
.withdraw-banner { background: linear-gradient(135deg, #e8f4ff, #dfefff) !important; box-shadow: 0 3px 0 #b8d4f0 !important; }
.history-banner { background: linear-gradient(135deg, #fff3e6, #e4f1ea) !important; box-shadow: 0 3px 0 #f0c9a8 !important; }
.user-history-list { display: flex; flex-direction: column; gap: 10px; }
.hist-item {
  background: #fff;
  border: 1.5px solid #d7e8df;
  border-radius: 14px;
  padding: 12px;
  text-align: left;
}
.hist-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.hist-item-detail { font-size: 0.85rem; color: #51657a; }
.hist-item-date { font-size: 0.75rem; color: #51657a; margin-top: 4px; }

.menu-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 6px;
}
.duo-btn {
  border: none;
  border-radius: 14px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 3px 0 rgba(0,0,0,0.06);
}
.duo-btn strong { font-size: 0.88rem; color: #0b2239; }
.duo-icon {
  width: 36px; height: 36px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.duo-icon i, .duo-icon svg { width: 18px; height: 18px; }
.duo-btn.withdraw-banner { background: linear-gradient(135deg, #e8f4ff, #dfefff); }
.duo-btn.history-banner { background: linear-gradient(135deg, #fff3e6, #e4f1ea); }

.shop-field-select {
  padding-right: 8px;
}
.shop-field-select select {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.92rem;
  color: #0b2239;
  outline: none;
  width: 100%;
  min-width: 0;
  padding: 4px 0;
}
.play-banner {
  background: linear-gradient(135deg, #ffe8ec, #ffd6dc) !important;
  box-shadow: 0 3px 0 #f5b0b8 !important;
  margin-bottom: 6px !important;
}
.tasks-duo { background: linear-gradient(135deg, #eef2ff, #e0e7ff) !important; }
.duo-btn.grid-shop { background: #e6faf6 !important; }
.duo-btn.grid-rank { background: #f0e8ff !important; }
.duo-btn.grid-ref { background: #fff4e0 !important; }

.menu-duo:last-of-type { margin-bottom: 72px !important; }
.play-banner { margin-top: 0 !important; }
.home-card { margin-bottom: 8px !important; }
.logo-wrap { margin-bottom: 4px !important; }


/* ===== Personas en línea (bajo tablero) ===== */
.online-players {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 12px auto 8px;
  padding: 7px 16px;
  background: linear-gradient(135deg, #fff 0%, #f0fff8 100%);
  border: 1.5px solid #c8f0e0;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #0b2239;
  box-shadow: 0 4px 12px rgba(0, 184, 148, 0.1);
  width: fit-content;
  max-width: 92%;
  line-height: 1.2;
}
.online-players #online-count {
  color: #0fae67;
  font-weight: 800;
}
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0fae67;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(0,184,148,0.5);
  animation: onlinePulse 1.6s infinite;
}
@keyframes onlinePulse {
  0% { box-shadow: 0 0 0 0 rgba(0,184,148,0.45); }
  70% { box-shadow: 0 0 0 7px rgba(0,184,148,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,184,148,0); }
}

/* ===== Toasts flotantes (estilo pastel del proyecto) ===== */
.float-toasts {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 12px));
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 12px;
  box-sizing: border-box;
}
.float-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  background: linear-gradient(135deg, #ffffff 0%, #fff8f0 100%);
  color: #0b2239;
  padding: 11px 14px;
  border-radius: 16px;
  border: 2px solid #d7e8df;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(255, 107, 107, 0.12), 0 2px 8px rgba(0,0,0,0.06);
  animation: toastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1), toastOut 0.45s ease 3.5s forwards;
}
.float-toast .ft-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #55efc4, #0fae67);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0, 184, 148, 0.25);
}
.float-toast .ft-body {
  flex: 1;
  min-width: 0;
}
.float-toast strong {
  color: #0ea5a5;
  font-weight: 700;
}
.float-toast .ft-amount {
  color: #0fae67;
  font-weight: 800;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-10px) scale(0.98); }
}

/* Mobile: más compacto, siempre arriba */
@media (max-width: 480px) {
  .float-toasts {
    top: max(10px, env(safe-area-inset-top, 10px));
    padding: 0 10px;
    gap: 6px;
  }
  .float-toast {
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 0.8rem;
  }
  .float-toast .ft-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 0.9rem;
  }
  .online-players {
    font-size: 0.75rem;
    padding: 6px 12px;
    margin: 10px auto 6px;
    gap: 6px;
  }
  #game-screen .online-players {
    margin-top: 8px;
  }
}


/* ===== Historial usuario: tabs y items ===== */
.uh-tabs {
  display: flex;
  gap: 8px;
  margin: 4px 0 14px;
  padding: 4px;
  background: #fff8f0;
  border: 2px solid #d7e8df;
  border-radius: 16px;
}
.uh-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 8px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  color: #51657a;
  cursor: pointer;
  transition: 0.15s ease;
}
.uh-tab.active {
  background: linear-gradient(135deg, #12b76a, #0e9f5c);
  color: #fff;
  box-shadow: 0 3px 0 #0a6b45;
}
.uh-tab:active { transform: translateY(1px); }

.user-history-list { display: flex; flex-direction: column; gap: 10px; }
.hist-item {
  background: #fff;
  border: 2px solid #ffe8c2;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.06);
}
.hist-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.hist-item-top strong { color: #0b2239; font-size: 0.95rem; }
.hist-item-detail { font-size: 0.85rem; color: #51657a; margin-bottom: 2px; }
.hist-item-date { font-size: 0.75rem; color: #51657a; }


/* Colores historial: retiro rojo, compra amarillo */
.hist-item.hist-wd {
  border-color: #ffc9c9;
  background: linear-gradient(135deg, #fff 0%, #fff5f5 100%);
}
.hist-item.hist-wd .hist-item-amount {
  color: #d63031;
  font-weight: 800;
  font-size: 1rem;
  margin: 2px 0 4px;
}
.hist-item.hist-buy {
  border-color: #ffeaa7;
  background: linear-gradient(135deg, #fff 0%, #fffbeb 100%);
}
.hist-item.hist-buy .hist-item-amount {
  color: #0ea5a5;
  font-weight: 800;
  font-size: 1rem;
  margin: 2px 0 4px;
}
.hist-item .hist-item-detail {
  font-size: 0.8rem;
  color: #888;
}


/* Unlock level + top refs */
.btn-unlock-level {
  width: 100%;
  margin-top: 10px;
  padding: 12px 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 3px 0 #5b4cc4;
}
.btn-unlock-level.hidden { display: none !important; }
.ref-top-users {
  margin: 12px 0 16px;
  background: #fff;
  border: 2px solid #d7e8df;
  border-radius: 16px;
  padding: 12px 14px;
}
.ref-top-title {
  font-weight: 800;
  color: #0ea5a5;
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.ref-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #fff0e0;
  font-size: 0.88rem;
}
.ref-top-row:last-child { border-bottom: none; }
.ref-top-pos { font-weight: 800; color: #f59e0b; width: 28px; }
.ref-top-name { flex: 1; color: #0b2239; font-weight: 600; }
.ref-top-count { color: #0fae67; font-weight: 800; }
.rank-more {
  text-align: center;
  padding: 12px;
  color: #51657a;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Compact mobile UI */
@media (max-width: 480px) {
  .duo-btn {
    padding: 10px 8px !important;
    min-height: 72px !important;
    border-radius: 14px !important;
  }
  .duo-btn strong { font-size: 0.78rem !important; }
  .duo-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 12px !important;
  }
  .duo-icon svg, .duo-icon i { width: 18px !important; height: 18px !important; }
  .play-banner, .menu-btn-play {
    padding: 12px 14px !important;
    border-radius: 16px !important;
  }
  .home-card { padding: 12px !important; border-radius: 16px !important; }
  .shop-modern .shop-header-icon,
  .ref-header-icon {
    width: 52px !important;
    height: 52px !important;
  }
  .ref-code-card, .ref-how {
    padding: 12px !important;
    border-radius: 14px !important;
  }
  .ref-title, .shop-modern h1 {
    font-size: 1.35rem !important;
  }
  #profile-screen .shop-header-icon { width: 48px !important; height: 48px !important; }
  .podium-avatar { width: 52px !important; height: 52px !important; }
  .podium-avatar.first, .podium-place.podium-first .podium-avatar {
    width: 64px !important;
    height: 64px !important;
  }
}


/* ===== COMPACT MOBILE (forzado) ===== */
@media (max-width: 520px) {
  .container {
    max-width: 100% !important;
    padding: 8px 10px !important;
    margin: 0 auto !important;
  }
  .screen.shop-modern,
  .screen.ref-modern,
  .screen.ranking-modern,
  #withdraw-screen,
  #profile-screen,
  #history-user-screen,
  #tasks-screen {
    padding: 12px 12px 18px !important;
    border-radius: 18px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1) !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .shop-header-icon,
  .ref-header-icon,
  #ranking-screen .shop-header-icon,
  .ranking-modern .shop-header-icon {
    width: 44px !important;
    height: 44px !important;
    margin: -28px auto 6px !important;
    border-radius: 12px !important;
  }
  .shop-title, .ref-title, .ranking-modern h1, #ranking-screen h1 {
    font-size: 1.25rem !important;
    margin-bottom: 4px !important;
  }
  .shop-price-badge {
    font-size: 0.75rem !important;
    padding: 4px 10px !important;
    margin-bottom: 10px !important;
  }
  .shop-label { font-size: 0.82rem !important; margin-bottom: 6px !important; }
  .qty-control { gap: 12px !important; margin-bottom: 6px !important; }
  .qty-btn { width: 36px !important; height: 36px !important; font-size: 1.1rem !important; }
  .qty-value { font-size: 1.3rem !important; }
  .shop-total, .total-pay-box {
    padding: 10px 12px !important;
    border-radius: 12px !important;
    font-size: 0.9rem !important;
  }
  .pay-data-card, .ref-code-card, .ref-how, .comp-banner, .milestone-card {
    padding: 10px 12px !important;
    border-radius: 12px !important;
    margin-bottom: 10px !important;
  }
  .pay-data-row { padding: 6px 0 !important; font-size: 0.82rem !important; }
  .ref-code-value { font-size: 1.35rem !important; }
  .ref-link-box { font-size: 0.72rem !important; padding: 8px !important; word-break: break-all !important; }
  .ref-stats-row { gap: 8px !important; }
  .ref-stat-box { padding: 8px !important; border-radius: 12px !important; }
  .btn-copy-ref, .btn-claim-modern, .btn-unlock-level {
    padding: 10px 12px !important;
    font-size: 0.85rem !important;
    border-radius: 12px !important;
  }
  .duo-btn {
    padding: 8px 6px !important;
    min-height: 64px !important;
    border-radius: 12px !important;
    gap: 4px !important;
  }
  .duo-btn strong { font-size: 0.72rem !important; }
  .duo-icon { width: 30px !important; height: 30px !important; border-radius: 10px !important; }
  .duo-icon i, .duo-icon svg { width: 15px !important; height: 15px !important; }
  .play-banner { padding: 10px 12px !important; border-radius: 14px !important; }
  .home-card { padding: 8px !important; }
  .menu-grid { gap: 6px !important; }
  .grid-card { min-height: 78px !important; padding: 8px !important; }
  .grid-card strong { font-size: 0.8rem !important; }
  #withdraw-screen input,
  #withdraw-screen select,
  .shop-modern input,
  .shop-modern textarea {
    font-size: 0.9rem !important;
    padding: 10px 12px !important;
  }
  .btn-primary, .btn-withdraw-main {
    padding: 12px 16px !important;
    font-size: 0.9rem !important;
  }
  .podium-avatar { width: 48px !important; height: 48px !important; }
  .podium-place.podium-first .podium-avatar { width: 58px !important; height: 58px !important; }
  .podium-name { font-size: 0.75rem !important; }
  .podium-time { font-size: 0.7rem !important; }
  .podium-prize-bar { font-size: 0.68rem !important; padding: 4px 6px !important; }
}

/* USDT icon in prizes */
.prize-usdt-ico {
  width: 14px; height: 14px;
  vertical-align: -2px;
  margin-right: 3px;
  display: inline-block;
}
.podium-prize-bar img.prize-usdt-ico,
.rank-prize-col img.prize-usdt-ico {
  width: 13px; height: 13px;
}


/* Prize USDT chip limpio */
.prize-usdt-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  color: #0f766e;
  white-space: nowrap;
}
.prize-usdt-ico {
  width: 16px !important;
  height: 16px !important;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  border-radius: 50%;
  background: #26A17B;
}
.podium-prize-bar {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem !important;
  padding: 5px 8px !important;
}
.podium-prize-bar .prize-usdt-chip { color: inherit; }
.podium-prize-bar small { opacity: 0.85; font-weight: 600; }

/* Botón flotante Top referidos */
.float-top-ref-btn {
  position: fixed;
  right: 14px;
  bottom: 88px;
  z-index: 80;
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #ffd54a, #fdcb6e);
  color: #6d4c00;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.82rem;
  box-shadow: 0 6px 18px rgba(253, 203, 110, 0.45);
  cursor: pointer;
  display: none;
}
#referrals-screen:not(.hidden) ~ /* no */ .float-top-ref-btn,
#referrals-screen:not(.hidden) .float-top-ref-btn,
.ref-modern:not(.hidden) .float-top-ref-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* como el botón está dentro de #referrals-screen */
#referrals-screen .float-top-ref-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#referrals-screen.hidden .float-top-ref-btn {
  display: none !important;
}

.top-ref-modal-card {
  max-width: 380px;
  width: 92%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.top-ref-modal-list {
  overflow-y: auto;
  max-height: 50vh;
  text-align: left;
  margin: 0 -4px;
}
.top-ref-modal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid #fff0e0;
}
.top-ref-medal { width: 28px; text-align: center; font-size: 1.05rem; }
.top-ref-av {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; background: #ffeaa7;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #0ea5a5; font-size: 0.9rem;
}
.top-ref-av-letter { background: linear-gradient(135deg,#a29bfe,#6c5ce7); color: #fff; }
.top-ref-info { flex: 1; min-width: 0; }
.top-ref-info strong { display: block; font-size: 0.9rem; color: #0b2239; }
.top-ref-info small { display: block; font-size: 0.72rem; color: #888; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-ref-n { color: #0fae67; font-weight: 800; font-size: 1rem; }

/* ocultar caja vieja si quedó */
.ref-top-users { display: none !important; }

@media (max-width: 480px) {
  .float-top-ref-btn {
    right: 10px;
    bottom: 78px;
    padding: 10px 12px;
    font-size: 0.75rem;
  }
  .podium-prize-bar { font-size: 0.65rem !important; padding: 4px 6px !important; }
  .prize-usdt-ico { width: 14px !important; height: 14px !important; }
}


/* Tasks countdown */
.tasks-reset-cd {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0ea5a5;
  background: #fff5f0;
  border: 1.5px solid #d7e8df;
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 12px;
}

/* Cofre flotante */
.pot-fab {
  position: fixed;
  left: 12px;
  bottom: 88px;
  z-index: 85;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 18px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #fff8e7, #ffeaa7);
  box-shadow: 0 8px 22px rgba(253, 203, 110, 0.4);
  cursor: pointer;
  font-family: inherit;
}
.pot-fab.hidden { display: none !important; }
.pot-fab-chest {
  font-size: 1.6rem;
  animation: potBob 1.6s ease-in-out infinite;
}
@keyframes potBob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-5px) rotate(4deg); }
}
.pot-fab-info { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.pot-fab-info small { font-size: 0.68rem; color: #51657a; font-weight: 600; }
.pot-fab-info strong { font-size: 0.82rem; color: #0ea5a5; font-weight: 800; }

.pot-modal-card { max-width: 400px; width: 92%; max-height: 85vh; overflow-y: auto; }
.pot-chest-anim {
  font-size: 3rem;
  animation: potBob 1.4s ease-in-out infinite;
  margin-bottom: 4px;
}
.pot-total-box {
  background: linear-gradient(135deg, #fff8e7, #ffeaa7);
  border: 2px solid #fdcb6e;
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  margin: 8px 0;
}
.pot-total-box small { display: block; color: #51657a; font-size: 0.75rem; }
.pot-total-box strong { font-size: 1.4rem; color: #0ea5a5; }
.pot-donate-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0 14px;
}
.pot-donate-row input {
  flex: 1;
  min-width: 100px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid #d7e8df;
  font-family: inherit;
}
.pot-donate-row #pot-amount-unit {
  font-weight: 800;
  color: #0fae67;
  min-width: 40px;
}
.pot-sec-title {
  font-size: 0.9rem;
  color: #0b2239;
  margin: 12px 0 6px;
  text-align: left;
}
.pot-list { text-align: left; max-height: 140px; overflow-y: auto; }
.pot-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #fff0e0;
  font-size: 0.84rem;
}
.pot-chance { color: #6c5ce7; font-size: 0.75rem; font-weight: 700; }
.pot-empty { color: #888; font-size: 0.82rem; padding: 8px 0; }

@media (max-width: 480px) {
  .pot-fab { bottom: 78px; left: 10px; padding: 8px 10px; }
  .pot-fab-chest { font-size: 1.35rem; }
}

.pot-fab-chest-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  animation: potBob 1.6s ease-in-out infinite;
}
.pot-chest-img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  animation: potBob 1.4s ease-in-out infinite;
}

/* Contador encima del cofre */
.pot-fab {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 4px !important;
  padding: 8px 10px !important;
}
.pot-fab-cd {
  display: block;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: #0ea5a5;
  background: rgba(255,255,255,0.75);
  border-radius: 8px;
  padding: 2px 6px;
  letter-spacing: 0.3px;
  line-height: 1.2;
  min-height: 14px;
}
.pot-fab-cd:empty { display: none; }
.pot-fab-cd.done { color: #51657a; }
.pot-fab-main {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pot-modal-cd {
  font-weight: 800 !important;
  color: #0ea5a5 !important;
  font-size: 0.95rem !important;
}

/* Pot UI estilo mockup */
.pot-ui {
  position: relative;
  text-align: center;
  padding: 18px 16px 16px !important;
  border-radius: 24px !important;
  background: linear-gradient(180deg, #fffaf3 0%, #fff 55%) !important;
  max-width: 380px !important;
}
.pot-close-x {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  border: none;
  border-radius: 50%;
  background: #fff0e8;
  color: #0ea5a5;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.pot-chest-wrap { margin: 4px auto 6px; }
.pot-chest-img { width: 110px; height: 110px; object-fit: contain; animation: potBob 1.5s ease-in-out infinite; }
.pot-ui-title {
  font-size: 1.45rem !important;
  font-weight: 900 !important;
  color: #12b76a !important;
  margin: 4px 0 8px !important;
}
.pot-cd-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff5f0;
  border: 1.5px solid #d7e8df;
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #0ea5a5;
}
.pot-rules-text {
  font-size: 0.8rem;
  color: #51657a;
  margin: 0 0 10px;
  line-height: 1.35;
  font-weight: 600;
}
.pot-donate-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.pot-donate-row input {
  flex: 1;
  min-width: 0;
  border: 2px solid #d7e8df;
  border-radius: 14px;
  padding: 11px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
}
.btn-pot-donate {
  border: none;
  border-radius: 14px;
  padding: 11px 14px;
  background: linear-gradient(135deg, #f7b500, #d98a00);
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 0 #0a6b45;
}
.pot-link-card {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: #f8fafc;
  border-radius: 14px;
  padding: 10px 12px;
  margin-top: 8px;
  border: 1.5px solid #eef2f7;
}
.pot-link-ico {
  width: 36px; height: 36px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.pot-link-ico.green { background: #e6faf6; }
.pot-link-ico.purple { background: #f0e8ff; }
.pot-link-txt { flex: 1; min-width: 0; }
.pot-link-txt strong { display: block; font-size: 0.88rem; color: #0b2239; }
.pot-link-txt small { display: block; font-size: 0.72rem; color: #888; }
.pot-list-expand { max-height: 120px; margin-top: 4px; }
.btn-pot-close {
  width: 100%;
  margin-top: 14px;
  border: none;
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(135deg, #55efc4, #0fae67);
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 3px 0 #00a381;
}
.pot-total-box strong {
  font-size: 1.55rem !important;
  color: #0ea5a5 !important;
}


/* ===== Donantes / candidatos del bote (bonito) ===== */
.pot-row {
  color: #0b2239 !important;
}
.pot-donor-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px !important;
  border-bottom: 1px solid #e4f1ea !important;
}
.pot-donor-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.pot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #d7e8df;
  background: #fff5f0;
}
.pot-avatar-fallback {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #12b76a, #2dd4a7);
  color: #fff !important;
  font-weight: 800;
  font-size: 0.9rem;
  border: 2px solid #d7e8df;
}
.pot-donor-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.pot-donor-name {
  font-weight: 800 !important;
  font-size: 0.88rem !important;
  color: #0b2239 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.pot-donor-date {
  font-size: 0.7rem !important;
  color: #95a5a6 !important;
  font-weight: 600;
}
.pot-donor-amt {
  color: #0ea5a5 !important;
  font-weight: 800 !important;
  font-size: 0.88rem !important;
  white-space: nowrap;
  flex-shrink: 0;
}
.pot-rank {
  font-weight: 900;
  color: #6c5ce7;
  font-size: 0.78rem;
  min-width: 22px;
}
.pot-list-expand {
  max-height: 220px !important;
  overflow-y: auto;
  padding: 0 2px;
}
.pot-list-expand::-webkit-scrollbar { width: 4px; }
.pot-list-expand::-webkit-scrollbar-thumb { background: #ffd4b8; border-radius: 4px; }


/* Toggle listas del bote al hacer clic */
.pot-link-card[data-pot-toggle] {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, transform 0.1s;
}
.pot-link-card[data-pot-toggle]:hover {
  background: #fff5f0;
  border-color: #ffd4b8;
}
.pot-link-card[data-pot-toggle]:active {
  transform: scale(0.99);
}
.pot-chevron {
  font-size: 0.7rem;
  color: #51657a;
  font-weight: 800;
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 4px;
}
.pot-link-card.is-open .pot-chevron {
  transform: rotate(180deg);
  color: #0ea5a5;
}
.pot-list-collapsed {
  display: none !important;
}
.pot-list-expand:not(.pot-list-collapsed) {
  display: block;
  max-height: 240px !important;
  overflow-y: auto;
  margin-top: 6px;
  padding: 4px 2px 8px;
  background: #fffaf6;
  border-radius: 12px;
  border: 1px solid #e4f1ea;
}


/* Historial retiros: bruto + neto */
.hist-item-amount {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0;
  font-weight: 700;
  color: #0b2239;
}
.hist-gross {
  font-size: 0.95rem;
  color: #0b2239;
  font-weight: 800;
}
.hist-net {
  font-size: 0.82rem;
  color: #0fae67;
  font-weight: 700;
}
.hist-item-detail {
  font-size: 0.75rem;
  color: #888;
}


/* Empates en el podio: varios avatares juntos */
.podium-avatars-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 2px 0 4px;
}
.podium-avatars-row .podium-avatar {
  margin: 0;
}
.podium-av-tie {
  width: 36px !important;
  height: 36px !important;
  font-size: 0.95rem !important;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
  margin-left: -8px !important;
}
.podium-avatars-row .podium-avatar:first-child {
  margin-left: 0 !important;
}
.podium-tied .podium-name {
  font-size: 0.72rem !important;
  max-width: 110px;
  line-height: 1.2;
  white-space: normal;
  text-align: center;
}
.podium-tie-tag {
  font-size: 0.65rem;
  font-weight: 800;
  color: #b7791f;
  background: #fff3cd;
  border-radius: 999px;
  padding: 1px 7px;
  margin: 2px auto 2px;
  display: inline-block;
}
.rank-tie {
  color: #b7791f;
  font-weight: 700;
  font-size: 0.7rem;
}
.podium-place .podium-avatar img,
.podium-avatars-row .podium-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ===== CANJE SALDO → TICKETS ===== */
.stat-item-saldo {
  position: relative;
  gap: 6px;
}
.btn-convert-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}
.btn-convert-arrow:active {
  transform: scale(0.92);
}
.btn-convert-arrow i,
.btn-convert-arrow svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

/* ===== CONVERT MODAL ===== */
.convert-modal-card {
  max-width: 300px;
  width: calc(100% - 36px);
  padding: 22px 18px 18px;
  position: relative;
  border-radius: 22px;
  text-align: center;
}
.convert-header { margin-bottom: 14px; }
.convert-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.35);
}
.convert-icon-wrap i,
.convert-icon-wrap svg {
  width: 26px;
  height: 26px;
  color: #fff;
  stroke-width: 2.4;
}
.convert-title {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}
.convert-sub {
  margin: 0;
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
}
.convert-saldo-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 16px;
  font-size: 0.78rem;
  color: #0f766e;
  font-weight: 600;
}
.convert-saldo-pill strong {
  font-weight: 800;
  color: #0f172a;
  font-size: 0.9rem;
}
.convert-qty-label {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 600;
}
.convert-qty-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 14px;
}
.convert-qty-btn {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  line-height: 1;
}
.convert-qty-btn:active {
  transform: scale(0.92);
  background: #e2e8f0;
}
.convert-qty-num {
  min-width: 48px;
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  text-align: center;
}
.convert-cost-box {
  background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
  border: 1px solid #a7f3d0;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.convert-cost-label {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 2px;
}
.convert-cost-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.convert-rate-hint {
  display: block;
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 2px;
}
.convert-max-hint {
  margin: 0 0 14px;
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
}
.convert-btn-go {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  box-shadow: 0 6px 16px rgba(20, 184, 166, 0.35);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.convert-btn-go:active { transform: scale(0.97); }
.convert-btn-go:disabled { opacity: 0.65; cursor: not-allowed; }
.convert-btn-cancel {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px;
  cursor: pointer;
}

/* Historial ganancias */
.hist-item.hist-earn {
  border-left: 3px solid #10b981;
}
.hist-item.hist-convert {
  border-left: 3px solid #14b8a6;
}

/* ===== SÍGUENOS WIDGET (solo index) ===== */
.siguenos-widget {
  position: fixed;
  right: 10px;
  bottom: 80px;
  z-index: 1200;
  background: #fff;
  border-radius: 12px;
  padding: 6px 8px 8px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  animation: siguenos-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom right;
}
.siguenos-widget.hidden { display: none !important; }
@keyframes siguenos-in {
  0% { opacity: 0; transform: translateY(14px) scale(0.8); }
  60% { opacity: 1; transform: translateY(-2px) scale(1.05); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.siguenos-close {
  position: absolute;
  top: 1px;
  right: 3px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  z-index: 1;
}
.siguenos-title {
  font-size: 0.65rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 10px;
}
.siguenos-spark { font-size: 0.7rem; }
.siguenos-links {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}
.siguenos-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.siguenos-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.siguenos-btn:active { transform: scale(0.94); }
.siguenos-fb { background: #1877F2; }
.siguenos-ig {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}
.siguenos-svg {
  width: 15px;
  height: 15px;
  display: block;
}
@media (max-width: 380px) {
  .siguenos-widget { right: 8px; bottom: 76px; padding: 5px 7px 7px; }
  .siguenos-btn { width: 28px; height: 28px; }
  .siguenos-svg { width: 14px; height: 14px; }
}

/* ===== Banner Multitag HilltopAds ===== */
.ad-banner-wrap {
  margin: 14px 0 10px;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ad-banner-wrap iframe,
.ad-banner-wrap > div,
.ad-banner-wrap img {
  max-width: 100% !important;
  border-radius: 16px;
}

/* Evitar que el banner se vea muy grande en móviles pequeños */
@media (max-width: 380px) {
  .ad-banner-wrap {
    margin: 12px 0 8px;
    border-radius: 14px;
  }
}

/* ===== Menú compacto 3 columnas (nuevo diseño) ===== */
.menu-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0 14px;
  padding: 0 2px;
}

.grid-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  border: none;
  border-radius: 18px;
  padding: 16px 8px 14px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  min-height: 92px;
}

.grid-btn:active {
  transform: scale(0.96);
}

.grid-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.grid-icon i {
  width: 22px;
  height: 22px;
}

.grid-btn strong {
  font-family: 'Baloo 2', Fredoka, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: #333;
  text-align: center;
  line-height: 1.15;
}
.grid-icon-img {
  background: transparent !important;
  box-shadow: none;
}
.grid-icon-img img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}

/* ===== Card Bote limpio ===== */
.bote-card {
  background: linear-gradient(135deg, #fff9e6, #fff3d0);
  border-radius: 18px;
  padding: 12px 16px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.05);
}

.bote-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bote-chest {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.bote-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bote-status {
  font-size: 0.7rem;
  background: #fff;
  color: #888;
  padding: 2px 10px;
  border-radius: 20px;
  width: fit-content;
  font-weight: 500;
}

.bote-title {
  font-size: 0.95rem;
  color: #333;
  font-weight: 700;
}

.bote-finalizado {
  color: #d98a00;
}

/* Ajustes de espacio general */
.menu-modern .play-banner {
  margin-bottom: 6px !important;
}

@media (max-width: 380px) {
  .menu-grid-3 {
    gap: 8px;
  }
  .grid-btn {
    min-height: 84px;
    padding: 12px 6px 10px;
  }
  .grid-icon {
    width: 38px;
    height: 38px;
  }
  .grid-btn strong {
    font-size: 0.68rem;
  }
}

/* Forzar ocultar el bote flotante viejo si se duplica */
.pot-fab {
  display: none !important;
}

/* Evitar que el bote dinámico viejo se muestre duplicado en el home */
#menu-screen .bote-card-old,
#menu-screen [class*="pot-home"],
#menu-screen .pot-status-card {
  display: none !important;
}

/* Bote clickeable */
.bote-card {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
}
.bote-card:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Contador discreto en el card del Bote */
#bote-home-status {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#bote-home-label {
  transition: color 0.2s;
}


/* Empates agrupados en lista de ranking */
.rank-avatars-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.rank-avatars-wrap .rank-avatar {
  width: 36px;
  height: 36px;
  margin-right: -10px;
  border: 2px solid #fff;
  box-sizing: border-box;
}
.rank-avatars-wrap .rank-avatar:last-of-type { margin-right: 0; }
.rank-av-more {
  font-size: 0.72rem;
  font-weight: 800;
  color: #51657a;
  margin-left: 6px;
}
.rank-row-tie {
  background: linear-gradient(90deg, rgba(255, 230, 109, 0.18), transparent);
  border-radius: 14px;
}
.rank-row-tie .rank-num {
  background: linear-gradient(135deg, #ffd54a, #fdcb6e);
  color: #0b2239;
}


.rank-people {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  flex: 1;
  min-width: 0;
}
.rank-person {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.rank-person .rank-avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  margin: 0;
}
.rank-person-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0b2239;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}
.rank-row-tie .rank-people {
  padding-right: 4px;
}




/* 4º y 5º — tarjetas anchas estilo ranking */
.subpodium {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 2px 8px;
}
.subpodium.hidden { display: none; }

.place-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 18px;
  padding: 12px 14px 12px 10px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.04);
  position: relative;
}
.place-4 {
  background: linear-gradient(90deg, #f3eeff 0%, #fff 40%);
}
.place-5 {
  background: linear-gradient(90deg, #e8fff6 0%, #fff 40%);
}
.place-ribbon {
  flex-shrink: 0;
  width: 28px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%);
  padding-bottom: 6px;
}
.place-4 .place-ribbon {
  background: linear-gradient(180deg, #00c9a7, #0fae67);
}
.place-5 .place-ribbon {
  background: linear-gradient(180deg, #a29bfe, #6c5ce7);
}
.place-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  border: 2.5px solid #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}
.place-avatar img { width: 100%; height: 100%; object-fit: cover; }
.place-avatar.empty { background: #dfe6e9; color: #b2bec3; }

/* Mismo tiempo (no ganan premio): avatares mini al lado */
.place-extras {
  display: flex;
  align-items: center;
  margin-left: -6px;
  margin-right: 2px;
}
.place-extra-av {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #fff;
  margin-left: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 800;
  color: #fff;
  opacity: 0.85;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.place-extra-av:first-child { margin-left: 0; }
.place-extra-av img { width: 100%; height: 100%; object-fit: cover; }

.place-mid {
  flex: 1;
  min-width: 0;
}
.place-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0b2239;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.place-time {
  font-size: 0.8rem;
  font-weight: 600;
  color: #51657a;
  white-space: nowrap;
  flex-shrink: 0;
}
.place-prize {
  font-size: 0.8rem;
  font-weight: 800;
  color: #0ea5a5;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 4px;
}
.place-card-empty { opacity: 0.4; }

/* Lista 6º+ más compacta */
.rank-row-sm {
  padding: 8px 10px !important;
  gap: 8px !important;
}
.rank-row-sm .rank-avatar {
  width: 30px !important;
  height: 30px !important;
}
.rank-row-sm .rank-uname {
  font-size: 0.8rem !important;
}
.rank-row-sm .rank-num {
  width: 24px !important;
  height: 24px !important;
  font-size: 0.72rem !important;
}
.rank-row-sm .rank-time-col,
.rank-row-sm .rank-prize-col {
  font-size: 0.75rem !important;
}

button.rank-more {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #f1f7f4, #e4f1ea);
  color: #0ea5a5;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 #ffd4b8;
  -webkit-tap-highlight-color: transparent;
}
button.rank-more:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #ffd4b8;
}
button.rank-more-less {
  background: #f1f2f6;
  color: #51657a;
  box-shadow: 0 4px 0 #dfe6e9;
}

/* ===== SALA DE JUEGO ===== */
.rooms-modern { padding-bottom: 28px; }
.rooms-tabs {
  display: flex;
  gap: 6px;
  margin: 0 4px 14px;
  background: #0f172a;
  border-radius: 14px;
  padding: 5px;
}
.rooms-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 10px 6px;
  border-radius: 10px;
  cursor: pointer;
}
.rooms-tab.active {
  background: linear-gradient(135deg,#0b2239, #164a7a);
  color: #fff;
}
.rooms-panel { padding: 0 4px; }
.rooms-form-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 16px;
}
.rooms-form-card label {
  display: block;
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 10px 0 4px;
}
.rooms-form-card input,
.rooms-form-card select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid #1e293b;
  background: #0b1220;
  color: #e2e8f0;
  font-size: 0.95rem;
  box-sizing: border-box;
}
.rooms-hint {
  font-size: 0.75rem;
  color: #64748b;
  margin: 10px 0 0;
  line-height: 1.35;
}
.rooms-list { display: flex; flex-direction: column; gap: 10px; }
.room-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.room-card-main { flex: 1; min-width: 0; }
.room-card-name {
  font-weight: 700;
  color: #f1f5f9;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-card-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 3px;
}
.room-card-pot {
  font-size: 0.78rem;
  color: #f59e0b;
  font-weight: 700;
  margin-top: 2px;
}
.room-card-join {
  border: none;
  background: linear-gradient(135deg,#55efc4,#0fae67);
  color: #0b1220;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
}
.room-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  align-items: stretch;
}
.room-card-edit {
  border: none;
  background: linear-gradient(135deg,#74b9ff,#0984e3);
  color: #fff;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.room-card-x {
  border: none;
  background: linear-gradient(135deg,#ff7675,#d63031);
  color: #fff;
  font-weight: 900;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1;
}
.room-card-edit:active, .room-card-x:active {
  transform: scale(0.96);
}
.rooms-empty {
  text-align: center;
  color: #64748b;
  padding: 28px 12px;
  font-size: 0.9rem;
}
.rooms-lobby-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 16px;
}
.rooms-lobby-head h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: #f8fafc;
}
.rooms-code-badge {
  display: inline-block;
  background: #1e293b;
  color: #f59e0b;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 999px;
  letter-spacing: 1px;
}
.rooms-lobby-meta {
  margin-top: 12px;
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.5;
}
.rooms-lobby-pot {
  margin-top: 10px;
  font-size: 1rem;
  color: #f59e0b;
}
.lobby-players { display: flex; flex-direction: column; gap: 8px; }
.lobby-player {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0b1220;
  border-radius: 12px;
  padding: 8px 10px;
}
.lobby-player img,
.lobby-player-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #e2e8f0;
  flex-shrink: 0;
}
.lobby-player-name { flex: 1; font-weight: 600; color: #e2e8f0; font-size: 0.9rem; }
.lobby-host-tag {
  font-size: 0.7rem;
  background: #7c3aed;
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}
.rooms-lobby-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.rooms-lobby-actions .btn { flex: 1; font-size: 0.85rem; }

/* ===== ROOMS 1vs1 MOCKUP ===== */
.rooms-title { text-align:center; color:#12b76a; font-size:1.45rem; margin:4px 0 2px; font-weight:800; }
.rooms-sub { text-align:center; color:#94a3b8; font-size:0.85rem; margin:0 0 12px; }
.rooms-list-head { display:flex; justify-content:space-between; align-items:center; color:#94a3b8; font-size:0.85rem; margin-bottom:10px; }
.rooms-icon-btn { border:none; background:#1e293b; color:#e2e8f0; width:36px; height:36px; border-radius:10px; cursor:pointer; font-size:1.1rem; }
.rooms-cta-red {
  width:100%; border:none; margin-top:14px; padding:14px;
  background:linear-gradient(135deg,#0b2239, #164a7a); color:#fff;
  font-weight:800; font-size:1rem; border-radius:14px; cursor:pointer;
}
.rooms-cta-green {
  width:100%; border:none; margin-top:12px; padding:13px;
  background:linear-gradient(135deg,#2dd4bf,#14b8a6); color:#0b1220;
  font-weight:800; border-radius:14px; cursor:pointer;
}
.rooms-note { font-size:0.75rem; color:#64748b; text-align:center; margin-top:10px; line-height:1.4; }
.rooms-form-title { color:#12b76a; font-weight:800; font-size:0.9rem; margin-bottom:8px; }
.rooms-mode-fixed {
  padding:11px 12px; border-radius:10px; background:#0b1220; border:1px solid #1e293b;
  color:#e2e8f0; font-weight:600;
}
.rooms-bet-row { display:flex; align-items:center; gap:8px; }
.rooms-bet-btn {
  width:42px; height:42px; border:none; border-radius:12px;
  background:#1e293b; color:#fff; font-size:1.3rem; font-weight:700; cursor:pointer;
}
#room-bet-display {
  flex:1; text-align:center; font-weight:800; font-size:1.05rem; color:#f59e0b;
  border:1px solid #1e293b; background:#0b1220; border-radius:10px; padding:11px;
}
.rooms-hint-center { text-align:center; font-size:0.75rem; color:#64748b; margin:6px 0 0; }
.rooms-info-box {
  margin-top:12px; padding:12px; border-radius:12px;
  background:rgba(251,191,36,0.1); border:1px solid rgba(251,191,36,0.25);
  color:#fde68a; font-size:0.8rem; line-height:1.4;
}
.rooms-summary {
  margin-top:12px; padding:12px; border-radius:12px; background:#0b1220;
  border:1px solid #1e293b; font-size:0.82rem; color:#cbd5e1; line-height:1.6;
}
.rooms-summary strong { color:#f59e0b; }
.room-card-join { background:linear-gradient(135deg,#2dd4bf,#14b8a6) !important; color:#0b1220 !important; }
.rooms-lobby-label { text-align:center; color:#12b76a; font-weight:800; font-size:1.1rem; }
.rooms-lobby-sala { text-align:center; margin:8px 0; color:#e2e8f0; font-size:0.95rem; }
.rooms-code-big {
  display:flex; align-items:center; justify-content:center; gap:10px;
  font-size:1.8rem; font-weight:900; letter-spacing:4px; color:#12b76a; margin:8px 0;
}
.rooms-copy-btn { border:none; background:#1e293b; border-radius:10px; padding:8px 10px; cursor:pointer; font-size:1rem; }
.rooms-share-row { display:flex; justify-content:center; gap:12px; margin:12px 0; }
.rooms-share {
  width:44px; height:44px; border-radius:50%; border:none;
  background:#1e293b; color:#e2e8f0; font-weight:800; cursor:pointer;
}
.rooms-vs { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:16px 0; }
.rooms-vs-player { flex:1; text-align:center; }
.rooms-vs-av {
  width:72px; height:72px; border-radius:50%; margin:0 auto 8px;
  background:linear-gradient(135deg,#a78bfa,#6366f1); color:#fff;
  display:flex; align-items:center; justify-content:center; font-size:1.6rem; font-weight:800;
  overflow:hidden; border:3px solid #12b76a;
}
.rooms-vs-av.empty { border-color:#334155; background:#1e293b; color:#64748b; }
.rooms-vs-av img { width:100%; height:100%; object-fit:cover; }
.rooms-vs-name { font-weight:700; color:#e2e8f0; font-size:0.9rem; }
.rooms-vs-tag { font-size:0.72rem; color:#94a3b8; margin-top:2px; }
.rooms-vs-tag.wait { color:#f59e0b; }
.rooms-vs-mid { text-align:center; color:#12b76a; font-weight:900; font-size:1.4rem; }
.rooms-vs-mid small { display:block; font-size:0.7rem; color:#94a3b8; font-weight:600; }
.rooms-details { font-size:0.82rem; color:#94a3b8; line-height:1.7; margin:10px 0; }
.rooms-details b { color:#e2e8f0; float:right; }
.rooms-wait-box {
  padding:12px; border-radius:12px; background:rgba(251,191,36,0.12);
  border:1px solid rgba(251,191,36,0.3); color:#fde68a; font-size:0.8rem; text-align:center;
}
.rooms-cancel-btn {
  width:100%; margin-top:14px; padding:12px; border-radius:12px;
  border:1.5px solid #12b76a; background:transparent; color:#12b76a;
  font-weight:700; cursor:pointer;
}
.rooms-play-head { margin-bottom:10px; }
.rooms-play-scores { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.rps { text-align:center; background:#0f172a; border-radius:12px; padding:8px 12px; min-width:70px; border:1px solid #1e293b; }
.rps span { display:block; font-size:1.3rem; font-weight:900; color:#55efc4; }
.rps.opp span { color:#ff7675; }
.rps small { color:#94a3b8; font-size:0.7rem; }
.rps-pot { font-weight:800; color:#f59e0b; font-size:0.9rem; }
.rooms-play-turn { text-align:center; margin:8px 0; font-weight:700; color:#a78bfa; font-size:0.9rem; }
.room-board {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px;
  background: #0f172a;
  border-radius: 16px;
  border: 1px solid #1e293b;
  width: 100%;
  box-sizing: border-box;
}
.room-card-tile {
  aspect-ratio:1; border-radius:12px; border:none; cursor:pointer;
  background:linear-gradient(135deg,#334155,#1e293b); color:transparent;
  font-size:1.6rem; display:flex; align-items:center; justify-content:center;
  transition: transform .15s, background .15s;
}
.room-card-tile.open, .room-card-tile.matched {
  background:#0b1220; color:#fff; border:2px solid #55efc4;
}
.room-card-tile.matched { border-color:#f59e0b; opacity:0.85; }
.room-card-tile:disabled { cursor:default; opacity:0.7; }

/* Room list nice */
.room-card-nice { align-items: center; }
.room-host-av {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
  border: 2px solid #12b76a; flex-shrink: 0; background: #1e293b;
}
.room-host-av-letter {
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; background: linear-gradient(135deg,#a78bfa,#6366f1);
}
.room-card-host { font-size: 0.75rem; color: #94a3b8; margin-top: 2px; }
.room-card-pots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 0.75rem; color: #cbd5e1; }
.room-pot-badge {
  background: rgba(251,191,36,0.15); color: #f59e0b; font-weight: 800;
  padding: 2px 8px; border-radius: 999px;
}

/* Room board uses same .card as main game */
.room-board.game-board {
  margin: 0 auto; max-width: min(94vw, 400px);
}
.room-board .card {
  border: none; padding: 0; cursor: pointer;
  position: relative;
}
.room-board .card:disabled { cursor: default; }

/* Chat */
.room-chat-box {
  margin-top: 14px; background: #0b1220; border: 1px solid #1e293b;
  border-radius: 14px; padding: 10px; overflow: hidden;
}
.room-chat-title { font-size: 0.8rem; color: #94a3b8; font-weight: 700; margin-bottom: 8px; }
.room-chat-list { max-height: 140px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.room-chat-msg { display: flex; gap: 8px; align-items: flex-start; }
.room-chat-msg.mine { flex-direction: row-reverse; }
.rc-av {
  width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: #334155; display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800; color: #e2e8f0;
}
.rc-av img { width: 100%; height: 100%; object-fit: cover; }
.rc-body {
  background: #1e293b; border-radius: 10px; padding: 6px 10px; max-width: 80%;
}
.room-chat-msg.mine .rc-body { background: #7c3aed; }
.rc-body strong { display: block; font-size: 0.68rem; color: #cbd5e1; }
.rc-body p { margin: 2px 0 0; font-size: 0.82rem; color: #f1f5f9; }
.room-chat-send { display: flex; gap: 6px; margin-top: 8px; }
.room-chat-send input {
  flex: 1; border-radius: 10px; border: 1px solid #1e293b; background: #0f172a;
  color: #e2e8f0; padding: 8px 10px; font-size: 0.85rem;
}
.room-chat-send button {
  border: none; border-radius: 10px; background: linear-gradient(135deg,#0b2239, #164a7a);
  color: #fff; font-weight: 700; padding: 8px 12px; cursor: pointer;
}
.rooms-filters { margin-bottom: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.rooms-filters select {
  flex: 1; min-width: 120px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid #1e293b; background: #0b1220; color: #e2e8f0; font-size: 0.85rem;
}
.rooms-soft .rooms-filters select {
  background: #fff !important; color: #333 !important; border: 2px solid #e5f5ec !important;
}
.rooms-pager {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 10px 0; color: #94a3b8; font-size: 0.85rem;
}
.rooms-pager button {
  border: none; background: #1e293b; color: #e2e8f0; width: 36px; height: 36px;
  border-radius: 10px; cursor: pointer; font-weight: 700;
}
.rooms-pager button:disabled { opacity: 0.4; cursor: default; }
.rooms-global-chat { margin-top: 14px; }
.rps-av {
  width: 40px; height: 40px; border-radius: 50%; margin: 0 auto 4px;
  overflow: hidden; background: #334155; display: flex; align-items: center;
  justify-content: center; font-weight: 800; color: #fff; border: 2px solid #12b76a;
}
.rps-av img { width: 100%; height: 100%; object-fit: cover; }
.rps.opp .rps-av { border-color: #a78bfa; }


/* ===== Rooms match project style (Fredoka) ===== */
#rooms-screen,
#rooms-screen button,
#rooms-screen input,
#rooms-screen select {
  font-family: 'Fredoka', sans-serif !important;
}
.rooms-title { font-family: 'Fredoka', sans-serif; font-weight: 700; }
.rooms-cta-red, .rooms-cta-green, .room-card-join, .rooms-cancel-btn {
  font-family: 'Fredoka', sans-serif !important;
  font-weight: 600;
  border-radius: 16px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.15);
}
.rooms-cta-red:active, .rooms-cta-green:active, .room-card-join:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.12);
}

/* Tablero salas = mismo sistema .card del juego */
.room-board.game-board {
  display: grid !important;
  gap: 6px;
  margin: 10px auto;
  max-width: 300px;
  width: 100%;
  padding: 10px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 20px;
  box-sizing: border-box;
  align-content: start;
  justify-items: stretch;
}
.room-board.game-board.cols-4 { grid-template-columns: repeat(4, 1fr) !important; max-width: 280px; }
.room-board.game-board.cols-5 { grid-template-columns: repeat(5, 1fr) !important; max-width: 300px; gap: 5px; }
.room-board.game-board.cols-6 { grid-template-columns: repeat(6, 1fr) !important; max-width: 320px; gap: 4px; }
.room-board.game-board.cols-8 { grid-template-columns: repeat(5, 1fr) !important; max-width: 300px; gap: 5px; }
.room-board .card {
  width: 100%;
  aspect-ratio: 1;
  border: none;
  outline: none;
  cursor: pointer;
  position: relative;
  background: transparent;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.room-board .card:disabled { cursor: default; }

/* Chat burbujas */
.rooms-global-chat .room-chat-list {
  max-height: 180px;
  padding: 6px 2px;
  gap: 10px;
}
.room-chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 100%;
}
.room-chat-msg.mine {
  flex-direction: row-reverse;
}
.room-chat-msg .rc-av {
  width: 32px; height: 32px; border-radius: 50%;
  flex-shrink: 0; overflow: hidden;
  background: linear-gradient(135deg,#a78bfa,#6366f1);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.room-chat-msg .rc-av img { width: 100%; height: 100%; object-fit: cover; }
.room-chat-msg .rc-body {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 16px 16px 16px 4px;
  background: #1e293b;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.room-chat-msg.mine .rc-body {
  border-radius: 16px 16px 4px 16px;
  background: linear-gradient(135deg, #0b2239, #164a7a);
}
.room-chat-msg .rc-body strong {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 2px;
  font-family: 'Fredoka', sans-serif;
}
.room-chat-msg.mine .rc-body strong { color: rgba(255,255,255,0.85); }
.room-chat-msg .rc-body p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
  color: #f1f5f9;
  font-family: 'Fredoka', sans-serif;
}
.room-chat-send input {
  font-family: 'Fredoka', sans-serif !important;
  border-radius: 20px !important;
  padding: 10px 14px !important;
}
.room-chat-send button {
  font-family: 'Fredoka', sans-serif !important;
  border-radius: 20px !important;
  padding: 10px 16px !important;
  box-shadow: 0 3px 0 rgba(0,0,0,0.15);
}

/* Modal victoria sala */
.room-result-card {
  text-align: center;
  padding: 28px 22px !important;
  font-family: 'Fredoka', sans-serif;
}
.room-result-emoji { font-size: 3rem; margin-bottom: 8px; }
.room-result-card h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  font-weight: 700;
  color: #12b76a;
}
.room-result-msg { color: #64748b; margin: 0 0 12px; font-size: 0.95rem; }
.room-result-prize {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(251,191,36,0.12);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}
.room-result-scores {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: #475569;
}

/* ===== Rooms soft (estilo index claro) ===== */
.rooms-soft .rooms-form-card {
  background: #fff !important;
  border: 2px solid #e5f5ec !important;
  border-radius: 20px !important;
  box-shadow: 0 8px 24px rgba(255,107,107,0.12);
  text-align: left;
}
.rooms-soft .rooms-form-card label {
  color: #888 !important;
  font-weight: 600;
  font-size: 0.82rem;
}
.rooms-soft .rooms-form-card input,
.rooms-soft .rooms-form-card select,
.rooms-soft .rooms-mode-fixed {
  background: #fff8f8 !important;
  border: 2px solid #e5f5ec !important;
  color: #333 !important;
  border-radius: 14px !important;
  font-family: 'Fredoka', sans-serif !important;
}
.rooms-soft #room-bet-display {
  background: #fff8f8 !important;
  border: 2px solid #e5f5ec !important;
  color: #12b76a !important;
  font-family: 'Fredoka', sans-serif !important;
}
.rooms-soft .rooms-bet-btn {
  background: linear-gradient(135deg,#12b76a,#0e9f5c) !important;
  color: #fff !important;
  border-radius: 14px !important;
  box-shadow: 0 3px 0 #d63031;
}
.rooms-soft .rooms-summary {
  background: #fff8f8 !important;
  border: 2px solid #e5f5ec !important;
  color: #555 !important;
  border-radius: 14px !important;
}
.rooms-soft .rooms-summary strong,
.rooms-soft .rooms-summary b { color: #12b76a !important; }
.rooms-soft .rooms-info-box {
  background: #fff9e6 !important;
  border: 1px solid #ffeaa7 !important;
  color: #856404 !important;
  border-radius: 14px !important;
}
.rooms-soft .rooms-tabs {
  background: #f1f2f6 !important;
  border-radius: 50px !important;
  padding: 4px !important;
}
.rooms-soft .rooms-tab {
  color: #51657a !important;
  border-radius: 50px !important;
  font-family: 'Fredoka', sans-serif !important;
}
.rooms-soft .rooms-tab.active {
  background: linear-gradient(135deg,#12b76a,#0e9f5c) !important;
  color: #fff !important;
  box-shadow: 0 3px 0 #0e9f5c;
}
.rooms-soft .rooms-filters select {
  background: #fff !important;
  border: 2px solid #e5f5ec !important;
  color: #333 !important;
  border-radius: 14px !important;
  font-family: 'Fredoka', sans-serif !important;
}
.rooms-soft .room-card-nice {
  background: #fff !important;
  border: 2px solid #e5f5ec !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.rooms-soft .room-card-name { color: #333 !important; }
.rooms-soft .room-card-host, .rooms-soft .room-card-meta { color: #888 !important; }
.rooms-soft .rooms-list-head { color: #888 !important; }
.rooms-soft .rooms-icon-btn {
  background: #f1f2f6 !important;
  color: #51657a !important;
  border-radius: 12px !important;
}
.rooms-soft .rooms-empty { color: #b2bec3 !important; }
.rooms-soft .rooms-note { color: #b2bec3 !important; }
.rooms-soft .rooms-lobby-card,
.rooms-soft .rooms-form-card {
  background: #fff !important;
}
.rooms-soft .rooms-lobby-card {
  border: 2px solid #e5f5ec !important;
  border-radius: 20px !important;
}
.rooms-soft .rooms-lobby-sala,
.rooms-soft .rooms-vs-name,
.rooms-soft .rooms-details { color: #333 !important; }
.rooms-soft .rooms-details b { color: #12b76a !important; float: none; }

/* FAB chat flotante */
.rooms-fab-wrap {
  position: fixed;
  right: 16px;
  bottom: 24px;
  z-index: 9990;
  font-family: 'Fredoka', sans-serif;
}
.rooms-fab-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #12b76a, #0e9f5c);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 6px 0 #d63031, 0 8px 20px rgba(238,90,90,0.4);
  position: relative;
}
.rooms-fab-btn:active { transform: translateY(2px); box-shadow: 0 4px 0 #d63031; }
.rooms-fab-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 14px; height: 14px;
  background: #e0364d;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(231,76,60,0.35);
  animation: fabPulse 1.2s ease infinite;
}
@keyframes fabPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.rooms-fab-dot.hidden { display: none !important; }
.rooms-fab-panel {
  position: absolute;
  bottom: 68px; right: 0;
  width: min(320px, calc(100vw - 32px));
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  border: 2px solid #e5f5ec;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 380px;
}
.rooms-fab-panel.hidden { display: none !important; }
.rooms-fab-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(135deg, #12b76a, #0e9f5c);
  color: #fff;
  font-weight: 600;
}
.rooms-fab-close {
  border: none; background: rgba(255,255,255,0.25);
  color: #fff; width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; font-size: 0.9rem;
}
.rooms-fab-list {
  flex: 1; max-height: 240px; overflow-y: auto;
  padding: 12px; background: #fff8f8;
}
.rooms-fab-panel .room-chat-send {
  padding: 10px; border-top: 1px solid #e5f5ec; background: #fff;
}
.rooms-fab-panel .room-chat-msg .rc-body {
  background: #f1f2f6 !important;
  color: #333 !important;
}
.rooms-fab-panel .room-chat-msg .rc-body strong { color: #51657a !important; }
.rooms-fab-panel .room-chat-msg .rc-body p { color: #333 !important; }
.rooms-fab-panel .room-chat-msg.mine .rc-body {
  background: linear-gradient(135deg,#12b76a,#0e9f5c) !important;
}
.rooms-fab-panel .room-chat-msg.mine .rc-body strong,
.rooms-fab-panel .room-chat-msg.mine .rc-body p { color: #fff !important; }
.rooms-fab-panel .rc-av { cursor: pointer; }

/* Menu retar */
.retar-menu {
  position: fixed;
  z-index: 10000;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  border: 2px solid #e5f5ec;
  padding: 6px;
}
.retar-menu button {
  border: none;
  background: linear-gradient(135deg,#12b76a,#0e9f5c);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
}


/* ===== ARENA 1vs1 (mockup estilo juego) ===== */
.rooms-arena {
  text-align: center;
  padding: 8px 4px 20px;
  font-family: 'Fredoka', sans-serif;
}
.arena-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.arena-player {
  flex: 1;
  background: #fff;
  border-radius: 18px;
  padding: 10px 8px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.08), 0 8px 20px rgba(0,0,0,0.06);
  border: 3px solid #55efc4;
}
.arena-player.opp { border-color: #ff7675; }
.arena-av {
  width: 64px; height: 64px; border-radius: 50%;
  margin: 0 auto 6px; overflow: hidden;
  background: linear-gradient(135deg,#a29bfe,#6c5ce7);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.4rem; color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.arena-av img { width: 100%; height: 100%; object-fit: cover; }
.arena-name {
  font-weight: 700; font-size: 0.9rem; color: #0b2239;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.arena-score {
  margin-top: 6px;
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff8e6; color: #f39c12;
  font-weight: 700; font-size: 0.95rem;
  padding: 4px 12px; border-radius: 999px;
}
.arena-vs-block { flex-shrink: 0; width: 90px; }
.arena-vs {
  font-size: 1.8rem; font-weight: 800;
  color: #fdcb6e;
  text-shadow: 0 3px 0 #0ea5a5, 0 0 12px rgba(253,203,110,0.5);
  line-height: 1;
}
.arena-pot {
  margin-top: 6px;
  background: linear-gradient(135deg,#ffeaa7,#fdcb6e);
  color: #6c4a00;
  font-weight: 700; font-size: 0.78rem;
  padding: 6px 8px; border-radius: 12px;
  box-shadow: 0 3px 0 #0ea5a5;
}
.arena-turn {
  display: inline-block;
  margin: 6px auto 12px;
  background: linear-gradient(135deg,#a29bfe,#6c5ce7);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 18px;
  border-radius: 999px;
  box-shadow: 0 4px 0 #4834d4;
}
.arena-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.arena-tip {
  display: none;
  width: 70px;
  font-size: 0.65rem;
  color: #51657a;
  line-height: 1.3;
  background: rgba(255,255,255,0.7);
  border-radius: 12px;
  padding: 8px 6px;
}
@media (min-width: 420px) {
  .arena-tip { display: block; }
}
.rooms-arena .room-board.game-board {
  display: grid !important;
  flex: none;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  background: linear-gradient(180deg, #6c5ce7, #4834d4);
  border-radius: 20px;
  padding: 12px;
  box-shadow: 0 8px 0 #2d1b8f, 0 12px 28px rgba(108,92,231,0.35);
  border: 3px solid rgba(255,255,255,0.25);
  box-sizing: border-box;
  align-content: start;
  justify-items: stretch;
}
.rooms-arena .room-board .card {
  border-radius: 12px;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-width: 0;
  min-height: 0;
}
.arena-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: center;
}
.arena-btn {
  font-family: 'Fredoka', sans-serif !important;
  font-weight: 600;
  border: none;
  border-radius: 16px;
  padding: 12px 16px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,0.15);
}
.arena-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.12); }
.arena-btn.leave {
  background: linear-gradient(135deg,#51657a,#0b2239);
  color: #fff;
  flex: 1;
}
.arena-btn.chat {
  background: linear-gradient(135deg,#0fae67,#00a884);
  color: #fff;
  flex: 1;
}

/* Hide old rps when arena present */
.rooms-arena .rooms-play-head { display: none; }

.rooms-fab-img {
  width: 28px; height: 28px; object-fit: contain;
  display: block; margin: 0 auto;
}
.arena-chat-img {
  width: 18px; height: 18px; vertical-align: middle; margin-right: 4px;
}
.rooms-inline-chat {
  margin-top: 14px;
  background: #fff !important;
  border: 2px solid #e5f5ec !important;
  border-radius: 18px !important;
}
.rooms-inline-chat .room-chat-list {
  max-height: 160px;
  background: #fff8f8;
}
.rooms-inline-chat .rc-body {
  background: #f1f2f6 !important;
}
.rooms-inline-chat .room-chat-msg.mine .rc-body {
  background: linear-gradient(135deg,#12b76a,#0e9f5c) !important;
}
.rooms-inline-chat .room-chat-msg .rc-body p,
.rooms-inline-chat .room-chat-msg .rc-body strong { color: #333 !important; }
.rooms-inline-chat .room-chat-msg.mine .rc-body p,
.rooms-inline-chat .room-chat-msg.mine .rc-body strong { color: #fff !important; }

/* Tablero adaptable — misma grilla en todos los dispositivos */
.rooms-arena .room-board.game-board.cols-4 {
  grid-template-columns: repeat(4, 1fr) !important;
  max-width: 280px;
  gap: 6px;
  padding: 10px;
}
.rooms-arena .room-board.game-board.cols-5 {
  grid-template-columns: repeat(5, 1fr) !important;
  max-width: 300px;
  gap: 5px;
  padding: 8px;
}
.rooms-arena .room-board.game-board.cols-6 {
  grid-template-columns: repeat(6, 1fr) !important;
  max-width: 320px;
  gap: 4px;
  padding: 8px;
}
.rooms-arena .room-board.game-board.cols-5 .card,
.rooms-arena .room-board.game-board.cols-6 .card {
  border-radius: 10px;
}
.rooms-arena .room-board.game-board.cols-5 .card .card-img,
.rooms-arena .room-board.game-board.cols-6 .card .card-img {
  max-width: 70%;
  max-height: 70%;
}
.rooms-arena .room-board.game-board.cols-4 .card .card-img {
  max-width: 75%;
  max-height: 75%;
}
@media (max-width: 380px) {
  .rooms-arena .room-board.game-board.cols-4,
  .rooms-arena .room-board.game-board.cols-5,
  .rooms-arena .room-board.game-board.cols-6 {
    max-width: 96%;
  }
  .arena-av { width: 52px; height: 52px; }
  .arena-vs { font-size: 1.4rem; }
}

.rooms-chat-bubble-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 8px;
  justify-content: center;
}
.rooms-chat-bubble-btn {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #12b76a, #0e9f5c);
  box-shadow: 0 5px 0 #b57300, 0 8px 18px rgba(247,181,0,0.35);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.rooms-chat-bubble-btn:active { transform: translateY(2px); box-shadow: 0 3px 0 #b57300; }
.rooms-chat-bubble-img { width: 28px; height: 28px; object-fit: contain; }
.rooms-chat-bubble-emoji { font-size: 1.5rem; }
.rooms-chat-bubble-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
  color: #888;
  font-weight: 600;
}
.rooms-chat-bubble-btn .rooms-fab-dot {
  top: 4px; right: 4px;
}
.rooms-chat-bubble-btn.has-msg {
  animation: bubbleShake 0.6s ease infinite;
}
@keyframes bubbleShake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-6deg) scale(1.05); }
  75% { transform: rotate(6deg) scale(1.05); }
}

.arena-btn.leave {
  background: linear-gradient(135deg, #f7b500, #d98a00) !important;
  box-shadow: 0 4px 0 #b71c1c !important;
  color: #fff !important;
  font-size: 0.95rem;
}
.arena-leave-ico { margin-right: 4px; }
.arena-btn.react {
  background: linear-gradient(135deg, #ffeaa7, #fdcb6e) !important;
  box-shadow: 0 4px 0 #0ea5a5 !important;
  color: #0b2239 !important;
  font-size: 1.4rem;
  width: 56px;
  flex: 0 0 56px !important;
  padding: 10px !important;
}
.room-react-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
  padding: 10px;
  background: #fff;
  border-radius: 16px;
  border: 2px solid #e5f5ec;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.room-react-panel.hidden { display: none !important; }
.room-react-panel button {
  width: 44px; height: 44px;
  border: none;
  border-radius: 12px;
  background: #fff8f8;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 2px 0 #e5f5ec;
}
.room-react-panel button:active { transform: scale(0.92); }
.room-react-float {
  position: fixed;
  right: 16px;
  bottom: 28%;
  left: auto;
  top: auto;
  transform: none;
  font-size: 2.4rem;
  z-index: 9995;
  pointer-events: none;
  animation: reactSlide 1.15s ease forwards;
  text-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.room-react-float.hidden { display: none !important; }
@keyframes reactSlide {
  0% { opacity: 0; transform: translateX(40px) scale(0.6); }
  25% { opacity: 1; transform: translateX(0) scale(1.15); }
  70% { opacity: 1; transform: translateX(-6px) scale(1); }
  100% { opacity: 0; transform: translateX(-18px) scale(0.9); }
}

.rooms-chat-wrap {
  position: relative;
  z-index: 50;
}
.rooms-chat-popover {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: min(280px, 78vw);
  max-height: 260px;
  background: #fff;
  border-radius: 16px;
  border: 2px solid #e5f5ec;
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 60;
}
.rooms-chat-popover.hidden { display: none !important; }
.rooms-chat-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: linear-gradient(135deg,#12b76a,#0e9f5c);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
}
.rooms-chat-pop-list {
  max-height: 150px !important;
  padding: 8px !important;
  background: #fff8f8;
  flex: 1;
  overflow-y: auto;
}
.rooms-chat-popover .room-chat-send {
  padding: 8px;
  border-top: 1px solid #e5f5ec;
}
.rooms-chat-popover .room-chat-send input {
  font-size: 0.85rem !important;
  padding: 8px 10px !important;
}
.rooms-chat-popover .room-chat-send button {
  padding: 8px 12px !important;
  font-size: 0.85rem !important;
}

/* Reacción sobre avatar */
.arena-av {
  position: relative;
}
.arena-react-bubble {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 1.5rem;
  line-height: 1;
  animation: reactAv 1.4s ease forwards;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
  z-index: 5;
  pointer-events: none;
}
@keyframes reactAv {
  0% { opacity: 0; transform: scale(0.3) translateY(8px); }
  25% { opacity: 1; transform: scale(1.25) translateY(0); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.8) translateY(-10px); }
}

/* Hide old big FAB during rooms list - use popover only */
#rooms-screen #rooms-fab-wrap { display: none !important; }

/* Banner horizontal Sala de juego (menú) — animado */
.rooms-banner-btn {
  grid-column: 1 / -1;
  width: 100%;
  border: none;
  padding: 0;
  margin: 6px 0 10px;
  border-radius: 18px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
  position: relative;
  box-shadow:
    0 6px 0 rgba(214, 48, 49, 0.25),
    0 12px 28px rgba(255, 107, 107, 0.35);
  font-family: 'Fredoka', sans-serif;
  animation: bannerFloat 3s ease-in-out infinite;
}
.rooms-banner-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255,255,255,0.55) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: bannerShine 2.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}
.rooms-banner-btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  background: linear-gradient(90deg, #12b76a, #fdcb6e, #a29bfe, #12b76a);
  background-size: 300% 100%;
  animation: bannerBorder 4s linear infinite;
  z-index: -1;
  opacity: 0.9;
}
.rooms-banner-btn:hover {
  animation: bannerPulse 0.9s ease-in-out infinite;
}
.rooms-banner-btn:active {
  transform: translateY(3px) scale(0.98);
  box-shadow: 0 3px 0 rgba(214, 48, 49, 0.2), 0 6px 14px rgba(255,107,107,0.25);
}
.rooms-banner-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: cover;
  object-position: center;
  border-radius: 18px;
  border: 3px solid rgba(255,255,255,0.95);
  position: relative;
  z-index: 1;
}
@keyframes bannerFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes bannerShine {
  0% { background-position: 120% 0; }
  100% { background-position: -80% 0; }
}
@keyframes bannerBorder {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
@keyframes bannerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}
.rooms-banner-fallback-text {
  display: none;
  padding: 18px 16px;
  background: linear-gradient(135deg, #12b76a, #0e9f5c, #a29bfe);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: 18px;
  text-align: center;
}
.rooms-banner-btn.rooms-banner-fallback .rooms-banner-fallback-text {
  display: block;
}
.rooms-banner-btn.rooms-banner-fallback .rooms-banner-img {
  display: none;
}

.rooms-intro-card {
  position: relative;
  text-align: left;
  max-width: 340px;
}
.rooms-intro-card h2 {
  text-align: center;
}
.rooms-intro-x {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: #f1f2f6;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  color: #51657a;
  font-family: 'Fredoka', sans-serif;
}
.rooms-intro-body {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.45;
}
.rooms-intro-body ul {
  margin: 10px 0 0;
  padding-left: 18px;
}
.rooms-intro-body li {
  margin-bottom: 6px;
}
.rooms-intro-card .room-result-emoji {
  text-align: center;
}

/* Reacción FUERA del avatar (no cortada) */
.arena-player {
  position: relative;
  overflow: visible !important;
}
.arena-av {
  overflow: visible !important;
  position: relative;
}
.arena-react-bubble {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  font-size: 2rem;
  line-height: 1;
  z-index: 20;
  pointer-events: none;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.25));
  animation: reactAvOut 1.5s ease forwards;
}
@keyframes reactAvOut {
  0% { opacity: 0; transform: translateX(-50%) translateY(12px) scale(0.4); }
  20% { opacity: 1; transform: translateX(-50%) translateY(-4px) scale(1.2); }
  55% { opacity: 1; transform: translateX(-50%) translateY(-14px) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-28px) scale(0.9); }
}
.arena-top {
  overflow: visible;
}
.rooms-arena {
  overflow: visible;
}

/* Chat full mobile sheet */
.rooms-chat-sheet {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.rooms-chat-sheet.hidden { display: none !important; }
.rooms-chat-sheet-inner {
  width: 100%;
  max-width: 420px;
  height: min(88vh, 640px);
  background: #fff;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.2);
  font-family: 'Fredoka', sans-serif;
  animation: sheetUp 0.28s ease;
}
@keyframes sheetUp {
  from { transform: translateY(40%); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
.rooms-chat-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg,#12b76a,#0e9f5c);
  color: #fff;
  border-radius: 20px 20px 0 0;
  flex-shrink: 0;
}
.rooms-chat-sheet-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px !important;
  max-height: none !important;
  background: #fff8f8;
  -webkit-overflow-scrolling: touch;
}
.rooms-chat-sheet-send {
  flex-shrink: 0;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid #e5f5ec;
  background: #fff;
  display: flex;
  gap: 8px;
}
.rooms-chat-sheet-send input {
  flex: 1;
  border-radius: 20px !important;
  border: 2px solid #e5f5ec !important;
  padding: 12px 14px !important;
  font-family: 'Fredoka', sans-serif !important;
  font-size: 1rem !important;
  background: #fff !important;
  color: #333 !important;
}
.rooms-chat-sheet-send button {
  border-radius: 20px !important;
  padding: 12px 16px !important;
  font-family: 'Fredoka', sans-serif !important;
  background: linear-gradient(135deg,#12b76a,#0e9f5c) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 600;
}

/* Create form more compact on mobile */
.rooms-soft .rooms-form-card {
  padding: 12px 12px !important;
}
.rooms-soft .rooms-form-card label {
  margin-top: 6px !important;
  margin-bottom: 2px !important;
  font-size: 0.78rem !important;
}
.rooms-soft .rooms-form-card input,
.rooms-soft .rooms-form-card select,
.rooms-soft .rooms-mode-fixed {
  padding: 8px 10px !important;
  font-size: 0.9rem !important;
}
.rooms-soft .rooms-info-box {
  padding: 8px 10px !important;
  font-size: 0.78rem !important;
  margin: 8px 0 !important;
}
.rooms-soft .rooms-summary {
  padding: 8px 10px !important;
  font-size: 0.82rem !important;
  line-height: 1.4;
}
.rooms-soft .rooms-cta-red {
  padding: 12px !important;
  margin-top: 8px !important;
}
.rooms-soft .rooms-hint-center {
  font-size: 0.75rem;
  margin: 4px 0 6px;
}

.rooms-intro-warn {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #0ea5a5;
  text-align: center;
  font-weight: 600;
}
#btn-rooms-intro-ok:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

/* Apuesta tickets + canjear */
.rooms-tickets-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 4px;
  padding: 10px 12px;
  background: #fff8f0;
  border: 2px solid #d7e8df;
  border-radius: 14px;
  font-size: 0.85rem;
  color: #51657a;
}
.rooms-tickets-bar strong { color: #0ea5a5; font-weight: 700; }
.rooms-canjear-btn {
  border: none;
  background: linear-gradient(135deg, #74b9ff, #0984e3);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.rooms-canjear-btn:active { transform: scale(0.96); }
.arena-timer {
  text-align: center;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: #6c5ce7;
  margin: 4px 0 8px;
}

.rooms-pay-toggle {
  display: flex; gap: 8px; margin-bottom: 10px;
}
.rooms-pay-opt {
  flex: 1; border: 2px solid #e5f5ec; background: #fff;
  border-radius: 14px; padding: 10px; cursor: pointer;
  font-family: Fredoka, sans-serif; font-weight: 600; font-size: 0.85rem;
  color: #51657a;
}
.rooms-pay-opt.active {
  border-color: #12b76a;
  background: linear-gradient(135deg,#fff5f5,#e5f5ec);
  color: #b57300;
}

/* NOVEDADES */
.novedades-card { text-align: center; max-width: 340px; }
.novedades-badge {
  display: inline-block;
  background: linear-gradient(135deg,#ffd54a,#fdcb6e);
  color: #6c3b00;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.novedades-body {
  text-align: left;
  font-size: 0.9rem;
  color: #51657a;
  line-height: 1.45;
  margin: 10px 0 4px;
}
.novedades-body ul {
  margin: 10px 0 0;
  padding-left: 18px;
}
.novedades-body li { margin: 6px 0; }

/* Modal novedades con imagen completa (poster) */
.novedades-img-card {
  max-width: min(360px, 92vw) !important;
  width: 100% !important;
  padding: 10px 10px 14px !important;
  overflow: hidden !important;
  background: #fff !important;
  border-radius: 20px !important;
  box-sizing: border-box !important;
}
.novedades-poster {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: min(70vh, 520px) !important;
  object-fit: contain !important;
  object-position: center top !important;
  border-radius: 14px !important;
  margin: 0 auto 12px !important;
}
.novedades-actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  padding: 0 4px !important;
}
.novedades-btn-probar,
.novedades-btn-later {
  width: 100% !important;
  margin: 0 !important;
}
@media (max-width: 380px) {
  .novedades-img-card {
    max-width: 94vw !important;
    padding: 8px 8px 12px !important;
  }
  .novedades-poster {
    max-height: min(62vh, 420px) !important;
  }
}

/* Cuenta regresiva 3-2-1 */
.room-countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(15, 23, 42, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.room-countdown-overlay.hidden { display: none !important; }
.room-countdown-num {
  font-family: 'Fredoka', sans-serif;
  font-weight: 800;
  font-size: 5.5rem;
  color: #fff;
  text-shadow: 0 6px 24px rgba(108,92,231,0.6);
  animation: cd-pop 0.45s ease;
}
.room-countdown-num.go {
  font-size: 2.8rem;
  color: #55efc4;
}
@keyframes cd-pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.retar-create-tip {
  background: linear-gradient(135deg,#fff5f5,#e5f5ec);
  border: 2px solid #ffd54a;
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: #b57300;
  font-family: 'Fredoka', sans-serif;
}

/* En línea sobre banner */
.rooms-online-wrap { display:none !important;
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0 0 6px;
}
.rooms-online-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.95);
  border: 1px solid #dfe6e9;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.78rem;
  color: #51657a;
  font-family: 'Fredoka', sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.rooms-online-badge strong {
  color: #0fae67;
  font-weight: 700;
}
.retar-menu {
  z-index: 20050 !important;
}

/* Contador EN LÍNEA dentro del banner (como el diseño) */
.rooms-banner-btn {
  position: relative;
  overflow: hidden;
}
.rooms-online-on-banner {
  position: static;
  margin: 8px auto 0;
  left: auto;
  right: auto;
  bottom: auto;
  transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  padding: 5px 14px;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: #5f6c7b;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  pointer-events: none;
  z-index: 3;
  line-height: 1.2;
}
 .rooms-online-on-banner strong {
  color: #0b2239;
  font-weight: 800;
  font-size: 0.66rem;
}
.rooms-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0fae67;
  box-shadow: 0 0 0 3px rgba(0,184,148,0.22);
  flex-shrink: 0;
}
@media (min-width: 400px) {
  .rooms-online-on-banner { font-size: 0.62rem; padding: 3px 8px; right: 8px; bottom: 8px; left:auto; transform:none; }
  .rooms-online-on-banner strong { font-size: 0.85rem; }
}


/* =========================================================
   SOLO salas 1vs1: tablero grande y usable
   NO cambia el juego individual (#game-screen) ni el estilo de cartas base
   ========================================================= */
.rooms-arena .arena-mid {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
  gap: 0 !important;
}
.rooms-arena .arena-tip {
  display: none !important;
}

/* Tablero de sala: ancho real del contenedor */
.rooms-arena #room-board.room-board.game-board,
.rooms-arena .room-board.game-board {
  display: grid !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 8px auto 12px !important;
  padding: 12px !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  background: linear-gradient(180deg, #6c5ce7, #4834d4) !important;
  border-radius: 20px !important;
  border: 3px solid rgba(255,255,255,0.25) !important;
  box-shadow: 0 8px 0 #2d1b8f, 0 12px 28px rgba(108,92,231,0.35) !important;
}

.rooms-arena #room-board.cols-4,
.rooms-arena .room-board.game-board.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
.rooms-arena #room-board.cols-5,
.rooms-arena .room-board.game-board.cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 6px !important;
}
.rooms-arena #room-board.cols-6,
.rooms-arena .room-board.game-board.cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 5px !important;
}

/* Cartas del 1vs1: SIN max-width 64px — llenan la celda del grid */
.rooms-arena #room-board .card,
.rooms-arena .room-board .card {
  max-width: none !important;
  max-height: none !important;
  width: 100% !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 14px !important;
}

.rooms-arena #room-board .card::before,
.rooms-arena .room-board .card::before {
  font-size: clamp(1.1rem, 6vw, 1.8rem) !important;
}

.rooms-arena #room-board .card .card-img,
.rooms-arena .room-board .card .card-img {
  width: 75% !important;
  height: 75% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
}

.rooms-arena .arena-actions {
  width: 100% !important;
  max-width: 100% !important;
  margin-top: 10px !important;
}

.rooms-arena .arena-top {
  width: 100% !important;
  max-width: 100% !important;
}

/* Banner volver a sala */
.rooms-return-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(135deg, #0b2239, #0984e3);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 14px;
}
.rooms-return-banner.hidden { display: none !important; }


/* === NOVEDADES POSTER FIX FINAL === */
#novedades-modal.modal-overlay {
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  z-index: 30000 !important;
}
#novedades-modal .novedades-img-card.modal-card {
  max-width: min(340px, 90vw) !important;
  width: min(340px, 90vw) !important;
  margin: auto !important;
  padding: 8px 8px 12px !important;
  overflow: visible !important;
  max-height: 90vh !important;
}
#novedades-modal .novedades-poster {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-height: 68vh !important;
  object-fit: contain !important;
  border-radius: 12px !important;
}
#novedades-modal .novedades-actions {
  margin-top: 8px !important;
}


/* Reto / Revancha: visibles en index y cualquier pantalla */
#retar-recv-modal.modal-overlay,
#rematch-recv-modal.modal-overlay,
#rematch-waiting-modal.modal-overlay,
#challenge-status-modal.modal-overlay {
  z-index: 99999 !important;
  position: fixed !important;
  inset: 0 !important;
}
#retar-recv-modal.modal-overlay:not(.hidden),
#rematch-recv-modal.modal-overlay:not(.hidden),
#rematch-waiting-modal.modal-overlay:not(.hidden),
#challenge-status-modal.modal-overlay:not(.hidden) {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#retar-recv-modal.modal-overlay.hidden,
#rematch-recv-modal.modal-overlay.hidden,
#rematch-waiting-modal.modal-overlay.hidden,
#challenge-status-modal.modal-overlay.hidden {
  display: none !important;
}


/* ===== Mesas 1vs1 (estilo lista) — un poco más compactas ===== */
.mesa-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 16px;
  padding: 10px 10px;
  margin: 0 0 8px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.04);
  flex-wrap: wrap;
}
.mesa-bet-pill i,
.mesa-time-pill i,
.mesa-entrada-label i {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
  vertical-align: -2px;
  display: inline-block;
}
.mesa-entrada-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.mesa-card-playing {
  border-color: rgba(255,107,107,0.35);
  background: linear-gradient(180deg, #fff 0%, #fff5f5 100%);
}
.mesa-card-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
  flex: 0 0 auto;
}
.mesa-icon {
  width: 36px; height: 36px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.mesa-icon svg { width: 18px; height: 18px; }
.mesa-title { display: block; font-size: 0.95rem; color: #0b2239; }
.mesa-sub { font-size: 0.72rem; color: #95a5a6; margin-top: 2px; }
.mesa-vs {
  display: flex; align-items: center; gap: 6px; flex: 1; min-width: 140px;
  justify-content: center;
}
.mesa-player {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 56px;
}
.mesa-player span {
  font-size: 0.65rem; color: #51657a; max-width: 56px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center;
}
.mesa-av {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  background: #dfe6e9;
}
.mesa-av-letter, .mesa-av-empty {
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #51657a; font-size: 0.9rem;
}
.mesa-av-empty { border: 2px dashed #b2bec3; background: #f8f9fa; color: #b2bec3; }
.mesa-vs-label {
  font-weight: 800; font-size: 0.75rem; color: #fdcb6e;
  letter-spacing: 0.04em;
}
.mesa-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  margin-left: auto; min-width: 88px;
}
.mesa-bet-pill, .mesa-time-pill {
  font-size: 0.72rem; font-weight: 700; color: #51657a;
  background: #f1f2f6; padding: 2px 8px; border-radius: 999px;
}
.mesa-btn-play {
  margin-top: 4px;
  border: none; border-radius: 999px;
  padding: 8px 16px; font-family: Fredoka, sans-serif; font-weight: 700;
  font-size: 0.85rem; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  box-shadow: 0 3px 0 #0f9f8a;
}
.mesa-btn-play:active { transform: translateY(2px); box-shadow: 0 1px 0 #0f9f8a; }
.mesa-playing-badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 4px; padding: 6px 10px; border-radius: 999px;
  background: linear-gradient(135deg, #12b76a, #0ea5a5);
  color: #fff; font-weight: 800; font-size: 0.72rem; letter-spacing: 0.04em;
}
.mesa-swords {
  display: inline-block;
  animation: mesaSwords 0.7s ease-in-out infinite alternate;
  transform-origin: center;
}
@keyframes mesaSwords {
  from { transform: rotate(-18deg) scale(1); }
  to { transform: rotate(18deg) scale(1.12); }
}

/* Chat: punto rojo que palpita */
.chat-dot-pulse,
#rooms-fab-dot.chat-dot-pulse,
#rooms-chat-bubble-dot.chat-dot-pulse {
  animation: chatDotPulse 1s ease-in-out infinite !important;
  background: #ff3b30 !important;
  box-shadow: 0 0 0 0 rgba(255,59,48,0.55);
}
@keyframes chatDotPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,59,48,0.5); }
  70% { transform: scale(1.25); box-shadow: 0 0 0 8px rgba(255,59,48,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,59,48,0); }
}


/* Lobby stats + Estoy listo */
.lobby-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.lobby-stat {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 8px; border-radius: 14px;
  background: #f8fafc;
}
.lobby-stat-bet { background: #eef6ff; }
.lobby-stat-pot { background: #eefbf3; }
.lobby-stat-cards { background: #fff7ed; }
.lobby-stat-ico { font-size: 1.2rem; }
.lobby-stat small { display: block; font-size: 0.68rem; color: #94a3b8; font-weight: 600; }
.lobby-stat strong { font-size: 0.85rem; color: #1e293b; }
.lobby-ready-wrap {
  text-align: center; margin: 12px 0 8px;
}
.lobby-ready-status {
  font-weight: 700; color: #f59e0b; margin-bottom: 10px; font-size: 0.95rem;
}
.btn-lobby-im-ready {
  width: 100%; padding: 16px; border: none; border-radius: 16px;
  font-family: Fredoka, sans-serif; font-weight: 800; font-size: 1.15rem;
  background: linear-gradient(135deg, #55efc4, #0fae67); color: #053;
  box-shadow: 0 5px 0 #00a884; cursor: pointer;
}
.btn-lobby-im-ready:disabled { opacity: 0.85; cursor: default; box-shadow: none; }
.rooms-share-labels {
  display: flex; justify-content: space-around; font-size: 0.7rem; color: #94a3b8;
  margin: -4px 0 10px; font-weight: 600;
}
.mesa-entrada-label {
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.04em;
  color: #0f766e; margin-right: 2px;
}
.mesa-bet-pill { font-size: 0.72rem; }

/* =========================================================
   Chat burbuja izquierda + ENTRADA con iconos
   ========================================================= */

/* ENTRADA con iconos Lucide */
.room-entry-line {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-family: 'Fredoka', sans-serif;
}
.room-entry-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0fae67;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.room-entry-label i,
.room-entry-meta i {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
}
.room-entry-amount {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0b2239;
}
.room-entry-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: #51657a;
  font-weight: 600;
}
.room-entry-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* ========== CHAT BURBUJA IZQUIERDA ========== */
#btn-rooms-chat-bubble {
  position: fixed !important;
  left: 12px !important;
  bottom: 96px !important;
  z-index: 9000 !important;
  width: 58px !important;
  height: 58px !important;
  border-radius: 20px !important;
  background: linear-gradient(180deg, #f7b500, #d98a00) !important;
  color: #fff !important;
  border: 3px solid #fff !important;
  box-shadow: 0 6px 0 #b57300, 0 10px 18px rgba(247,181,0,.35) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  font-family: 'Fredoka', sans-serif !important;
}
#btn-rooms-chat-bubble.hidden {
  display: none !important;
}
#btn-rooms-chat-bubble:active {
  transform: scale(0.9) !important;
}
#btn-rooms-chat-bubble.has-msg {
  animation: chatBubblePulse 1.4s ease infinite !important;
}
#rooms-chat-bubble-dot {
  position: absolute !important;
  top: 3px !important;
  right: 3px !important;
  width: 13px !important;
  height: 13px !important;
  background: #12b76a !important;
  border: 2px solid #fff !important;
  border-radius: 50% !important;
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.3) !important;
}
#rooms-chat-bubble-dot.hidden {
  display: none !important;
}

@keyframes chatBubblePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.55); }
  50%      { box-shadow: 0 0 0 14px rgba(0, 184, 148, 0); }
}

/* Panel del chat desde la IZQUIERDA (no estorba) */
.rooms-chat-sheet {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10050 !important;
  background: rgba(0, 0, 0, 0.35) !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  padding: 0 !important;
}
.rooms-chat-sheet.hidden {
  display: none !important;
}

.rooms-chat-sheet-inner {
  width: min(320px, 85vw) !important;
  max-width: 320px !important;
  height: 100% !important;
  max-height: 100% !important;
  background: #fff !important;
  border-radius: 0 20px 20px 0 !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.18) !important;
  animation: chatSlideIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) !important;
  font-family: 'Fredoka', sans-serif !important;
}

@keyframes chatSlideIn {
  from { transform: translateX(-100%); opacity: 0.7; }
  to   { transform: translateX(0); opacity: 1; }
}

.rooms-chat-sheet-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 14px 16px !important;
  background: linear-gradient(135deg, #00cec9, #0fae67) !important;
  color: #fff !important;
  border-radius: 0 20px 0 0 !important;
  flex-shrink: 0 !important;
}
.rooms-chat-sheet-list {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 12px !important;
  background: #f8fffe !important;
  -webkit-overflow-scrolling: touch !important;
}
.rooms-chat-sheet-send {
  flex-shrink: 0 !important;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) !important;
  border-top: 1px solid #e0f7f4 !important;
  background: #fff !important;
  display: flex !important;
  gap: 8px !important;
}

/* Icono copiar limpio (Lucide) */
.btn-copy-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: #f1f2f6;
  color: #51657a;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-copy-icon:active {
  background: #dfe6e9;
  color: #0b2239;
}
.btn-copy-icon i {
  width: 18px;
  height: 18px;
}
/* Chat head online */
.rooms-chat-online {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  margin-top: 2px;
}
.rooms-chat-sheet-head .rooms-online-dot {
  width: 7px;
  height: 7px;
  background: #55efc4;
  box-shadow: 0 0 0 2px rgba(85,239,196,0.35);
}
.rooms-fab-close {
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  font-family: Fredoka, sans-serif;
}
.rooms-chat-sheet-send button {
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* =========================================================
   MOBILE-FIRST FIX — tablero 1v1 y juego individual
   Escala con vw/vh, sin overflow ni scroll innecesario
   ========================================================= */
#rooms-screen,
#rooms-panel-play.rooms-arena {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}
.rooms-arena {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  max-height: 100dvh;
  padding: 6px 8px 12px;
}
.rooms-arena .arena-top {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.rooms-arena .arena-player {
  padding: 6px 4px;
  border-radius: 14px;
  min-width: 0;
}
.rooms-arena .arena-av {
  width: clamp(36px, 10vw, 56px);
  height: clamp(36px, 10vw, 56px);
  font-size: clamp(0.9rem, 4vw, 1.2rem);
}
.rooms-arena .arena-name { font-size: clamp(0.7rem, 3.2vw, 0.9rem); }
.rooms-arena .arena-score { font-size: clamp(0.7rem, 3vw, 0.9rem); padding: 2px 8px; }
.rooms-arena .arena-vs-block { width: clamp(56px, 18vw, 90px); }
.rooms-arena .arena-timer {
  font-size: clamp(0.95rem, 4.2vw, 1.25rem);
  margin: 4px 0 6px;
}

.rooms-arena #room-board.room-board.game-board,
.rooms-arena .room-board.game-board,
#room-board.room-board.game-board {
  width: min(96vw, 420px) !important;
  max-width: min(96vw, 92dvh) !important;
  max-height: min(68dvh, 96vw) !important;
  padding: clamp(6px, 2vw, 12px) !important;
  gap: clamp(3px, 1.4vw, 8px) !important;
  margin: 4px auto !important;
}

#game-screen .game-board {
  width: min(92vw, 360px) !important;
  max-width: min(92vw, 70dvh) !important;
  gap: clamp(3px, 1.2vw, 8px) !important;
}

#game-screen .card,
.rooms-arena #room-board .card,
.rooms-arena .room-board .card {
  max-width: none !important;
  max-height: none !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
}

@media (max-width: 480px) {
  .rooms-arena { padding: 4px 6px 10px; }
  .rooms-arena .arena-av { width: 40px; height: 40px; }
  .rooms-arena #room-board.room-board.game-board {
    width: min(96vw, 100%) !important;
    max-height: 62dvh !important;
  }
  .rooms-arena .arena-actions { margin-top: 6px !important; }
  .arena-btn { font-size: 0.85rem; padding: 8px 12px; }
}

@media (max-height: 700px) {
  .rooms-arena #room-board.room-board.game-board {
    max-height: 54dvh !important;
    padding: 6px !important;
    gap: 4px !important;
  }
  .rooms-arena .arena-player { padding: 4px 3px; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .rooms-arena {
    max-height: 100dvh;
  }
  .rooms-arena .arena-top { transform: scale(0.9); transform-origin: top center; }
  .rooms-arena #room-board.room-board.game-board {
    max-height: 70dvh !important;
    width: min(70vw, 70dvh) !important;
  }
}

/* Chat compacto + hora */
.room-chat-msg .rc-body strong {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.room-chat-msg .rc-time {
  font-style: normal;
  font-weight: 600;
  font-size: 0.68rem;
  color: #94a3b8;
  white-space: nowrap;
}
.room-chat-msg.mine .rc-time { color: rgba(255,255,255,0.75); }
.rooms-chat-sheet-inner {
  height: min(72dvh, 520px) !important;
  max-width: 100% !important;
}
.rooms-chat-sheet-head {
  background: linear-gradient(135deg,#0fae67,#00a884) !important;
  padding: 10px 14px !important;
}
.rooms-chat-sheet-head strong { font-size: 0.95rem; }
.room-chat-msg .rc-body { padding: 6px 10px !important; font-size: 0.88rem; }
.room-chat-msg .rc-av { width: 28px !important; height: 28px !important; }

/* Mesas compactas */
.mesa-card-compact {
  display: grid !important;
  grid-template-columns: minmax(0,1.1fr) minmax(0,1.2fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px !important;
}
.mesa-icon-sm {
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.mesa-icon-sm svg { width: 18px; height: 18px; color: #fff; }
.mesa-card-compact .mesa-title { font-size: 0.88rem; }
.mesa-card-compact .mesa-sub { font-size: 0.72rem; color: #64748b; }
.mesa-card-compact .mesa-bet-pill {
  font-size: 0.75rem !important;
  padding: 4px 8px !important;
  white-space: nowrap;
}
.mesa-card-compact .mesa-btn-play {
  padding: 8px 12px !important;
  font-size: 0.8rem !important;
}
@media (max-width: 420px) {
  .mesa-card-compact {
    grid-template-columns: 1fr auto;
  }
  .mesa-card-compact .mesa-vs { grid-column: 1 / -1; justify-content: center; }
}

/* Chat estilo juego infantil */
.rooms-chat-sheet-inner {
  background: linear-gradient(180deg,#e8fff6 0%,#fff 28%) !important;
}
.room-chat-msg { animation: mwPopIn .28s ease; }
@keyframes mwPopIn {
  from { transform: translateY(8px) scale(.96); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.room-chat-msg .rc-body {
  position: relative;
  border-radius: 18px 18px 18px 6px !important;
  background: #fff !important;
  border: 2px solid #d1fae5 !important;
  box-shadow: 0 3px 0 #bbf7d0 !important;
  color: #334155 !important;
}
.room-chat-msg.mine .rc-body {
  border-radius: 18px 18px 6px 18px !important;
  background: linear-gradient(180deg,#f7b500,#e0a000) !important;
  border-color: #ffd54a !important;
  box-shadow: 0 3px 0 #d98a00 !important;
  color: #fff !important;
}
.rc-retar {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg,#f59e0b,#f59e0b);
  box-shadow: 0 2px 0 #d97706;
  font-size: 12px;
  line-height: 26px;
  padding: 0;
  cursor: pointer;
}
.room-chat-msg.mine .rc-retar { display: none; }

.mesa-card-compact {
  background: #fff;
  border: 2px solid #e9d5ff;
  border-radius: 18px;
  box-shadow: 0 4px 0 #ddd6fe;
  animation: mwPopIn .3s ease;
}
.mesa-card-compact .mesa-btn-play {
  background: linear-gradient(180deg,#34d399,#10b981) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: 0 3px 0 #059669;
  font-weight: 800;
}
.mesa-card-playing { border-color: #ffd54a; box-shadow: 0 4px 0 #f7b500; }

/* Chat: texto siempre visible, sin parpadeo de color */
.rooms-chat-sheet .room-chat-msg .rc-body,
.rooms-chat-sheet .room-chat-msg .rc-body p,
.rooms-chat-sheet .room-chat-msg .rc-body strong {
  color: #1e293b !important;
}
.rooms-chat-sheet .room-chat-msg .rc-time { color: #64748b !important; }
.rooms-chat-sheet .room-chat-msg.mine .rc-body,
.rooms-chat-sheet .room-chat-msg.mine .rc-body p,
.rooms-chat-sheet .room-chat-msg.mine .rc-body strong {
  color: #fff !important;
}
.rooms-chat-sheet .room-chat-msg.mine .rc-time { color: rgba(255,255,255,.8) !important; }
.rc-body p { margin: 4px 0 0 !important; min-height: 1em; }

/* Duelo de espadas en mesa llena */
.mesa-playing-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 78px;
  color: #d98a00;
  font-weight: 800;
  font-size: 0.72rem;
  text-align: center;
}
.mesa-swords-duel {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 28px;
}
.mesa-swords-duel i, .mesa-swords-duel svg {
  width: 18px; height: 18px; color: #d98a00;
}
.mesa-swords-duel i:first-child, .mesa-swords-duel svg:first-child {
  animation: mwSwordL .55s ease-in-out infinite alternate;
  transform-origin: 80% 80%;
}
.mesa-swords-duel i:last-child, .mesa-swords-duel svg:last-child {
  animation: mwSwordR .55s ease-in-out infinite alternate;
  transform-origin: 20% 80%;
}
@keyframes mwSwordL {
  from { transform: rotate(-28deg) translateX(2px); }
  to { transform: rotate(-8deg) translateX(-1px); }
}
@keyframes mwSwordR {
  from { transform: rotate(28deg) scaleX(-1) translateX(2px); }
  to { transform: rotate(8deg) scaleX(-1) translateX(-1px); }
}

/* Modal victoria juego móvil */
#room-result-modal .room-result-card {
  border-radius: 24px !important;
  border: 3px solid #fde68a;
  box-shadow: 0 8px 0 #f59e0b, 0 18px 40px rgba(0,0,0,.18);
  background: linear-gradient(180deg,#fffbeb,#fff);
  padding: 22px 18px !important;
}
#room-result-emoji {
  width: 64px; height: 64px; margin: 0 auto 8px;
  border-radius: 50%;
  background: linear-gradient(180deg,#fde68a,#f59e0b);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 0 #d97706;
}
#room-result-emoji svg { width: 32px; height: 32px; color: #fff; }
#room-result-title { font-size: 1.45rem; font-weight: 800; }
#btn-room-rematch {
  background: linear-gradient(180deg,#f7b500,#d98a00) !important;
  border: 0 !important; border-radius: 999px !important;
  box-shadow: 0 4px 0 #b57300; font-weight: 800;
}
#btn-room-result-ok {
  background: linear-gradient(180deg,#2dd4bf,#0d9488) !important;
  color: #fff !important; border: 0 !important; border-radius: 999px !important;
  box-shadow: 0 4px 0 #0f766e; font-weight: 800;
}

/* Crear sala + lobby juego móvil */
.rooms-form-card {
  border-radius: 22px !important;
  border: 2px solid #fde68a !important;
  box-shadow: 0 6px 0 #f59e0b !important;
  background: linear-gradient(180deg,#fffbeb,#fff) !important;
}
.rooms-form-title { font-weight: 800; color: #d98a00; }
.rooms-pay-opt.active {
  background: linear-gradient(180deg,#f7b500,#d98a00) !important;
  color: #fff !important;
  box-shadow: 0 3px 0 #b57300;
}
.rooms-cta-red, #btn-room-create {
  border-radius: 999px !important;
  box-shadow: 0 5px 0 #b57300 !important;
  font-weight: 800 !important;
}
#rooms-panel-lobby .rooms-form-card,
#rooms-panel-lobby .lobby-card {
  border-radius: 22px;
  border: 2px solid #a7f3d0;
  box-shadow: 0 6px 0 #34d399;
}
#btn-room-ready {
  border-radius: 999px !important;
  background: linear-gradient(180deg,#34d399,#059669) !important;
  box-shadow: 0 5px 0 #047857 !important;
  font-weight: 800 !important;
  font-size: 1.05rem !important;
}

.room-chat-sys {
  margin: 8px 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #ecfeff;
  border: 2px solid #67e8f9;
  text-align: center;
  font-size: 0.85rem;
  color: #155e75;
}
.rc-join-room {
  margin-top: 6px;
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  background: linear-gradient(180deg,#34d399,#10b981);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 3px 0 #047857;
}
#room-timer-display.hidden { display: none !important; }

.rooms-vs-tabs, .rooms-vs-pick {
  display: flex; gap: 8px; margin: 8px 0 12px; flex-wrap: wrap;
}
.rooms-vs-tab, .rooms-vs-opt {
  flex: 1; min-width: 90px;
  border: 0; border-radius: 999px;
  padding: 8px 10px; font-weight: 800;
  background: #f1f5f9; color: #64748b;
  box-shadow: 0 3px 0 #cbd5e1;
}
.rooms-vs-tab.active, .rooms-vs-opt.active {
  background: linear-gradient(180deg,#f7b500,#d98a00);
  color: #fff; box-shadow: 0 3px 0 #b57300;
}
.rooms-lobby-card {
  border-radius: 24px !important;
  border: 3px solid #fde68a !important;
  box-shadow: 0 8px 0 #f59e0b !important;
  background: linear-gradient(180deg,#fffbeb,#fff) !important;
  padding: 16px 14px !important;
}
#lobby-code {
  font-size: 1.8rem !important;
  letter-spacing: 4px;
  color: #d98a00;
}

.mesa-vs-n{flex-wrap:wrap;justify-content:center;gap:4px}
.rooms-vs-multi{flex-wrap:wrap;justify-content:center;gap:8px}
.rooms-vs-multi .rooms-vs-player{min-width:72px}
.rooms-vs-multi .rooms-vs-av{width:52px;height:52px}

.arena-top-multi{flex-wrap:wrap;justify-content:center;gap:6px}
.arena-player-sm{min-width:56px;max-width:72px;padding:6px 4px}
.arena-player-sm .arena-av{width:36px;height:36px;font-size:14px}
.arena-player-sm .arena-av img{width:100%;height:100%;object-fit:cover;border-radius:50%}
.arena-player-sm .arena-name{font-size:10px;max-width:70px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.arena-vs-mini{font-weight:900;color:#f59e0b;font-size:11px;align-self:center}
.special-board-map .sbm-grid{gap:4px}

body.mw-in-match #btn-rooms-chat-bubble,body.mw-in-match #rooms-chat-sheet{display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important}
.arena-top{display:flex;flex-wrap:nowrap;justify-content:center;align-items:flex-start;gap:4px;overflow-x:auto;max-width:100
body.mw-in-match #btn-rooms-chat-bubble,
body.mw-in-match #rooms-chat-sheet{display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important}
.arena-top{display:flex;flex-wrap:nowrap;justify-content:center;align-items:flex-start;gap:4px;overflow-x:auto;max-width:100%;padding:0 2px}
.arena-top-multi .arena-player-sm{min-width:52px;max-width:64px;flex:0 0 auto}
.arena-actions{display:flex;justify-content:center;align-items:center;gap:8px;margin-top:8px}
.arena-btn-sm{padding:7px 14px!important;font-size:13px!important;border-radius:999px!important;font-weight:800}
.arena-btn-sm i{width:16px;height:16px}
.arena-pot-bar{margin:8px auto 0;max-width:240px;background:linear-gradient(180deg,#fff7ed,#ffedd5);border:2px solid #fdba74;border-radius:16px;padding:6px 12px;font-weight:800;color:#c2410c;display:flex;align-items:center;justify-content:center;gap:6px}
.arena-pot-bar i{width:16px;height:16px}

.card-ghost{
  position:absolute !important;
  left:50% !important;
  top:50% !important;
  transform:translate(-50%,-50%) !important;
  width:68% !important;
  height:68% !important;
  max-width:68% !important;
  max-height:68% !important;
  object-fit:contain !important;
  object-position:center center !important;
  opacity:.4 !important;
  pointer-events:none !important;
  z-index:2 !important;
  filter:none !important;
}
.card .card-q{
  position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  color:#fff;font-weight:900;font-size:1.1rem;opacity:.55;pointer-events:none;
}
#room-board .card{position:relative;overflow:hidden}
.special-board-map{display:none !important}
body.mw-in-match #btn-rooms-chat-bubble,
body.mw-playing #btn-rooms-chat-bubble,
body.mw-in-match #rooms-chat-sheet,
body.mw-in-match .live-ticker,
body.mw-playing .live-ticker{display:none !important;visibility:hidden !important}
.arena-top{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;padding:4px 2px}
.arena-player-sm{min-width:70px;max-width:96px;padding:6px}
.arena-player-sm .arena-av{width:46px;height:46px;font-size:1rem}
.arena-player-sm .arena-name{font-size:11px}
.arena-actions{display:flex;justify-content:center;align-items:center;gap:8px;margin-top:8px}
.arena-btn-sm{padding:8px 12px;font-size:.82rem;border-radius:14px}
.arena-pot-bar{
  display:flex;justify-content:center;align-items:center;gap:8px;
  margin:8px auto 4px;width:min(220px,86%);
  font-weight:800;color:#92400e;
  background:linear-gradient(180deg,#fffbeb,#fde68a);
  border:3px solid #f59e0b;border-radius:18px;
  padding:8px 16px;
  box-shadow:0 4px 0 #d97706;
}
.arena-btn.leave.arena-btn-sm{padding:6px 12px !important;font-size:12px !important;min-width:auto}
@media (max-width:420px){
  .arena-player-sm{min-width:46px;max-width:64px}
  .arena-player-sm .arena-name{font-size:9px}
  .arena-vs-mini{font-size:10px}
}


#room-board .card img.card-ghost,#room-board .card .card-ghost{display:block!important;object-fit:contain!important}

/* Visión especial: figura ENTERA y pequeña, nunca recorte */
.rooms-arena #room-board .card img.card-ghost,
.rooms-arena .room-board .card img.card-ghost,
#room-board .card .card-ghost {
  position: absolute !important;
  left: 50% !important;
  top: 52% !important;
  width: 42% !important;
  height: 42% !important;
  max-width: 42% !important;
  max-height: 42% !important;
  transform: translate(-50%, -50%) !important;
  object-fit: contain !important;
  object-position: center !important;
  opacity: 0.55 !important;
  display: block !important;
  z-index: 3 !important;
}
.rooms-arena #room-board .card .card-img,
.rooms-arena .room-board .card .card-img,
#room-board .card .card-img {
  object-fit: contain !important;
  object-position: center !important;
  width: 62% !important;
  height: 62% !important;
  max-width: 62% !important;
  max-height: 62% !important;
}

.arena-top-vs {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "l vs r";
  align-items: center;
  width: 100%;
  padding: 4px 6px 2px;
  gap: 4px;
}
.arena-top-vs .slot-l { grid-area: l; justify-self: start; }
.arena-top-vs .slot-r { grid-area: r; justify-self: end; }
.arena-top-vs .arena-vs-center {
  grid-area: vs;
  font-weight: 900;
  font-size: 1.55rem;
  color: #f59e0b;
  text-shadow: 0 2px 0 #fde68a;
  letter-spacing: 1px;
}
.arena-top-vs.cap-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas: none;
  gap: 2px;
}
.arena-top-vs.cap-3 .arena-vs-center { display: none !important; }
.arena-top-vs.cap-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas: none;
  gap: 2px;
  overflow: hidden;
  max-width: 100%;
}
.arena-top-vs.cap-4 .arena-vs-center { display: none !important; }
.arena-top-vs.cap-3 .arena-player-sm,
.arena-top-vs.cap-4 .arena-player-sm {
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100%;
  padding: 4px 2px !important;
}
.arena-top-vs.cap-3 .arena-av,
.arena-top-vs.cap-4 .arena-av {
  width: 34px !important;
  height: 34px !important;
  margin: 0 auto;
}
.arena-top-vs.cap-3 .arena-name,
.arena-top-vs.cap-4 .arena-name {
  font-size: 9px !important;
  max-width: 100% !important;
}
.arena-player-sm .arena-av { width: 48px !important; height: 48px !important; }
.arena-player-sm .arena-name { font-size: 12px !important; font-weight: 800; }

#btn-room-forfeit.arena-btn {
  padding: 6px 12px !important;
  font-size: 12px !important;
  border-radius: 12px !important;
}
#btn-room-react.arena-btn {
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  border-radius: 12px !important;
}
#btn-room-react i { width: 18px !important; height: 18px !important; }

.arena-pot-bar {
  margin: 10px auto 6px !important;
  width: min(230px, 88%) !important;
  background: linear-gradient(180deg, #fffbeb 0%, #f59e0b 100%) !important;
  border: 3px solid #f59e0b !important;
  border-radius: 18px !important;
  box-shadow: 0 5px 0 #d97706, 0 10px 18px rgba(245,158,11,.28) !important;
  padding: 10px 16px !important;
  font-size: 1.02rem !important;
  color: #78350f !important;
  animation: potPulse 1.6s ease-in-out infinite;
}
@keyframes potPulse {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.04); }
}

.home-wheel-btn{
  position:relative;border:0;background:transparent;padding:0;width:78px;cursor:pointer;
}
.home-wheel-disc{
  display:block;width:68px;height:68px;margin:0 auto;border-radius:50%;
  background:conic-gradient(#f472b6,#fb923c,#facc15,#34d399,#60a5fa,#a78bfa,#f472b6);
  box-shadow:0 0 0 4px #f59e0b,0 0 16px rgba(251,191,36,.6);
  animation:wheelIconSpin 8s linear infinite;
}
.home-wheel-ribbon{
  display:block;margin-top:4px;background:#f7b500;color:#fff;font-weight:800;font-size:11px;
  border-radius:999px;padding:2px 8px;box-shadow:0 2px 0 #d98a00;
}
.home-wheel-badge{
  position:absolute;top:-8px;right:-6px;background:#f7b500;color:#fff;font-size:9px;font-weight:800;
  padding:2px 6px;border-radius:8px;z-index:2;
}
@keyframes wheelIconSpin{to{transform:rotate(360deg)}}
.wheel-card{
  width:min(420px,94vw);max-height:92dvh;overflow:auto;background:linear-gradient(180deg,#fff7ed,#ffedd5);
  border-radius:24px;padding:18px 16px 16px;position:relative;
  box-shadow:0 16px 40px rgba(0,0,0,.2);border:3px solid #fde68a;
}
.wheel-x{position:absolute;top:10px;right:10px;width:36px;height:36px;border:0;border-radius:50%;background:#fff;color:#d98a00;font-size:22px;font-weight:800;box-shadow:0 3px 0 #ffeaa7}
.wheel-ribbon-title{margin:0 auto 6px;width:max-content;background:#f7b500;color:#fff;font-weight:900;padding:6px 18px;border-radius:12px;box-shadow:0 3px 0 #d98a00}
.wheel-sub{text-align:center;color:#92400e;margin:0 0 10px;font-size:.9rem}
.wheel-invite{background:#f5f3ff;border:2px dashed #c4b5fd;border-radius:16px;padding:10px 12px;margin-bottom:12px}
.wheel-invite-copy{display:flex;flex-direction:column;gap:4px;align-items:flex-start}
.wheel-invite-copy strong{color:#6d28d9;font-size:1.05rem}
.wheel-claim{border:0;border-radius:999px;padding:8px 14px;font-weight:800;background:#cbd5e1;color:#64748b}
.wheel-claim.locked{cursor:not-allowed}
.wheel-claim.ready{background:linear-gradient(180deg,#34d399,#059669);color:#fff;box-shadow:0 3px 0 #047857;animation:claimPulse 1.2s ease-in-out infinite}
@keyframes claimPulse{50%{transform:scale(1.04);filter:brightness(1.08)}}
.wheel-stage{position:relative;width:280px;height:280px;margin:8px auto 10px}
#wheel-canvas{width:280px;height:280px;border-radius:50%;box-shadow:0 0 0 10px #f59e0b,0 0 24px rgba(251,191,36,.55)}
.wheel-pointer{position:absolute;top:-8px;left:50%;transform:translateX(-50%);width:0;height:0;border-left:12px solid transparent;border-right:12px solid transparent;border-top:22px solid #ef4444;z-index:3;filter:drop-shadow(0 2px 2px rgba(0,0,0,.2))}
.wheel-hub{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:54px;height:54px;border-radius:50%;background:linear-gradient(180deg,#f59e0b,#d97706);color:#fff;font-weight:900;display:flex;align-items:center;justify-content:center;box-shadow:0 3px 0 #92400e;z-index:2;font-size:.95rem;letter-spacing:.02em}
.wheel-spins{text-align:center;font-weight:800;color:#9a3412;margin:4px 0}
.wheel-spin-btn{display:block;width:100%;border:0;border-radius:16px;padding:12px;font-weight:900;font-size:1.1rem;color:#fff;background:linear-gradient(180deg,#f7b500,#d98a00);box-shadow:0 4px 0 #b57300}
.wheel-spin-btn:disabled{opacity:.5}
.wheel-foot{text-align:center;font-size:.75rem;color:#a16207;margin:8px 0 0}

/* Chat fijo abajo, no a media pantalla */
.rooms-chat-sheet{
  align-items:flex-end !important;
  justify-content:center !important;
}
.rooms-chat-sheet-inner{
  width:100% !important;
  max-width:480px !important;
  height:min(68dvh, 520px) !important;
  max-height:68dvh !important;
  border-radius:22px 22px 0 0 !important;
  margin-bottom:0 !important;
}


#lobby-vs.cap-3, #lobby-vs.cap-4, .lobby-vs.cap-3, .lobby-vs.cap-4 {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 6px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}
#lobby-vs.cap-3 .rooms-vs-mid, #lobby-vs.cap-4 .rooms-vs-mid {
  display: none !important;
}
#lobby-vs.cap-3 .rooms-vs-player, #lobby-vs.cap-4 .rooms-vs-player {
  min-width: 0;
}
.arena-turn-tag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #f59e0b;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .3px;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
  z-index: 5;
  box-shadow: 0 2px 0 #d97706;
}
.arena-player.is-turn { position: relative; }

.top-img-icon,.convert-img-icon,.bn-img{width:22px;height:22px;object-fit:contain;display:block}
.play-icon-img{background:transparent!important}
.play-icon-img img{width:36px;height:36px;object-fit:contain;display:block}
.uh-tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;gap:6px;padding-bottom:4px}
.uh-tab{flex:0 0 auto}
.hist-ico{width:18px;height:18px;object-fit:contain;vertical-align:middle;margin-right:4px}

.bottom-nav{overflow:hidden;}
.bn-item{overflow:visible;max-width:72px;}
.bn-item img,
.bn-img{
  width:22px!important;
  height:22px!important;
  max-width:22px!important;
  max-height:22px!important;
  object-fit:contain!important;
  display:block!important;
}
.top-img-icon{width:18px!important;height:18px!important;object-fit:contain!important;}
.convert-img-icon{width:20px!important;height:20px!important;object-fit:contain!important;}
.play-icon-img img{width:34px!important;height:34px!important;object-fit:contain!important;}

.bottom-nav .bn-item img.bn-img,
.bottom-nav img.bn-img{
  width:22px!important;
  height:22px!important;
  max-width:22px!important;
  max-height:22px!important;
  object-fit:contain!important;
  display:block!important;
}
.bn-item{overflow:hidden}
.hist-item .hist-ico,
.hist-ico{
  width:16px!important;
  height:16px!important;
  max-width:16px!important;
  max-height:16px!important;
  object-fit:contain!important;
  vertical-align:middle!important;
}
.top-img-icon{width:16px!important;height:16px!important;object-fit:contain!important}
.convert-img-icon{width:18px!important;height:18px!important;object-fit:contain!important}
.play-icon-img img{width:32px!important;height:32px!important;object-fit:contain!important}
.grid-icon-img img{width:32px!important;height:32px!important;object-fit:contain!important}
.stat-img-icon{width:22px!important;height:22px!important;object-fit:contain!important}

.bottom-nav img{width:22px!important;height:22px!important;max-width:22px!important;max-height:22px!important;object-fit:contain!important;}
.bn-star-circle img,.bn-star img{width:18px!important;height:18px!important;}
.hist-item img{width:16px!important;height:16px!important;object-fit:contain!important;}
