/* --- Fond vidéo --- */
#bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    filter: brightness(0.35) saturate(1.3) blur(2px);
}

#bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(0, 60, 120, 0.25), rgba(0,0,0,0.9));
    z-index: -1;
}

/* ------------ MENU ----------- */
#menuLogout {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 9999;
}

#btnLogoutStatic {
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile comfort */
@media (max-width: 640px) {
    #menuLogout {
        top: 8px;
        right: 8px;
    }

    #btnLogoutStatic {
        width: 40px;
        height: 40px;
    }
}

/* ------------ FIN MENU ----------- */

/* ============ VISIBILITY UTILITIES ============ */
.hidden {
    display: none !important;
}

/* ------------ LANDING PAGE ---------------------------------- */
#landing-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    text-align: center;
    color: #fff;
}

.landing-container {
    max-width: 700px;
}

.landing-description {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 40px;
    color: #ccc;
}

.landing-cta {
    margin-bottom: 40px;
}

/* === LANDING PAGE PALETTE === */
/* Primary: #76a1da (blue for section titles) */
/* Accent: #00cfff (cyan for borders/accents) */
/* Text: #ccc (descriptions) */

.cta-text {
    font-size: 1em;
    color: #76a1da;
    margin-bottom: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stages-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.stages-buttons .btn {
    font-size: 1.1em;
    padding: 10px 30px;
    border: 2px solid #76a1da !important;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.stages-buttons .btn:not(.btn-primary) {
    color: #76a1da !important;
    background: transparent !important;
}

.stages-buttons .btn:not(.btn-primary):hover {
    background-color: #76a1da !important;
    color: #fff !important;
    box-shadow: 0 0 15px rgba(118, 161, 218, 0.5);
    transform: translateY(-2px);
}

.cta-wallet {
    font-size: 0.9em;
    color: #ccc;
}

/* ========== SHARE SECTION ========== */
.share-section {
    text-align: center;
}

.share-title {
    display: block;
    font-size: 1em;
    color: #76a1da;
    margin-bottom: 15px;
    font-family: 'Orbitron', sans-serif;
}

.share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-social {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px !important;
    font-size: 0.9em;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 2px solid;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent !important;
}

.btn-social i {
    font-size: 1.1em;
}

/* Twitter Button */
.btn-twitter {
    border-color: #00cfff !important;
    color: #00cfff !important;
}

.btn-twitter:hover {
    background-color: #00cfff !important;
    color: #000 !important;
    box-shadow: 0 0 20px rgba(0, 207, 255, 0.6);
    transform: translateY(-2px);
}

/* Facebook Button */
.btn-facebook {
    border-color: #76a1da !important;
    color: #76a1da !important;
}

.btn-facebook:hover {
    background-color: #76a1da !important;
    color: #fff !important;
    box-shadow: 0 0 20px rgba(118, 161, 218, 0.6);
    transform: translateY(-2px);
}

/* Copy Link Button */
.btn-copy {
    border-color: #00cfff !important;
    color: #00cfff !important;
}

.btn-copy:hover {
    background-color: #00cfff !important;
    color: #000 !important;
    box-shadow: 0 0 20px rgba(0, 207, 255, 0.6);
    transform: translateY(-2px);
}

.btn-copy.copied {
    background-color: #00d084;
    animation: pulse 0.5s ease-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ====================================== */

.welcome-greeting {
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    color: #76a1da;
    text-shadow: 0 0 10px rgba(118, 161, 218, 0.3);
    margin-bottom: 30px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Welcome-specific button styling when connected */
#landing-connected .stages-buttons .btn {
    border: 2px solid #76a1da !important;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    font-weight: 600;
}

#landing-connected .stages-buttons .btn-primary {
    background-color: #76a1da !important;
    color: #fff !important;
    box-shadow: 0 0 15px rgba(118, 161, 218, 0.4);
}

#landing-connected .stages-buttons .btn-primary:hover {
    background-color: #5a89c7 !important;
    box-shadow: 0 0 25px rgba(118, 161, 218, 0.6);
    transform: scale(1.05);
}

