:root {
    --obsidian: #0A0A0B;
    --titanium: #1C1C1E;
    --titanium2: #232325;
    --titanium3: #2C2C2E;
    --gold: #D4AF37;
    --gold-glow: rgba(212, 175, 55, 0.25);
    --gold-subtle: rgba(212, 175, 55, 0.1);
    --mint: #00FF85;
    --mint-glow: rgba(0, 255, 133, 0.2);
    --mint-subtle: rgba(0, 255, 133, 0.08);
    --red: #E5373A;
    --red-subtle: rgba(229, 55, 58, 0.12);
    --blue: #4C8BF5;
    --blue-subtle: rgba(76, 139, 245, 0.12);
    --bg: var(--obsidian);
    --bg-card: var(--titanium);
    --bg-card2: var(--titanium2);
    --bg-card3: var(--titanium3);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.08);
    --border2: rgba(255, 255, 255, 0.04);
    --text: #F5F5F5;
    --text2: #8E8E93;
    --text3: #636366;
    --accent: var(--gold);
    --accent-glow: var(--gold-glow);
    --positive: var(--mint);
    --positive-glow: var(--mint-glow);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 7px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 2px 16px rgba(0, 0, 0, 0.4);
    --font-display: 'Cinzel', serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-chalk: 'Permanent Marker', cursive;
}
html.light {
    --obsidian: #F8F9FA;
    --titanium: #FFFFFF;
    --titanium2: #F1F3F5;
    --titanium3: #E8EAED;
    --gold: #064E3B;
    --gold-glow: rgba(6, 78, 59, 0.15);
    --gold-subtle: rgba(6, 78, 59, 0.06);
    --mint: #064E3B;
    --mint-glow: rgba(6, 78, 59, 0.15);
    --mint-subtle: rgba(6, 78, 59, 0.05);
    --bg: var(--obsidian);
    --bg-card: var(--titanium);
    --bg-card2: var(--titanium2);
    --bg-card3: var(--titanium3);
    --bg-glass: rgba(0, 0, 0, 0.02);
    --border: #E2E8F0;
    --border2: #EEF2F7;
    --text: #1E293B;
    --text2: #64748B;
    --text3: #94A3B8;
    --accent: var(--gold);
    --shadow: 0 4px 20px rgba(30, 41, 59, 0.1);
    --shadow-sm: 0 2px 8px rgba(30, 41, 59, 0.07);
}
*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
* {
    margin: 0;
    padding: 0;
}
html {
    height: 100%;
}
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}
.t-display { font-family: var(--font-display); letter-spacing: 0.05em; font-weight: 700; }
.t-heading { font-family: 'Playfair Display', serif; font-weight: 700; }
.t-mono { font-family: var(--font-mono); }
.t-label {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text2);
}
.logo-text {
    font-family: var(--font-display);
    font-weight: 900;
    letter-spacing: 0.15em;
    background: linear-gradient(135deg, #D4AF37 0%, #F0D060 40%, #B8960C 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.slogan {
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.3em;
    color: var(--text2);
    text-transform: uppercase;
}
.page {
    display: none;
    animation: pageIn 0.25s ease;
    min-height: calc(100vh - 136px);
}
.page.active { display: block; }
@keyframes pageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.safe-bottom { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
.px-page { padding-left: 16px; padding-right: 16px; }
.app-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(10, 10, 11, 0.92);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s;
}
html.light .app-header { background: rgba(248, 249, 250, 0.92); }
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: rgba(10, 10, 11, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border);
    display: flex;
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom);
    transition: background 0.3s;
}
html.light .bottom-nav { background: rgba(248, 249, 250, 0.96); }
.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text3);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.nav-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    transition: filter 0.2s;
}
.nav-btn.active { color: var(--accent); }
.nav-btn.active svg { filter: drop-shadow(0 0 6px var(--accent-glow)); }
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background 0.3s, border-color 0.3s;
}
.card-glass {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
}
.card-gold {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(212, 175, 55, 0.04) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--radius);
}
.card-premium {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.6;
}
.section-header {
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: 0.2em;
    color: var(--text2);
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.btn-primary {
    background: linear-gradient(135deg, #D4AF37, #C09A20);
    color: #0A0A0B;
    font-size: 13px;
    padding: 12px 24px;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(212, 175, 55, 0.5); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    padding: 12px 24px;
}
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text2);
    font-size: 12px;
    padding: 8px 16px;
}
.btn-danger {
    background: var(--red-subtle);
    border: 1px solid rgba(229, 55, 58, 0.3);
    color: var(--red);
    font-size: 12px;
    padding: 8px 16px;
}
.btn-sm { font-size: 11px; padding: 8px 16px; }
.btn-xs { font-size: 10px; padding: 5px 12px; border-radius: 6px; }
.btn-full { width: 100%; }
.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    color: var(--text2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-icon:hover {
    opacity: 0.8;
}
.btn-icon svg { width: 16px; height: 16px; }
.btn-delete-league {
    background: var(--red-subtle);
    border: 1px solid rgba(229, 55, 58, 0.3);
    color: var(--red);
}
.btn-delete-league:hover {
    background: rgba(229, 55, 58, 0.2);
}
.inp {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--gold-subtle); }
.inp::placeholder { color: var(--text3); }
.inp-sm { padding: 8px 12px; font-size: 13px; border-radius: var(--radius-xs); }
select.inp {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.inp-label {
    font-family: var(--font-display);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text2);
    display: block;
    margin-bottom: 6px;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    border-radius: 20px;
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
.badge-gold { background: var(--gold-subtle); color: var(--accent); border: 1px solid rgba(212, 175, 55, 0.2); }
.badge-mint { background: var(--mint-subtle); color: var(--mint); border: 1px solid rgba(0, 255, 133, 0.15); }
.badge-red { background: var(--red-subtle); color: var(--red); border: 1px solid rgba(229, 55, 58, 0.2); }
.badge-blue { background: var(--blue-subtle); color: var(--blue); border: 1px solid rgba(76, 139, 245, 0.2); }
.badge-muted { background: var(--bg-card3); color: var(--text2); }
.badge-amber { background: rgba(245, 158, 11, 0.12); color: #F59E0B; border: 1px solid rgba(245, 158, 11, 0.2); }
html.light .badge-mint { background: rgba(6, 78, 59, 0.12); color: #064E3B; border-color: rgba(6, 78, 59, 0.2); }
html.light .badge-amber { background: rgba(245, 158, 11, 0.12); color: #B45309; border-color: rgba(245, 158, 11, 0.25); }

.pick-btn {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-body);
    background: var(--bg-card2);
    cursor: pointer;
    transition: all 0.18s;
    text-align: center;
    color: var(--text);
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.pick-btn:active { transform: scale(0.96); }
.pick-btn.sel {
    border-color: #D4AF37;
    background: var(--gold-subtle);
    color: #D4AF37;
    box-shadow: 0 0 14px var(--gold-glow);
}
.pick-btn.sel::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #D4AF37;
}
.pick-btn--locked { pointer-events: none; opacity: 0.4; cursor: not-allowed; }
.pick-btn--locked::before { content: '🔒 '; font-size: 10px; }
@keyframes pick-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.pick-pulse { animation: pick-pulse 0.22s ease; }

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.game-card.matchweek {
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow: 0 0 24px rgba(212, 175, 55, 0.08);
}
@keyframes liveDotBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    animation: liveDotBlink 1s ease-in-out infinite;
    margin-right: 4px;
    vertical-align: middle;
}
.sw {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.sw input { opacity: 0; width: 0; height: 0; }
.sw-track {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-card3);
    border: 1px solid var(--border);
    transition: 0.3s;
    border-radius: 24px;
}
.sw-track::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: var(--text3);
    transition: 0.3s;
    border-radius: 50%;
}
input:checked + .sw-track { background: var(--gold-subtle); border-color: var(--accent); }
input:checked + .sw-track::before { transform: translateX(20px); background: var(--accent); }
.prog {
    height: 4px;
    background: var(--bg-card3);
    border-radius: 2px;
    overflow: hidden;
}
.prog-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    margin: 0;
}
.modal-overlay.center {
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 0 48px rgba(0, 0, 0, 0.7);
    margin: 0;
    position: relative;
}
.modal.center-modal {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 0;
}
.modal-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 10px auto 4px;
}
.toast {
    position: fixed;
    top: 76px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--titanium);
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    z-index: 500;
    white-space: nowrap;
    max-width: 88vw;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: var(--shadow-sm);
}
.toast.show { opacity: 1; }
.rank-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    margin-bottom: 6px;
    transition: border-color 0.2s;
    cursor: pointer;
}
.rank-row.me { border-color: var(--accent); background: var(--gold-subtle); }
.rank-row.gold { border-color: rgba(212, 175, 55, 0.4); }
.rank-row.silver { border-color: rgba(180, 180, 180, 0.3); }
.rank-row.bronze { border-color: rgba(180, 130, 80, 0.3); }
.rank-num { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--text2); width: 22px; flex-shrink: 0; }
.rank-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--bg-card2);
    border: 1.5px solid var(--border);
}
.feed-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 6px;
    border-left: 3px solid var(--border);
}
.feed-item.lock { border-left-color: var(--red); }
.feed-item.unlock { border-left-color: var(--mint); }
.feed-item.enable_week { border-left-color: var(--mint); }
.feed-item.disable_week { border-left-color: var(--red); }
.feed-item.result_posted { border-left-color: var(--blue); }
/* Publicaciones fijadas del admin — destacadas */
.feed-item.pinned {
    border-left-color: var(--accent);
    background: var(--gold-subtle);
    border-color: var(--accent);
}
html.light .feed-item.pinned {
    background: rgba(212, 175, 55, 0.08);
}
.skel {
    background: linear-gradient(90deg, var(--bg-card2) 25%, var(--bg-card3) 50%, var(--bg-card2) 75%);
    background-size: 200%;
    animation: skel 1.5s infinite;
    border-radius: var(--radius-xs);
}
@keyframes skel {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.countdown {
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 2px 8px;
    border-radius: 20px;
}
.countdown.live { background: var(--red-subtle); color: var(--red); }
.countdown.soon { background: rgba(245, 158, 11, 0.12); color: #F59E0B; }
.countdown.future { background: var(--mint-subtle); color: var(--mint); }
.auth-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.08) 0%, transparent 60%), var(--obsidian);
}
.install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--titanium);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
/* ==================== TROFEOS ==================== */
.trophy-card {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
/* Unificar todas las tarjetas de trofeos con el mismo estilo (sin degradados ni colores especiales) */
.trophy-sovereign,
.trophy-oracle,
.trophy-centurion,
.trophy-ghost,
.trophy-king,
.trophy-paladin,
.trophy-perfect,
.trophy-strategist,
.trophy-guardian,
.trophy-streak,
.trophy-legend {
    background: var(--bg-card2);
    border-color: var(--border);
}

/* Contenedores de íconos SVG (uso común) */
.trophy-icon-container,
.trophy-icon-container-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px auto;
    transition: all 0.2s;
}
.trophy-icon-container svg,
.trophy-icon-container-modal svg {
    width: 100%;
    height: 100%;
    display: block;
    color: var(--accent);
    fill: currentColor;
    stroke: currentColor;
}

