:root {
    /* Primary Theme Colors */
    --color-1: #2a4d69; 
    --color-2: #f7f9fb; 
    --color-3: #0d1b2a; 
    --color-4: #1b263b; 
    --color-5: #e0f7fa; 

    /* Fonts and Base Sizing */
    --font-family: 'Roboto', 'Source Code Pro', sans-serif;
    --font-size: 18px;

    /* Additional “Card” and “Input” Colors for Variation */
    --card-bg: rgba(255,255,255,0.05);
    --card-bg-alt: rgba(255,255,255,0.1);
    --border-color: #2a4d69;
    --input-bg: #f7f9fb;
    --text-color: #0d1b2a;
    --text-color-secondary: #f7f9fb;
    --primary-color: #2a4d69;

    /* Add RGB variables for color-1 */
    --color-1-rgb: 42, 77, 105;  /* This matches the default --color-1: #2a4d69 */
}

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

/**********************************************************************
 * BASE BODY STYLES
 **********************************************************************/
body {
    font-family: var(--font-family);
    font-size: var(--font-size);
    background-color: var(--color-3);
    color: var(--color-2);
    height: 100vh;
    overflow: auto; 
    position: relative;
}

/* Hide elements with the 'hidden' class */
.hidden {
    display: none !important;
}

/**********************************************************************
 * PARTICLES BACKGROUND
 **********************************************************************/
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

/**********************************************************************
 * GAME CONTAINER
 **********************************************************************/
.game-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: .5rem;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow: auto;
    gap: .5rem;
}

/**********************************************************************
 * HEADER
 **********************************************************************/
header {
    background-color: rgba(27, 38, 59, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0.8;
    flex-wrap: wrap; /* for mobile responsiveness */
}

.title {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color-1);
    font-family: 'Orbitron', sans-serif;
    white-space: nowrap;
}

.palette-changer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#palette-selection, 
#palette-selection-step3 {
    padding: 0.5rem;
    background-color: var(--color-1);
    color: var(--color-2);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

#palette-selection:hover,
#palette-selection-step3:hover {
    background-color: var(--color-5);
    color: var(--color-3);
}

/* When the user logs out, show login/register buttons, else show create/view profile buttons */
.user-section {
    text-align: center;
    margin: 2rem 0;
}
.logged-out-buttons button,
.logged-in-buttons button {
    margin: 0.5rem;
}

/**********************************************************************
 * PLAYERS IN HEADER
 **********************************************************************/
.players {
    display: flex;
    gap: 1rem;
    margin-left: 1rem;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}
