@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
    --arcade-bg: #000000;
    --arcade-yellow: #ffff00;
    --arcade-red: #ff0000;
    --arcade-cyan: #00ffff;
    --arcade-pink: #ffb8ff;
    --arcade-white: #ffffff;
    --arcade-orange: #ffb851;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: #000;
    color: var(--arcade-white);
    font-family: 'Press Start 2P', cursive;
    overflow: hidden;
}

/* CRT Screen Effect & Vignette */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.3) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 4px, 6px 100%;
    box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.9);
}

/* Conteneur Arcade Cabinet Frame */
.arcade-cabinet {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background: #000000;
    position: relative;
}

/* Arcade Top Header HUD (1UP - HIGH SCORE - 2UP) */
.arcade-header-hud {
    position: absolute;
    top: 15px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 50;
    padding: 0 40px;
}

.hud-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.hud-label-red {
    color: var(--arcade-red);
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.hud-label-white {
    color: var(--arcade-white);
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.hud-val-white {
    color: var(--arcade-white);
    font-size: 1.2rem;
    letter-spacing: 2px;
}

/* Arcade Canvas Display Area */
canvas { 
    position: absolute; 
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.menu {
    width: 100vw;
    height: 100vh;
    display: none;
    position: relative;
}

/* Menu Démarrage Arcade */
#menu-start {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 35px;
    z-index: 30;
    background: #000;
}

.arcade-title-marquee {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.arcade-logo {
    font-size: calc(2.5rem + 2.5vw);
    color: var(--arcade-yellow);
    text-shadow: 4px 4px 0px var(--arcade-red), -2px -2px 0px var(--arcade-cyan);
    letter-spacing: 8px;
    text-align: center;
}

.arcade-subtitle {
    color: var(--arcade-pink);
    font-size: 0.9rem;
    letter-spacing: 3px;
}

#menu-start-btns {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.parent { 
    padding: 15px 30px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.1s ease;
}

.parent h2 {
    font-size: 1.3rem;
    color: var(--arcade-white);
    letter-spacing: 3px;
}

.parent.active {  
    border-color: var(--arcade-yellow);
    background: rgba(255, 255, 0, 0.1);
}

.parent.active h2 {
    color: var(--arcade-yellow);
    animation: arcadeFlash 0.6s infinite alternate;
}

@keyframes arcadeFlash {
    0% { opacity: 1; }
    100% { opacity: 0.3; }
}

.blink-text {
    animation: arcadeBlink 1s infinite steps(1);
}

@keyframes arcadeBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Arcade Bottom HUD (Lives & Credit) */
.arcade-bottom-hud {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 50;
}

#container-life {
    display: flex;
    gap: 12px;
    align-items: center;
}

#container-life img {
    height: 28px;
    width: 28px;
    object-fit: contain;
    filter: invert(1);
    transition: opacity 0.3s ease;
}

.arcade-credit {
    color: var(--arcade-white);
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.text-mask-indic {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.2rem;
    font-weight: bold;
    color: var(--arcade-yellow);
    text-align: center; 
    z-index: 60;
    font-family: 'Press Start 2P', cursive;
    pointer-events: none;
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(255, 255, 0, 0.6);
}

/* Overlay Game Over & Pause Arcade */
.arcade-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: 4px solid var(--arcade-red);
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 100;
    box-shadow: 0 0 30px var(--arcade-red);
}

.arcade-modal-cyan {
    border-color: var(--arcade-cyan);
    box-shadow: 0 0 30px var(--arcade-cyan);
}

.arcade-modal h1 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    letter-spacing: 4px;
}

.arcade-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    padding: 14px 28px;
    background: var(--arcade-yellow);
    color: #000;
    border: none;
    cursor: pointer;
    margin-top: 20px;
    letter-spacing: 2px;
}

.arcade-btn:hover {
    background: var(--arcade-white);
    box-shadow: 0 0 15px var(--arcade-white);
}

/* Keyboard Game Over Arcade */
#game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: 4px solid var(--arcade-yellow);
    padding: 30px 20px;
    z-index: 100;
    box-shadow: 0 0 30px var(--arcade-yellow);
}

#name-display {
    font-size: 1.8rem;
    color: var(--arcade-yellow);
    background: #000;
    border: 2px solid var(--arcade-white);
    padding: 10px;
    margin: 15px 0;
    letter-spacing: 6px;
    text-align: center;
}

#virtual-keyboard {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 6px;
    margin-top: 15px;
}

.key {
    font-size: 0.75rem;
    background: #111;
    border: 1px solid #444;
    color: white;
    padding: 10px 4px;
    text-align: center;
    cursor: pointer;
}

.key.selected {
    background: var(--arcade-yellow);
    color: black;
    box-shadow: 0 0 10px var(--arcade-yellow);
}

/* Score Menu Arcade */
#menu-score {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 650px;
    z-index: 100;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.score-container {
    width: 100%;
    border: 4px solid var(--arcade-cyan);
    padding: 30px;
    background: rgba(0, 0, 0, 0.95);
    box-shadow: 0 0 35px var(--arcade-cyan);
    border-radius: 12px;
}

.score-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.score-list li {
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    color: var(--arcade-yellow);
    border-bottom: 1px dashed #333;
    padding-bottom: 6px;
}

.score-list li span {
    color: var(--arcade-cyan);
}