/* ============================================================
   Quiniela Mundialista 2026 — Main Stylesheet
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --verde:       #006847;
  --verde-light: #00854d;
  --rojo:        #CE1126;
  --rojo-light:  #e8192d;
  --azul:        #003DA5;
  --azul-light:  #0050cc;
  --blanco:      #FFFFFF;
  --gris-claro:  #F5F5F5;
  --gris:        #e0e0e0;
  --gris-med:    #9e9e9e;
  --texto:       #1a1a2e;
  --texto-sec:   #555577;

  /* Dark sidebar */
  --sidebar-bg:     #0d1117;
  --sidebar-hover:  #161b22;
  --sidebar-active: #21262d;
  --sidebar-border: #30363d;

  /* Surfaces */
  --card-bg:     #ffffff;
  --card-shadow: 0 2px 16px rgba(0,0,0,.08);
  --body-bg:     #f0f2f8;

  /* Gradients */
  --grad-mexico: linear-gradient(135deg, #006847 0%, #CE1126 50%, #006847 100%);
  --grad-hero:   linear-gradient(135deg, #0d1117 0%, #003DA5 60%, #CE1126 100%);
  --grad-gold:   linear-gradient(135deg, #f7971e, #ffd200);

  --radius: .75rem;
  --radius-lg: 1.25rem;
  --transition: .2s ease;
}

/* ── Dark Mode ─────────────────────────────────────────────── */
[data-theme="dark"] {
  --card-bg:    #161b22;
  --body-bg:    #0d1117;
  --texto:      #e6edf3;
  --texto-sec:  #8b949e;
  --gris-claro: #21262d;
  --gris:       #30363d;
  --card-shadow: 0 2px 16px rgba(0,0,0,.4);
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--body-bg);
  color: var(--texto);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

/* ── Typography ─────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.2; }
.display-title {
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  letter-spacing: 2px;
}
a { text-decoration: none; color: inherit; }

/* ── Layout: Sidebar + Main ────────────────────────────────── */
.qm-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.qm-sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  transition: transform var(--transition);
  overflow-y: auto;
}

.qm-sidebar .sidebar-brand {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: .75rem;
}

.sidebar-brand .brand-icon {
  width: 44px; height: 44px;
  background: var(--grad-mexico);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.sidebar-brand .brand-text {
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .3px;
}
.sidebar-brand .brand-text span {
  display: block;
  font-size: .7rem;
  font-weight: 400;
  color: var(--gris-med);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-nav { flex: 1; padding: 1rem 0; }

.nav-section-title {
  padding: .5rem 1.25rem .25rem;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #484f58;
}

.nav-item { margin: .1rem .75rem; }

.nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .75rem;
  border-radius: var(--radius);
  color: #8b949e;
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}
.nav-link:hover {
  background: var(--sidebar-hover);
  color: #e6edf3;
}
.nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  position: relative;
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--verde);
  border-radius: 0 2px 2px 0;
}
.nav-link .nav-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.nav-badge {
  margin-left: auto;
  background: var(--verde);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 999px;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--sidebar-border);
}
.sidebar-user {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem;
  border-radius: var(--radius);
  background: var(--sidebar-hover);
}
.sidebar-user .user-avatar {
  width: 36px; height: 36px;
  background: var(--grad-mexico);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name {
  font-size: .8rem;
  font-weight: 600;
  color: #e6edf3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .user-role {
  font-size: .68rem;
  color: #484f58;
  text-transform: capitalize;
}

/* ── Main Content ───────────────────────────────────────────── */
.qm-main {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.qm-topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--gris);
  padding: .875rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky; top: 0;
  z-index: 900;
  transition: background var(--transition);
}
.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--texto);
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: .5rem; }

.btn-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--texto-sec);
  transition: all var(--transition);
  font-size: 1rem;
}
.btn-icon:hover { background: var(--gris-claro); color: var(--texto); }

/* ── Page Content ───────────────────────────────────────────── */
.qm-content {
  flex: 1;
  padding: 1.75rem;
}

.page-header {
  margin-bottom: 1.5rem;
}
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--texto);
}
.page-header p { color: var(--texto-sec); font-size: .9rem; margin-top: .25rem; }

