/* --- STRUCTURE GÉNÉRALE --- */
html, body {
    margin: 0; padding: 0;
    font-family: 'Inter', sans-serif;
    color: white; width: 100%;
    overflow-x: hidden;
    background-color: #1a1a1a;
}

/* --- GRILLE DE PROJETS --- */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 250px);
    justify-content: center;
    gap: 40px;
    padding: 20px 40px;
    margin-bottom: 50px;
}

.game-card {
    width: 250px; height: 350px;
    background-color: #333; background-size: cover; background-position: center;
    border: 8px solid #000; position: relative; cursor: pointer;
    transition: transform 0.2s ease; overflow: hidden; 
    display: flex; flex-direction: column;
    justify-content: flex-end; 
}

.game-card:hover { transform: scale(1.05); }

.card-header {
    background: rgba(43, 92, 255, 0.95); width: 100%; padding: 10px 0;
    text-align: center; border-top: 2px solid #000;
}

.card-header h2 { 
    margin: 0; color: white; font-size: 1.1rem; font-weight: 600; 
    letter-spacing: 2px;
}

/* --- BADGES --- */
.card-category-tag {
    position: absolute; top: 10px; left: 10px;
    color: black; font-size: 10px; font-weight: 800;
    padding: 2px 6px; border-radius: 4px; 
    text-transform: uppercase; z-index: 3;
}

#label-games { background: #ff7b25; }
#label-software { background: #22eb22; }
#label-tools { background: #eef135; }
#label-misc { background: #ffffff; }

/* --- MODAL --- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex; justify-content: center;
    align-items: flex-start; 
    overflow-y: auto; 
    padding: 40px 20px;
}

.modal-content {
    background: #2a2a2a; width: 100%; max-width: 850px; padding: 40px;
    border-radius: 12px; position: relative; color: white;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.modal-body-top { display: flex; gap: 40px; align-items: flex-start; margin-bottom: 30px; }

.modal-card-preview {
    width: 200px; height: 280px; background-size: cover; background-position: center;
    border: 5px solid #000; flex-shrink: 0;
    display: flex; flex-direction: column; justify-content: flex-end;
}

/* --- ACTIONS & FIX TAILLE BOUTONS --- */
.modal-actions { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    align-items: flex-start; 
}

.title-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    gap: 10px;
    width: 100%;
}

.modal-actions h1 { font-size: 2.5rem; margin: 0; font-weight: 800; line-height: 1.1; }

.quick-pitch { font-size: 1.1rem; color: #ddd; line-height: 1.5; margin: 10px 0; text-align: left; }

/* TAGS */
.tags-container { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-start; }
.tag { 
    padding: 4px 10px; border-radius: 4px; font-size: 0.75rem; 
    font-weight: 800; text-transform: uppercase; background: #444; 
    white-space: nowrap;
}

.tag-cpp { background-color: #00599C; } 
.tag-csharp { background-color: #178600; }
.tag-unreal-engine { background-color: #a13ce4; border: 1px solid #555; } 

/* LIENS / BOUTONS */
.links-row { 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap; 
    width: 100%; 
    justify-content: flex-start; 
}

.steam-btn {
    background: #1b2838; color: white; padding: 8px 18px; border-radius: 6px;
    text-decoration: none; font-weight: bold; display: inline-flex; 
    align-items: center; gap: 10px; width: fit-content; transition: background 0.2s;
}

.steam-icon { width: 18px; height: 18px; object-fit: contain; }

/* --- EXPERIENCE --- */
.modal-experience {
    margin-top: 20px; padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; flex-direction: column; gap: 25px;
}

.modal-experience h3 { 
    color: #2b5cff; text-transform: uppercase; 
    font-size: 0.9rem; margin-bottom: 12px; 
    font-weight: 700; letter-spacing: 1px;
}

.tech-list {
    white-space: pre-line; color: #ccc; line-height: 1.6; font-size: 1.05rem;
    background: rgba(255, 255, 255, 0.03); padding: 15px; border-radius: 8px; margin: 0;
}

.feeling-column { border-left: 3px solid #ff7b25; padding-left: 15px; }
.feeling-text { font-style: italic; color: #bbb; line-height: 1.6; margin: 0; }

/* --- STORYTELLING (RETOUR DU BLEU) --- */
.modal-storytelling {
    margin-top: 40px; padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-detail-section {
    display: flex; flex-direction: column; gap: 20px; margin-bottom: 60px;
}

.modal-detail-section h4 { 
    color: #2b5cff; 
    text-transform: uppercase; 
    font-size: 1.4rem; 
    font-weight: 800;
    letter-spacing: 2px;
    margin: 0;
    width: 100%;
}

.detail-content-wrapper { display: flex; gap: 40px; align-items: center; }
.modal-detail-section:nth-child(even) .detail-content-wrapper { flex-direction: row-reverse; }

.detail-text { flex: 1.4; }
.detail-text p { 
    color: #ccc; line-height: 1.7; font-size: 1.05rem; margin: 0;
    text-align: left; text-wrap: pretty; hyphens: auto;
}

.detail-media { flex: 1; }
.detail-media img, .detail-media video {
    width: 100%; border-radius: 8px; border: 3px solid #000; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.4); display: block;
}

.close-btn { position: absolute; top: 15px; right: 25px; font-size: 35px; cursor: pointer; color: #aaa; z-index: 10; }

/* --- RESPONSIVE --- */
@media (max-width: 800px) {
    .games-grid { grid-template-columns: 1fr; justify-items: center; }
    .game-card { width: 100%; max-width: 280px; }
    .modal-body-top { flex-direction: column; align-items: center; }
    .modal-actions, .title-row { align-items: center; text-align: center; }
    .links-row, .tags-container { justify-content: center; }
    .detail-content-wrapper, .modal-detail-section:nth-child(even) .detail-content-wrapper { 
        flex-direction: column; 
    }
}