:root {
    --bg-color: #0d1117;
    --card-bg: rgba(30, 39, 50, 0.7);
    --accent-color: #00d2ff;
    --text-primary: #ffffff;
    --text-secondary: #8b949e;
    --success: #238636;
    --danger: #da3633;
    --warning: #d29922;
    --primary: #58a6ff;
    --glass-border: rgba(255, 255, 255, 0.1);
    --rojo: #f1130f;
    --verde: #26c340;
    --nav-bg: rgba(13, 17, 23, 0.9);
    --header-gradient: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --bg-azul: #0162f3;
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --card-bg: #e8f0f0;
    --accent-color: #f1130f;
    --text-primary: #121212;
    --text-secondary: #4a4a4a;
    --success: #26c340;
    --danger: #f1130f;
    --warning: #d29922;
    --primary: #58a6ff;
    --glass-border: rgba(0, 0, 0, 0.1);
    --nav-bg: rgba(255, 255, 255, 0.95);
    --header-gradient: linear-gradient(135deg, #ffffff 0%, #f1f3f5 100%);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    color: var(--rojo);

    line-height: 1.6;
    padding-top: 60px;
    /* Space for fixed top bar */
    padding-bottom: 220px;
    /* Space for sticky footer */
}

/* Top Bar */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    height: 60px;
    background: var(--nav-bg);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mini-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-logo {
    height: 36px;
    width: 36px;
    object-fit: contain;
}

.logo-mini {
    font-size: 0.9rem;
    font-weight: 900;
    text-transform: uppercase;
    color: rgb(255, 217, 0);
    line-height: 1;
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.top-cierre {
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--verde);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.top-cierre i {
    width: 12px;
    height: 12px;
}

/* Desktop Centering for Cierre */
@media (min-width: 601px) {
    .top-bar {
        position: relative;
    }

    .top-cierre {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        background: rgba(210, 153, 34, 0.08);
        padding: 6px 15px;
        border-radius: 20px;
        border: 1px solid rgba(210, 153, 34, 0.2);
        margin-top: 0;
        white-space: nowrap;
        font-size: 0.75rem;
    }

    .top-cierre i {
        width: 14px;
        height: 14px;
    }
}

.logo-mini span {
    color: var(--success);
}

.header-badges {
    display: flex;
    gap: 15px;
}

.badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.b-label {
    font-size: 0.5rem;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    line-height: 1;
}

.b-value {
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.2;
}

.badge-acc .b-value {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.badge-price .b-value {
    color: var(--danger);
}

[data-theme="light"] .logo-mini {
    color: #fc0606;
}

[data-theme="light"] .badge-acc .b-value {
    color: #b8860b;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: var(--bg-color);
    z-index: 1200;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1150;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar-header {
    padding: 25px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
}

.sidebar-subtitle {
    font-size: 0.7rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 4px;
}

.sidebar-logo {
    height: 50px;
    object-fit: contain;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-link-sb {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.nav-link-sb i {
    width: 20px;
    height: 20px;
    color: var(--accent-color);
}

.nav-link-sb:hover,
.nav-link-sb.active {
    background: rgba(72, 255, 0, 0.144);
    color: #ffd700;
    border-left-color: #ffd700;
}

#btn-install-pwa {
    color: var(--warning);
    position: relative;
}

#btn-install-pwa i {
    color: var(--warning);
    animation: pwa-pulse 2s infinite;
}

@keyframes pwa-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.sidebar-footer {
    padding: 25px 20px;
    border-top: 1px solid var(--glass-border);
}

.cierre-pill {
    font-size: 0.7rem;
    background: rgba(210, 153, 34, 0.1);
    color: #ffd700;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    border: 1px solid rgba(210, 153, 34, 0.2);
}

.countdown-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    text-align: center;
}

[data-theme="light"] .countdown-container {
    background: rgba(0, 0, 0, 0.03);
}

.countdown-label {
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.cd-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
}

.cd-item span {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--rojo);
    line-height: 1;
}

.cd-item small {
    font-size: 0.45rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 2px;
}

[data-theme="light"] .cd-item {
    background: white;
}

/* UI Elements */
.icon-btn,
.close-btn,
.theme-toggle-simple {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.icon-btn:hover,
.close-btn:hover,
.theme-toggle-simple:hover {
    background: var(--glass-border);
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.match-notice {
    background: rgba(88, 166, 255, 0.1);
    border: 1px dashed var(--primary);
    color: var(--primary);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid var(--glass-border);
}

.input-group i {
    color: var(--accent-color);
    margin-right: 10px;
}

.input-group input {
    background: none;
    border: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 1rem;
    font-family: inherit;
}

.input-group input:focus {
    outline: none;
}

.input-group.invalid-input {
    border-color: var(--danger) !important;
    box-shadow: 0 0 10px rgba(218, 54, 51, 0.3);
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* User Info Table-like compact section */
.user-info {
    padding: 12px 15px !important;
    margin-bottom: 15px;
}

.user-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.user-form .input-group {
    flex: 1;
    min-width: 200px;
    margin: 0 !important;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-form .input-group i {
    width: 16px;
    height: 16px;
    color: var(--accent-color);
}

.user-form .input-group input {
    background: none;
    border: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
}

.user-form .input-group input:focus {
    outline: none;
}

/* Compact Betting Sheet Layout */
.matches-container {
    position: relative;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
    /* To keep watermark inside if it overflows */
}

.match-legend {
    background: rgba(251, 255, 1, 0.664);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    color: var(--bg-color);
    padding: 12px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 5;
}

[data-theme="light"] .match-legend {
    background: rgba(196, 130, 6, 0.911);
    color: var(--bg-color);
}

.matches-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(80vw, 500px);
    height: min(80vw, 500px);
    background-image: url('asset/imgs/logo-mediasemana.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.1;
    /* Transparente tipo marca de agua */
    z-index: 0;
    pointer-events: none;
}

/* Ensure rows are relative to be above watermark if needed, 
   though they follow naturally. We set z-index just in case. */
.match-row-compact {
    position: relative;
    z-index: 2;
    background: transparent;
    display: grid;
    grid-template-columns: 40px 1fr 140px;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding: 10px 15px;
    gap: 15px;
    transition: background 0.2s ease;
}

.match-row-compact:hover {
    background: rgba(255, 255, 255, 0.03);
}

.m-id {
    font-size: 0.75rem;
    font-weight: 800;
    color: #ffd700;
    /*opacity: 0.5;*/
}

.m-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
}

.m-team {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
    overflow: hidden;
    /* For ellipsis */
}

.m-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.m-team.home {
    justify-content: flex-end;
    text-align: right;
}

.m-team.away {
    justify-content: flex-start;
    text-align: left;
}

.m-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.m-vs {
    font-size: 0.65rem;
    font-weight: 900;
    color: var(--rojo);
    text-transform: uppercase;
    /*opacity: 0.4;*/
}

.m-options {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 2px;
    border: 1px solid var(--glass-border);
}

.m-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px 0;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.m-btn.active {
    background: var(--danger);
    color: #000;
    box-shadow: 0 2px 8px rgba(235, 84, 73, 0.3);
}

[data-theme="light"] .match-row-compact {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .m-options {
    background: rgba(0, 0, 0, 0.05);
}



/* Section specific styles */
.section-content {
    margin-top: 15px;
}

.pago-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--glass-border);
}

.pago-info {
    flex: 1;
}

.tarjeta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 5px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.card-number {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: 1px;
}

.btn-copy {
    background: var(--primary);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.btn-copy i {
    width: 14px !important;
    height: 14px !important;
    color: white !important;
}

.btn-copy:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

.btn-copy.copied {
    background: var(--success);
}

#copy-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent-color);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    z-index: 2000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    opacity: 0;
    white-space: nowrap;
}

#copy-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Mobile adjustments for payment */
@media (max-width: 600px) {
    .tarjeta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
    }

    .btn-copy {
        width: 100%;
        justify-content: center;
        padding: 10px;
        font-size: 0.85rem;
    }

    .card-number {
        font-size: 0.95rem;
        word-break: break-all;
    }
}

[data-theme="light"] .pago-item p,
[data-theme="light"] .pago-item strong {
    color: #000000;
}

.pago-note {
    font-size: 0.75rem;
    color: var(--warning);
    text-align: center;
    margin-top: 15px;
    font-weight: 600;
}

.reglamento-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reglamento-list li {
    font-size: 0.85rem;
    padding-left: 20px;
    position: relative;
    color: var(--text-secondary);
}

.reglamento-list li::before {
    content: "•";
    color: var(--accent-color);
    position: absolute;
    left: 0;
    font-weight: 900;
}

/* Actions */
.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 40px;
}

.btn {
    border-radius: 8px;
    padding: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.1s active;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
    width: 100%;
}

/* Summary List */
.registered-list {
    margin-top: 20px;
    border-color: var(--primary);
}

.card-header h3 {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    margin-bottom: 15px;
}

.summary-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--glass-border);
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 5px;
}

