* {
    box-sizing: border-box;
}


:root {

    --bg: #090909;

    --surface: #111111;

    --surface2: #171717;

    --surface3: #202020;

    --border: #292929;

    --text: #f2f2f2;

    --muted: #929292;

    --yellow: #ffc832;

    --yellowDark: #c99b16;

}


html,
body {

    margin: 0;

    width: 100%;
    height: 100%;

    background: var(--bg);

    color: var(--text);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

}


body {
    overflow-x: hidden;
}


button,
input,
select {
    font: inherit;
}


/* =====================================================
   HEADER
===================================================== */

.topbar {

    height: 64px;

    padding: 0 clamp(16px, 4vw, 28px);

    display: flex;

    align-items: center;

    justify-content: space-between;

    border-bottom:
        1px solid var(--border);

    background:
        rgba(9,9,9,.94);

    backdrop-filter:
        blur(16px);

}


.brand {

    display: flex;

    align-items: center;

    gap: 10px;

    color: white;

    text-decoration: none;

    font-weight: 700;

}


.brandMark {

    width: 28px;
    height: 28px;

    display: grid;

    place-items: center;

    background: var(--yellow);

    color: #111;

    border-radius: 7px;

    font-weight: 900;

}


/* =====================================================
   ACCOUNT
===================================================== */

.account {

    display: flex;

    align-items: center;

    gap: 9px;

    color: #ddd;

    font-size: 13px;

}


.accountDot {

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #6dcc72;

}


.accountGuest {

    color: var(--muted);

}


/* =====================================================
   BUTTONS
===================================================== */

.button {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    border-radius: 8px;

    padding:
        11px 16px;

    text-decoration: none;

    border: 1px solid var(--border);

    cursor: pointer;

    transition:
        .15s ease;

}


.button.primary {

    background: var(--yellow);

    border-color: var(--yellow);

    color: #111;

    font-weight: 700;

}


.button.primary:hover {

    background: #ffd75d;

}


.button.secondary {

    background: var(--surface2);

    color: var(--text);

}


.button.secondary:hover {

    background: var(--surface3);

}


/* =====================================================
   HOME
===================================================== */

.home {

    max-width: 1150px;

    margin:
        0 auto;

    padding:
        clamp(40px, 8vw, 110px) clamp(16px, 4vw, 30px) clamp(30px, 5vw, 70px);

}


.hero {

    max-width: 780px;

}


.eyebrow {

    color: var(--yellow);

    font-size: 11px;

    font-weight: 800;

    letter-spacing:
        .16em;

    margin-bottom: 18px;

}


.hero h1 {

    margin: 0;

    font-size:
        clamp(32px, 7vw, 94px);

    line-height:
        .95;

    letter-spacing:
        -.06em;

}


.hero p {

    max-width: 610px;

    margin:
        28px 0;

    color: var(--muted);

    font-size: clamp(14px, 2vw, 17px);

    line-height: 1.6;

}


.heroButtons {

    display: flex;

    gap: 10px;

    flex-wrap: wrap;

}


/* =====================================================
   FEATURES
===================================================== */

.features {

    margin-top: clamp(40px, 8vw, 100px);

    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(260px, 1fr));

    gap: 12px;

}


.featureCard {

    padding: 24px;

    border:
        1px solid var(--border);

    background:
        linear-gradient(
            145deg,
            #121212,
            #0e0e0e
        );

    border-radius: 12px;

}


.featureIcon {

    font-size: 23px;

}


.featureCard h2 {

    font-size: 16px;

    margin:
        22px 0 9px;

}


.featureCard p {

    margin: 0;

    color: var(--muted);

    line-height: 1.5;

    font-size: 13px;

}


/* =====================================================
   PAGE
===================================================== */

.page {

    max-width: 1150px;

    margin: auto;

    padding:
        clamp(24px, 5vw, 55px) clamp(16px, 4vw, 30px);

}


.pageHeader {

    display: flex;

    justify-content: space-between;

    align-items: flex-end;

    gap: 20px;

    margin-bottom: 35px;

    flex-wrap: wrap;

}


.pageHeader h1 {

    margin: 0;

    font-size: clamp(28px, 5vw, 43px);

    letter-spacing:
        -.04em;

}


.pageHeader p {

    color: var(--muted);

}


