/* Importation de la police "Roman/Scénario" */
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime&display=swap');

/* RESET ET BASE */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: #000000;
    color: #ffffff;
    font-family: 'Courier Prime', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- PAGE LOGIN --- */
.container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.question {
    display: block;
    font-size: 1.3rem; 
    margin-bottom: 60px; 
    opacity: 0.9;
}

input[type="password"] {
    width: 300px; 
    background: transparent;
    border: none;
    border-bottom: 1px solid #ffffff; 
    color: #ffffff;
    font-family: inherit;
    font-size: 1.5rem;
    padding: 10px 0;
    outline: none;
    text-align: center; 
}
input[type="password"]:focus { border-bottom: 1px solid #aaaaaa; }

#error-msg { margin-top: 30px; color: #ff4444; font-size: 0.9rem; display: none; }
.hidden { display: none !important; }
.visible { display: block !important; }

/* --- DASHBOARD --- */

.dashboard-body {
    display: block;
    padding: 20px;
    height: auto;
    min-height: 100vh;
    box-sizing: border-box;
    max-width: 1200px;
    margin: 0 auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid #fff;
    padding-bottom: 10px;
    margin-bottom: 40px;
    font-size: 0.8rem;
}

.exit-btn { color: #666; text-decoration: none; transition: 0.3s; }
.exit-btn:hover { color: #fff; }

/* GRILLE */
.grid-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 1px; 
    background-color: #333; 
    border: 1px solid #333; 
}

/* CASES DE LA GRILLE */
.grid-cell {
    background-color: #000000; 
    padding: 30px;
    display: flex;
    flex-direction: column;
    height: auto; 
}

/* CLASSE POUR GRANDE CASE */
.full-width {
    grid-column: span 2;
}

.cell-title {
    font-size: 0.9rem;
    color: #888;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px dashed #333;
    padding-bottom: 10px;
    flex-shrink: 0;
}

/* CONTENU INTERNE DES CASES */
.cell-content { 
    display: flex; 
    flex-direction: column; 
    flex-grow: 1; 
}

/* --- MODULES (Météo, Tram, etc) --- */
.value-display { font-size: 3rem; font-weight: bold; color: #fff; margin: 10px 0; }
.sub-info { font-size: 0.8rem; color: #666; }
.placeholder-text { color: #333; font-style: italic; }

.link-list { list-style: none; padding: 0; }
.link-list li { margin-bottom: 10px; }
.link-list a { color: #ccc; text-decoration: none; font-size: 0.9rem; transition: 0.2s; }
.link-list a:hover { color: #fff; padding-left: 5px; }

.meteo-main { display: flex; align-items: center; gap: 10px; }
.meteo-main .value-display { font-size: 1.5rem; }
.meteo-icon { font-size: 1.5rem; }
.module-block .label { font-size: 0.75rem; color: #666; text-transform: uppercase; letter-spacing: 1px; }

.ogcnice-standing { display: flex; align-items: baseline; gap: 5px; margin-top: 5px; }
.standing-rank { font-size: 2rem; font-weight: bold; color: #fff; }
.standing-suffix { font-size: 1rem; color: #888; }
.standing-league { font-size: 0.85rem; color: #666; margin-left: 10px; }
.ogcnice-live { margin-top: 10px; }
.live-match { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; }
.live-indicator { color: #ff4444; font-size: 0.8rem; font-weight: bold; animation: blink-live 1s infinite; }
@keyframes blink-live { 0%, 50%, 100% { opacity: 1; } 25%, 75% { opacity: 0.3; } }
.match-minute { color: #fff; font-size: 1rem; }
.match-score { display: flex; align-items: center; gap: 15px; }
#home-team, #away-team { font-size: 0.85rem; color: #888; min-width: 80px; }
#home-team { text-align: right; }
#away-team { text-align: left; }

.tram-directions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.tram-dir { display: flex; justify-content: space-between; align-items: center; }
.tram-dest { color: #888; font-size: 0.85rem; }
.tram-time { color: #fff; font-family: 'Courier New', monospace; font-size: 1rem; font-weight: bold; }

/* ========================================= */
/* BLOC-NOTES SÉCURISÉ                       */
/* ========================================= */

#notepad-wrapper {
    position: relative;
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    height: 100%; 
}

#notepad-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
}
.lock-screen {
    background: black;
    border: 1px solid white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
}
.status-blink { color: #ff4444; font-size: 0.8rem; animation: blink-live 1.5s infinite; margin: 0; }
#notepad-overlay input { width: 200px; font-size: 1rem; background: black; color: white; text-align: center; border: none; border-bottom: 1px solid white; }
#note-error { color: #ff4444; font-size: 0.8rem; margin: 0; text-transform: uppercase; }

.blurred-content {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
    transition: filter 0.5s ease;
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
    opacity: 0.7;
    height: 100%;
}

.blurred-content.unlocked {
    filter: blur(0);
    pointer-events: auto;
    user-select: auto;
    opacity: 1;
}

.notepad-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; 
    margin-bottom: 10px;
}
.notepad-status {
    text-align: right;
    font-size: 0.7rem;
    color: #555;
    margin-top: 5px;
    flex-shrink: 0; 
}

#notepad-area {
    flex-grow: 1; 
    height: 100%; 
    width: 100%;
    background: #111;
    border: 1px solid #333;
    color: #fff;
    font-family: 'Courier Prime', monospace;
    padding: 15px;
    resize: none;
    outline: none;
    font-size: 0.9rem;
    box-sizing: border-box;
    line-height: 1.4;
    display: block;
}

#notepad-area:focus {
    border-color: #666;
    background: #0a0a0a;
}

.terminal-btn { background: white; color: black; border: none; padding: 5px 15px; font-family: 'Courier Prime', monospace; font-weight: bold; cursor: pointer; }
.terminal-btn:hover { background: #ccc; }
.mini-btn { background: transparent; border: 1px solid #555; color: #555; font-size: 0.7rem; cursor: pointer; font-family: 'Courier Prime', monospace; }
.mini-btn:hover { color: white; border-color: white; }

/* ========================================= */
/* MODULE PIXEL ART GAME                    */
/* ========================================= */

#pixel-game-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1; 
    height: 100%;
    gap: 15px;
}

.pixel-display {
    flex: 1; 
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    border: 1px solid #333;
    overflow: hidden;
    position: relative;
    min-height: 200px;
}

canvas#daily-pixel-art {
    image-rendering: pixelated; 
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

.loading-msg {
    position: absolute;
    color: #444;
    font-size: 0.7rem;
    z-index: 1;
    animation: blink-live 1s infinite;
}

.game-interface {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.instruction {
    margin: 0;
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
}

.input-line {
    display: flex;
    border: 1px solid #fff;
}

.input-line input {
    flex: 1;
    background: black;
    color: white;
    border: none;
    padding: 10px;
    font-family: 'Courier Prime', monospace;
    font-size: 0.9rem;
    outline: none;
    text-transform: uppercase;
}

.input-line button {
    background: white;
    color: black;
    border: none;
    padding: 0 15px;
    font-weight: bold;
    cursor: pointer;
}

.input-line button:hover {
    background: #ccc;
}

.feedback-msg {
    height: 20px;
    font-size: 0.8rem;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
}

.feedback-success { color: #00ff00; }
.feedback-fail { color: #ff4444; }
.feedback-admin { color: #ffd700; animation: blink-live 0.5s infinite; }

.success-link {
    display: block;
    margin-top: 15px;
    text-align: center;
    text-decoration: none;
    background-color: white;
    color: black;
    border: 1px solid white;
    animation: fadeIn 1s ease;
}

.success-link:hover {
    background-color: #000;
    color: #fff;
}

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

/* ========================================= */
/* MODULE 05 : WHO AM I (CONSOLE)           */
/* ========================================= */

#whoami-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    gap: 10px;
    font-family: 'Courier New', Courier, monospace;
}

.terminal-output {
    flex: 1;
    background: #0d0d0d;
    border: 1px solid #333;
    padding: 15px;
    overflow-y: auto;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 200px;
}

.terminal-output::-webkit-scrollbar { width: 8px; }
.terminal-output::-webkit-scrollbar-track { background: #000; }
.terminal-output::-webkit-scrollbar-thumb { background: #333; }

.sys-msg { color: #666; font-style: italic; }
.user-msg { color: #fff; }
.ai-msg { color: #00ff00; text-shadow: 0 0 5px rgba(0,255,0,0.3); }

.console-input-area {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #000;
    border: 1px solid #fff;
    padding: 5px 10px;
}

.prompt-sign {
    color: #00ff00;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

#whoami-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    outline: none;
    font-size: 0.9rem;
}

#whoami-send {
    background: #fff;
    color: #000;
    border: none;
    font-weight: bold;
    cursor: pointer;
    padding: 2px 8px;
}
#whoami-send:hover { background: #ccc; }

.thinking {
    color: #00ff00;
    animation: blink-live 0.5s infinite;
}

/* ANIMATION VICTOIRE (WHO AM I) */
.whoami-win-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    border: 2px solid #00ff00;
    overflow: hidden;
    animation: flash-green 0.5s;
}

.pixel-win-msg {
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 2.5rem;
    font-weight: bold;
    white-space: nowrap;
    text-shadow: 2px 2px 0px #003300;
    animation: scroll-text 3s linear infinite;
}

@keyframes flash-green {
    0% { background-color: #00ff00; }
    100% { background-color: rgba(0, 0, 0, 0.9); }
}

@keyframes scroll-text {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.sys-msg-admin {
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

/* ========================================= */
/* RESPONSIVE (CORRECTION MOBILE)           */
/* ========================================= */
@media (max-width: 768px) {
    /* Passage en 1 colonne pour tout le monde */
    .grid-wrapper { grid-template-columns: 1fr; }
    
    /* Annulation de l'extension 2 colonnes pour WHO AM I */
    .full-width { grid-column: auto; }
    
    /* Ajustements généraux */
    #notepad-area { min-height: 200px; }
    .container { padding: 10px; }
    .grid-cell { padding: 15px; }
    .top-bar { flex-direction: column; align-items: center; gap: 10px; }
}