.player {
    background-color: rgba(27, 38, 59, 0.9);
    padding: 1.5rem;
    border-radius: 1rem;
    width: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.player h3 {
    color: var(--color-1);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}
.player p {
    font-size: 1.5rem;
    color: var(--color-5);
}
.player.active {
    border: 3px solid var(--color-5);
    box-shadow: 0 0 15px var(--color-5);
    transform: scale(1.05);
}

/**********************************************************************
 * CURRENT TURN
 **********************************************************************/
.current-turn {
    background-color: rgba(224,247,250,0.1);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    flex: 1;
    max-width: 300px;
    margin-top: 1rem;
}
.highlighted-turn {
    background-color: var(--color-4);
    border: 2px solid var(--color-5);
    box-shadow: 0 0 15px var(--color-5);
}
.current-turn h3 {
    color: var(--color-5);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}
.current-turn p {
    color: var(--color-2);
    font-size: 1rem;
}
.current-scores {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}
.current-scores p {
    background-color: rgba(224, 247, 250, 0.1);
    padding: 0.8rem;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}
.current-scores p.active-dart {
    background-color: rgba(var(--color-1-rgb), 0.2);
    border-color: var(--color-1);
    box-shadow: 0 0 10px var(--color-1);
    animation: dartPulse 1.5s infinite;
}
@keyframes dartPulse {
    0% {
        box-shadow: 0 0 5px var(--color-1);
    }
    50% {
        box-shadow: 0 0 15px var(--color-1), 0 0 5px var(--color-5);
    }
    100% {
        box-shadow: 0 0 5px var(--color-1);
    }
}

/**********************************************************************
 * MAIN LAYOUT
 **********************************************************************/
main {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    padding: .5rem 1rem;
    gap: .5rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
    background-color: rgba(27, 38, 59, 0.95);
    opacity: 0.8;
    border-radius: .5rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    flex-wrap: wrap;
}

/**********************************************************************
 * DART INPUT SECTION
 **********************************************************************/
.dart-input {
    background-color: rgba(27, 38, 59, 0.9);
    padding: .5rem;
    border-radius: .5rem;
    width: 65%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}
.dart-input input {
    max-width: 250px;
    padding: 0.5rem;
    border: 2px solid var(--color-1);
    border-radius: 0.5rem;
    color: var(--color-3);
    background: var(--color-2);
    font-family: var(--font-family);
}
.dart-input button {
    background-color: var(--color-1);
    color: var(--color-2);
    border: none;
    border-radius: 0.5rem;
    padding: 0.7rem 1.2rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.dart-input button:hover {
    background-color: var(--color-5);
    color: var(--color-3);
}

/**********************************************************************
 * KEYS & KEY SECTIONS
 **********************************************************************/
.score-sections {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}
.score-section {
    background-color: rgba(255,255,255,0.05);
    padding: 1rem;
    border-radius: 0.5rem;
}
.score-section h4 {
    margin-bottom: 0.5rem;
    color: var(--color-1);
    text-align: center;
    font-size: 1.2rem;
    text-transform: uppercase;
}
.keypad {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    min-width: 45px;
}
.key {
    background-color: var(--color-1);
    color: var(--color-2);
    border: none;
    border-radius: 0.3rem;
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center;
    min-width: 50px;
    font-weight: bold;
}
.key:hover {
    background-color: var(--color-5);
    color: var(--color-3);
    transform: scale(1.05);
}
.key.zero-key,
.key.off-board-key {
    background-color: var(--color-4);
    width: 100%;
    max-width: 200px;
    margin-top: 0.5rem;
    font-size: 1rem;
    padding: 0.7rem 1rem;
}
.key.zero-key:hover,
.key.off-board-key:hover {
    background-color: var(--color-5);
    color: var(--color-3);
}
.selected-key {
    background-color: var(--color-5) !important;
    color: var(--color-3) !important;
    border: 2px solid var(--color-3);
}

/**********************************************************************
 * POSSIBLE OUTS
 **********************************************************************/
.possible-outs {
    background-color: var(--color-5);
    padding: 15px;
    border-radius: 8px;
    max-height: 300px;
    width: 30%;
    overflow-y: auto;
    color: var(--color-1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}
.possible-outs h4 {
    color: var(--color-1);
}
.possible-outs h5 {
    margin-top: 10px;
    color: var(--color-1);
}
.possible-outs ul {
    list-style-type: none;
    padding-left: 0;
}
.possible-outs li {
    background-color: var(--color-2);
    margin: 5px 0;
    padding: 8px;
    border-radius: 4px;
    font-family: 'Source Code Pro', monospace;
    color: var(--color-1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.progress-bar {
    width: 100%;
    background-color: var(--color-4);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 0.5rem;
}
.progress {
    height: 10px;
    background-color: var(--color-1);
    transition: width 0.3s ease;
}

/**********************************************************************
 * MODALS (LOGIN, REGISTER, CHECKOUT, SCORE CONFIRM, ETC.)
 **********************************************************************/
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background-color: rgba(27, 38, 59, 0.95);
    padding: 2rem;
    border-radius: 1.5rem;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    text-align: center;
    position: relative;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}
.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    color: var(--color-2);
    cursor: pointer;
    background: none;
    border: none;
}
.close-button:hover {
    color: var(--color-5);
}

/* Shared Modal Buttons */
.modal-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}
.modal-buttons button {
    margin: 0;
    flex: 1;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

/**********************************************************************
 * FINISH (WINNER) MODAL
 **********************************************************************/
.finish-modal h2 {
    font-size: 2rem;
    color: var(--color-1);
    margin-bottom: 1rem;
}
.finish-modal p {
    font-size: 1.5rem;
    color: var(--color-5);
    margin-bottom: 1.5rem;
}
.finish-modal .end-game-btn {
    background-color: var(--color-1);
    color: var(--color-2);
    border: none;
    border-radius: 0.5rem;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.finish-modal .end-game-btn:hover {
    background-color: var(--color-5);
    color: var(--color-3);
    transform: scale(1.05);
}

/**********************************************************************
 * KEYBOARD FOCUS
 **********************************************************************/
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-5);
    outline-offset: 2px;
}

/**********************************************************************
 * RESPONSIVE BREAKPOINTS
 **********************************************************************/
@media (max-width: 992px) {
    main {
        flex-direction: column;
        align-items: center;
    }
    .dart-input, 
    .possible-outs {
        width: 100%;
    }
}

@media (min-width: 992px) {
    .score-sections {
        flex-direction: row;
        gap: 0.5rem;
        justify-content: space-evenly;
        align-items: flex-start;
    }
    .score-section {
        flex: 1 1 auto;
        min-width: 0;
        padding: 0.5rem;
        margin: 0;
    }
    .score-section h4 {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }
    header {
        padding: 0.5rem;
    }
    .header-left {
        gap: 0.5rem;
    }
    .players {
        gap: 0.5rem;
        margin-left: 0.5rem;
    }
    .current-turn {
        padding: 0.5rem;
        max-width: 250px;
    }
    .current-turn h3 {
        font-size: 1.1rem;
    }
    .current-turn p {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 1.2rem;
    }
    button, 
    input, 
    select {
        font-size: 1.1rem;
    }
    .player h3 {
        font-size: 1rem;
    }
    .player p {
        font-size: 1.2rem;
    }
    .current-turn h3 {
        font-size: 1.2rem;
    }
    .current-turn p,
    .dart-score {
        font-size: 1rem;
    }
    .login-step h3 {
        font-size: 1.2rem;
    }
    .login-step button {
        font-size: 1.2rem;
        padding: 1rem;
    }
    .key {
        font-size: 1.1rem;
        padding: 0.7rem;
    }
    .score-section h4 {
        font-size: 1rem;
    }
}

/**********************************************************************
 * THEME-SPECIFIC ANIMATIONS
 **********************************************************************/
.classic-theme {
    transition: background-color 0.5s ease, color 0.5s ease;
}
.modern-theme {
    animation: fadeIn 1s ease-in-out;
}
.retro-theme {
    animation: bounceIn 1s;
}

/* Neon Theme */
.neon-theme {
    --color-1: #00ff9c; /* neon green */
    --color-2: #ffffff;
    --color-3: #000000;
    --color-4: #333333;
    --color-5: #ff00de; /* neon pink */
    --font-family: 'Orbitron', sans-serif;
    --font-size: 18px;
}
/* Pastel Theme */
.pastel-theme {
    --color-1: #a3d5ff; 
    --color-2: #ffffff; 
    --color-3: #f2f6f9; 
    --color-4: #b8e4c9; 
    --color-5: #ffb3c6; 
    --font-family: 'Exo', sans-serif;
    --font-size: 18px;
}
/* Dark Minimal Theme */
.dark-minimal-theme {
    --color-1: #ffcc00;
    --color-2: #f0f0f0;
    --color-3: #1c1c1c;
    --color-4: #2e2e2e;
    --color-5: #ff6138;
    --font-family: 'VT323', monospace;
    --font-size: 18px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/**********************************************************************
 * ACTION BUTTONS
 **********************************************************************/
.action-button {
    font-size: .9rem;
    padding: 0.4rem 0.6rem;
    border-radius: 0.4rem;
    border: none;
    background-color: var(--color-1);
    color: var(--color-2);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin: 0.3rem;
    line-height: 1.2;
}
.action-button:hover {
    background-color: var(--color-5);
    color: var(--color-3);
    transform: scale(1.05);
}
.next-to-palette-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/**********************************************************************
 * LOADING OVERLAY
 **********************************************************************/
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--color-2);
    border-top-color: var(--color-1);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.loading-message {
    color: var(--color-2);
    margin-top: 1rem;
    font-size: 1.2rem;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/**********************************************************************
 * GAME SETUP (STEP 1 / STEP 2)
 **********************************************************************/
.game-setup-section {
    background: var(--color-4);
    padding: 1.5rem;
    border-radius: 1rem;
    margin-top: 1.5rem;
}

.game-setup-options {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.create-game-option {
    align-items: center;
    background: var(--color-3);
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
    max-width: 300px;
    width: 100%;
}

.create-game-option h5 {
    color: var(--color-1);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.player-count-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.active-lobbies-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
}
.player-count-btn {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 0.5rem;
    background-color: var(--color-1);
    color: var(--color-2);
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    margin: 0.5rem 0;
}
.player-count-btn:hover {
    background-color: var(--color-5);
    color: var(--color-3);
    transform: scale(1.05);
}

/**********************************************************************
 * PLAYER SETUP (STEP 2)
 **********************************************************************/
.player-setup-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.player-slots {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.player-input-group {
    background: var(--color-4);
    padding: 1.5rem;
    border-radius: 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.player-input-group h4 {
    color: var(--color-1);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.player-input-group input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 2px solid var(--color-3);
    border-radius: 0.5rem;
    background: var(--color-2);
    color: var(--color-1);
    font-size: 1rem;
    box-sizing: border-box;
}

.player-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.player-actions button {
    flex: 1;
    min-width: 150px;
    white-space: nowrap;
}

.player-stats {
    background: var(--color-3);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.player-stats p {
    color: var(--color-1);
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .player-setup-container {
        padding: 0.5rem;
    }

    .player-input-group {
        padding: 1rem;
    }

    .player-actions {
        flex-direction: column;
    }

    .player-actions button {
        width: 100%;
        min-width: unset;
    }
}

@media screen and (max-width: 480px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
        margin: 1rem auto;
        padding: 1rem;
    }

    .player-input-group {
        margin: 0 auto;
        width: 100%;
        box-sizing: border-box;
    }

    .player-input-group input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .player-stats {
        padding: 0.75rem;
    }
}

/* Ensure modal content is properly centered and scrollable on mobile */
@media screen and (max-width: 480px) {
    .modal {
        padding: 0.5rem;
    }
    
    .login-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 1rem;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .login-step {
        width: 100%;
        padding: 0.5rem;
        box-sizing: border-box;
    }
}

/**********************************************************************
 * THEME PREVIEW (STEP 3)
 **********************************************************************/
.theme-preview {
    margin: 1rem auto;
    text-align: center;
}
.theme-preview .preview-box {
    width: 200px;
    height: 100px;
    background: var(--color-1);
    border-radius: 8px;
    margin: 0 auto 1rem auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}
.theme-preview .preview-box:hover {
    transform: scale(1.03);
}

/**********************************************************************
 * AUTH FORMS & PROFILE MODALS
 **********************************************************************/
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-2);
}
.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--color-4);
    border-radius: 0.5rem;
    background: var(--color-2);
    color: var(--color-3);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}
.form-group input:focus {
    border-color: var(--color-1);
    outline: none;
}
.form-group input:invalid {
    border-color: #ff6b6b;
}
.password-requirements {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--color-4);
    border-radius: 0.5rem;
    font-size: 0.9rem;
}
.password-requirements ul {
    list-style-type: none;
    padding-left: 1rem;
    margin-top: 0.5rem;
}
.password-requirements li {
    color: var(--color-2);
    margin-bottom: 0.25rem;
}
.password-requirements li::before {
    content: '•';
    color: var(--color-1);
    margin-right: 0.5rem;
}

/* Switch Forms + Forgot Password */
.auth-switch {
    margin-top: 1rem;
    text-align: center;
    color: var(--color-2);
}
.forgot-password {
    text-align: center;
    margin-top: 0.5rem;
}
.forgot-password-link {
    color: var(--color-1);
    text-decoration: none;
}
.forgot-password-link:hover {
    text-decoration: underline;
}

/**********************************************************************
 * CHECKOUT MODAL
 **********************************************************************/
.checkout-modal .modal-content {
    max-width: 800px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.checkout-modal h2 {
    color: var(--color-1);
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1rem;
}
.checkout-info {
    display: flex;
    justify-content: space-around;
    background: var(--color-4);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.checkout-info p {
    font-size: 1.2rem;
    color: var(--color-2);
}
.checkout-darts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--color-3);
    padding: 1rem;
    border-radius: 8px;
}
.checkout-dart {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--color-4);
    border-radius: 4px;
}
.checkout-dart .dart-label {
    font-weight: bold;
    color: var(--color-2);
}
.checkout-dart .dart-value {
    color: var(--color-1);
}
.checkout-keypad {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.checkout-section {
    background: var(--color-3);
    padding: 1rem;
    border-radius: 8px;
}
.checkout-section h4 {
    color: var(--color-2);
    margin-bottom: 0.5rem;
    text-align: center;
}
.checkout-section-keypad {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 0.5rem;
    justify-items: center;
}
.checkout-key {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 4px;
    background: var(--color-4);
    color: var(--color-2);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.checkout-key:hover {
    background: var(--color-1);
    transform: scale(1.05);
}
.checkout-key.selected {
    background: var(--color-1);
    color: var(--color-2);
    transform: scale(1.05);
}
.checkout-possibilities {
    background: var(--color-3);
    padding: 1rem;
    border-radius: 8px;
}
.checkout-possibilities h3 {
    color: var(--color-2);
    margin-bottom: 1rem;
    text-align: center;
}
.checkout-routes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 150px;
    overflow-y: auto;
    padding: 0.5rem;
}
.checkout-routes p {
    color: var(--color-2);
    padding: 0.5rem;
    background: var(--color-4);
    border-radius: 4px;
    text-align: center;
}
.checkout-controls {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}
.checkout-controls button {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}
.undo-checkout-dart-btn {
    background: var(--color-4);
    color: var(--color-2);
}
.cancel-checkout-btn {
    background: #ff6b6b;
    color: white;
}
.confirm-checkout-btn {
    background: var(--color-1);
    color: var(--color-2);
}
.checkout-controls button:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}
/* Scrollbar for checkout routes */
.checkout-routes::-webkit-scrollbar {
    width: 8px;
}
.checkout-routes::-webkit-scrollbar-track {
    background: var(--color-4);
    border-radius: 4px;
}
.checkout-routes::-webkit-scrollbar-thumb {
    background: var(--color-1);
    border-radius: 4px;
}