.summary-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-remove {
    background: rgba(218, 54, 51, 0.2);
    border: 1px solid var(--danger);
    color: var(--danger);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background: var(--danger);
    color: white;
}

.btn-remove i {
    width: 14px;
    height: 14px;
}

.summary-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent-color);
}

.summary-cost {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--warning);
}

.summary-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.summary-match {
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    border: 1px solid var(--glass-border);
}

.summary-match span {
    color: var(--accent-color);
    margin-left: 3px;
}

/* Sticky Footer */
.sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--glass-border);
    padding: 10px 15px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-stats {
    display: flex;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 12px;
    border-radius: 10px;
    margin-top: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.55rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-value.highlight {
    color: var(--warning);
}

.footer-btns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

#btn-enviar {
    grid-column: span 3;
    width: 100%;
}

.btn-small {
    padding: 8px !important;
    font-size: 0.75rem !important;
}

.btn-small i {
    width: 14px !important;
    height: 14px !important;
}

.dev-credit {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.dev-credit a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}


/* Theme Toggle */
.theme-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    border-color: var(--accent-color);
}

.theme-toggle i {
    width: 20px;
    height: 20px;
}

/* Light mode specific tweaks */
[data-theme="light"] .vs {
    background: rgba(0, 0, 0, 0.05);
}

