/* --- TOURNAMENTS VIEW --- */
.tournament-header {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.tournament-main-title {
    font-family: var(--font-heading);
    color: white;
    font-size: 28px;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.back-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 12px;
    color: var(--neon-cyan);
    font-family: var(--font-heading);
    cursor: pointer;
    transition: 0.3s;
}

.back-btn:hover {
    background: var(--neon-cyan);
    color: black;
    box-shadow: 0 0 15px var(--neon-cyan);
}

.tournament-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 40px 60px;
    width: 100%;
}

.tournament-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.tournament-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--neon-cyan);
    box-shadow: 0 10px 30px rgba(0, 242, 254, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.tournament-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    opacity: 0.5;
}

.room-rank {
    font-family: var(--font-heading);
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    letter-spacing: 3px;
}

.prize-tag {
    font-family: var(--font-heading);
    font-size: 18px;
    color: white;
}

.prize-value {
    color: #ffcc00;
    font-size: 32px;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(255, 204, 0, 0.4);
}

.timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 30px;
    border-radius: 15px;
    width: 100%;
}

.timer-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 2px;
}

.countdown {
    font-family: var(--font-heading);
    font-size: 24px;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

.join-btn {
    width: 100%;
    padding: 15px;
    border-radius: 15px;
    border: none;
    background: linear-gradient(90deg, #00f2fe 0%, #4facfe 100%);
    color: black;
    font-family: var(--font-heading);
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}

.join-btn:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 20px var(--neon-cyan);
    transform: scale(1.02);
}

.neon-pulse {
    animation: neon-border-pulse 2s infinite alternate;
}

@keyframes neon-border-pulse {
    from {
        border-color: var(--glass-border);
        box-shadow: 0 0 5px rgba(255, 0, 127, 0.1);
    }

    to {
        border-color: var(--neon-pink);
        box-shadow: 0 0 20px rgba(255, 0, 127, 0.3);
    }
}

@keyframes slot-pulse-green {
    from {
        border-color: rgba(0, 255, 141, 0.2);
        box-shadow: 0 0 5px rgba(0, 255, 141, 0.1);
    }

    to {
        border-color: #00ff8d;
        box-shadow: 0 0 15px rgba(0, 255, 141, 0.3);
    }
}

@keyframes slot-pulse-red {
    from {
        border-color: rgba(255, 0, 127, 0.2);
        box-shadow: 0 0 5px rgba(255, 0, 127, 0.1);
    }

    to {
        border-color: #ff007f;
        box-shadow: 0 0 15px rgba(255, 0, 127, 0.3);
    }
}

/* --- TOURNAMENT CARD ACTIONS --- */
.card-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}

.pre-reg-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--neon-cyan);
    background: rgba(0, 242, 254, 0.1);
    color: var(--neon-cyan);
    font-family: var(--font-heading);
    font-size: 11px;
    cursor: pointer;
    transition: 0.3s;
    white-space: nowrap;
}

.pre-reg-btn:hover {
    background: var(--neon-cyan);
    color: black;
    box-shadow: 0 0 15px var(--neon-cyan);
}

/* Room Status Colors */
.tournament-card.room-available {
    border-color: #00ff8d;
    box-shadow: 0 0 15px rgba(0, 255, 141, 0.1);
}

.tournament-card.room-full {
    border-color: #ff007f;
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.1);
}

.tournament-card.room-full::after {
    content: 'FULL';
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff007f;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
}

/* Modal and Slots Grid */
.price-banner {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-family: var(--font-heading);
    font-size: 14px;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.slot-item {
    aspect-ratio: 1;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: 0.15s ease-out;
    /* Faster return transition */
    cursor: pointer;
    position: relative;
    background: rgba(255, 255, 255, 0.02);
}

.slot-item.empty {
    animation: slot-pulse-green 1s infinite alternate;
    /* Faster & Synced */
}

.slot-item.empty:hover {
    border-color: var(--neon-cyan);
    background: rgba(0, 242, 254, 0.15);
    transform: scale(1.03);
    box-shadow: 0 0 20px var(--neon-cyan);
}

.slot-item.occupied {
    cursor: default;
    background: rgba(255, 255, 255, 0.05);
    animation: slot-pulse-red 1s infinite alternate;
    /* Synced duration */
}

.slot-num {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
}

.slot-status {
    font-size: 10px;
    font-weight: bold;
    color: var(--neon-cyan);
}

.slot-item.occupied .slot-pfp {
    border-color: #ff007f;
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.3);
}

.slot-pfp {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid var(--neon-cyan);
    background-size: cover;
    background-position: center;
    background-color: #333;
}

.slot-id {
    font-size: 10px;
    color: white;
    opacity: 0.7;
}

.room-info-mini {
    color: var(--neon-cyan);
    font-size: 14px;
    font-family: var(--font-heading);
    margin-bottom: 15px;
}

/* Adjust Join Button inside card-actions */
.tournament-card .join-btn {
    flex: 1.5;
    margin-top: 0;
}

.join-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
    filter: grayscale(1);
    opacity: 0.5;
}

@media (max-width: 900px) {
    .tournament-grid {
        grid-template-columns: 1fr;
        padding: 10px 20px;
    }

    .tournament-header {
        padding: 10px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .tournament-main-title {
        font-size: 22px;
    }

    .prize-value {
        font-size: 24px;
    }
}