#landing-connected .stages-buttons .btn-outline-primary {
    background: transparent !important;
    color: #76a1da !important;
}

#landing-connected .stages-buttons .btn-outline-primary:hover {
    background-color: #76a1da !important;
    border-color: #76a1da !important;
    color: white !important;
    box-shadow: 0 0 15px rgba(118, 161, 218, 0.5);
    transform: translateY(-2px);
}

/* ------------ WALLET OVERLAY ---------------------------------- */
.wallet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.wallet-box {
    background: #111;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    color: white;
    width: 330px;
    border: 1px solid #444;
}

.wallet-btn {
    padding: 12px 25px;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
}
/* --------------- FIN WALLET OVERLAY ---------------------------------- */


#gamehtm_board p {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: #ddd; /* gris clair lisible sur fond sombre */
    max-width: 800px;  /* évite les lignes trop longues */
    margin: 0 auto 25px auto; /* centré */
    text-align: center;
    padding: 0 10px;
    font-family: 'Inter', 'Roboto', system-ui, sans-serif;
}

/* --- Conteneur --- */
#game-root {
    position: relative;
    color: #e8f1ff;
    font-family: 'Orbitron', sans-serif;
    padding: 5px;
    text-align: center;
    margin-top: 50px;
   /* min-height: 100vh;*/
}

/* --- Loader --- */
#game-loader {
    margin-top: 10vh;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: auto;
    border: 6px solid rgba(0,140,255,0.2);
    border-top: 6px solid #00aaff;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    margin-top: 15px;
    font-size: 1.1em;
    color: #bbdfff;
    text-shadow: 0 0 10px #0090ff;
}


/* --- Zone du plateau --- */
.game-board {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 60px;
}

/* ----------------- TITRE DU JEU --------------------- */
.htm-header {
    text-align: center;
    padding: 20px 20px 20px;
    margin-bottom: 20px;
}

.htm-title {
    font-size: clamp(12px, 2rem, 3rem); /* mobile 4 ^x - tablette 1vw 7-8 px - desktop 10 */
    /*font-size: 3rem;*/
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
    margin: 0;
}

.htm-subtitle {
    font-size: clamp(10px, 1.2rem, 2rem); /* mobile 4 ^x - tablette 1vw 7-8 px - desktop 10 */
    /*font-size: 1.2rem;*/
    margin-top: 12px;
    color: #ddd;
    font-weight: 300;
    opacity: 0.85;
}

.htm-title {
    animation: fadeSlide 0.6s ease-out;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================== GAME SECTIONS ==================== */
/* Sections internes de game-root */
#season-preview {
    padding: 30px;
    background: rgba(20, 20, 35, 0.7);
    border: 1px solid #444;
    border-radius: 8px;
    margin-top: 30px;
}

#preview-title {
    font-size: 1.8em;
    color: #76a1da;
    margin-bottom: 15px;
}

#preview-description {
    font-size: 1em;
    color: #ccc;
    margin-bottom: 30px;
}

.preview-cards-container {
    display: grid;
    gap: 20px;
    justify-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: 0 10px;
}

/* Mobile portrait: 2 colonnes */
@media (max-width: 639px) {
    .preview-cards-container {
        grid-template-columns: repeat(2, 1fr);
        max-width: 400px;
    }
    .preview-card-stack {
        width: 160px;
        height: 240px;
    }
}

/* Mobile landscape / */
@media (min-width: 640px) and (max-width: 899px) {
    .preview-cards-container {
        grid-template-columns: repeat(5, 120px);
        max-width: 100%;
    }
    .preview-card-stack {
        width: 100px;
        height: 150px;
    }
}

