/* --- Variables Thème ZZZ --- */
:root {
    --bg-dark: #0a0b10;
    --primary-blue: #00f0ff; /* Cyan Cyber */
    --ice-blue: #aeeeff;     /* Bleu Glace */
    --neon-gold: #ffbd00;    /* Or Néon */
    --alert-red: #ff3366;    /* Pour les erreurs */
    --glass: rgba(20, 22, 31, 0.8);
    --text-white: #ffffff;
    --grid-gap: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: 'Rajdhani', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Background Effects --- */
.noise-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.04; pointer-events: none; z-index: 0;
}

.scanlines {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.1));
    background-size: 100% 4px; pointer-events: none; z-index: 1;
}

.hex-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='hexagons' fill='%2300f0ff' fill-opacity='0.05' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-7.5L27.99 34H28v2.31h-.01L17 42.65V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: -1; opacity: 0.5;
}

/* --- Navigation --- */
.top-nav {
    display: flex; justify-content: space-between; padding: 15px 5%;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    background: rgba(10, 11, 16, 0.95); position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(5px);
}
.back-btn {
    color: var(--ice-blue); text-decoration: none; font-weight: 700;
    text-transform: uppercase; transition: 0.3s; display: flex; align-items: center; gap: 10px;
}
.back-btn:hover { color: var(--primary-blue); letter-spacing: 1px; }
.back-btn i { font-size: 0.8rem; }
.logo-small { color: #666; font-family: 'Orbitron', sans-serif; letter-spacing: 2px; font-size: 0.9rem; }

/* --- Layout Principal --- */
.main-wrapper {
    display: flex; justify-content: center; padding: 30px 20px;
}

.terminal-container {
    width: 100%; max-width: 550px;
    background: rgba(10, 14, 22, 0.8);
    border: 1px solid var(--primary-blue);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.15), inset 0 0 20px rgba(0, 240, 255, 0.05);
    padding: 25px; position: relative;
    backdrop-filter: blur(10px);
    /* Coins coupés style tech */
    clip-path: polygon(0 0, 100% 0, 100% 95%, 95% 100%, 0 100%);
}

/* Décorations de coins */
.terminal-container::before, .terminal-container::after {
    content: ''; position: absolute; width: 15px; height: 15px;
    border: 2px solid var(--primary-blue);
}
.terminal-container::before { top: 0; left: 0; border-right: none; border-bottom: none; }
.terminal-container::after { bottom: 0; right: 0; border-left: none; border-top: none; }

/* --- Header du Jeu --- */
.game-header {
    text-align: center; margin-bottom: 25px; position: relative;
    display: flex; justify-content: center; align-items: center;
}

.glitch-title {
    font-family: 'Orbitron', sans-serif; font-size: 2.5rem;
    color: var(--text-white); text-shadow: 0 0 10px var(--primary-blue);
    letter-spacing: 4px; margin: 0 20px;
}

.header-decoration {
    height: 2px; flex-grow: 1; background: var(--primary-blue);
    position: relative; opacity: 0.5;
}
.header-decoration::after {
    content: ''; position: absolute; width: 10px; height: 10px;
    background: var(--primary-blue); top: 50%; transform: translateY(-50%);
    box-shadow: 0 0 10px var(--primary-blue);
}

/* --- Menu Screen --- */
.menu-screen {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; min-height: 400px; text-align: center;
}

.menu-title {
    font-size: 3rem; margin-bottom: 40px;
}

.menu-options {
    display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 300px;
}

.btn-menu {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 15px 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    display: flex; flex-direction: column; align-items: center;
    position: relative; overflow: hidden;
}

.btn-menu:hover {
    background: var(--primary-blue);
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--primary-blue);
}

.btn-subtitle {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 5px;
    text-transform: none;
}

/* Settings Panel */
.settings-panel {
    margin-bottom: 20px;
    padding: 15px;
    text-align: left;
}

.settings-title {
    color: var(--primary-blue);
    margin-bottom: 10px;
    border-bottom: 1px solid var(--primary-blue);
    padding-bottom: 6px;
}

.setting-item {
    margin-bottom: 10px;
}

.setting-value {
    color: var(--neon-gold);
}

.setting-range {
    width: 100%;
    accent-color: var(--primary-blue);
}

.setting-select {
    width: 100%;
    background: var(--bg-dark);
    color: white;
    border: 1px solid var(--primary-blue);
    padding: 5px;
}

.btn-menu.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.menu-footer {
    margin-top: 50px;
    color: #555;
    font-size: 0.8rem;
    letter-spacing: 2px;
}

.hidden { display: none !important; }

/* --- Header du Jeu --- */
.deco-left::after { right: 0; } .deco-right::after { left: 0; }