/* Grid de trofeos en perfil */
#trophiesContent {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 10px;
}

/* Tarjetas de trofeos en modal (por defecto 2 columnas) */
.modal .grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* ====== RESPONSIVE: MÓVIL ====== */
@media (max-width: 640px) {
    .trophy-card {
        padding: 8px 4px;
    }
    .trophy-icon-container,
    .trophy-icon-container-modal {
        width: 32px !important;
        height: 32px !important;
        margin-bottom: 4px !important;
    }
    .trophy-card div[style*="font-family"] {
        font-size: 9px !important;
        line-height: 1.2 !important;
        margin-bottom: 2px;
    }
    .trophy-card .text-xs {
        font-size: 8px !important;
        line-height: 1.2;
    }
    #trophiesContent {
        gap: 6px;
    }
    .modal .grid-2 {
        gap: 8px;
    }
}

/* ====== RESPONSIVE: ESCRITORIO (3 columnas) ====== */
@media (min-width: 768px) {
    #trophiesContent {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px;
    }
    .trophy-card {
        padding: 16px 12px;
    }
    .trophy-icon-container,
    .trophy-icon-container-modal {
        width: 48px !important;
        height: 48px !important;
        margin-bottom: 12px !important;
    }
    .trophy-card div[style*="font-family"] {
        font-size: 12px !important;
        margin-bottom: 6px;
    }
    .trophy-card .text-xs {
        font-size: 11px !important;
        line-height: 1.3;
    }
    /* Modal también 3 columnas */
    .modal .grid-2 {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* Estilos para íconos pequeños en rankings (sin cambios) */
.rank-trophy-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 18px !important;
    height: 18px !important;
    vertical-align: middle !important;
}
.rank-trophy-icon svg {
    width: 100% !important;
    height: 100% !important;
    color: var(--accent);
}

