/*
    La NIRDvolution - Plateforme d'entraide et de sobriété numérique.
    Copyright (C) 2025 ESIROI

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published
    by the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.
*/

:root {
    --primary-color: #007BFF;
    --primary-light: #E6F3FF;
    --text-color: #333;
    --light-gray: #f4f7f9;
    --border-color: #e0e0e0;
    --shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    --input-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --nc-bg-1: #0f0f0f;
    --nc-bg-2: rgba(26, 26, 26, 0.6);
    --nc-bg-3: #2a2a2a;
    --nc-txt-1: #ffffff;
    --nc-txt-2: #d2d2d2;
    --nc-shadow-1: 0 4px 18px rgba(0, 0, 0, 0.35);
    --nc-shadow-2: 0 0 40px 8px rgba(255, 255, 255, 0.4);
    --accent-color: #ff6b6b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, sans-serif;
}

body {
    background: var(--nc-bg-1);
    color: var(--nc-txt-1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    width: 100%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    position: relative;
}

header img {
    width: 130px;
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

header h1 {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
}

.game-wrapper {
    max-width: 1200px;
    margin: 2rem auto 4rem;
    padding: 0 1rem;
    width: 100%;
    padding-bottom: 300px;
}

.game-header {
    text-align: center;
    margin-bottom: 3rem;
}

.game-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--nc-txt-1);
    margin-bottom: 1rem;
}

.game-intro {
    max-width: 700px;
    margin: 0 auto;
    color: var(--nc-txt-2);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ——— STATS (STICKY BOTTOM) ——— */

.stats-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, var(--nc-bg-1) 20%);
    padding: 1.5rem 1.5rem 2rem;
    border-top: 2px solid rgba(255, 107, 107, 0.3);
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.stats-panel h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nird-alignment-bar {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 1.5rem;
    padding: 1rem;
    background: rgba(255, 107, 107, 0.05);
    border: 2px solid rgba(255, 107, 107, 0.3);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.nird-alignment-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alignment-meter {
    display: flex;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 107, 107, 0.3);
    position: relative;
}

.alignment-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b 0%, #ff8787 50%, #ffa5a5 100%);
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.8rem;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.6);
}

.alignment-percentage {
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.alignment-description {
    font-size: 0.8rem;
    color: var(--nc-txt-2);
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}

.stats-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    max-width: 1200px;
    margin: 0 auto;
}

.stat-item {
    padding: 0.8rem;
    background: rgba(255, 107, 107, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 107, 107, 0.15);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 107, 107, 0.08);
    border-color: rgba(255, 107, 107, 0.4);
    transform: scale(1.05);
}

.stat-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--nc-txt-1);
}

.stat-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.stat-fill {
    height: 100%;
    border-radius: inherit;
    width: 50%;
    background: linear-gradient(90deg, #ff6b6b, #ff8787);
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

/* ——— CARTE DU JEU ——— */

.game-card {
    margin-top: 2rem;
    padding: 2.5rem;
    border-radius: 20px;
    background: var(--nc-bg-2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 107, 107, 0.2);
    box-shadow: var(--nc-shadow-1);
}

.game-card h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--nc-txt-1);
    margin-bottom: 1rem;
}

.options-grid {
    display: grid;
    gap: 1.2rem;
    margin: 2rem 0;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    animation: fadeInUp 0.5s ease 0.2s backwards;
}

.option-btn {
    border-radius: 16px;
    padding: 1.2rem;
    border: 1px solid rgba(255, 107, 107, 0.2);
    background: rgba(26, 26, 26, 0.8);
    text-align: left;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.option-btn:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(255, 107, 107, 0.6);
    box-shadow: var(--nc-shadow-2);
    background: rgba(255, 107, 107, 0.08);
}

.option-btn:hover::before {
    opacity: 1;
}

.option-index {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

.option-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--nc-txt-1);
}

.option-subtext {
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ——— FEEDBACK & FIN ——— */

.choice-feedback {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 16px;
    display: none;
    background: rgba(255, 107, 107, 0.08);
    border: 1px solid rgba(255, 107, 107, 0.3);
    animation: slideInFromBottom 0.4s ease;
}

.choice-feedback strong {
    display: block;
    color: var(--accent-color);
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
}

.choice-feedback p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--nc-txt-2);
    margin: 0;
}

.next-btn {
    margin-top: 1.5rem;
    border: none;
    padding: 0.9rem 1.8rem;
    border-radius: 999px;
    cursor: pointer;
    background: var(--accent-color);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--nc-shadow-2);
    opacity: 0.9;
}

.end-screen {
    margin-top: 2rem;
    padding: 2rem;
    display: none;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(255, 107, 107, 0.05) 100%);
    border: 1px solid rgba(255, 107, 107, 0.3);
    text-align: center;
}

.tag-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 999px;
    background: var(--accent-color);
    color: white;
    margin-bottom: 1rem;
}

.end-screen h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--nc-txt-1);
    margin: 1rem 0;
}

.end-screen p {
    font-size: 1.05rem;
    color: var(--nc-txt-2);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.back-link {
    margin-top: 3rem;
    text-align: center;
    color: var(--nc-txt-2);
    font-size: 1.05rem;
}

.back-link a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.back-link a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ——— ANIMATIONS ——— */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* ——— RESPONSIVE ——— */

@media (max-width: 768px) {
    header {
        padding: 1.2rem 1rem;
    }

    header img {
        width: 100px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .game-wrapper {
        margin: 1.5rem auto 3rem;
        padding: 0 1rem;
        padding-bottom: 280px;
    }

    .game-header h1 {
        font-size: 1.8rem;
    }

    .game-intro {
        font-size: 0.95rem;
    }

    .stats-panel {
        padding: 1.5rem 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.8rem;
    }

    .stat-item {
        padding: 0.6rem;
    }

    .stat-label-row {
        font-size: 0.75rem;
    }

    .game-card {
        padding: 1.5rem;
    }

    .game-card h2 {
        font-size: 1.4rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .option-btn {
        padding: 1rem;
    }

    .end-screen h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 420px) {
    header h1 {
        font-size: 1.3rem;
    }

    .game-header h1 {
        font-size: 1.5rem;
    }

    .game-intro {
        font-size: 0.9rem;
    }

    .stats-panel {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .game-card {
        padding: 1rem;
    }

    .game-card h2 {
        font-size: 1.2rem;
    }

    .next-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
    }

    .end-screen h3 {
        font-size: 1.3rem;
    }
}
/* --- Footer Licence AGPL --- */
.site-footer {
    width: 100%;
    text-align: center;
    padding: 30px 10px;
    margin-top: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--nc-bg-1); /* Fond sombre */
    color: var(--nc-txt-2);
    font-size: 0.9rem;
}

.site-footer a {
    color: var(--accent-color); /* Utilise votre couleur d'accentuation */
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.source-link {
    display: inline-block;
    margin-top: 5px;
    opacity: 0.8;
}

