/* Variables CSS pour le thème Le Labyrinthe */
:root {
    --primary-color: #00ff41;
    --secondary-color: #ff6b35;
    --dark-bg: #0a0a0a;
    --darker-bg: #050505;
    --metal-color: #2a2a2a;
    --wckd-blue: #1e3a8a;
    --danger-red: #dc2626;
    --text-light: #e5e5e5;
    --text-dim: #9ca3af;
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: var(--dark-bg);
    color: var(--text-light);
    overflow: hidden;
    height: 100vh;
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 10;
}

.screen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Écran de chargement */
#loading-screen {
    background: linear-gradient(45deg, var(--dark-bg), var(--darker-bg));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.loading-content {
    text-align: center;
    max-width: 600px;
}

.loading-content h1 {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.loading-bar {
    width: 400px;
    height: 6px;
    background: var(--metal-color);
    border-radius: 3px;
    overflow: hidden;
    margin: 2rem auto;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 20px var(--primary-color);
    animation: pulse 2s infinite;
}

/* Menu principal */
#main-menu {
    background: linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.9)),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M0 0h100v100H0z" fill="%23111"/><path d="M20 20h60v60H20z" fill="none" stroke="%23333" stroke-width="0.5"/></svg>');
    background-size: 50px 50px;
}

.menu-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0,255,65,0.1), transparent 70%);
    animation: pulse-bg 4s infinite;
}

.menu-content {
    text-align: center;
    z-index: 2;
}

.title {
    font-family: 'Orbitron', monospace;
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-shadow: 0 0 30px var(--primary-color);
}

.subtitle {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.dedication {
    color: var(--text-dim);
    font-style: italic;
    margin-bottom: 3rem;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.menu-btn {
    background: linear-gradient(45deg, var(--metal-color), #444);
    border: 2px solid var(--primary-color);
    color: var(--text-light);
    padding: 15px 40px;
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 300px;
}

.menu-btn:hover {
    background: linear-gradient(45deg, var(--primary-color), #00cc33);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,255,65,0.3);
}

.menu-btn span {
    position: relative;
    z-index: 2;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.menu-btn:hover::before {
    left: 100%;
}

/* Effet Glitch */
.glitch {
    position: relative;
    animation: glitch 2s infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.3s infinite;
    color: var(--danger-red);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.3s infinite;
    color: var(--wckd-blue);
    z-index: -2;
}

/* Écran de profil de Léandre */
#leandre-profile .profile-content {
    max-width: 800px;
    text-align: left;
    padding: 2rem;
}

.profile-card {
    background: linear-gradient(135deg, var(--metal-color), #333);
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.profile-info h3 {
    color: var(--primary-color);
    font-family: 'Orbitron', monospace;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.profile-info p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

/* Écran de jeu */
#game-screen {
    background: var(--darker-bg);
    padding: 0;
}

.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    padding: 1rem;
}

.ui-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Orbitron', monospace;
}

.player-info, .game-stats {
    display: flex;
    gap: 2rem;
}

.player-info span, .game-stats span {
    background: rgba(0,0,0,0.7);
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    font-size: 0.9rem;
}

#game-canvas {
    width: 100%;
    height: 100vh;
    display: block;
    background: var(--darker-bg);
}

/* Contrôles de jeu */
.game-controls {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    z-index: 21;
    display: flex;
    gap: 2rem;
}

.control-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 5px;
    width: 120px;
    height: 120px;
}

.control-pad #up { grid-area: 1 / 2; }
.control-pad #left { grid-area: 2 / 1; }
.control-pad #right { grid-area: 2 / 3; }
.control-pad #down { grid-area: 3 / 2; }

.control-btn {
    background: linear-gradient(145deg, #333, #222);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.control-btn:hover, .control-btn.active {
    background: var(--primary-color);
    color: var(--dark-bg);
    box-shadow: 0 0 15px var(--primary-color);
}

.special-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-btn {
    background: linear-gradient(145deg, var(--secondary-color), #cc5522);
    border: 2px solid var(--secondary-color);
    color: white;
    padding: 1rem;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 100px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,107,53,0.4);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Boutons génériques */
.back-btn {
    background: transparent;
    border: 2px solid var(--text-dim);
    color: var(--text-dim);
    padding: 10px 20px;
    font-family: 'Orbitron', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    top: 2rem;
    left: 2rem;
}

.back-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.game-back {
    position: fixed;
    z-index: 30;
}

/* Écran à propos */
.about-content {
    max-width: 800px;
    padding: 2rem;
    text-align: left;
}

.about-content h2 {
    font-family: 'Orbitron', monospace;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.about-content h3 {
    color: var(--secondary-color);
    margin: 1.5rem 0 1rem;
}

.about-content ul {
    margin-left: 2rem;
}

.about-content li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.credits {
    text-align: center;
    font-style: italic;
    color: var(--text-dim);
    margin-top: 2rem;
}

/* Écran de victoire */
.victory-content {
    text-align: center;
    max-width: 600px;
}

.victory-title {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

/* Animations */
@keyframes glitch {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-2px); }
    20% { transform: translateX(2px); }
    30% { transform: translateX(-1px); }
    40% { transform: translateX(1px); }
    50% { transform: translateX(-2px); }
    60% { transform: translateX(2px); }
    70% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
    90% { transform: translateX(-2px); }
}

@keyframes glitch-1 {
    0% { clip: rect(64px, 9999px, 66px, 0); }
    5% { clip: rect(30px, 9999px, 36px, 0); }
    10% { clip: rect(76px, 9999px, 78px, 0); }
    15% { clip: rect(40px, 9999px, 44px, 0); }
    20% { clip: rect(10px, 9999px, 15px, 0); }
    25% { clip: rect(70px, 9999px, 72px, 0); }
    30% { clip: rect(20px, 9999px, 25px, 0); }
    35% { clip: rect(60px, 9999px, 65px, 0); }
    40% { clip: rect(50px, 9999px, 55px, 0); }
    45% { clip: rect(30px, 9999px, 35px, 0); }
    50% { clip: rect(80px, 9999px, 85px, 0); }
    100% { clip: rect(0, 9999px, 0, 0); }
}

@keyframes glitch-2 {
    0% { clip: rect(65px, 9999px, 67px, 0); }
    5% { clip: rect(31px, 9999px, 37px, 0); }
    10% { clip: rect(77px, 9999px, 79px, 0); }
    15% { clip: rect(41px, 9999px, 45px, 0); }
    20% { clip: rect(11px, 9999px, 16px, 0); }
    25% { clip: rect(71px, 9999px, 73px, 0); }
    30% { clip: rect(21px, 9999px, 26px, 0); }
    35% { clip: rect(61px, 9999px, 66px, 0); }
    40% { clip: rect(51px, 9999px, 56px, 0); }
    45% { clip: rect(31px, 9999px, 36px, 0); }
    50% { clip: rect(81px, 9999px, 86px, 0); }
    100% { clip: rect(0, 9999px, 0, 0); }
}

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

@keyframes pulse-bg {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .title { font-size: 2.5rem; }
    .subtitle { font-size: 1.2rem; }
    .menu-btn { min-width: 250px; }
    
    .ui-top {
        flex-direction: column;
        gap: 1rem;
    }
    
    .game-controls {
        bottom: 1rem;
        right: 1rem;
    }
    
    .control-pad {
        width: 100px;
        height: 100px;
    }
    
    .about-content, .profile-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .title { font-size: 2rem; }
    .loading-content h1 { font-size: 2rem; }
    .loading-bar { width: 300px; }
    
    .game-controls {
        flex-direction: column;
        align-items: flex-end;
    }
}