/**********************************************************************
 * SCORE CONFIRMATION MODAL
 **********************************************************************/
.score-confirm-modal .modal-content {
    max-width: 400px;
    background: var(--color-3);
    border: 2px solid var(--color-1);
}
.score-confirm-modal h2 {
    color: var(--color-1);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
.score-confirm-info {
    background: var(--color-4);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.player-turn-info {
    color: var(--color-2);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    text-align: center;
}
.confirm-player-name {
    color: var(--color-1);
    font-weight: bold;
}
.confirm-darts {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--color-3);
    border-radius: 6px;
}
.confirm-darts p {
    color: var(--color-2);
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--color-4);
    border-radius: 4px;
}
.confirm-dart {
    color: var(--color-1);
    font-weight: bold;
}
.total-score, .new-score {
    text-align: center;
    padding: 0.8rem;
    margin-top: 0.5rem;
    background: var(--color-3);
    border-radius: 6px;
    color: var(--color-2);
}
.confirm-total-score, .confirm-new-score {
    color: var(--color-1);
    font-weight: bold;
    margin-left: 0.5rem;
}
.score-confirm-controls {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}
.score-confirm-controls button {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.undo-confirm-dart-btn {
    background: var(--color-4) !important;
    color: var(--color-2) !important;
}
.cancel-confirm-btn {
    background: #ff6b6b !important;
    color: white !important;
}
.accept-confirm-btn {
    background: var(--color-1) !important;
    color: var(--color-2) !important;
}
.score-confirm-controls button:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}
@media (max-width: 600px) {
    .score-confirm-modal .modal-content {
        width: 90%;
        padding: 1rem;
    }
    .score-confirm-controls {
        flex-direction: column;
    }
    .score-confirm-controls button {
        width: 100%;
    }
}