/* Resto del CSS original (sin cambios) desde aquí */
.atab-bar {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: none;
}
.atab-bar::-webkit-scrollbar { display: none; }
.atab {
    white-space: nowrap;
    font-size: 11px;
    font-family: var(--font-display);
    letter-spacing: 0.06em;
    padding: 7px 14px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    color: var(--text2);
    background: var(--bg-card2);
    cursor: pointer;
    transition: all 0.15s;
}
.atab.active { background: var(--gold-subtle); border-color: var(--accent); color: var(--accent); }
.msg-bubble { max-width: 78%; padding: 8px 12px; border-radius: 14px; font-size: 13px; line-height: 1.45; }
.msg-me { background: var(--gold-subtle); border-bottom-right-radius: 4px; color: var(--accent); margin-left: auto; }
.msg-admin { background: var(--bg-card2); border-bottom-left-radius: 4px; color: var(--text); }
.circular-progress-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.circular-progress-wrap svg { flex-shrink: 0; }
.welcome-banner {
    background: linear-gradient(135deg, var(--gold-subtle), rgba(0, 255, 133, 0.08));
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: slide-up 0.4s ease;
}
#confettiCanvas { position: fixed; inset: 0; z-index: 9999; pointer-events: none; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--font-mono); }
.opacity-60 { opacity: 0.6; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.rounded { border-radius: var(--radius-xs); }
.rounded-full { border-radius: 50%; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }
.scroll-x { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
html.light .app-header { border-bottom-color: #E2E8F0; }
html.light .bottom-nav { border-top-color: #E2E8F0; }
html.light .logo-text {
    background: linear-gradient(135deg, #064E3B 0%, #0A7A5A 50%, #064E3B 100%);
    -webkit-background-clip: text;
    background-clip: text;
}
html.light .btn-primary {
    background: linear-gradient(135deg, #064E3B, #0A7A5A);
    color: #fff;
    box-shadow: 0 4px 20px rgba(6, 78, 59, 0.3);
}
.league-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.18s;
    margin-bottom: 8px;
    position: relative;
}
.league-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.league-card.active-league { border-color: var(--accent); }
.sport-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gold-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.sport-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes shimmer {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
@keyframes slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.no-scroll::-webkit-scrollbar { display: none; }
.no-scroll { -ms-overflow-style: none; scrollbar-width: none; }
.game-stadium {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.06) 0%, transparent 40%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
    transition: all 0.22s ease;
}
.game-stadium.finalized { opacity: 0.75; background: linear-gradient(180deg, rgba(100,100,100,0.04) 0%, transparent 40%); }
.game-stadium.live { border-color: rgba(229, 55, 58, 0.5); box-shadow: 0 0 20px rgba(229, 55, 58, 0.1); }

/* ========== ESTILOS DEL TOUR (FONDO CLARO, TEXTO OSCURO) ========== */
/* Botón flotante "Siguiente" */
.tour-float-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10001;
    background: linear-gradient(135deg, #D4AF37, #C09A20);
    color: #0A0A0B;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    padding: 12px 24px;
    border-radius: 40px;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: floatBtnPulse 1.5s ease-in-out infinite;
}
.tour-float-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 28px rgba(0,0,0,0.4);
}
@keyframes floatBtnPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* Tooltip principal - Fondo claro, texto oscuro */
.tour-tooltip {
    position: fixed;
    z-index: 10002;
    width: 320px;
    max-width: calc(100vw - 32px);
    background: #FFFFFF;
    border: 1px solid #D4AF37;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    font-family: var(--font-body);
    color: #1E293B;
    transition: all 0.2s ease;
}
.tour-tooltip.hidden {
    display: none;
}
.tour-tooltip-content {
    padding: 16px 18px;
}
.tour-tooltip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.tour-tooltip-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: #D4AF37;
    letter-spacing: 0.02em;
}
.tour-close-btn {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 50%;
    color: #64748B;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.tour-close-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}
.tour-close-btn:hover {
    background: #E2E8F0;
    color: #D4AF37;
    transform: rotate(90deg);
}
.tour-tooltip-text {
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
    margin-bottom: 16px;
}
.tour-tooltip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid #E2E8F0;
    padding-top: 12px;
}
.tour-progress {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: #64748B;
    background: #F8FAFC;
    padding: 4px 10px;
    border-radius: 20px;
}
.btn-tour {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}
.btn-tour-primary {
    background: #D4AF37;
    color: #0A0A0B;
}
.btn-tour-primary:hover {
    background: #E5C252;
    transform: translateX(2px);
}
.btn-tour-secondary {
    background: #F1F5F9;
    color: #334155;
    border: 1px solid #E2E8F0;
}
.btn-tour-secondary:hover {
    background: #E2E8F0;
    color: #D4AF37;
    transform: translateX(-2px);
}
.btn-tour:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
/* Flechas del tooltip */
.tour-tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    pointer-events: none;
}
.tour-tooltip.arrow-top .tour-tooltip-arrow {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 8px 8px 8px;
    border-color: transparent transparent #FFFFFF transparent;
    filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.1));
}
.tour-tooltip.arrow-bottom .tour-tooltip-arrow {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0 8px;
    border-color: #FFFFFF transparent transparent transparent;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

/* Resaltado dorado pulsante */
.tour-highlight {
    outline: 3px solid #D4AF37 !important;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.5), 0 0 20px rgba(212, 175, 55, 0.6) !important;
    transition: all 0.2s ease;
    z-index: 9999 !important;
    position: relative;
    animation: goldenPulse 1.2s ease-in-out infinite;
}
@keyframes goldenPulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.4), 0 0 20px rgba(212, 175, 55, 0.5);
        outline-width: 3px;
    }
    50% {
        box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.7), 0 0 30px rgba(212, 175, 55, 0.9);
        outline-width: 4px;
    }
}
/* Fondo blanco en elementos interactivos durante el tour (para mejorar contraste) */
.tour-highlight .pick-btn,
.tour-highlight .ou-toggle-btn,
.tour-highlight .market-dropdown,
.tour-highlight select.inp,
.tour-highlight .market-value,
.tour-highlight .btn-icon,
.tour-highlight .badge {
    background: #ffffff !important;
    color: #1e293b !important;
    border-color: var(--accent) !important;
}
.tour-highlight .ou-toggle-btn.ou-sel {
    background: var(--gold-subtle) !important;
    color: var(--accent) !important;
}
.tour-highlight select option {
    background: #ffffff !important;
    color: #1e293b !important;
}
.tour-highlight .rank-avatar,
.tour-highlight .sport-icon {
    background: var(--gold-subtle) !important;
    color: var(--accent) !important;
}
.pick-container-highlight {
    outline: 3px solid #D4AF37 !important;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.5), 0 0 20px rgba(212, 175, 55, 0.6) !important;
    border-radius: 12px;
    background: rgba(212, 175, 55, 0.05);
    transition: all 0.2s;
}