/* =====================================================
   GAMES
===================================================== */

.gamesGrid {

    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(min(100%, 270px), 1fr)
        );

    gap: 12px;

}


.gameCard {

    padding: 20px;

    border:
        1px solid var(--border);

    border-radius: 12px;

    background: var(--surface);

    transition:
        .15s ease;

}


.gameCard:hover {

    border-color:
        #454545;

    transform:
        translateY(-2px);

}


.gameCardTitle {

    font-weight: 700;

}


.gameCardMeta {

    color: var(--muted);

    font-size: 12px;

    margin-top: 7px;

}


.gameCardButton {

    margin-top: 18px;

}


.loadingCard {

    padding: 30px;

    color: var(--muted);

    border:
        1px solid var(--border);

    border-radius: 12px;

}


/* =====================================================
   GAME
===================================================== */

.gameBody {

    overflow: hidden;

}


#game {

    position: relative;

    width: 100vw;

    height: 100vh;
    height: 100dvh;

    overflow: hidden;

}


#map {

    position: absolute;

    inset: 0;

    background:
        #0b0e12;

}


#map svg {

    width: 100%;
    height: 100%;

}


/* =====================================================
   GAME HEADER
===================================================== */

.gameHeader {

    position: absolute;

    top: 0;
    left: 0;
    right: 0;

    height: 60px;

    padding:
        0 clamp(12px, 3vw, 18px);

    display: flex;

    align-items: center;

    justify-content: space-between;

    pointer-events: none;

    z-index: 20;

}


.gameBrand {

    color: white;

    text-decoration: none;

    font-size: 11px;

    font-weight: 800;

    letter-spacing:
        .1em;

    pointer-events: auto;

}


/* =====================================================
   DATE
===================================================== */

#dateDisplay {

    position: absolute;

    top: 70px;

    left: 50%;

    transform:
        translateX(-50%);

    z-index: 20;

    padding:
        7px 11px;

    border:
        1px solid rgba(255,255,255,.08);

    background:
        rgba(8,8,8,.75);

    border-radius: 7px;

    color: #c6c6c6;

    font-size: 11px;

    backdrop-filter:
        blur(10px);

    white-space: nowrap;

}


/* =====================================================
   COUNTRY
===================================================== */

.country {

    stroke:
        rgba(0,0,0,.6);

    stroke-width:
        .6px;

    transition:
        filter .12s;

}


.country:hover {

    filter:
        brightness(1.2);

    cursor: pointer;

}


.country.selected {

    stroke: white;

    stroke-width: 1.5px;

}


.country-label {
    font-size: 2px;
    font-weight: 600;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    fill: white;

    paint-order: stroke;
    stroke: rgba(0, 0, 0, 0.75);
    stroke-width: 3px;
    stroke-linejoin: round;

    white-space: nowrap;
}


.country-label.small {

    font-size: 2px;

}


/* =====================================================
   COUNTRY PANEL
===================================================== */

#countryPanel {

    position: absolute;

    right: 18px;
    bottom: 18px;

    width: min(235px, calc(100vw - 36px));

    padding: 15px;

    border:
        1px solid var(--border);

    border-radius: 10px;

    background:
        rgba(12,12,12,.9);

    backdrop-filter:
        blur(15px);

    display: none;

    z-index: 30;

}


#countryPanel.visible {

    display: block;

}


#countryName {

    font-weight: 700;

    font-size: 14px;

}


.countryInfo {

    margin-top: 7px;

    color: var(--muted);

    font-size: 12px;

}


/* =====================================================
   TIME
===================================================== */

#timeContainer {

    position: absolute;

    top: 18px;

    right: 18px;

    z-index: 40;

}


#timeButton {

    border:
        1px solid var(--border);

    background:
        rgba(15,15,15,.9);

    color: white;

    border-radius: 8px;

    padding:
        9px 12px;

    cursor: pointer;

}


#timeMenu {

    display: none;

    position: absolute;

    right: 0;

    top: calc(100% + 7px);

    width: min(165px, calc(100vw - 36px));

    padding: 5px;

    background:
        #111;

    border:
        1px solid var(--border);

    border-radius: 9px;

}


#timeMenu.open {

    display: block;

}