/*[data-theme="light"] .option-btn {
    background: rgba(0, 0, 0, 0.03);
}*/

[data-theme="light"] .summary-item {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .input-group {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .sticky-footer {
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .footer-stats {
    background: rgba(0, 0, 0, 0.03);
}

/* Leaderboard Styles */
.leaderboard-header {
    text-align: center;
    padding: 25px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f);
    color: white;
    border-radius: 12px;
}

.slogan-text {
    font-size: 1.1rem;
    font-weight: 700;
    font-style: italic;
    margin-bottom: 20px;
    opacity: 0.9;
}

.prize-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.prize-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.prize-card .label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.prize-card .amount {
    font-size: 1.5rem;
    font-weight: 900;
}

.main-prize {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.4);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    padding: 15px;
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.leaderboard-table td {
    padding: 15px;
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
}

.rank-pill {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
}

.top-rank {
    background: #ffd700;
    color: #000;
}

/* Leader */
.high-score {
    background: rgba(255, 215, 0, 0.05);
}

/* Contact Section */
.contact-card {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
    text-align: center;
    padding: 10px 0;
}

.contact-intro {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 400px;
}

.social-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.social-btn {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 210, 255, 0.3);
}

.social-btn i {
    width: 28px;
    height: 28px;
}

.whatsapp-group-box {
    width: 100%;
    background: rgba(38, 195, 64, 0.1);
    border: 1px dashed var(--verde);
    border-radius: 16px;
    padding: 25px;
    margin-top: 10px;
}

.whatsapp-group-box h3 {
    color: var(--verde);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.whatsapp-group-box p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.btn-group-wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--verde);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(38, 195, 64, 0.3);
    animation: pulse-wa 2s infinite;
}

@keyframes pulse-wa {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(38, 195, 64, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 25px rgba(38, 195, 64, 0.5);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(38, 195, 64, 0.3);
    }
}

.btn-group-wa:hover {
    background: #1fab35;
    transform: translateY(-2px);
}