/* ── Cards ──────────────────────────────────────────────────── */
.card-qm {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--gris);
  transition: box-shadow var(--transition), background var(--transition);
  overflow: hidden;
}
.card-qm:hover { box-shadow: 0 4px 24px rgba(0,0,0,.12); }
.card-qm .card-header-qm {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gris);
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem;
}
.card-qm .card-body-qm { padding: 1.25rem; }
.card-title-qm { font-size: .95rem; font-weight: 600; color: var(--texto); }

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--gris);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,.12); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.verde  { background: rgba(0,104,71,.12);  color: var(--verde); }
.stat-icon.rojo   { background: rgba(206,17,38,.12); color: var(--rojo); }
.stat-icon.azul   { background: rgba(0,61,165,.12);  color: var(--azul); }
.stat-icon.gold   { background: rgba(247,151,30,.12); color: #f7971e; }
.stat-info .stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; color: var(--texto); }
.stat-info .stat-label { font-size: .8rem; color: var(--texto-sec); margin-top: .2rem; }

/* ── Team Cards ─────────────────────────────────────────────── */
.equipo-card {
  background: var(--card-bg);
  border: 1px solid var(--gris);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  display: flex;
  align-items: center;
  gap: .875rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.equipo-card:hover { border-color: var(--verde); box-shadow: 0 4px 16px rgba(0,104,71,.15); }
.equipo-card.eliminado {
  opacity: .5;
  filter: grayscale(1);
  background: var(--gris-claro);
}
.equipo-card.eliminado::after {
  content: 'ELIMINADO';
  position: absolute;
  top: 50%; right: 1rem;
  transform: translateY(-50%);
  font-size: .7rem;
  font-weight: 800;
  color: var(--rojo);
  letter-spacing: 1.5px;
  border: 1.5px solid var(--rojo);
  padding: .15rem .4rem;
  border-radius: 4px;
}
.equipo-flag {
  width: 40px; height: 28px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  flex-shrink: 0;
}
.equipo-nombre {
  font-weight: 600;
  font-size: .9rem;
  color: var(--texto);
  flex: 1;
}
.equipo-stats {
  display: flex;
  gap: .5rem;
  font-size: .75rem;
  color: var(--texto-sec);
}
.equipo-stats .stat-pill {
  background: var(--gris-claro);
  border-radius: 4px;
  padding: .1rem .4rem;
  font-weight: 600;
  color: var(--texto-sec);
}
.equipo-puntos {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--verde);
  min-width: 2rem;
  text-align: center;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-verde {
  background: var(--verde);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .6rem 1.25rem;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.btn-verde:hover { background: var(--verde-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,104,71,.4); }

.btn-rojo {
  background: var(--rojo);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .6rem 1.25rem;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-rojo:hover { background: var(--rojo-light); }

.btn-azul {
  background: var(--azul);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .6rem 1.25rem;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gris);
  color: var(--texto-sec);
  border-radius: 8px;
  padding: .55rem 1.2rem;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-outline:hover { border-color: var(--verde); color: var(--verde); }

/* ── Tables ─────────────────────────────────────────────────── */
.table-qm {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.table-qm thead th {
  background: var(--gris-claro);
  color: var(--texto-sec);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--gris);
  text-align: left;
}
.table-qm tbody td {
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--gris);
  color: var(--texto);
  vertical-align: middle;
}
.table-qm tbody tr:last-child td { border-bottom: none; }
.table-qm tbody tr:hover td { background: rgba(0,104,71,.04); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge-verde  { background: rgba(0,104,71,.12); color: var(--verde);  }
.badge-rojo   { background: rgba(206,17,38,.12); color: var(--rojo);  }
.badge-azul   { background: rgba(0,61,165,.12);  color: var(--azul);  }
.badge-gris   { background: rgba(0,0,0,.06);     color: var(--texto-sec); }
.badge-qm {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .3px;
}

/* ── Ruleta / Sorteo ────────────────────────────────────────── */
.sorteo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}
.ruleta-wrapper {
  position: relative;
  width: 380px; height: 380px;
}
.ruleta-canvas {
  border-radius: 50%;
  box-shadow: 0 0 0 6px var(--gris), 0 8px 40px rgba(0,0,0,.3);
  cursor: pointer;
}
.ruleta-pointer {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 28px solid var(--rojo);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.4));
  z-index: 10;
}
.ruleta-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 64px; height: 64px;
  background: var(--sidebar-bg);
  border-radius: 50%;
  border: 4px solid var(--gris);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.spin-btn {
  min-width: 180px;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 999px;
  background: var(--grad-mexico);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,104,71,.4);
  transition: all var(--transition);
  text-transform: uppercase;
}
.spin-btn:hover { transform: scale(1.05); box-shadow: 0 6px 28px rgba(0,104,71,.5); }
.spin-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.grupo-result-card {
  background: linear-gradient(135deg, var(--verde), var(--azul));
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  color: #fff;
  min-width: 280px;
  box-shadow: 0 8px 32px rgba(0,104,71,.3);
  animation: slideUp .4s ease;
}
.grupo-result-card .grupo-label {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: .8;
  margin-bottom: .5rem;
}
.grupo-result-card .grupo-nombre {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 2px;
}