.timeOption {

    width: 100%;

    border: 0;

    background: transparent;

    color: #ddd;

    text-align: left;

    padding: 9px;

    border-radius: 6px;

    cursor: pointer;

    font-size: 12px;

}


.timeOption:hover {

    background: var(--surface3);

}


.timeSeparator {

    height: 1px;

    background: var(--border);

    margin: 4px 0;

}


/* =====================================================
   CONTROLS
===================================================== */

#bottomControls {

    position: absolute;

    left: 18px;
    bottom: 18px;

    display: flex;

    flex-wrap: wrap;

    gap: 7px;

    z-index: 40;

    max-width: calc(100vw - 36px);

}


.controlButton {

    border:
        1px solid var(--border);

    background:
        rgba(15,15,15,.92);

    color: white;

    padding:
        10px 13px;

    border-radius: 8px;

    cursor: pointer;

    backdrop-filter:
        blur(12px);

}


.controlButton:hover {

    border-color:
        #4b4b4b;

}


/* =====================================================
   AI PANEL
===================================================== */

#aiPanel {

    position: absolute;

    left: 18px;
    top: 18px;

    width:
        min(390px, calc(100vw - 36px));

    height:
        min(500px, calc(100vh - 36px));

    display: none;

    flex-direction: column;

    z-index: 80;

    background:
        rgba(13,13,13,.97);

    border:
        1px solid var(--border);

    border-radius: 11px;

    box-shadow:
        0 20px 70px rgba(0,0,0,.6);

    overflow: hidden;

    backdrop-filter:
        blur(18px);

}


#aiPanel.open {

    display: flex;

}


#aiHeader {

    height: 44px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding:
        0 12px;

    border-bottom:
        1px solid var(--border);

}


#aiTitle {

    font-size: 13px;

    font-weight: 700;

}


#closeAi {

    border: 0;

    background: transparent;

    color: #888;

    cursor: pointer;

    font-size: 20px;

}


/* =====================================================
   MESSAGES
===================================================== */

#messages {

    flex: 1;

    overflow-y: auto;

    padding: 12px;

}


.message {

    max-width: 88%;

    padding: 8px 10px;

    border-radius: 8px;

    margin-bottom: 8px;

    font-size: 12px;

    line-height: 1.5;

    white-space: pre-wrap;

}


.message.ai {

    background: var(--surface2);

}


.message.user {

    margin-left: auto;

    background:
        #2c2c2c;

}


/* =====================================================
   ACTIONS
===================================================== */

#actionsList {

    flex: 1;

    overflow-y: auto;

    padding: 12px;

    display: none;

}


.actionItem {

    border:
        1px solid var(--border);

    background:
        var(--surface);

    border-radius: 8px;

    padding: 10px;

    margin-bottom: 7px;

    font-size: 12px;

}


.actionPending {

    display: block;

    color: var(--muted);

    font-size: 10px;

    margin-top: 5px;

}


.emptyActions {

    color: var(--muted);

    font-size: 12px;

    line-height: 1.5;

}


/* =====================================================
   INPUT
===================================================== */

#inputArea {

    display: flex;

    gap: 6px;

    padding: 8px;

    border-top:
        1px solid var(--border);

}


#messageInput {

    flex: 1;

    min-width: 0;

    background:
        #090909;

    border:
        1px solid var(--border);

    color: white;

    border-radius: 7px;

    padding: 9px;

    outline: none;

    font-size: 12px;

}


#messageInput:focus {

    border-color:
        #555;

}


#sendButton {

    width: 38px;

    border: 0;

    border-radius: 7px;

    background:
        var(--yellow);

    color: #111;

    font-weight: 900;

    cursor: pointer;

}


/* =====================================================
   MODAL
===================================================== */

#customOverlay {

    position: absolute;

    inset: 0;

    display: none;

    align-items: center;

    justify-content: center;

    z-index: 100;

    background:
        rgba(0,0,0,.5);

}


#customOverlay.open {

    display: flex;

}


#customBox {

    width:
        min(340px, calc(100vw - 36px));

    padding: 17px;

    background:
        #121212;

    border:
        1px solid var(--border);

    border-radius: 11px;

    box-shadow:
        0 25px 70px rgba(0,0,0,.65);

}


.modalTitle {

    font-size: 14px;

    font-weight: 700;

    margin-bottom: 13px;

}