/* Tablette large / desktop: 5 colonnes (une par carte pour les stages) */
@media (min-width: 900px) {
    .preview-cards-container {
        grid-template-columns: repeat(5, 160px);
        max-width: 100%;
    }
    .preview-card-stack {
        width: 160px;
        height: 240px;
    }
}

/* Make preview cards look like in-game cards */
.preview-card-stack {
    position: relative;
    /*width: 160px;*/
    /*height: 240px;*/
    cursor: pointer;
    transition: transform 0.12s ease;
}
.preview-card-stack:hover { transform: translateY(-6px); }

.preview-card-img {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    box-shadow: 0 0 20px rgba(0, 150, 255, 0.25);
    object-fit: cover;
    display: block;
}
.preview-card-img.active { transform: scale(1.02); }


#game-section {
    margin-top: 30px;
}

#reward {
    padding: 5px;
    background: linear-gradient(135deg, rgba(76, 50, 20, 0.8) 0%, rgba(100, 60, 30, 0.8) 100%);
    border: 2px solid #d4a574;
    border-radius: 8px;
    margin-top: 40px;
}

#reward h3 {
    font-size: 2em;
    color: #ffd700;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.reward-video-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

#game-stages {
    margin-top: 50px;
    padding: 5px;
}

.stages-section {
    margin-bottom: 40px;
}

#leaderboard-container {
    margin-top: 30px;
    background: rgba(20, 20, 45, 0.6);
    border: 1px solid #444;
    border-radius: 8px;
}

#gamehtm_board {
    margin-top: 30px;
    background: rgba(20, 20, 45, 0.6);
    border: 1px solid #444;
    border-radius: 8px;
}

/* ==================== */ 

/* ----------------- GAME HTML 2 --------------------- */

#slots-container {
    display: flex;
    justify-content: center;
    gap: clamp(4px, 2vw, 30px); /* mobile 4 ^x - tablette 1vw 7-8 px - desktop 10 */
    /*gap: 20px;         /* espace constant entre colonnes */
    margin: 0 auto;    /* centrage */
    max-width: 1200px; /* limite pour éviter l'étirement */
    padding: 10px;
}

.slot .name {
    max-width: 150px;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot {
    position: relative; /* Améliore la détection du drop */
    border: 1px solid #ccc;
    padding: clamp(2px, 0.7vw, 6px); /* 320–480px → ~2–3px - 600–800px → ~4–5px - Desktop → max 6px */
    width: 150px;
    min-width: 55px !important;
    background: #fafafa;
    border-radius: 8px;     
}

.slot-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #00738d;
    font-size: clamp(6px, 1.2vw, 14px);
    text-align: center;
    margin-bottom: 6px;
    white-space: nowrap;    /* évite les retours à la ligne moches */
    overflow: hidden;       /* évite que ça dépasse */
    text-overflow: ellipsis; /* coupe proprement si c'est trop long */
}

.slot-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slot img {
    -webkit-touch-callout: none; /* empêche menu iOS */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none; /* IMPORTANT : l'image ne reçoit pas les touches */
}

.card-img {
    width: 100%;
    border-radius: 4px;
}

.slot.correct {
    border: 3px solid gold !important;
    animation: goldPulse 1.2s infinite;
}

@keyframes goldPulse {
    0%   { box-shadow: 0 0 10px rgba(255,215,0,0.5); }
    50%  { box-shadow: 0 0 20px rgba(255,215,0,0.9); }
    100% { box-shadow: 0 0 10px rgba(255,215,0,0.5); }
}

.slot {
    transition: transform 0.1s ease;
}

/* --------- pro --------- */
.drag-clone {
    transition: transform 0.1s ease-out;
    touch-action: none;
    /* Ombre du clone (carte en train d'être déplacée) */
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45),
                0 4px 10px rgba(0, 0, 0, 0.3);
    transform: scale(1.06); /* tu as déjà un scale 1.04, mais 1.06 passe mieux avec la shadow */
    cursor: grabbing !important;   /* main fermée */    
}
.drag-clone {
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.40))
            drop-shadow(0 2px 3px rgba(255, 255, 255, 0.15));
}