/* ── Login Page ─────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--grad-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-card {
  background: rgba(255,255,255,.97);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  position: relative;
  z-index: 1;
}
[data-theme="dark"] .login-card {
  background: rgba(22,27,34,.97);
  border: 1px solid var(--sidebar-border);
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo .trophy {
  width: 64px; height: 64px;
  background: var(--grad-mexico);
  border-radius: 50%;
  margin: 0 auto .75rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  box-shadow: 0 4px 16px rgba(0,104,71,.4);
}
.login-logo h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--texto);
  line-height: 1.2;
}
.login-logo p { font-size: .85rem; color: var(--texto-sec); margin-top: .35rem; }

/* ── Form Controls ──────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--texto-sec);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: .4rem;
}
.form-control-qm {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--gris);
  border-radius: 8px;
  font-size: .9rem;
  color: var(--texto);
  background: var(--card-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control-qm:focus {
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(0,104,71,.15);
}
.form-control-qm.is-invalid {
  border-color: var(--rojo);
  box-shadow: 0 0 0 3px rgba(206,17,38,.1);
}
.input-group-qm { position: relative; }
.input-group-qm .form-control-qm { padding-left: 2.75rem; }
.input-icon {
  position: absolute;
  left: .875rem;
  top: 50%; transform: translateY(-50%);
  color: var(--gris-med);
  font-size: 1rem;
  pointer-events: none;
}

/* ── World Cup Flag Banner ──────────────────────────────────── */
.world-cup-banner {
  background: var(--grad-hero);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.world-cup-banner::after {
  content: '⚽';
  position: absolute;
  right: 1.5rem; top: 50%;
  transform: translateY(-50%);
  font-size: 4rem;
  opacity: .15;
}
.world-cup-banner h2 { font-size: 1.35rem; font-weight: 800; }
.world-cup-banner p  { font-size: .85rem; opacity: .8; margin-top: .35rem; }

/* ── Phase Tracker ──────────────────────────────────────────── */
.phase-steps {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding-bottom: .5rem;
}
.phase-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  min-width: 80px;
  padding: .5rem .25rem;
  position: relative;
}
.phase-step:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -1px; top: 1.1rem;
  width: 100%; height: 2px;
  background: var(--gris);
  z-index: 0;
}
.phase-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gris);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--texto-sec);
  position: relative;
  z-index: 1;
  border: 2px solid var(--gris);
}
.phase-dot.active   { background: var(--verde); color: #fff; border-color: var(--verde); }
.phase-dot.complete { background: var(--azul);  color: #fff; border-color: var(--azul); }
.phase-label { font-size: .65rem; font-weight: 600; color: var(--texto-sec); text-align: center; white-space: nowrap; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse-verde {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,104,71,.4); }
  50%       { box-shadow: 0 0 0 10px rgba(0,104,71,.0); }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.animate-fade-in  { animation: fadeIn .4s ease; }
.animate-slide-up { animation: slideUp .4s ease; }
.spin-loading     { animation: spin-slow .8s linear infinite; }

/* ── Ranking Table ──────────────────────────────────────────── */
.ranking-pos {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800;
}
.ranking-pos.gold   { background: var(--grad-gold); color: #333; }
.ranking-pos.silver { background: linear-gradient(135deg,#c0c0c0,#e8e8e8); color: #333; }
.ranking-pos.bronze { background: linear-gradient(135deg,#cd7f32,#e8a968); color: #fff; }

/* ── Mobile Menu Toggle ─────────────────────────────────────── */
.menu-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--texto);
  font-size: 1.25rem;
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
}

/* ── Skeleton Loading ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gris) 25%, var(--gris-claro) 50%, var(--gris) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.4s infinite;
  border-radius: 4px;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gris); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gris-med); }

/* ── Responsive ─────────────────────────────────────────────── */

/* Tablet grande (<=992px) — sidebar oculto */
@media (max-width: 992px) {
  .qm-sidebar { transform: translateX(-100%); width: 280px; }
  .qm-sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.4); }
  .qm-main { margin-left: 0; }
  .menu-toggle { display: flex; }
  .sidebar-overlay.visible { display: block; }
  .ruleta-wrapper { width: 300px; height: 300px; }
  .qm-content { padding: 1.25rem; }
}

/* Tablet (<=768px) */
@media (max-width: 768px) {
  .page-header h1 { font-size: 1.2rem; }
  .page-header p  { font-size: .82rem; }
  .stat-info .stat-value { font-size: 1.4rem; }
  .world-cup-banner h2 { font-size: 1.1rem; }
  .qm-topbar { padding: .65rem 1rem; }
  .topbar-title { font-size: .9rem; }
  .table-qm thead th { padding: .6rem .75rem; font-size: .7rem; }
  .table-qm tbody td { padding: .7rem .75rem; font-size: .82rem; }
  .card-qm .card-body-qm { padding: 1rem; }
  .card-qm .card-header-qm { padding: .875rem 1rem; }
  .btn-verde, .btn-rojo, .btn-azul, .btn-outline { padding: .6rem 1rem; font-size: .82rem; }
  .equipo-stats { display: none; }
  .equipo-card { padding: .75rem; gap: .625rem; }
  .equipo-nombre { font-size: .82rem; }
  .equipo-flag { width: 32px; height: 22px; }
  .ruleta-wrapper { width: 270px; height: 270px; }
  .spin-btn { min-width: 150px; padding: .875rem 1.5rem; font-size: 1rem; }
  .grupo-result-card { padding: 1.5rem; min-width: 0; width: 100%; }
  .grupo-result-card .grupo-nombre { font-size: 2rem; }
}

/* Movil (<=576px) */
@media (max-width: 576px) {
  .qm-content { padding: .875rem; }
  .page-header h1 { font-size: 1.1rem; }
  .stat-info .stat-value { font-size: 1.25rem; }
  .stat-card { padding: .875rem; gap: .75rem; }
  .stat-icon { width: 42px; height: 42px; font-size: 1.1rem; }
  .ruleta-wrapper { width: 240px; height: 240px; }
  .ruleta-center { width: 50px; height: 50px; font-size: 1.2rem; }
  .spin-btn { width: 100%; padding: .875rem; font-size: .95rem; }
  .sorteo-container { gap: 1.25rem; }
  .overflow-x-auto { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-qm { min-width: 480px; }
  .table-qm thead th { padding: .5rem .6rem; font-size: .68rem; white-space: nowrap; }
  .table-qm tbody td { padding: .6rem .6rem; font-size: .8rem; }
  .hide-mobile { display: none !important; }
  .login-card { padding: 1.75rem 1.25rem; }
  .login-logo h1 { font-size: 1.15rem; }
  .login-logo .trophy { width: 52px; height: 52px; font-size: 1.6rem; }
  .form-control-qm { font-size: .9rem; padding: .7rem .875rem; }
  .input-group-qm .form-control-qm { padding-left: 2.5rem; }
  .card-qm .card-body-qm { padding: .875rem; }
  .card-qm .card-header-qm { padding: .75rem .875rem; flex-wrap: wrap; gap: .4rem; }
  .card-title-qm { font-size: .875rem; }
  .equipo-card { padding: .625rem .75rem; }
  .equipo-nombre { font-size: .8rem; }
  .equipo-puntos { font-size: .95rem; }
  .equipo-card.eliminado::after { display: none; }
  .badge-qm { font-size: .68rem; padding: .15rem .5rem; }
  .btn-verde, .btn-rojo, .btn-azul, .btn-outline { min-height: 44px; font-size: .82rem; padding: .6rem .875rem; }
  .grupo-result-card { padding: 1.25rem; }
  .grupo-result-card .grupo-nombre { font-size: 1.75rem; }
  .nav-tabs .nav-link { padding: .5rem .75rem; font-size: .82rem; }
  .world-cup-banner { padding: 1.1rem; }
  .world-cup-banner h2 { font-size: 1rem; }
  .world-cup-banner::after { display: none; }
  .d-flex.align-items-center.justify-content-between.mb-4 { flex-direction: column; align-items: flex-start !important; gap: .5rem; }
  canvas { max-height: 260px !important; }
  .grupo-hero-title { font-size: 1.75rem !important; letter-spacing: 1px !important; }
  .ranking-pos { width: 24px; height: 24px; font-size: .72rem; }
  .phase-step { min-width: 60px; }
  .phase-label { font-size: .6rem; }
}

/* Movil pequeño (<=400px) */
@media (max-width: 400px) {
  .qm-content { padding: .75rem; }
  .ruleta-wrapper { width: 210px; height: 210px; }
  .login-card { padding: 1.5rem 1rem; }
  .stat-icon { width: 38px; height: 38px; }
  .stat-info .stat-value { font-size: 1.1rem; }
}

/* ── Utilities ──────────────────────────────────────────────── */
.text-verde  { color: var(--verde) !important; }
.text-rojo   { color: var(--rojo) !important; }
.text-azul   { color: var(--azul) !important; }
.text-gold   { color: #f7971e !important; }
.text-muted  { color: var(--texto-sec) !important; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.fw-900 { font-weight: 900 !important; }
.rounded-full { border-radius: 999px !important; }
.overflow-x-auto { overflow-x: auto; }