/* Animación de pulso para el botón de ayuda (opcional) */
.help-btn-pulse {
    animation: helpPulse 2s ease-in-out infinite;
}
@keyframes helpPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(212, 175, 55, 0); }
}

/* Estilos específicos para el gráfico y otros componentes (no modificados) */
.accordion-header {
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: 0.1em;
    color: var(--text);
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    transition: all 0.2s;
    user-select: none;
}
.accordion-header:hover { background: var(--bg-card2); }
.accordion-arrow { display: inline-block; transition: transform 0.25s ease; font-size: 11px; color: var(--text2); }
.accordion-header.open .accordion-arrow { transform: rotate(180deg); }
.accordion-body { overflow: hidden; max-height: 0; transition: max-height 0.22s ease; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.accordion-body.open { max-height: 2000px; }
.accordion-body-inner { padding: 12px 4px; }

.bulk-fab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 100;
    background: linear-gradient(135deg, #D4AF37, #C09A20);
    color: #0A0A0B;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    padding: 14px 22px;
    border-radius: 40px;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(212, 175, 55, 0.45);
    transition: all 0.25s ease;
    animation: slide-up 0.3s ease;
}
.bulk-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(212, 175, 55, 0.6); }
.bulk-select { width: 18px; height: 18px; accent-color: #D4AF37; cursor: pointer; flex-shrink: 0; }

.join-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.join-tab {
    flex: 1; text-align: center; padding: 10px; border-radius: var(--radius-xs);
    font-family: var(--font-display); font-size: 11px; letter-spacing: 0.06em;
    border: 1px solid var(--border); background: var(--bg-card2); color: var(--text2); cursor: pointer; transition: all 0.15s;
}
.join-tab.active { background: var(--gold-subtle); border-color: var(--accent); color: var(--accent); }
#qrVideo { width: 100%; max-width: 300px; border-radius: var(--radius-sm); border: 2px solid var(--border); display: block; margin: 0 auto; }
#qrCanvas { display: none; }

.flex-shrink-0 { flex-shrink: 0; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.mt-0\.5 { margin-top: 2px; }

.theme-logo {
    display: block;
    transition: opacity 0.3s;
}

.team-logo-container {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent !important;
    border: none !important;
}
.team-logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.team-initials {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--bg-card2);
    border: 1.5px solid var(--border);
}
.team-logo-card .logo-container {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    margin-bottom: 8px;
}
.team-logo-card .logo-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ==================== MEJORAS PARA ALTA COMPETENCIA (adicionales) ==================== */
.game-stadium .team-logo-container,
.game-stadium .team-initials {
    width: 150px !important;
    height: 150px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    margin: 0 auto;
    flex-shrink: 0;
}
.game-stadium .team-logo-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
}
.game-stadium .team-initials {
    background: var(--gold-subtle) !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    border-radius: 50% !important;
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
}
/* Ajustes para móvil - TAMAÑOS DE LOGOS REDUCIDOS */
@media (max-width: 640px) {
    .game-stadium .team-logo-container,
    .game-stadium .team-initials {
        width: 70px !important;
        height: 70px !important;
    }
    .game-stadium .team-initials {
        font-size: 22px !important;
    }
    .game-stadium .team-name {
        font-size: 14px !important;
        margin-top: 4px !important;
    }
    .game-stadium .vs-grid {
        gap: 8px !important;
        margin: 12px 0 !important;
    }
    .game-stadium .vs-divider {
        font-size: 16px !important;
        padding: 2px 6px !important;
    }
    .game-stadium .score-final {
        font-size: 18px !important;
        margin: 6px 0 !important;
    }
}
.game-stadium .vs-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 16px 0;
}
.game-stadium .team-col {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.game-stadium .team-name {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    margin-top: 8px;
    color: var(--text);
    word-break: break-word;
}
.game-stadium .vs-divider {
    font-family: var(--font-display) !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--accent) !important;
    margin: 0 8px !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    flex-shrink: 0;
    align-self: center;
}
/* Marcador central cuando el partido está finalizado */
.game-stadium .vs-score-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 4px;
}
.game-stadium .score-result {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    letter-spacing: 2px;
}
.game-stadium .score-extras {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 500;
    color: var(--text2);
    letter-spacing: 0.02em;
    text-align: center;
}
/* Eliminar el score-final anterior (ya no se usa) */
.game-stadium .score-final {
    display: none;
}

