/**
 * Stylesheet Retro Arcade & CRT Matrix pour Space Invaders 320x200
 */

:root {
    --color-matrix: #00ff41;
    --color-matrix-dim: #008f11;
    --color-matrix-glow: rgba(0, 255, 65, 0.4);
    --color-bg-dark: #020502;
    --color-bezel: #121812;
    --color-bezel-border: #1e2b1e;
    --color-text: #c0fec0;
    --font-mono: "Courier New", Courier, monospace;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg-dark);
    color: var(--color-text);
    font-family: var(--font-mono);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
    overflow-x: hidden;
    background-image: 
        radial-gradient(ellipse at 50% 20%, rgba(0, 255, 65, 0.08) 0%, rgba(2, 5, 2, 0.95) 70%),
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.15) 0px, rgba(0, 0, 0, 0.15) 1px, transparent 1px, transparent 2px);
}

/* En-tête arcade */
.arcade-header {
    text-align: center;
    margin-bottom: 16px;
}

.arcade-title {
    font-size: 1.6rem;
    color: var(--color-matrix);
    text-shadow: 0 0 8px var(--color-matrix-glow), 0 0 16px var(--color-matrix);
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.arcade-subtitle {
    font-size: 0.85rem;
    color: var(--color-matrix-dim);
    letter-spacing: 1px;
}

/* Boîtier moniteur CRT vintage */
.crt-monitor {
    position: relative;
    background: var(--color-bezel);
    padding: 24px 20px 20px 20px;
    border-radius: 18px;
    border: 3px solid var(--color-bezel-border);
    box-shadow: 
        0 0 30px rgba(0, 0, 0, 0.9),
        0 0 20px var(--color-matrix-glow),
        inset 0 0 15px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
}

.crt-bezel-top {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px 10px 8px;
    font-size: 0.75rem;
    color: var(--color-matrix-dim);
    text-transform: uppercase;
    border-bottom: 1px solid rgba(0, 255, 65, 0.15);
    margin-bottom: 12px;
}

.crt-badge {
    background: #000;
    color: var(--color-matrix);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--color-matrix-dim);
    font-weight: bold;
}

.crt-screen-wrap {
    position: relative;
    border: 4px solid #000;
    border-radius: 8px;
    overflow: hidden;
    background-color: #030803;
    box-shadow: 
        inset 0 0 25px rgba(0, 255, 65, 0.15),
        0 0 12px rgba(0, 0, 0, 0.8);
}

/* Canvas Space Invaders 320x200 */
.invaders-canvas {
    display: block;
    width: 640px;
    height: 400px;
    max-width: 92vw;
    height: auto;
    aspect-ratio: 320 / 200;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    background-color: #030803;
}

/* Lignes de balayage CRT (Scanlines) */
.crt-monitor.crt-scanlines .crt-screen-wrap::after {
    content: " ";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.35) 0px,
        rgba(0, 0, 0, 0.35) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 10;
}

/* Panneau de contrôle sous l'écran */
.crt-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
    width: 100%;
}

.retro-btn {
    background: #0b140b;
    color: var(--color-matrix);
    border: 1px solid var(--color-matrix-dim);
    padding: 8px 14px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.retro-btn:hover {
    background: #142814;
    border-color: var(--color-matrix);
    box-shadow: 0 0 10px var(--color-matrix-glow);
    transform: translateY(-1px);
}

.retro-btn:active {
    transform: translateY(1px);
}

.retro-btn.is-active {
    background: #00ff41;
    color: #030803;
    border-color: #00ff41;
    box-shadow: 0 0 12px var(--color-matrix);
}

.retro-btn.is-paused {
    background: #ffb000;
    color: #030803;
    border-color: #ffb000;
}

/* Panneau d'informations sur les boucliers QR Code */
.info-section {
    max-width: 680px;
    width: 100%;
    margin-top: 24px;
    background: #060c06;
    border: 1px solid var(--color-bezel-border);
    border-radius: 10px;
    padding: 16px 20px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.info-title {
    color: var(--color-matrix);
    font-size: 1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-shields-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.info-shield-pill {
    background: #0e1e0e;
    border: 1px solid var(--color-matrix-dim);
    color: var(--color-matrix);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: bold;
}

.info-help {
    color: #7d9b7d;
    font-size: 0.75rem;
    margin-top: 8px;
}

/* Pied de page et lien de retour */
.arcade-footer {
    margin-top: 20px;
    text-align: center;
}

.arcade-back-link {
    color: var(--color-matrix);
    text-decoration: none;
    font-size: 0.85rem;
    border-bottom: 1px dashed var(--color-matrix-dim);
    padding-bottom: 2px;
    transition: color 0.15s, border-color 0.15s;
}

.arcade-back-link:hover {
    color: #ffffff;
    border-color: #ffffff;
}

/* Responsive pour mobiles */
@media (max-width: 680px) {
    .crt-monitor {
        padding: 14px 10px 14px 10px;
        border-radius: 10px;
    }
    .retro-btn {
        font-size: 0.72rem;
        padding: 6px 10px;
    }
    .arcade-title {
        font-size: 1.25rem;
    }
}