[data-theme="light"] .social-btn {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .whatsapp-group-box {
    background: rgba(38, 195, 64, 0.05);
}

@media (max-width: 600px) {
    .top-bar {
        padding: 0 8px;
        height: 55px;
    }

    .top-bar-left {
        gap: 6px;
    }

    .mini-logo {
        height: 28px;
        width: 28px;
    }

    .logo-mini {
        font-size: 0.7rem;
    }

    .top-cierre {
        font-size: 0.5rem;
    }

    .header-badges {
        gap: 8px;
    }

    .badge {
        gap: 0;
    }

    .b-label {
        font-size: 0.45rem;
    }

    .b-value {
        font-size: 0.8rem;
    }

    .user-info {
        padding: 10px !important;
    }

    .user-form {
        gap: 8px;
    }

    .user-form .input-group {
        min-width: 100%;
        padding: 6px 10px;
    }

    .user-form .input-group input {
        font-size: 0.8rem;
    }

    .match-row-compact {
        grid-template-columns: 25px 1fr 105px;
        padding: 6px 8px;
        gap: 5px;
    }

    .m-id {
        font-size: 0.6rem;
    }

    .m-teams {
        gap: 4px;
        width: 100%;
        overflow: hidden;
    }

    .m-team {
        font-size: 0.72rem;
        gap: 4px;
    }

    .m-logo {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

    .m-btn {
        padding: 5px 0;
        font-size: 0.7rem;
    }

    .m-options {
        width: 105px;
    }

    .sticky-footer {
        padding: 8px 10px;
        gap: 6px;
        align-items: center;
    }

    .footer-btns {
        width: 100%;
        gap: 5px;
    }

    .footer-stats {
        width: 100%;
    }

    .btn-small {
        font-size: 0.6rem;
        padding: 6px 4px;
    }

    .btn-success {
        font-size: 0.8rem;
    }

    .stat-value {
        font-size: 0.8rem;
    }
}

@media (max-width: 360px) {
    .logo-mini span {
        display: none;
    }

    .b-label {
        display: none;
    }
}

/* Bolsa Inicial Table */
.bolsa-table-public {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-color);
    color: var(--text-primary);
    margin-top: 10px;
}

.bolsa-table-public th {
    background: var(--primary);
    color: white !important;
    padding: 12px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    text-align: center;
}

.bolsa-table-public td {
    padding: 10px 8px;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    text-align: center;
}

.total-cell-public {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8 !important;
    font-weight: 800;
    text-align: center;
}

[data-theme="light"] .total-cell-public {
    background: rgba(23, 162, 184, 0.1);
    color: #0b7a8a !important;
}

.bolsa-table-public tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .bolsa-table-public tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.bolsa-table-public th:nth-child(2),
.bolsa-table-public td:nth-child(2) {
    text-align: left;
    position: sticky;
    left: 0;
    background: #171a1f;
    /* Solid background for sticky col */
    z-index: 2;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .bolsa-table-public th:nth-child(2),
[data-theme="light"] .bolsa-table-public td:nth-child(2) {
    background: #14cce4;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.bolsa-table-public th {
    background: #3bbbbb;
    color: white !important;
    padding: 12px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    text-align: center;
}

.bolsa-table-public td {
    padding: 10px 8px;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    text-align: center;
    color: var(--text-primary) !important;
}

[data-theme="light"] .bolsa-table-public td {
    color: #333 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.total-cell-public {
    background: rgba(23, 162, 184, 0.2);
    color: #00d2ff !important;
    font-weight: 800;
    text-align: center;
}

[data-theme="light"] .total-cell-public {
    background: rgba(23, 162, 184, 0.1);
    color: #1a2a6c !important;
}

/* --- TICKET VISUAL SYSTEM --- */

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-color);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    color: var(--accent-color);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--glass-border);
}