/* ==================== ESTILOS PARA MERCADOS EN FILA ==================== */
.markets-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 12px;
    justify-content: space-between;
    overflow-x: auto;
    padding-bottom: 4px;
}
.market-item {
    flex: 1;
    min-width: 120px;
    background: var(--bg-card2);
    border-radius: var(--radius-sm);
    padding: 6px 4px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}
.market-label {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text2);
    text-align: center;
    margin-bottom: 4px;
}
.market-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.market-controls .ou-toggle-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 4px 2px;
    font-size: 12px;
    font-weight: 700;
    background: var(--bg-card3);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text2);
    font-family: var(--font-display);
}
.market-controls .ou-toggle-btn .ou-pts {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 400;
    opacity: 0.7;
}
.market-controls .ou-toggle-btn.ou-sel {
    background: var(--gold-subtle);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 8px var(--gold-glow);
}
.market-value {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    background: var(--bg-card);
    padding: 2px 4px;
    border-radius: var(--radius-xs);
    min-width: 32px;
    text-align: center;
    color: var(--text);
    border: 1px solid var(--border);
}
.market-dropdown {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 4px;
    color: var(--text);
    cursor: pointer;
    text-align: center;
    min-width: 45px;
}
@media (max-width: 640px) {
    .markets-row {
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .market-item {
        min-width: 100px;
        flex-shrink: 0;
        padding: 4px 3px;
    }
    .market-label { font-size: 7px; margin-bottom: 2px; }
    .market-controls .ou-toggle-btn { padding: 3px 2px; font-size: 8px; }
    .market-controls .ou-toggle-btn .ou-pts { font-size: 6px; }
    .market-value { font-size: 9px; min-width: 28px; padding: 1px 2px; }
    .market-dropdown { font-size: 8px; min-width: 38px; padding: 1px 2px; }
}

/* ==================== CENTRAR LOGO EN PANTALLA DE AUTENTICACIÓN ==================== */
.auth-screen .theme-logo { display: block; margin: 0 auto; }
.auth-screen .slogan { text-align: center; width: 100%; display: block; }

/* ==================== AJUSTES PARA ADMINISTRACIÓN DE LOGOS ==================== */
.team-logo-card { min-width: 120px; max-width: 100%; box-sizing: border-box; }
.team-logo-card .logo-container { width: 80px; height: 80px; margin: 0 auto 6px auto; display: flex; align-items: center; justify-content: center; background: transparent; }
.team-logo-card .logo-container img { max-width: 100%; max-height: 100%; object-fit: contain; }
.team-logo-card .text-sm { margin-top: 4px; word-break: break-word; text-align: center; font-size: 11px; }
.team-logo-card .flex { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.team-logo-card .btn-xs {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    font-size: 18px !important;
    line-height: 1 !important;
    text-align: center;
    box-sizing: border-box;
}
@media (max-width: 480px) {
    .team-logo-card .btn-xs { width: 28px !important; height: 28px !important; font-size: 16px !important; }
    .team-logo-card .flex { gap: 4px; }
}
.game-tbd-header { text-align: center; margin: 8px 0 4px 0; }

/* ==================== BADGE DE NOTIFICACIÓN DE PAGOS ==================== */
#adminPaymentBadge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 0 1px var(--bg-card);
}

/* ==================== ACORDEÓN DE PAGOS ==================== */
.pay-accordion { display: flex; flex-direction: column; gap: 8px; }
.pay-accordion .card { transition: all 0.2s ease; }
.pay-accordion .badge { font-size: 10px; }
.jornada-accordion { margin-bottom: 8px; }
.accordion-summary {
    user-select: none;
    transition: background 0.2s ease;
    border-radius: var(--radius-xs);
}
.accordion-summary:hover { background: var(--bg-card3); }
.accordion-summary::-webkit-details-marker { display: none; }
.accordion-content { transition: all 0.2s ease; }

@media (max-width: 640px) {
    .hide-on-mobile {
        display: none;
    }
}

/* ==================== AJUSTES MÓVILES PARA CARD DE JUGADORES Y BOLSA ==================== */
@media (max-width: 640px) {
    #playersPrizeCard .flex {
        flex-wrap: nowrap !important;
        gap: 8px !important;
    }
    #playersPrizeCard .t-heading {
        font-size: 18px !important;
        line-height: 1.2 !important;
    }
    #playersPrizeCard .t-label {
        font-size: 8px !important;
        white-space: nowrap !important;
    }
    #playersPrizeCard button {
        width: 18px !important;
        height: 18px !important;
        font-size: 10px !important;
        margin-left: 4px !important;
        margin-right: 0 !important;
        display: inline-flex !important;
    }
}

