* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  font-family: 'Fredoka', sans-serif;
  background: url('fondo.png') center center / cover no-repeat fixed;
  background-color: #ffd3b6;
  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: #ff6b6b;
  margin-bottom: 4px;
  text-shadow: 2px 2px 0 #ffe66d;
}

.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 #ffd93d;
  border-radius: 14px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.05rem;
  outline: none;
  background: #fffef5;
}

.form-box input:focus { border-color: #ff6b6b; }
.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: #ff6b6b; 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, #ff6b6b, #ee5a5a); 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 #ffd93d;
  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 #ffd93d;
  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: #ff6b6b; }
.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: #ff6b6b; 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 #ffd93d;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  font-size: 0.95rem;
  color: #555;
}
.file-name { font-size: 0.85rem; color: #00b894; 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: #ffe8d6; }
.rank-pos { font-weight: 700; font-size: 1.15rem; width: 34px; color: #ff6b6b; }
.rank-name { flex: 1; font-weight: 600; }
.rank-score { font-weight: 700; color: #00b894; }

/* ===== 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 #ffe66d;
  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, #ffe0e0, #ffcccc);
  color: #ff6b6b;
}
.hud-score .hud-icon {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  color: #e67e22;
}
.hud-pairs .hud-icon {
  background: linear-gradient(135deg, #d5f5ee, #a8e6cf);
  color: #00b894;
}

.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: #2d3436;
}

.hud-time .hud-meta strong { color: #ff6b6b; }
.hud-score .hud-meta strong { color: #e67e22; }
.hud-pairs .hud-meta strong { color: #00b894; }


/* ===== 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;
}

/* ===== 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%, #fff9f0 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: #ff6b6b;
  font-weight: 700;
  margin: 6px 0;
  text-shadow: 3px 3px 0 #ffe66d;
}
#result-message, #result-pairs {
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: #555;
}

/* REFERIDOS */
.ref-code-box {
  background: #fff8e7;
  border: 3px dashed #ffd93d;
  border-radius: 16px;
  padding: 16px;
  margin: 14px 0;
}
.ref-code {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ff6b6b;
  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: #00b894; 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, #00b894);
  border-radius: 20px;
  transition: width 0.4s ease;
}
.progress-text { font-size: 0.8rem; color: #666; }
.btn-claim {
  background: linear-gradient(to bottom, #ffe66d, #ffd93d);
  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: #ff6b6b; 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: #e67e22;
  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: #2d3436;
  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, #ff6b6b, #ee5a5a);
}

.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: #2d3436;
}

.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: #636e72;
  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: #ff6b6b;
  font-size: 1rem;
  margin-bottom: 3px;
}

.promo-card p {
  font-size: 0.8rem;
  color: #636e72;
  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: #e67e22;
}

.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: #ff6b6b;
}

/* 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, #ffe66d, #ffd93d);
  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: #e67e22;
  stroke-width: 2.2;
}

.shop-title {
  font-size: 1.7rem !important;
  color: #ff6b6b !important;
  text-shadow: none !important;
  margin-bottom: 8px !important;
}

.shop-price-badge {
  display: inline-block;
  background: #e8f8f5;
  color: #00b894;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 50px;
  margin-bottom: 18px;
}

.shop-label {
  font-size: 0.95rem;
  color: #636e72;
  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: #ffe0e0;
  color: #ff6b6b;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 #ffb3b3;
  transition: all 0.15s;
  font-family: 'Fredoka', sans-serif;
}

.qty-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #ffb3b3;
}

.qty-value {
  font-size: 2rem;
  font-weight: 700;
  color: #2d3436;
  min-width: 48px;
  text-align: center;
}

.qty-max {
  display: inline-block;
  background: #fff8e7;
  color: #e17055;
  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: #00b894;
}

.total-label {
  display: block;
  font-size: 0.85rem;
  color: #636e72;
}

.total-amount {
  display: block;
  font-size: 1.45rem;
  color: #ff6b6b;
  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: #00b894;
  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: #2d3436;
}

.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: #00b894;
  flex-shrink: 0;
}

.copy-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: white;
  color: #636e72;
  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: #00b894;
  color: white;
}

.pay-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #00b894;
  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 #ffe0e0;
  border-radius: 14px;
  padding: 4px 4px 4px 12px;
  margin-bottom: 12px;
}

.shop-field .field-icon {
  width: 28px;
  height: 28px;
  background: #ffe66d;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #e67e22;
  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: #ff6b6b;
  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: #ff6b6b;
  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, #ff6b6b, #ee5a5a);
  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 #c0392b;
  margin-bottom: 12px;
  transition: all 0.15s;
}

.btn-send-pay:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #c0392b;
}

.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: #636e72;
  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, #ffe66d, #ffd93d);
  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: #e67e22;
}

.rank-title {
  font-size: 1.75rem !important;
  color: #ff6b6b !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: #ffe66d;
}

.podium-crown {
  margin-bottom: 2px;
  color: #ffd93d;
}

.podium-crown svg {
  width: 28px;
  height: 28px;
  fill: #ffd93d;
  stroke: #e67e22;
}

.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: #e17055; }

.podium-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2d3436;
  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: #00b894;
  background: #e8f8f5;
  padding: 2px 8px;
  border-radius: 50px;
  margin-bottom: 8px;
}

.podium-first .podium-score {
  color: #e17055;
  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, #ffe66d, #f9ca24);
}

.podium-second .podium-block {
  height: 70px;
  background: linear-gradient(180deg, #55efc4, #00b894);
}

.podium-third .podium-block {
  height: 55px;
  background: linear-gradient(180deg, #ff7675, #e17055);
}

/* 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: #2d3436;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-pts {
  font-weight: 700;
  color: #00b894;
  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: #ff6b6b !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 #ffd93d;
  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: #ff6b6b;
  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, #00b894, #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: #2d3436;
  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 #ffd93d;
  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: #2d3436;
  font-size: 0.95rem;
}
.ref-milestone-top span {
  background: #00b894;
  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: #ff6b6b;
  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: #ff6b6b;
  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: #2d3436;
}

.ref-item-modern .ref-item-status {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 50px;
}

.st-progress { background: #fff8e7; color: #e17055; }
.st-ready { background: #e8f8f5; color: #00b894; }
.st-claimed { background: #dfe6e9; color: #636e72; }

.btn-claim-modern {
  width: 100%;
  margin-top: 8px;
  border: none;
  border-radius: 50px;
  padding: 10px;
  background: linear-gradient(135deg, #ffe66d, #ffd93d);
  color: #2d3436;
  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: #ff6b6b;
}

.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: #ff6b6b;
  color: white;
}

.ref-how-medal {
  background: #ffe66d;
  color: #e67e22;
}

.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: #ff6b6b; }
.step-num.s2 { background: #fdcb6e; }
.step-num.s3 { background: #00b894; }
.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, #ffe66d, #ffd93d);
  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: #e67e22;
}

.modal-title {
  font-size: 1.4rem;
  color: #ff6b6b;
  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: #e17055;
  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, #ff6b6b, #ee5a5a);
  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 #c0392b;
  margin-bottom: 10px;
  transition: all 0.15s;
}

.btn-start-game:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #c0392b;
}

.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: #636e72;
  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: #ff6b6b;
  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: #2d3436;
}
.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: #2d3436; }
.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 #ffd93d;
  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 #ff6b6b;
  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, #ff6b6b, #ee5a5a);
  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.72rem;
  color: #b08968;
  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: #e17055;
}

.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: #2d3436;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Banner de invitación */
.invite-banner {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  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 #ffd93d;
  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 Memory WIN) ===== */
.comp-card {
  background: #fffef5;
  border: 3px solid #ffd93d;
  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: #e67e22;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 10px;
  border: 2px solid #ffd93d;
}

.comp-label i { width: 14px; height: 14px; }

.comp-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ff6b6b;
  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, #ff6b6b, #ee5a24);
  border-radius: 14px;
  padding: 14px 12px;
  box-shadow: 0 4px 12px rgba(238, 90, 36, 0.25);
}

.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 #ffd93d;
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2d3436;
}
.comp-prize-chip strong { color: #ff6b6b; }

/* Historial */
.history-panel {
  background: #fffef5;
  border: 3px solid #ffd93d;
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
}
.history-panel.hidden { display: none; }
.history-title {
  font-size: 1.1rem;
  color: #ff6b6b;
  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: #2d3436;
}
.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, #ffd93d, #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: #e67e22;
  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, #ffd93d, #ff6b6b);
  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: #ff6b6b;
  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 #ffd93d;
  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: #2d3436;
  font-size: 0.95rem;
}
.hm-comp-badge {
  background: #ffeaa7;
  color: #e67e22;
  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: #ff6b6b;
  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: #2d3436;
  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: #00b894; }
.hm-prize { font-size: 0.75rem; color: #e67e22; 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, #ffd93d, #f39c12); font-size: 0.95rem; width: 32px; height: 32px; }
.pb-silver { background: linear-gradient(135deg, #b2bec3, #636e72); }
.pb-bronze { background: linear-gradient(135deg, #e17055, #d63031); }

.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 #ffd93d !important;
  margin-bottom: 6px !important;
  font-size: 1.4rem !important;
}
.podium-first .podium-avatar {
  width: 72px !important;
  height: 72px !important;
  border-color: #ff6b6b !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: #636e72 !important;
}

.podium-name {
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  color: #2d3436 !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: #ff6b6b !important;
}

.podium-time {
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  color: #636e72 !important;
  margin-bottom: 8px !important;
}
.podium-first .podium-time {
  color: #e67e22 !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, #ffd93d, #f39c12);
  color: #5d4e00 !important;
  border: 2px solid #fff;
}
.pp-2 {
  background: linear-gradient(135deg, #55efc4, #00b894);
  color: #fff !important;
}
.pp-3 {
  background: linear-gradient(135deg, #fd79a8, #e84393);
  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: #636e72;
  font-weight: 600;
  margin-left: auto;
  white-space: nowrap;
}
.rank-prize-col {
  font-size: 0.82rem;
  font-weight: 700;
  color: #e67e22;
  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;
}

#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 .game-board {
    max-width: 260px !important;
    width: 260px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    gap: 5px !important;
  }
  #game-screen .game-board.cols-3 {
    max-width: 220px !important;
    width: 220px !important;
  }
  #game-screen .game-board.cols-5 {
    max-width: 280px !important;
    width: 280px !important;
  }
  #game-screen .game-board.cols-6 {
    max-width: 290px !important;
    width: 290px !important;
  }
  #game-screen .card {
    max-width: 58px !important;
    max-height: 58px !important;
    width: 100% !important;
    border-radius: 12px !important;
  }
  #game-screen .card::before {
    font-size: 1.25rem !important;
  }
  #game-screen .card .card-img {
    width: 70% !important;
    height: 70% !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 #ffd93d;
}
.st-countdown-label {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 6px;
}
.st-countdown {
  font-size: 2rem;
  font-weight: 700;
  color: #ff6b6b;
  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 #ffd93d;
  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: #00b894;
  background: linear-gradient(135deg, #e8f8f5, #d1f2eb);
  box-shadow: 0 4px 0 #00a884;
}
.promo-pack-badge {
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
  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, #00b894, #00a884);
}
.promo-pack-main {
  flex: 1;
  min-width: 0;
}
.promo-pack-main strong {
  display: block;
  font-size: 0.98rem;
  color: #2d3436;
}
.promo-pack-main small {
  display: block;
  font-size: 0.82rem;
  color: #636e72;
  margin-top: 2px;
}
.promo-pack-main small b {
  color: #e67e22;
}
.promo-pack-btn.active .promo-pack-main small b {
  color: #00b894;
}
.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: #e67e22;
}
.promo-pack-btn.active .promo-pack-gift {
  color: #00b894;
}
.promo-pack-check {
  display: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #00b894;
  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 #00b894;
  border-radius: 14px;
  padding: 10px 14px;
  margin: 0 0 12px;
  text-align: center;
  font-size: 0.88rem;
  color: #00b894;
  font-weight: 600;
}
.promo-gift-banner strong {
  color: #008f72;
}
.promo-gift-banner span {
  color: #e67e22;
  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 #ffe0c2;
  background: #fff;
  color: #ff6b6b;
  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: #636e72;
  min-width: 48px;
  text-align: center;
}