/* Ticket Image Container */
.ticket-image-container {
    width: 100%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.ticket-image-container img {
    max-width: 100%;
    height: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.ticket-instruction {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
}

/* --- TICKET EXPORT CARD (The area being captured) --- */
.ticket-export-card {
    width: 400px;
    background: #0d1117;
    /* Dark background for export */
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    padding: 30px;
    border-radius: 0;
    /* Keep it square or slightly rounded for image */
    position: relative;
}

.ticket-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 15px;
}

.ticket-logo {
    height: 60px;
    width: 60px;
    object-fit: contain;
}

.ticket-brand {
    font-size: 1.2rem;
    font-weight: 900;
    margin: 0;
    line-height: 1;
    color: #00d2ff;
}

.ticket-brand span {
    color: #f1130f;
}

.ticket-subtitle {
    font-size: 0.8rem;
    font-weight: 600;
    color: #8b949e;
    margin-top: 4px;
}

.ticket-user-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.t-user-item {
    display: flex;
    flex-direction: column;
}

.t-label {
    font-size: 0.6rem;
    font-weight: 800;
    color: #8b949e;
    letter-spacing: 1px;
}

.t-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
}

.t-value.highlight {
    color: #ffd700;
    font-size: 1.1rem;
}

.ticket-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 0;
}

.ticket-matches {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.t-match {
    display: grid;
    grid-template-columns: 25px 1fr 60px;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid var(--accent-color);
}

.tm-id {
    font-size: 0.7rem;
    font-weight: 900;
    color: #8b949e;
}

.tm-teams {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
}

.tm-pick {
    background: #f1130f;
    color: #000;
    font-size: 0.8rem;
    font-weight: 900;
    text-align: center;
    padding: 2px 0;
    border-radius: 4px;
}

.ticket-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
    padding-top: 20px;
}

.t-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ticket-watermark {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.1);
    font-weight: 800;
    letter-spacing: 2px;
    transform: rotate(-90deg);
    transform-origin: bottom right;
    position: absolute;
    bottom: 40px;
    right: 10px;
}

@media (max-width: 600px) {
    .bolsa-table-public {
        font-size: 0.7rem;
    }

    .bolsa-table-public td,
    .bolsa-table-public th {
        padding: 8px 4px;
    }
}

/* community trends section */
.trends-table-header {
    display: grid;
    grid-template-columns: 1fr 45px 45px 45px;
    padding: 12px 15px;
    background: #f1f5f9;
    font-weight: 700;
    font-size: 0.75rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}

.trend-row {
    display: grid;
    grid-template-columns: 1fr 45px 45px 45px;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.trend-row:hover {
    background: #f8fafc;
}

.trend-teams {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trend-team-line {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

.trend-mini-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.trend-vs {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 700;
    border-left: 2px solid #e2e8f0;
    padding-left: 10px;
    margin-top: 2px;
}

.perc-badge {
    width: 38px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}

.perc-badge.l {
    background: #10b981;
}

/* Green for Home */
.perc-badge.e {
    background: #3b82f6;
}

/* Blue for Draw */
.perc-badge.v {
    background: #ef4444;
}

/* Red for Away */

/* Responsive table for trends */
@media (min-width: 600px) {

    .trends-table-header,
    .trend-row {
        grid-template-columns: 1fr 80px 80px 80px;
    }

    .trend-teams {
        flex-direction: row;
        align-items: center;
        gap: 15px;
        justify-content: space-between;
        padding-right: 20px;
    }

    .trend-team-line:last-child {
        flex-direction: row-reverse;
    }

    .trend-vs {
        margin: 0;
        border: none;
        padding: 0;
    }

    .perc-badge {
        width: 60px;
    }
}

/* --- CLOSED QUINIELA STATE --- */
.closed-message {
    text-align: center;
    padding: 40px 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(255, 79, 79, 0.3);
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.closed-icon {
    width: 64px;
    height: 64px;
    color: #ff4f4f;
    margin-bottom: 15px;
    opacity: 0.8;
}

.closed-title {
    font-size: 2rem;
    font-weight: 900;
    color: #ff4f4f;
    margin: 0 0 10px 0;
    letter-spacing: 2px;
}

.closed-text {
    font-size: 1rem;
    color: #a0aec0;
    margin: 0;
}

/* Light Theme Overrides for Closed State */
[data-theme="light"] .closed-message {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(229, 62, 62, 0.4);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .closed-icon {
    color: #e53e3e;
}

[data-theme="light"] .closed-title {
    color: #e53e3e;
}

[data-theme="light"] .closed-text {
    color: #4a5568;
    font-weight: 600;
}