.filter-active {
    border-radius: var(--radius-sm) !important;
    box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px rgba(212, 175, 55, 0.3) !important;
    transition: all 0.2s ease;
}

/* Ajuste para título del modal de premios en móvil */
@media (max-width: 640px) {
    .prize-modal-title {
        font-size: 18px !important;
        white-space: nowrap;
    }
}

/* Botón de cierre (X) dentro del modal genérico */
.generic-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text2);
    font-size: 22px;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}
.generic-modal-close:hover {
    background: var(--bg-card3);
    color: var(--accent);
    transform: rotate(90deg);
}

@media (max-width: 640px) {
    .generic-modal-close {
        top: 8px;
        right: 8px;
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
}
/* ==================== ESTILOS PARA BOTONES DE PICK Y MERCADOS (SOLO SELECCIONADOS) ==================== */
/* Modo oscuro - seleccionado en dorado */
.pick-btn.sel,
.ou-toggle-btn.ou-sel {
    background: rgba(212, 175, 55, 0.25) !important;
    border-color: #D4AF37 !important;
    color: #D4AF37 !important;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.4) !important;
}

/* Modo claro - seleccionado en verde */
html.light .pick-btn.sel,
html.light .ou-toggle-btn.ou-sel {
    background: rgba(6, 78, 59, 0.2) !important;
    border-color: #064E3B !important;
    color: #064E3B !important;
    box-shadow: 0 0 8px rgba(6, 78, 59, 0.3) !important;
}

/* Opcional: efecto hover suave (solo para feedback, sin pintar el fondo intensamente) */
.pick-btn:hover,
.ou-toggle-btn:hover {
    background: rgba(128, 128, 128, 0.08) !important;
}
html.light .pick-btn:hover,
html.light .ou-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

input[readonly] {
    cursor: default;
    background: var(--bg-card3);
    color: var(--text2);
}
/* Eliminar el resaltado de foco en campos readonly */
input[readonly] {
    outline: none;
    box-shadow: none;
}

input[readonly]:focus {
    outline: none;
    box-shadow: none;
    border-color: var(--border);
}

/* ==================== ESTILOS PARA MENÚ DESPLEGABLE DE AYUDA ==================== */
.help-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    z-index: 100;
    min-width: 180px;
    overflow: hidden;
}
.help-dropdown.hidden {
    display: none;
}
.help-dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
.help-dropdown-item:hover {
    background: var(--bg-card2);
    color: var(--accent);
}