/**********************************************************************
 * SMALL VISUAL EFFECTS
 **********************************************************************/
.winner-name {
    display: inline-block;
    animation: winnerPulse 1s infinite alternate;
}
@keyframes winnerPulse {
    from { transform: scale(1); color: var(--color-5); }
    to { transform: scale(1.2); color: var(--color-1); }
}

/**********************************************************************
 * MOBILE HEADER ADJUSTMENTS
 **********************************************************************/
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        width: 100%;
    }
    .players {
        flex-wrap: wrap;
        justify-content: flex-start;
        width: 100%;
        margin-top: 0.5rem;
    }
    .current-turn {
        max-width: 100%;
        margin-top: 0.5rem;
        align-self: stretch;
    }
}

/**********************************************************************
 * ADDITIONAL GLOW & HOVER FOR LOGINS
 **********************************************************************/
.active-player-highlight {
    animation: glow 1.5s infinite alternate;
    border: 2px solid var(--color-5);
    border-radius: 1rem;
}
@keyframes glow {
    0% { box-shadow: 0 0 5px var(--color-5); }
    100% { box-shadow: 0 0 20px var(--color-5); }
}
.profile-card {
    animation: playerJoin 0.3s ease-out;
}
@keyframes playerJoin {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* View Stats Button */
.view-stats-btn {
    background-color: var(--color-1);
    color: var(--color-2);
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 8px;
    transition: all 0.2s ease-in-out;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-stats-btn:hover {
    background-color: var(--color-2);
    color: var(--color-1);
    border-color: var(--color-1);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.view-stats-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.view-stats-btn.small {
    font-size: 0.75em;
    padding: 4px 10px;
    border-radius: 15px;
}

/* Stats Modal */
.stats-modal .modal-content {
    max-width: 400px;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.stats-modal .player-stats-details {
    margin-top: 25px;
}

.stats-modal .player-stats-details p {
    margin: 12px 0;
    font-size: 1.1em;
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-4);
    transition: background-color 0.2s ease;
}

.stats-modal .player-stats-details p:hover {
    background-color: rgba(var(--color-1-rgb), 0.05);
    padding: 8px;
    border-radius: 8px;
}

.stats-modal .player-stats-details p span {
    font-weight: bold;
    color: var(--color-1);
    padding: 2px 8px;
    border-radius: 12px;
    background-color: rgba(var(--color-1-rgb), 0.1);
}

.stats-modal h2 {
    color: var(--color-1);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-1);
    text-align: center;
    font-size: 1.6em;
    text-transform: uppercase;
    letter-spacing: 1px;
}