.slot.drop-highlight {
    outline: 3px solid #4aa3ff;
    transform: scale(1.05);
    transition: transform 0.1s ease-out, outline 0.1s ease-out;
    cursor: grabbing !important;   /* main fermée */    
}
/* --------------------- */
/* curseurs */
.slot { cursor: grab; }
.slot.dragging { cursor: grabbing !important; }

/* fallback : quand body a la classe, force le curseur globalement */
body.dragging { cursor: grabbing !important; }



.slot.dragging {
    opacity: 0.4;  
}

/* Une carte en train d’être touchée */
.slot.dragging-mobile {
    transform: scale(1.06);
    opacity: 0.6;
    z-index: 50;
}

/* Le clone qui suit le doigt */
.drag-ghost {
    z-index: 99999 !important;
    pointer-events: none;
    transform: translate(-50%, -50%);
    opacity: 0.8;
    /*cursor: grabbing !important;   */    
}

.slot.drop-target {
    outline: 3px dashed #fff;
    outline-offset: -4px;
}
/*
.slot.drop-target {
    outline: 3px solid rgba(255, 215, 0, 0.85); 
    outline-offset: 3px;
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.7);
    transition: box-shadow 0.12s ease-out, outline 0.12s ease-out;
}*/

@keyframes dropPulse {
    0% { box-shadow: 0 0 4px rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 0 12px rgba(255, 215, 0, 0.85); }
    100% { box-shadow: 0 0 4px rgba(255, 215, 0, 0.4); }
}

.slot.drop-target {
    outline: 3px solid rgba(255, 215, 0, 0.85);
    outline-offset: 3px;
    border-radius: 8px;
    animation: dropPulse 0.4s ease-in-out infinite;
}

/* Slot cible quand on glisse au-dessus */
.slot.drop-target-mobile {
    outline: 3px dashed #00eaff;
    outline-offset: -4px;
    background: rgba(0, 255, 255, 0.1);
}

/* ----------------------------- FIN GAME HTM2 ----------------- */
#reward {
    text-align: center;
    color: #ddd; /* gris clair lisible sur fond sombre */
    text-shadow: 0 2px 12px rgba(0,0,0,0.65);
}
.reward-video-wrapper {
    max-width: 960px;
    margin: 2rem auto;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.reward-video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
}


/* --------- VICTORY ---------- */ 

/* Fond semi-transparent */
.victory-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
}

/* Popup */
.victory-box {
    background: #111;
    color: #fff;
    padding: 25px 40px;
    border-radius: 20px;
    text-align: center;
    font-size: 1.6rem;
    box-shadow: 0 0 20px gold;
    animation: pop-in 0.4s ease-out;
    border: 2px solid gold;
}

/* Animation apparition */
@keyframes pop-in {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Animation confetti */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -20px;
    border-radius: 2px;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}




/* --- Cartes --- */
.game-card-stack {
    position: relative;
    width: 160px;
    height: 240px;
    cursor: pointer;
    transition: transform 0.1s;
}

.game-card-stack:hover {
    transform: translateY(-6px);
}

/* Le nom est désormais AU-DESSUS, sans décaler les cartes */
.card-name {
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    white-space: nowrap;
    pointer-events: none;
}

/* Si la carte est complétée (owned) */
.card_success .card-name {
    color: #00ffea;
    text-shadow: 0 0 6px #00fff2;
}

/* images des cartes */
.game-card-img {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    box-shadow: 0 0 20px rgba(0, 150, 255, 0.3);
    transition: opacity 0.4s, transform 0.4s;
    opacity: 0;
}

.game-card-img.active {
    opacity: 1;
    transform: scale(1.02);
}