/* ==================== ESTILOS PARA ACORDEÓN Y BUSCADOR EN MODALES ==================== */
.accordion-section {
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 0;
    background: none;
    border: none;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
    transition: color 0.2s;
}
.accordion-header:hover {
    color: var(--accent);
}
.accordion-header .arrow {
    transition: transform 0.2s;
    font-size: 12px;
}
.accordion-header.open .arrow {
    transform: rotate(180deg);
}
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 8px;
    margin-bottom: 8px;
}
.accordion-content.open {
    max-height: 500px;
}
.accordion-content p {
    margin: 8px 0;
    font-size: 13px;
    color: var(--text2);
    line-height: 1.5;
}
.modal-search {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 16px;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
}
.modal-search:focus {
    outline: none;
    border-color: var(--accent);
}

/* ============================================================
   RANKINGS — ESTILOS REDISEÑADOS
   Reemplaza el bloque desde ".rankings-header-buttons" hasta
   el final del archivo (línea 1774 en adelante).
   ============================================================ */

/* --- Fila de filtros (Temporada + Jornada) --- */
.rankings-filter-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* Botón "Temporada" */
.rankings-filter-btn {
    flex: 1;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text2);
}
.rankings-filter-btn.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}
html.light .rankings-filter-btn.active {
    color: white;
}

/* Selector de jornada con flecha custom */
.rankings-jornada-select-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}
.rankings-jornada-select-wrap.active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}
.rankings-jornada-select {
    flex: 1;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    outline: none;
    padding: 10px 36px 10px 14px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    width: 100%;
}
/* Opciones del select — forzar colores para dark/light mode */
.rankings-jornada-select option {
    background: var(--bg-card);
    color: var(--text);
}
.rankings-jornada-select-wrap.active .rankings-jornada-select {
    color: var(--bg);
    background: transparent;
}
/* En modo activo las options también deben ser legibles */
.rankings-jornada-select-wrap.active .rankings-jornada-select option {
    background: var(--bg-card);
    color: var(--text);
}
html.light .rankings-jornada-select-wrap.active .rankings-jornada-select {
    color: white;
}
.rankings-select-arrow {
    position: absolute;
    right: 10px;
    width: 16px;
    height: 16px;
    color: var(--text2);
    pointer-events: none;
    flex-shrink: 0;
}
.rankings-jornada-select-wrap.active .rankings-select-arrow {
    color: var(--bg);
}
html.light .rankings-jornada-select-wrap.active .rankings-select-arrow {
    color: white;
}