#customInputs {

    display: flex;

    gap: 7px;

}


#customAmount,
#customUnit {

    flex: 1;

    min-width: 0;

    background:
        #090909;

    color: white;

    border:
        1px solid var(--border);

    border-radius: 7px;

    padding: 9px;

    outline: none;

}


.modalButtons {

    display: flex;

    justify-content: flex-end;

    gap: 7px;

    margin-top: 14px;

}


/* =====================================================
   COMPTE GAMES
===================================================== */

.gamesAccount {

    position: relative;

    display: flex;

    align-items: center;

    gap: 10px;

}


/* Solde Pamp */

.pampBalance {

    display: flex;

    align-items: center;

    gap: 5px;


    padding: 7px 11px;


    border-radius: 999px;


    background: rgba(255, 255, 255, 0.08);

    border: 1px solid rgba(255, 255, 255, 0.12);


    color: white;


    font-size: 14px;

    font-weight: 600;


    white-space: nowrap;

}


/* Rond du profil */

.profileButton {

    width: 38px;

    height: 38px;


    padding: 0;


    border: 1px solid rgba(255, 255, 255, 0.2);

    border-radius: 50%;


    background: rgba(255, 255, 255, 0.12);


    color: white;


    font-size: 15px;

    font-weight: 700;


    cursor: pointer;


    display: flex;

    align-items: center;

    justify-content: center;


    transition:

        background 0.15s ease,

        transform 0.15s ease;

}


.profileButton:hover {

    background: rgba(255, 255, 255, 0.2);

    transform: scale(1.05);

}


/* Menu */

.accountMenu {

    position: absolute;


    top: calc(100% + 10px);

    right: 0;


    width: min(210px, calc(100vw - 32px));


    padding: 14px;


    border-radius: 14px;


    background: rgba(25, 25, 30, 0.97);


    border: 1px solid rgba(255, 255, 255, 0.12);


    box-shadow:

        0 12px 35px rgba(0, 0, 0, 0.35);


    backdrop-filter: blur(14px);


    opacity: 0;

    visibility: hidden;


    transform: translateY(-5px);


    transition:

        opacity 0.15s ease,

        transform 0.15s ease,

        visibility 0.15s ease;


    z-index: 1000;

}


.accountMenu.open {

    opacity: 1;

    visibility: visible;


    transform: translateY(0);

}


/* Nom */

.accountName {

    color: white;


    font-size: 15px;

    font-weight: 600;


    padding: 4px 4px 10px;


    border-bottom: 1px solid rgba(255, 255, 255, 0.1);


    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

}


/* Pamp dans le menu */

.accountPamp {

    color: rgba(255, 255, 255, 0.75);


    font-size: 14px;


    padding: 11px 4px;

}


/* Déconnexion */

.accountLogout {

    width: 100%;


    padding: 9px 10px;


    border: none;

    border-radius: 9px;


    background: rgba(255, 255, 255, 0.07);


    color: white;


    font-size: 14px;


    cursor: pointer;


    text-align: left;


    transition:

        background 0.15s ease;

}


.accountLogout:hover {

    background: rgba(255, 255, 255, 0.14);

}


/* =====================================================
   RESPONSIVE & MEDIA QUERIES
===================================================== */

@media (max-width: 768px) {

    .features {

        grid-template-columns: 1fr;

    }


    .pageHeader {

        align-items: flex-start;

        flex-direction: column;

        gap: 12px;

    }


    .home {

        padding-top: 50px;

    }


    #bottomControls {

        bottom: 12px;

        left: 12px;

        max-width: calc(100vw - 24px);

    }


    #countryPanel {

        right: 12px;

        bottom: 70px;

    }


    #aiPanel {

        left: 12px;

        top: 12px;

        width: calc(100vw - 24px);

        height: calc(100vh - 80px);

        height: calc(100dvh - 80px);

    }

}


@media (max-width: 480px) {

    .topbar {

        padding: 0 16px;

    }


    .pampBalance {

        font-size: 12px;

        padding: 5px 9px;

    }


    .profileButton {

        width: 34px;

        height: 34px;

        font-size: 13px;

    }


    #dateDisplay {

        font-size: 10px;

        padding: 5px 8px;

    }

}
