/* Darkside Pool Theme */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;600;700&display=swap');

:root {
    --dsp-red: #ff1a1a;
    --dsp-black: #000000;
    --dsp-dark-gray: #111111;
    --dsp-text: #ffffff;
}

body {
    background-color: var(--dsp-black);
    color: var(--dsp-text);
    font-family: 'Rajdhani', sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background: linear-gradient(to bottom, #111, #000);
    border-bottom: 2px solid var(--dsp-red);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 0 15px rgba(255, 26, 26, 0.2);
}

.nav-brand {
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: uppercase;
    color: white;
    text-decoration: none;
    letter-spacing: 2px;
}

.nav-brand span { color: var(--dsp-red); }

.nav-link {
    color: #ccc;
    text-decoration: none;
    font-weight: 600;
    margin-left: 20px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.nav-link:hover { color: var(--dsp-red); text-shadow: 0 0 8px var(--dsp-red); }

/* Buttons */
.btn-dsp {
    background: transparent;
    color: white;
    border: 2px solid var(--dsp-red);
    padding: 10px 25px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-dsp:hover {
    background: var(--dsp-red);
    color: black;
    box-shadow: 0 0 20px rgba(255, 26, 26, 0.6);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

/* Flash Messages */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #333;
    background: #111;
    color: white;
}
.alert-error { border-left: 5px solid red; }
.alert-success { border-left: 5px solid green; }


@media (max-width: 768px) {

    /* 1. Stack the Navbar */
    .navbar {
        flex-direction: column;
        padding: 15px;
        text-align: center;
    }
    .navbar > div {
        margin-top: 15px;
        flex-direction: column; /* Stack links vertically */
        gap: 10px;
    }
    .nav-brand {
        font-size: 1.5rem; /* Slightly smaller logo */
        margin-bottom: 5px;
    }

    /* 2. Fix the Container Width */
    .container {
        width: 95%; /* Use full width on mobile */
        padding: 0 10px;
        margin-top: 20px;
    }

    /* 3. Leaderboard Cards: Stack the Stats */
    /* Changes grid from 3 columns to 1 column */
    .stats-grid {
        grid-template-columns: 1fr !important; 
        gap: 10px;
        margin: 15px 0 !important;
    }
    
    /* 4. Shot Card Adjustments */
    .shot-card {
        flex-direction: column; /* Stack player info, stats, and score */
        align-items: flex-start;
        padding: 15px;
    }
    .player-section, .score-section {
        width: 100%;
        margin-bottom: 15px;
        text-align: left;
        display: flex;
        justify-content: space-between; /* Put rank and name on opposite sides if needed */
        align-items: center;
    }
    .score-section {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid #333;
        padding-top: 10px;
    }
    
    /* 5. Play Button Adjustment */
    .play-btn-circle {
        margin-left: 0;
        margin-top: 10px;
        width: 100%; /* Full width button on mobile is easier to tap */
        border-radius: 8px; /* Rectangular button look */
    }

    /* 6. Dashboard KPI Grid (2 columns instead of 4) */
    .kpi-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    
    /* 7. Titles */
    .lb-title { font-size: 2rem !important; } /* Shrink big titles */
    .category-title { font-size: 1.5rem !important; }

    /* 8. Pool Table Ghost Ball Tooltips */
    /* Tooltips are hard on mobile (no hover), so we ensure they don't overflow */
    #shotTooltip {
        max-width: 90vw;
        left: 5vw !important; /* Force center */
    }
}