/* --- Podio Top 3 --- */
.rankings-podium-wrapper {
    margin-bottom: 28px;
}
.rankings-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 10px;
}
.rankings-podium-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* Alturas de plataforma (efecto visual de podio escalonado) */
.rankings-podium-slot.first  { margin-bottom: 0px; }
.rankings-podium-slot.second { margin-bottom: -10px; }
.rankings-podium-slot.third  { margin-bottom: -20px; }

/* Card de cada posición en el top 3 */
.rankings-top3-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 10px 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-card2);
    border: 1px solid var(--border);
    width: 100px;
}
.rankings-top3-card.first  { width: 110px; background: var(--bg-card); border-color: var(--accent); box-shadow: 0 4px 20px var(--accent-glow); }
.rankings-top3-card.second { width: 96px; }
.rankings-top3-card.third  { width: 88px; }
.rankings-top3-card.is-me  { border-color: var(--accent) !important; }
.rankings-top3-card:hover  { transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.rankings-top3-card.first:hover { transform: translateY(-6px); }

/* Corona/medalla encima del avatar */
.top3-crown {
    font-size: 20px;
    margin-bottom: 6px;
    line-height: 1;
}
.rankings-top3-card.second .top3-crown,
.rankings-top3-card.third  .top3-crown { font-size: 16px; }

/* Avatar circular */
.top3-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px auto;
    border-radius: 50%;
    background: var(--gold-subtle);
    border: 2px solid var(--accent);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.top3-avatar.first  { width: 72px; height: 72px; }
.top3-avatar.second { width: 58px; height: 58px; }
.top3-avatar.third  { width: 48px; height: 48px; }

.top3-avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
}
.rankings-top3-card.second .top3-avatar-initials,
.rankings-top3-card.third  .top3-avatar-initials { font-size: 1.1rem; }

.top3-name {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}
.rankings-top3-card.first .top3-name { font-size: 12px; max-width: 100px; }

.top3-trophies {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-bottom: 4px;
}

.top3-points {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    margin-top: 2px;
}
.rankings-top3-card.second .top3-points,
.rankings-top3-card.third  .top3-points { font-size: 13px; }

.podium-empty {
    width: 88px;
    height: 80px;
}

/* --- Lista (posición 4+) --- */
.rankings-list {
    margin-bottom: 80px; /* espacio para la floating card */
}

/* --- Tarjeta flotante (posición del usuario, sobre la nav) --- */
.rankings-floating-card {
    position: fixed;
    bottom: calc(64px + env(safe-area-inset-bottom) + 8px);
    left: 16px;
    right: 16px;
    z-index: 95;
    background: var(--bg-card);
    border: 1.5px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 16px var(--accent-glow);
    animation: floatingCardIn 0.3s ease;
}
@keyframes floatingCardIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
html.light .rankings-floating-card {
    background: rgba(255,255,255,0.97);
}

.rankings-floating-left {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 0 0 auto;
}
.rankings-floating-rank {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}
.rankings-floating-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text2);
}
.rankings-floating-pts {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.rankings-floating-locate {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gold-subtle);
    border: 1.5px solid var(--accent);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}
.rankings-floating-locate:hover,
.rankings-floating-locate:active {
    background: var(--accent);
    color: var(--bg);
    box-shadow: 0 0 12px var(--accent-glow);
}
.rankings-floating-locate svg {
    width: 18px;
    height: 18px;
}

/* Responsive móvil */
@media (max-width: 640px) {
    .rankings-top3-card        { width: 92px;  padding: 8px 8px 12px; }
    .rankings-top3-card.first  { width: 102px; }
    .rankings-top3-card.second { width: 88px; }
    .rankings-top3-card.third  { width: 80px; }
    .top3-avatar.first  { width: 60px; height: 60px; }
    .top3-avatar.second { width: 50px; height: 50px; }
    .top3-avatar.third  { width: 42px; height: 42px; }
    .top3-crown { font-size: 16px; }
    .rankings-top3-card.second .top3-crown,
    .rankings-top3-card.third  .top3-crown { font-size: 14px; }
    .rankings-floating-card { left: 12px; right: 12px; }
}

/* Forzar estilo del botón Temporada activo (compatibilidad) */
#rankSeasonBtn.btn-primary {
    background: var(--accent);
    color: var(--bg);
    border: none;
}
#rankSeasonBtn.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text2);
}
html.light #rankSeasonBtn.btn-primary {
    background: var(--accent);
    color: white;
}