/* --- HUD Scoreboard --- */
.hud-panel {
    background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(0, 240, 255, 0.3);
    padding: 15px; margin-bottom: 25px;
}

.score-board {
    display: flex; justify-content: space-between; align-items: center;
}

.score-box { text-align: center; }
.score-box .label { display: block; font-size: 0.7rem; color: var(--ice-blue); letter-spacing: 1px; margin-bottom: 5px; }
.score-box .value { font-family: 'Orbitron'; font-size: 1.5rem; font-weight: bold; }
.score-box.player .value { color: var(--primary-blue); text-shadow: 0 0 10px var(--primary-blue); }
.score-box.opponent .value { color: var(--alert-red); text-shadow: 0 0 10px var(--alert-red); }

.timer-box {
    text-align: center; color: var(--neon-gold);
}
.timer-box i { display: block; font-size: 1.2rem; margin-bottom: 5px; }
.timer-box .time { font-family: 'Orbitron'; font-size: 1.8rem; }
.icon-pulse { animation: pulse-gold 2s infinite; }

@keyframes pulse-gold {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px var(--neon-gold); }
    50% { opacity: 0.5; text-shadow: none; }
}

/* --- GRILLE DE JEU (Style Data Block) --- */
.grid-container {
    display: grid; grid-template-rows: repeat(6, 1fr);
    gap: var(--grid-gap); margin-bottom: 30px;
    padding: 10px; background: rgba(0,0,0,0.2);
    border: 1px dashed rgba(0, 240, 255, 0.2);
}

.grid-row {
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: var(--grid-gap);
}

.tile {
    aspect-ratio: 1/1;
    background: rgba(15, 23, 42, 0.8); /* Fond sombre semi-transparent */
    border: 2px solid rgba(0, 240, 255, 0.1); /* Bordure au repos */
    display: flex; justify-content: center; align-items: center;
    font-family: 'Orbitron', sans-serif; font-size: 2rem; font-weight: 700;
    color: var(--text-white);
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative; overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

/* Effet quand on tape une lettre */
.tile[data-state="active"] {
    border-color: var(--ice-blue);
    box-shadow: 0 0 15px rgba(174, 238, 255, 0.3), inset 0 0 10px rgba(0,0,0,0.5);
}

/* --- ÉTATS DES CASES --- */

/* CORRECT (Bien placé) -> CYAN NÉON */
.tile.correct {
    background-color: rgba(0, 240, 255, 0.2) !important;
    border-color: var(--primary-blue) !important;
    color: var(--primary-blue) !important;
    text-shadow: 0 0 10px var(--primary-blue);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.5), inset 0 0 10px rgba(0, 240, 255, 0.2);
}

/* PRESENT (Mal placé) -> OR NÉON */
.tile.present {
    background-color: rgba(255, 189, 0, 0.1) !important;
    border-color: var(--neon-gold) !important;
    color: var(--neon-gold) !important;
    text-shadow: 0 0 10px var(--neon-gold);
    border-radius: 50%; /* Cercle */
    box-shadow: 0 0 15px rgba(255, 189, 0, 0.4);
}

/* ABSENT -> ÉTEINT */
.tile.absent {
    background-color: rgba(0,0,0,0.6) !important;
    border-color: #333 !important;
    color: #555 !important;
}


/* --- CLAVIER VIRTUEL --- */
.keyboard {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
    padding: 15px;
}
/* --- FIN DE PARTIE --- */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(10, 14, 22, 0.95);
    border: 2px solid var(--primary-blue);
    padding: 40px;
    text-align: center;
    max-width: 500px; width: 90%;
    box-shadow: 0 0 50px rgba(0, 240, 255, 0.2);
    position: relative;
}

.modal-content h2 {
    font-size: 2.5rem; margin-bottom: 20px;
}

.highlight-data {
    color: var(--primary-blue); font-weight: bold; font-size: 1.5rem;
    display: block; margin: 10px 0 30px 0;
    text-shadow: 0 0 10px var(--primary-blue);
}

.btn-zzz {
    background: var(--primary-blue); color: var(--bg-dark);
    border: none; padding: 15px 30px;
    font-family: 'Orbitron', sans-serif; font-weight: bold; font-size: 1.1rem;
    cursor: pointer; clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    transition: 0.3s;
}

.btn-zzz:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--primary-blue);
}

.cyber-divider {
    height: 2px; background: var(--primary-blue); width: 50%; margin: 20px auto;
    opacity: 0.5;
}


/* --- Animation Erreur (Shake) --- */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.shake {
    animation: shake 0.4s ease-in-out;
    border-color: var(--alert-red) !important;
    box-shadow: 0 0 10px var(--alert-red);
}

