:root {
    --carbon-bg: #2c2e33;
    /* Lighter background */
    --metal-base: #1f2022;
    --metal-light: #3a3d46;
    --metal-dark: #121315;
    --accent-red: #ff2a2a;
    --accent-red-glow: rgba(255, 42, 42, 0.4);
    --text-main: #f0f4f8;
    --text-muted: #a0a6b1;
    /* Slightly brighter muted text */

    --gold: #FFD700;
    --silver: #E3E4E5;
    --bronze: #CD7F32;

    --panel-border: rgba(255, 255, 255, 0.2);
}

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

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-main);
    background-color: var(--carbon-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Backgrounds */
.bg-carbon {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background:
        linear-gradient(27deg, #32353e 5px, transparent 5px) 0 5px,
        linear-gradient(207deg, #32353e 5px, transparent 5px) 10px 0px,
        linear-gradient(27deg, #3a3d46 5px, transparent 5px) 0px 10px,
        linear-gradient(207deg, #3a3d46 5px, transparent 5px) 10px 5px,
        linear-gradient(90deg, #2c2e33 10px, transparent 10px),
        linear-gradient(#2f323a 25%, #2c2e33 25%, #2c2e33 50%, transparent 50%, transparent 75%, #353842 75%, #353842 100%);
    background-color: #2c2e33;
    background-size: 20px 20px;
    z-index: -2;
    opacity: 1;
}

.glow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 0%, rgba(255, 42, 42, 0.1) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* Header */
.header {
    text-align: center;
    padding: 1.5rem 0 0;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    max-width: 800px;
    margin-bottom: 1.5rem;
}

.logo h1 {
    font-family: 'Teko', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.countdown-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    width: 100%;
    max-width: 900px;
}

.flags-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.flag {
    width: 40px;
    height: 25px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, filter 0.3s ease;
    border-radius: 2px;
    filter: grayscale(80%) opacity(0.5);
}

.flag.active {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--accent-red-glow), 0 4px 8px rgba(0, 0, 0, 0.6);
}

.flag:hover {
    transform: scale(1.15);
    filter: grayscale(0%) opacity(0.9);
}

/* Countdown Timer */
.countdown-wrapper {
    background: linear-gradient(145deg, var(--metal-dark), #000);
    padding: 1rem 2rem;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6), inset 0 2px 10px rgba(255, 42, 42, 0.1);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.countdown-title {
    font-family: 'Teko', sans-serif;
    color: var(--text-muted);
    font-size: 1.2rem;
    letter-spacing: 3px;
    margin-bottom: 0.5rem;
}

.countdown-timer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--metal-base);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    min-width: 60px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.time-val {
    font-family: 'Teko', sans-serif;
    font-size: 2.2rem;
    color: var(--text-main);
    line-height: 1;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.time-lbl {
    font-size: 0.7rem;
    color: var(--accent-red);
    font-weight: 700;
    letter-spacing: 1px;
    margin-top: 3px;
}

.time-sep {
    font-family: 'Teko', sans-serif;
    font-size: 2rem;
    color: var(--accent-red);
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.winner-announcement {
    background: linear-gradient(90deg, transparent, rgba(255, 42, 42, 0.2), transparent);
    padding: 1rem 2rem;
    border-radius: 4px;
    animation: pulse 2s infinite;
}

.winner-text {
    font-family: 'Teko', sans-serif;
    color: var(--gold);
    font-size: 2.5rem;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    margin: 0;
    letter-spacing: 2px;
}

.logo .marca {
    color: var(--text-main);
}

.logo .performance {
    color: var(--accent-red);
    font-weight: 500;
    font-style: italic;
    text-shadow: 0 0 15px var(--accent-red-glow);
}

/* Main Dashboard */
.dashboard {
    display: flex;
    flex-direction: column;
    /* Cambiado a columna para acomodar mejor el hofan */
    gap: 2rem;
    padding: 1rem 2rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Container for standard widgets */
.dashboard-top {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    width: 100%;
}

.panel {
    flex: 1;
    min-width: 320px;
    background: linear-gradient(145deg, var(--metal-light), var(--metal-dark));
    border-radius: 12px;
    padding: 3px;
    /* border thickness */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Simulated metallic border using padding */
.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.5) 100%);
    z-index: 0;
    pointer-events: none;
}

.panel-inner {
    background-color: var(--metal-base);
    border-radius: 10px;
    height: 100%;
    position: relative;
    z-index: 1;
    padding: 2rem;
    box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.3);
}

.panel-header h2 {
    font-size: 1.2rem;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.live-pulse {
    font-size: 0.8rem;
    color: var(--accent-red);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 10px var(--accent-red);
    }

    100% {
        opacity: 0.5;
    }
}

.metal-line {
    height: 2px;
    background: linear-gradient(90deg, var(--accent-red), transparent);
    margin-bottom: 2rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

select {
    width: 100%;
    padding: 1rem;
    background-color: var(--metal-dark);
    color: var(--text-main);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    appearance: none;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

select:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 8px var(--accent-red-glow), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent-red);
    background: rgba(255, 42, 42, 0.05);
}

.drop-icon {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.text-highlight {
    color: var(--accent-red);
    font-weight: 700;
}

.image-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.remove-img {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-red);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
}

.remove-img:hover {
    transform: scale(1.1);
}

.hidden {
    display: none !important;
}

.btn-submit {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, #111, var(--metal-base));
    border: 1px solid var(--accent-red);
    border-radius: 6px;
    color: #fff;
    font-family: 'Teko', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.btn-submit:not(:disabled):hover {
    background: var(--accent-red);
    box-shadow: 0 0 20px var(--accent-red-glow);
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
}

.btn-submit:disabled {
    border-color: #555;
    background: #222;
    color: #555;
    cursor: not-allowed;
}

/* Solid Error Button from Submit Class */
.btn-error-solid {
    background: linear-gradient(135deg, #2a0808, #111);
    margin-top: 0.5rem;
    padding: 0.8rem;
}

.btn-error-solid .btn-text {
    font-size: 1.2rem;
}

/* Error Report Button */
.btn-error {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #1c0505, var(--metal-base));
    border: 1px dashed rgba(255, 42, 42, 0.4);
    border-radius: 6px;
    color: var(--accent-red);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.btn-error:hover {
    background: linear-gradient(135deg, #2a0808, var(--metal-base));
    border-color: var(--accent-red);
    box-shadow: 0 0 15px rgba(255, 42, 42, 0.2);
    transform: translateY(-2px);
}

.btn-error .error-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 5px rgba(255, 0, 0, 0.5));
}

.btn-error .error-text {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
}

.btn-error .error-text small {
    display: block;
    font-weight: 400;
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 3px;
    color: #ff8c8c;
}

/* Ranking List */
.ranking-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ranking-header {
    display: flex;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
}

.col-pos {
    width: 60px;
    text-align: center;
}

.col-name {
    flex: 1;
}

.col-score {
    width: 80px;
    text-align: center;
}

.ranking-list {
    list-style: none;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 5px;
}

.ranking-list::-webkit-scrollbar {
    width: 6px;
}

.ranking-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.ranking-list::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 3px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
    animation: slideIn 0.5s ease backwards;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.pos-badge {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--metal-dark);
    border-radius: 50%;
    font-weight: 900;
    margin: 0 auto;
    border: 2px solid var(--metal-light);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* Top 3 Styling */
.rank-1 .pos-badge {
    border-color: var(--gold);
    background: linear-gradient(135deg, #443a05, #111);
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold);
}

.rank-2 .pos-badge {
    border-color: var(--silver);
    background: linear-gradient(135deg, #333, #111);
    color: var(--silver);
}

.rank-3 .pos-badge {
    border-color: var(--bronze);
    background: linear-gradient(135deg, #422810, #111);
    color: var(--bronze);
}

.item-name {
    flex: 1;
    font-weight: 700;
    font-size: 1.1rem;
    padding-left: 1rem;
}

.item-score {
    width: 80px;
    text-align: center;
    font-family: 'Teko', sans-serif;
    font-size: 1.5rem;
    color: var(--accent-red);
}

.status-message {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 255, 100, 0.1);
    border-left: 3px solid #00ff64;
    color: #00ff64;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Ranking Totals Footer */
.ranking-totals {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(0,0,0,0.2), rgba(0,0,0,0.4));
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0 0 8px 8px;
}

.total-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    transition: transform 0.3s;
}

.total-box:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.total-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 0.2rem;
    font-weight: bold;
}

.total-value {
    font-family: 'Teko', sans-serif;
    font-size: 2.2rem;
    line-height: 1;
    color: #fff;
    text-shadow: 0 0 15px rgba(255,255,255,0.2);
}

.total-box.animated-border {
    border-color: rgba(0, 210, 255, 0.3);
    background: linear-gradient(135deg, rgba(5, 25, 35, 0.5), rgba(0, 0, 0, 0.5));
}

.total-box.animated-border .total-label {
    color: #00d2ff;
}

.total-box.animated-border .total-value {
    color: #00d2ff;
    text-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
}

@media (max-width: 480px) {
    .ranking-totals {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Responsiveness */
@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
        padding: 0.5rem;
        gap: 1.5rem;
    }

    .panel {
        min-width: 100%;
        margin-bottom: 1rem;
    }

    .panel-inner {
        padding: 1.2rem;
    }

    .logo h1 {
        font-size: 2.2rem;
    }

    .header-top {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }

    .countdown-group {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        padding: 0 1rem;
    }

    .flags-container {
        flex-direction: row;
        justify-content: center;
    }

    .countdown-wrapper {
        padding: 1rem;
        width: 100%;
    }

    .time-timer {
        justify-content: center;
        width: 100%;
    }

    .time-val {
        font-size: 1.6rem;
    }

    .time-box {
        padding: 0.4rem;
        min-width: 45px;
    }

    .time-sep {
        font-size: 1.5rem;
    }

    .drop-zone {
        padding: 1rem;
    }

    .btn-submit {
        font-size: 1.2rem;
        padding: 1rem;
    }

    .btn-error {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        padding: 0.8rem;
    }

    .btn-error-solid .btn-text {
        font-size: 0.95rem;
    }

    /* Ranking Mobile List Fixes */
    .ranking-header {
        font-size: 0.7rem;
        padding: 0.8rem 0.5rem;
    }

    .ranking-item {
        padding: 0.8rem 0.5rem;
    }

    .col-pos {
        width: 40px;
    }

    .col-score {
        width: 60px;
    }

    .pos-badge {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .item-name {
        font-size: 0.95rem;
        padding-left: 0.5rem;
    }

    .item-score {
        width: 60px;
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
    }
}

/* Modals ranking */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-content {
    max-width: 90%;
    max-height: 80vh;
    border: 2px solid var(--panel-border);
    border-radius: 4px;
}

.confirm-modal-content {
    background: var(--metal-dark);
    padding: 2.5rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    border: 2px solid var(--accent-red);
    box-shadow: 0 0 30px rgba(255, 42, 42, 0.4);
    border-radius: 8px;
    position: relative;
    color: #f0f4f8;
}

/* Ranking Tabs */
.ranking-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: Teko, sans-serif;
    font-size: 1.1rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tab-btn.active {
    background: rgba(0, 210, 255, 0.15);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}

/* Hall of Fame Section Styles */
.hall-of-fame-panel {
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(255, 215, 0, 0.05);
}

.hall-of-fame-content {
    display: flex;
    flex-direction: row;
    /* En desktop uno al lado del otro */
    gap: 2rem;
    padding: 0.5rem;
}

.podium-section {
    flex: 1;
}

.history-section {
    flex: 2;
}

.section-subtitle {
    font-family: 'Teko', sans-serif;
    color: var(--gold);
    font-size: 1.6rem;
    letter-spacing: 2px;
    margin-bottom: 1.2rem;
    text-transform: uppercase;
    text-align: center;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    padding-bottom: 0.3rem;
    margin-top: 0.5rem;
}

.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 0.8rem;
    padding: 1.5rem 0 1rem;
    min-height: 160px;
    position: relative;
}

.podium-loading {
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.7;
    text-align: center;
    width: 100%;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 32%;
}

.podium-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-transform: uppercase;
}

.podium-score {
    font-family: 'Teko', sans-serif;
    font-size: 1.4rem;
    color: var(--gold);
    line-height: 1;
}

.podium-base {
    width: 100%;
    margin-top: 6px;
    border-radius: 4px 4px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Teko', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.rank-1 {
    order: 2;
}

.rank-2 {
    order: 1;
}

.rank-3 {
    order: 3;
}

.rank-1 .podium-base {
    height: 95px;
    background: linear-gradient(0deg, #b8860b, var(--gold));
    color: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.rank-2 .podium-base {
    height: 65px;
    background: linear-gradient(0deg, #71706e, var(--silver));
    color: rgba(0, 0, 0, 0.5);
}

.rank-3 .podium-base {
    height: 45px;
    background: linear-gradient(0deg, #8b4513, var(--bronze));
    color: rgba(0, 0, 0, 0.5);
}

.monthly-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 columnas en desktop */
    gap: 8px;
}

.monthly-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.7rem 0.8rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 2px solid transparent;
}

.monthly-item.vacio {
    opacity: 0.2;
}

.monthly-item.current {
    border-left-color: var(--gold);
    background: rgba(255, 215, 0, 0.04);
}

.month-name {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.month-winner {
    font-family: 'Teko', sans-serif;
    font-size: 1.1rem;
    color: var(--gold);
    letter-spacing: 1px;
}

@media (max-width: 1024px) {
    .hall-of-fame-content {
        flex-direction: column;
    }

    .monthly-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .monthly-list {
        grid-template-columns: 1fr;
    }
}

/* --- LOGIN PANTALLA PRINCIPAL --- */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1c23 0%, #000 100%);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.login-overlay.hidden-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-box {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--accent-red);
    padding: 3rem 2.5rem;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(255, 42, 42, 0.1);
    width: 100%;
    max-width: 450px;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.login-logo-wrap {
    margin-bottom: 1rem;
}

.lock-icon {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 0 8px rgba(255, 42, 42, 0.6));
}

.login-title {
    font-family: 'Teko', sans-serif;
    color: #fff;
    font-size: 2rem;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.login-error {
    color: var(--accent-red);
    margin-top: 1rem;
    font-weight: bold;
    font-size: 0.85rem;
    text-shadow: 0 0 5px rgba(255, 42, 42, 0.5);
}

.login-input {
    width: 100%;
    padding: 1rem;
    background-color: var(--metal-dark);
    color: var(--text-main);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    margin-top: 0.5rem;
    text-align: center;
    letter-spacing: 2px;
}

.login-input:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 8px var(--accent-red-glow);
}

.login-btn {
    margin-top: 2rem;
    padding: 1rem;
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .login-box {
        padding: 2rem 1.5rem;
        width: 90%;
    }
    .login-title {
        font-size: 1.5rem;
    }
}



/* --- GALERÍA DE ASESOR EN RANKING --- */
.item-name {
    cursor: pointer;
    transition: color 0.3s;
}

.item-name:hover {
    color: var(--accent-red);
    text-decoration: underline;
}

.advisor-gallery-view {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    animation: fadeIn 0.4s ease;
}

.gallery-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.8rem;
    position: sticky;
    top: 0;
    background: var(--metal-base);
    z-index: 10;
}

.gallery-view-header h3 {
    font-family: 'Teko', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 1px;
}

.btn-close-gallery {
    background: var(--metal-dark);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.2s;
}

.btn-close-gallery:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

.advisor-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
}

.advisor-photo-item {
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: #000;
}

.advisor-photo-item:hover {
    transform: scale(1.05);
    border-color: var(--accent-red);
    box-shadow: 0 5px 15px rgba(255, 42, 42, 0.3);
}

.advisor-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.advisor-photo-item:hover img {
    opacity: 1;
}

/* Scrollbar para el grid si hay muchas fotos */
.advisor-photos-grid {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.advisor-photos-grid::-webkit-scrollbar {
    width: 4px;
}

.advisor-photos-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.advisor-photos-grid::-webkit-scrollbar-thumb {
    background: var(--accent-red);
    border-radius: 10px;
}

/* Modal Zoom */
#zoomed-img {
    max-width: 90%;
    max-height: 85vh;
    border: 3px solid #fff;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    border-radius: 8px;
    object-fit: contain;
}

.zoom-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20002;
    padding: 1rem;
    pointer-events: none;
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.btn-close-zoom {
    background: var(--accent-red);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-family: 'Teko', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
    pointer-events: auto;
}

.btn-close-zoom:hover {
    transform: scale(1.1);
    background: #ff4d4d;
}

@media (max-width: 768px) {
    .zoom-controls {
        top: 10px;
        right: 10px;
        padding: 0.5rem;
    }
    .btn-close-zoom {
        padding: 0.6rem 1.2rem;
        font-size: 1rem;
    }
    #zoomed-img {
        max-width: 95%;
        max-height: 80vh;
    }
}
/* --- MAINTENANCE OVERLAY --- */
.maintenance-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, rgba(18, 19, 21, 0.95) 0%, #000 100%);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.maintenance-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.maintenance-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 4rem 3rem;
    border-radius: 20px;
    border: 1px solid rgba(0, 210, 255, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 210, 255, 0.1);
    max-width: 600px;
    width: 90%;
    animation: maintenanceFadeIn 0.8s ease-out;
}

@keyframes maintenanceFadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.maintenance-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px rgba(255, 165, 0, 0.4));
    animation: maintenanceFloat 3s ease-in-out infinite;
}

@keyframes maintenanceFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.maintenance-title {
    font-family: 'Teko', sans-serif;
    font-size: 4rem;
    color: #fff;
    letter-spacing: 5px;
    margin-bottom: 1rem;
    text-shadow: 0 0 15px rgba(0, 210, 255, 0.5);
}

.maintenance-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.maintenance-countdown {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.3);
    border-radius: 50px;
    color: #00d2ff;
    font-family: 'Teko', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.pulse {
    display: inline-block;
    color: #00d2ff;
    margin-right: 8px;
    animation: pulseMaintenance 1.5s infinite;
}

@keyframes pulseMaintenance {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- RULES MODAL MOBILE FIXES --- */
.rules-modal-content {
    display: flex !important;
    flex-direction: column;
    max-height: 90vh !important;
    width: 95% !important;
    padding: 1.5rem !important;
    background: var(--metal-dark) !important;
    border: 1px solid rgba(255, 42, 42, 0.3) !important;
}

.rules-modal-content h3 {
    margin-bottom: 1rem !important;
    font-size: 1.8rem !important;
    flex-shrink: 0;
}

.rules-scroll-area {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 1.5rem;
}

.rules-list li {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.rules-modal-content div:last-child {
    flex-shrink: 0;
    margin-top: 0 !important;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .rules-modal-content {
        padding: 1rem !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }
    .rules-modal-content h3 {
        font-size: 1.4rem !important;
    }
    .rules-list li {
        font-size: 0.85rem;
    }
    .rules-modal-content .btn-submit {
        font-size: 1.1rem;
        padding: 1rem;
        width: 100%;
    }
    .rules-scroll-area {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }
}
