/* ============================================
   Le Solitaire - Feuille de styles
   Thème néon inspiré de Pulse Pattern
   ============================================ */

#game-main * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

#game-main {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    min-height: 100dvh;
    user-select: none;
    -webkit-user-select: none;
}

#game-main #solitaire-app {
    width: 100%;
    max-width: 680px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 12px;
    gap: 10px;
}

/* --- En-tête --- */
#game-main #solitaire-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#game-main #game-title {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(90deg, #00d2ff, #7b2ff7, #ff6fd8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* --- Barre d'outils --- */
#game-main #toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

#game-main .game-btn {
    padding: 9px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: 22px;
    cursor: pointer;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.3s ease;
}

#game-main .game-btn:active {
    transform: scale(0.95);
}

#game-main .btn-play {
    background: linear-gradient(135deg, #00d2ff, #7b2ff7);
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

#game-main .btn-play:hover {
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.5);
}

#game-main .btn-stop {
    background: linear-gradient(135deg, #ff5252, #d50000);
    box-shadow: 0 4px 15px rgba(255, 82, 82, 0.3);
}

#game-main .btn-stop:hover {
    box-shadow: 0 6px 20px rgba(255, 82, 82, 0.5);
}

#game-main .btn-rules {
    background: linear-gradient(135deg, #ff6fd8, #7b2ff7);
    box-shadow: 0 4px 15px rgba(123, 47, 247, 0.3);
}

#game-main .btn-rules:hover {
    box-shadow: 0 6px 20px rgba(123, 47, 247, 0.5);
}

#game-main .btn-alt {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

#game-main .btn-alt:hover {
    background: rgba(255, 255, 255, 0.2);
}

#game-main #level-select {
    padding: 8px 12px;
    border: 2px solid rgba(123, 47, 247, 0.4);
    border-radius: 8px;
    background: rgba(15, 12, 41, 0.8);
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
}

/* --- Statistiques --- */
#game-main #stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 6px 14px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

#game-main #stats b {
    color: #fff;
    font-size: 1rem;
    margin-left: 4px;
}

/* --- Zone de jeu --- */
#game-main #game-container {
    position: relative;
    width: 100%;
    min-height: 55vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden;
    touch-action: none;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

#game-main #game-canvas {
    display: block;
    max-width: 100%;
    border-radius: 12px;
}

#game-main #loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    color: #b0b0ff;
    pointer-events: none;
}

/* --- Modales --- */
#game-main .modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 15px;
    animation: ojsol-fadeIn 0.25s ease;
}

#game-main .modal.hidden {
    display: none !important;
}

#game-main .hidden {
    display: none !important;
}

#game-main .modal-content {
    background: linear-gradient(135deg, #1a1a3e, #2a2a5e);
    border: 1px solid rgba(123, 47, 247, 0.4);
    border-radius: 16px;
    padding: 24px 20px;
    max-width: 460px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    animation: ojsol-slideUp 0.3s ease;
    text-align: center;
}

#game-main .modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    width: auto;
    transition: color 0.2s;
}

#game-main .modal-close:hover {
    color: #fff;
}

#game-main .modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 14px;
    background: linear-gradient(90deg, #00d2ff, #7b2ff7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#game-main .modal-body {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #ccc;
    text-align: left;
    margin-bottom: 16px;
}

#game-main .modal-body ul {
    padding-left: 20px;
    margin: 8px 0;
}

#game-main .modal-body li {
    margin-bottom: 5px;
}

#game-main .modal-content p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 10px;
    color: #ccc;
}

#game-main .modal-content .game-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    max-width: none;
}

#game-main #go-stats {
    margin: 14px 0;
    color: #ccc;
}

#game-main #go-stats p {
    margin-bottom: 4px;
}

#game-main #go-record {
    color: #00e676;
    font-weight: 700;
    margin: 10px 0;
}

/* --- Leaderboard --- */
#game-main #leaderboard-filters {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

#game-main .lb-filter {
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

#game-main .lb-filter.active {
    background: linear-gradient(135deg, #00d2ff, #7b2ff7);
    color: #fff;
    border-color: transparent;
}

#game-main #leaderboard-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#game-main #leaderboard-content th,
#game-main #leaderboard-content td {
    padding: 8px 6px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#game-main #leaderboard-content th {
    color: #b0b0ff;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 1px;
}

#game-main #leaderboard-content .lb-score {
    color: #00d2ff;
    font-weight: 700;
}

#game-main .lb-empty {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 16px 0;
}

/* --- Animations --- */
@keyframes ojsol-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ojsol-slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- Responsive --- */
@media (max-width: 640px) {
    #game-main #game-title {
        font-size: 1.4rem;
    }

    #game-main .game-btn {
        padding: 7px 12px;
        font-size: 0.75rem;
    }

    #game-main #stats {
        font-size: 0.68rem;
        gap: 10px;
    }

    #game-main #stats b {
        font-size: 0.85rem;
    }
}