.stages-section {
    text-align: center;
    padding: 10px;
    color: #66cfff;
}

.stages-section h1{
    color: #00cfff;
    text-shadow: 0 0 8px #0099ff;
}

/* ----------------------------------------------------------- Leaderboard --- */
.leaderboard-container {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}


.leaderboard-section {
    margin-top: 40px;
    background: rgba(0, 20, 40, 0.6);
    padding: 25px;
    border-radius: 12px;
    backdrop-filter: blur(6px);
    box-shadow: 0 0 20px rgba(0, 140, 255, 0.4);
}

.leaderboard-section h2 {
    margin-bottom: 20px;
    color: #00cfff;
    text-shadow: 0 0 8px #0099ff;
}

.leaderboard-table {
    width: 100% !important;  /* Pour eviter depasst de largeur */
    max-width: 100% !important; /* Pour eviter depasst */
    table-layout: fixed; /* Pour eviter depasst */

    /*width: 100%;*/
    border-collapse: collapse;
    margin-top: 25px;
    background: rgba(0, 20, 40, 0.4);
    backdrop-filter: blur(4px);
    color: #e3f4ff;
    font-family: 'Orbitron', sans-serif;
}

/*
.leaderboard-table td.wallet {
    writing-mode: vertical-rl;
    transform: rotate(0deg);
    white-space: nowrap;
    font-size: clamp(9px, 2vw, 12px);
}*/
/* MOBILE : vertical */
.leaderboard-table td.wallet {
    writing-mode: vertical-rl;
    transform: rotate(0deg);
    white-space: nowrap;
    font-size: clamp(9px, 2vw, 12px);
}

/* DESKTOP & TABLETTES : horizontal */
@media (min-width: 640px) {
    .leaderboard-table td.wallet {
        writing-mode: horizontal-tb;
        transform: rotate(0deg);
        font-size: 14px;
        white-space: normal;
    }
}




.leaderboard-table td.wallet:hover {
    background: #222;
    color: gold;
    cursor: default;
}


.leaderboard-table td, 
.leaderboard-table th {
    word-wrap: break-word; /* Pour eviter depasst de largeur */
    white-space: normal !important; /* Pour eviter depasst de largeur */
}

.leaderboard-table th {
    text-align: left;
    padding: 10px;
    color: #66cfff;
    border-bottom: 1px solid rgba(0,150,255,0.4);
}

.leaderboard-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(0,150,255,0.2);
    text-align: center;
}

.leaderboard-table th {
    color: #66cfff;
    text-shadow: 0 0 4px #00aaff;
}

.lb-card-img {
    width: 50px;
    height: 70px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,150,255,0.4);
}

.leaderboard-table tr:hover {
    background: rgba(0,80,130,0.25);
}

/*------------ LEADERBORAD V3 ------------------------------------ */

/* Ligne du joueur connecté */
.leaderboard-row.current-user {
    background: #0077ff22;
    font-weight: bold;
}

/* Joueur ayant terminé (avec bordure gauche dorée) */
.leaderboard-row.completed {
    border-left: 6px solid gold;
}

/* Si joueur connecté + terminé → combo OK */
.leaderboard-row.current-user.completed {
    background: #0077ff33; /* un bleu un peu plus visible */
    border-left: 6px solid gold;
}

.lb-icon {
    font-size: 1.2rem;
    margin-right: 6px;
    vertical-align: middle;
    display: inline-block;
}

/* ⭐ Étoile = glow léger */
.lb-icon.star {
    color: gold;
    filter: drop-shadow(0 0 3px gold);
    animation: starPulse 1.8s infinite ease-in-out;
}

@keyframes starPulse {
    0% { opacity: 0.6; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.6; transform: scale(0.95); }
}