.withdraw-fee-preview {
  margin: -4px 0 12px;
  padding: 0 4px;
  text-align: left;
  font-size: 0.8rem;
  color: #b08968;
  font-weight: 600;
}
.withdraw-fee-preview strong {
  color: #e17055;
}
.withdraw-fee-preview strong { color: #e67e22; }


/* Tareas principales */
.tasks-box {
  background: #fff;
  border: 2px solid #ffe0c2;
  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: #2d3436;
  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: #fff9f0;
  border: 1.5px solid #ffe0c2;
  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: #00b894;
  color: #fff;
}
.task-icon i, .task-icon svg {
  width: 16px;
  height: 16px;
}
.task-title {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  color: #2d3436;
  min-width: 0;
}
.task-status {
  font-size: 0.75rem;
  font-weight: 700;
  color: #00b894;
}
.task-btn {
  border: none;
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
  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 #c0392b;
}
.task-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #c0392b;
}


/* 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: #00b894;
  background: #e8f8f5;
  color: #00b894;
  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: #636e72;
  font-size: 1.1rem;
}
.pieces-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2d3436;
}
.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 #ffe0c2;
  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,#ff6b6b,#ee5a5a); }
.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,#fbbf24,#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: #ff6b6b; }
.bn-star { margin-top: -22px; }
.bn-star-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe66d, #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 #ff6b6b;
  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: #e17055;
}
.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 #ffe0c2;
  background: #fff;
  color: #e17055;
  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, #ffe8d6) !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 #ffe0c2;
  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: #636e72; }
.hist-item-date { font-size: 0.75rem; color: #b08968; 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: #2d3436; }
.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, #ffe8d6); }

.shop-field-select {
  padding-right: 8px;
}
.shop-field-select select {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.92rem;
  color: #2d3436;
  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; }
