﻿/* ============================================================
   GAME LIST — TOKENISED
============================================================ */

/* ===========================
   Game List Container
=========================== */
#gameList {
    padding: var(--space-5);
    background: var(--color-bg-surface);
    color: var(--color-text-primary);
    border-radius: var(--radius-md);
    max-width: 600px;
    margin: var(--space-8) auto;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

    #gameList h2 {
        margin-bottom: var(--space-4);
        font-size: var(--font-size-lg);
        font-weight: 700;
        color: var(--color-text-primary);
        border-bottom: 2px solid var(--color-accent);
        padding-bottom: var(--space-2);
        width: 100%;
        text-align: left;
    }


/* ===========================
   Game List Items
=========================== */
#games {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-8) 0;
    width: 100%;
}

    #games li {
        background: var(--color-bg-surface);
        margin-bottom: var(--space-3);
        padding: var(--space-4);
        border-radius: var(--radius-md);
        cursor: pointer;
        transition: var(--transition);
        font-size: var(--font-size-md);
        font-weight: 500;
        border-left: 4px solid var(--color-success);
        border: 1px solid var(--color-border-dark);
        box-shadow: var(--shadow-soft);
        /* ⭐ Required for absolute-positioned settings button */
        position: relative;
        /* ❌ DO NOT USE FLEX HERE */
    }



        #games li:hover {
            background: var(--color-bg-main);
        }

        #games li.finished {
            border-left: 4px solid var(--color-danger);
        }

        #games li span.code {
            font-size: var(--font-size-sm);
            color: var(--color-text-muted);
        }

        #games li span.winner {
            display: block;
            margin-top: var(--space-1);
            font-size: var(--font-size-sm);
            color: var(--color-warning);
            font-weight: 600;
        }

    /* Smooth transitions */
    #games li,
    #gameList,
    #gameList input,
    #gameList button {
        transition: var(--transition);
    }


        /* ===========================
   Game List Inputs & Buttons
=========================== */
        #gameList input, #gameList button:not(.gameSettingsBtn) {
            width: 100%;
            box-sizing: border-box;
        }

        /* Inputs */
        #gameList input {
            padding: var(--space-4);
            margin-bottom: var(--space-3);
            border-radius: var(--radius-md);
            border: 1px solid var(--color-border-dark);
            font-size: var(--font-size-md);
            background: var(--color-bg-card);
            color: var(--color-text-primary);
        }
        .gameSettingsBtn {
            position: absolute;
            top: var(--space-2);
            right: var(--space-2);
            padding: var(--space-2);
            width: auto;
        }



/* ===========================
   Game Info Text
=========================== */
.game-name {
    font-weight: 700;
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-1);
    color: var(--color-text-primary);
}

.game-code {
    font-size: var(--font-size-md);
    color: var(--color-text-muted);
}

.winner {
    color: var(--color-warning);
    font-weight: 700;
    margin-top: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.playerStats {
    margin-top: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}


/* ===========================
   Section Headers
=========================== */
.gameSection {
    width: 100%;
    margin-bottom: var(--space-8);
}

    .gameSection h2,
    .gameSection h3 {
        color: var(--color-text-primary);
        text-align: center;
        margin-bottom: var(--space-4);
        font-weight: 700;
    }