/* 🏆 Trophée = plus important + glow plus net */
.lb-icon.trophy {
    color: #ffd700;
    filter: drop-shadow(0 0 5px #ffca2c);
    animation: trophyBlink 1.5s infinite ease-in-out;
}

@keyframes trophyBlink {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}


/*------------------------------------------------ */


.wallet {
    font-size: 0.85rem;
    opacity: 0.8;
}

.empty {
    opacity: 0.2;
}

.loading {
    color: #66cfff;
    text-shadow: 0 0 6px #0090ff;
}

.error {
    color: #ff7070;
    font-weight: bold;
}

/* ============================================ */
/* DYNAMICALLY GENERATED STYLES MOVED TO CSS */
/* ============================================ */

/* --- CARD ELEMENTS VIDEO/IMG --- */
.preview-card-img {
    aspect-ratio: 600 / 900;
    object-fit: cover;
    width: 100%;
    height: auto;
}

/* --- GAME LOADER --- */
#game-loader {
    /* display: none set dynamically, but can be overridden by other logic */
}

/* --- PREVIEW CARD STACK --- */
.preview-card-stack {
    position: relative;
}

.preview-card-stack a {
/*    display: inline-block;*/
}

/* --- LEADERBOARD TITLE (Hall of Fame) --- */
.leaderboard-wrapper > h3 {
    margin-bottom: 20px;
    padding-top: 30px;
    padding-bottom: 20px;
    font-size: 1.8em;
    font-weight: 700;
    color: #76a1da;
    font-family: 'Orbitron', sans-serif;
    text-align: center;
}

/* --- LEADERBOARD CONTROLS --- */
.leaderboard-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.leaderboard-controls .btn-sm {
    padding: 6px 12px;
}

/* --- LEADERBOARD FILTER CONTAINER --- */
.leaderboard-filter-container {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
}

/* --- LEADERBOARD TOGGLE LABEL --- */
.leaderboard-toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 8px;
}

.leaderboard-toggle-label input[type="checkbox"] {
    display: none;
}

/* --- TOGGLE SWITCH (Visual) --- */
.toggle-switch {
    width: 50px;
    height: 26px;
    background-color: #e9ecef;
    border-radius: 13px;
    position: relative;
    transition: background-color 0.3s;
}

.toggle-switch.active {
    background-color: #007bff;
}

/* --- TOGGLE SLIDER --- */
.toggle-switch-slider {
    width: 22px;
    height: 22px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.active .toggle-switch-slider {
    left: 26px;
}

/* --- TOGGLE TEXT --- */
.leaderboard-toggle-text {
    font-weight: 700;
    font-size: 13px;
    color: #333;
}

/* --- LEADERBOARD EMPTY CELL --- */
.leaderboard-empty-msg {
    text-align: center;
    padding: 20px;
    color: #999;
}

/* --- DRAG AND DROP STYLES --- */
.drag-clone {
    pointer-events: none;
    opacity: 0.9;
    z-index: 9999;
    transform: scale(1.04);
    transition: all 120ms ease-out;
}

.drag-clone.animating {
    transform: scale(1);
}

.slot.drop-highlight {
    outline: 2px dashed #00cfff;
    outline-offset: -4px;
    background-color: rgba(0, 207, 255, 0.1);
}

.slot.dragging {
    cursor: grabbing !important;
    opacity: 0.7;
}

body.dragging {
    cursor: grabbing !important;
}

.slot.correct {
    box-shadow: inset 0 0 20px rgba(0, 207, 255, 0.4), 0 0 10px rgba(0, 207, 255, 0.3);
    border: 2px solid #00cfff;
}

/* --- CONFETTI / VICTORY --- */
.victory-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.victory-box {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    color: white;
    font-size: 2.5em;
    font-weight: 700;
    border: 2px solid #00cfff;
    box-shadow: 0 0 30px rgba(0, 207, 255, 0.5);
    animation: bounceIn 0.5s ease-out;
    cursor: pointer;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.confetti {
    width: 10px;
    height: 10px;
    position: fixed;
    pointer-events: none;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}
