/**
 * JEU ARCADE - Arcade Museum Styles
 * Design rétro années 80-90 avec effets néon et CRT
 */

:root {
    /* Couleurs néon arcade */
    --neon-cyan: #00f3ff;
    --neon-magenta: #ff006e;
    --neon-yellow: #ffea00;
    --neon-green: #00ff41;
    --neon-purple: #b967ff;
    --neon-orange: #ff9500;
    
    /* Couleurs de base */
    --bg-dark: #0a0e27;
    --bg-darker: #050818;
    --grid-color: rgba(0, 243, 255, 0.15);
    --text-glow: 0 0 10px currentColor;
    
    /* Transitions */
    --transition-fast: all 0.2s ease;
    --transition-slow: all 0.5s ease;
}

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

body {
    font-family: 'Orbitron', 'Press Start 2P', monospace;
    background-color: var(--bg-darker);
    color: var(--neon-cyan);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ==================== BACKGROUND EFFECTS ==================== */

/* Animated grid background */
.arcade-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        linear-gradient(180deg, var(--bg-darker) 0%, var(--bg-dark) 50%, var(--bg-darker) 100%);
    overflow: hidden;
}

/* Grid overlay effect */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    perspective: 1000px;
    transform: rotateX(60deg);
    transform-origin: center top;
}

@keyframes gridMove {
    0% { background-position: 0 0; }
    100% { background-position: 0 50px; }
}

/* Animated stars */
.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, var(--neon-cyan), transparent),
        radial-gradient(1px 1px at 50% 50%, var(--neon-magenta), transparent),
        radial-gradient(1px 1px at 80% 10%, var(--neon-yellow), transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent);
    background-size: 200% 200%;
    animation: starsMove 60s linear infinite;
}

@keyframes starsMove {
    0% { background-position: 0 0, 40% 60%, 130% 270%, 70% 100%, 0% 0%; }
    100% { background-position: 0% 100%, 50% 70%, 140% 280%, 80% 110%, 10% 10%; }
}

/* CRT scan lines effect */
.scan-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        transparent 1px,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 3px
    );
    pointer-events: none;
    animation: scanlineMove 8s linear infinite;
}

@keyframes scanlineMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

/* ==================== NEON TEXT EFFECTS ==================== */

.neon-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 2rem;
    color: var(--neon-cyan);
    text-shadow: 
        0 0 5px var(--neon-cyan),
        0 0 10px var(--neon-cyan),
        0 0 20px var(--neon-cyan),
        0 0 40px var(--neon-magenta),
        0 0 80px var(--neon-magenta);
    animation: neonPulse 2s ease-in-out infinite alternate;
    letter-spacing: 0.1em;
}

@keyframes neonPulse {
    from {
        text-shadow: 
            0 0 5px var(--neon-cyan),
            0 0 10px var(--neon-cyan),
            0 0 20px var(--neon-cyan),
            0 0 40px var(--neon-magenta),
            0 0 80px var(--neon-magenta);
    }
    to {
        text-shadow: 
            0 0 10px var(--neon-cyan),
            0 0 20px var(--neon-cyan),
            0 0 30px var(--neon-cyan),
            0 0 50px var(--neon-magenta),
            0 0 100px var(--neon-magenta);
    }
}

/* Glitch effect */
.glitch {
    position: relative;
}

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

.glitch::before {
    color: var(--neon-magenta);
    animation: glitchTop 3s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch::after {
    color: var(--neon-cyan);
    animation: glitchBottom 2.5s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitchTop {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(-5px, -2px); }
    94% { transform: translate(5px, 2px); }
    96% { transform: translate(-3px, 1px); }
    98% { transform: translate(3px, -1px); }
}

@keyframes glitchBottom {
    0%, 88%, 100% { transform: translate(0); }
    90% { transform: translate(3px, 2px); }
    92% { transform: translate(-3px, -2px); }
    94% { transform: translate(2px, 1px); }
    96% { transform: translate(-2px, -1px); }
}

/* ==================== ARCADE TITLE ==================== */

.arcade-title {
    text-align: center;
    padding: 40px 20px 20px;
    position: relative;
    z-index: 10;
}

.arcade-title h1 {
    margin-bottom: 15px;
    font-size: clamp(1rem, 4vw, 2.5rem);
}

.subtitle {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.5rem, 2vw, 0.8rem);
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
    animation: blink 1.5s infinite;
    letter-spacing: 0.2em;
}

/* ==================== MAIN ARCADE CONTAINER ==================== */

.arcade-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    min-height: 100vh;
    position: relative;
}

/* ==================== GAME CONTAINER ==================== */

.game-container {
    position: relative;
    width: 880px;
    max-width: 95vw;
    margin: 20px auto;
    background: rgba(10, 14, 39, 0.7);
    border: 3px solid var(--neon-cyan);
    border-radius: 20px;
    box-shadow: 
        0 0 20px var(--neon-cyan),
        0 0 40px rgba(0, 243, 255, 0.5),
        inset 0 0 30px rgba(0, 243, 255, 0.1);
    padding: 20px;
    backdrop-filter: blur(10px);
}

/* LED Indicators */
.led-bar {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(5, 8, 24, 0.95);
    padding: 8px 25px;
    border-radius: 15px;
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.5);
    z-index: 100;
}

.led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.led-red {
    background: #ff0040;
    color: #ff0040;
}

.led-yellow {
    background: #ffea00;
    color: #ffea00;
}

.led-green {
    background: #00ff41;
    color: #00ff41;
}

.led-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 5px var(--neon-cyan);
    letter-spacing: 0.1em;
}

/* LED animations */
.pulse {
    animation: ledPulse 1s infinite;
}

.pulse-slow {
    animation: ledPulse 2s infinite;
}

.blink {
    animation: blink 0.5s infinite;
}

@keyframes ledPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

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

/* ==================== CONSOLE ==================== */

.game-console {
    position: relative;
    width: 100%;
    height: auto;
    margin-top: 20px;
}

.console-bg {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    filter: none;
}

/* Console glow effect */
.console-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    background: radial-gradient(
        ellipse at center,
        rgba(0, 243, 255, 0.2) 0%,
        rgba(255, 0, 110, 0.1) 50%,
        transparent 70%
    );
    pointer-events: none;
    z-index: -1;
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

/* Retro corner decorations */
.corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid var(--neon-magenta);
    z-index: 10;
    box-shadow: 0 0 10px var(--neon-magenta);
}

.corner-tl {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
}

.corner-tr {
    top: 10px;
    right: 10px;
    border-left: none;
    border-bottom: none;
}

.corner-bl {
    bottom: 10px;
    left: 10px;
    border-right: none;
    border-top: none;
}

.corner-br {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
}

/* ==================== CONTROL BUTTONS ==================== */

.game-controls {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1000;
    display: block;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}

.controls-divider {
    width: 2px;
    height: 30px;
    background: linear-gradient(
        to bottom,
        transparent,
        var(--neon-yellow),
        transparent
    );
    box-shadow: 0 0 5px var(--neon-yellow);
}

.arcade-btn {
    background: linear-gradient(
        145deg,
        rgba(255, 234, 0, 0.2),
        rgba(5, 8, 24, 0.8)
    );
    border: 2px solid var(--neon-yellow);
    color: var(--neon-yellow);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: var(--transition-fast);
    box-shadow: 
        0 0 10px rgba(255, 234, 0, 0.3),
        inset 0 0 5px rgba(255, 234, 0, 0.1);
    text-shadow: 0 0 5px currentColor;
}

.arcade-btn:hover {
    background: linear-gradient(
        145deg,
        rgba(255, 234, 0, 0.4),
        rgba(5, 8, 24, 0.9)
    );
    transform: translateY(-2px);
    box-shadow: 
        0 0 20px rgba(255, 234, 0, 0.6),
        inset 0 0 10px rgba(255, 234, 0, 0.2);
}

.arcade-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 0 10px rgba(255, 234, 0, 0.4),
        inset 0 0 15px rgba(255, 234, 0, 0.3);
}

.btn-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.btn-text {
    font-size: 0.5rem;
    letter-spacing: 0.1em;
}

.btn-reduce {
    border-color: var(--neon-green);
    color: var(--neon-green);
}

.btn-reduce:hover {
    box-shadow: 
        0 0 20px rgba(0, 255, 65, 0.6),
        inset 0 0 10px rgba(0, 255, 65, 0.2);
}

.btn-close {
    border-color: var(--neon-magenta);
    color: var(--neon-magenta);
}

.btn-close:hover {
    box-shadow: 
        0 0 20px rgba(255, 0, 110, 0.6),
        inset 0 0 10px rgba(255, 0, 110, 0.2);
}

/* ==================== GAME CONTENT ==================== */

.game-content {
    position: absolute;
    left: 106px;
    top: 18px;
    width: 0;
    height: 0;
    border-radius: 0;
    overflow: hidden;
}

.game-content iframe {
    border: none;
    background-color: #000;
    display: block;
    box-shadow: none;
}

/* CRT overlay effect */
.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        transparent 1px,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 3px
    );
    pointer-events: none;
    z-index: 10;
    animation: crtFlicker 0.15s infinite;
}

@keyframes crtFlicker {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.95; }
}

/* ==================== ARCADE SCORE DISPLAY ==================== */

.arcade-score {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
    background: rgba(5, 8, 24, 0.95);
    padding: 12px 25px;
    border-radius: 12px;
    border: 2px solid var(--neon-orange);
    box-shadow: 
        0 0 15px rgba(255, 149, 0, 0.5),
        inset 0 0 10px rgba(255, 149, 0, 0.1);
}

.score-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.score-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem;
    color: var(--neon-orange);
    text-shadow: 0 0 5px var(--neon-orange);
    letter-spacing: 0.1em;
}

.score-value {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
}

.digital {
    font-family: 'Orbitron', monospace;
    letter-spacing: 0.15em;
}

/* ==================== COIN SLOT ==================== */

.coin-slot {
    margin-top: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(5, 8, 24, 0.9);
    padding: 15px 30px;
    border-radius: 15px;
    border: 3px solid var(--neon-yellow);
    box-shadow: 
        0 0 20px rgba(255, 234, 0, 0.5),
        inset 0 0 15px rgba(255, 234, 0, 0.1);
}

.coin-icon {
    font-size: 2rem;
    animation: coinFlip 2s infinite;
}

@keyframes coinFlip {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

.coin-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8rem;
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
    letter-spacing: 0.1em;
    animation: blink 1s infinite;
}

/* ==================== GAME OVER SCREEN ==================== */

.game-over-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-over-screen {
    text-align: center;
    max-width: 900px;
}

.game-over-title {
    font-size: clamp(2rem, 6vw, 4rem);
    margin-bottom: 30px;
    color: var(--neon-magenta);
    text-shadow: 
        0 0 10px var(--neon-magenta),
        0 0 20px var(--neon-magenta),
        0 0 40px var(--neon-magenta),
        0 0 80px var(--neon-cyan);
}

.game-over-message {
    margin-bottom: 40px;
}

.game-over-message p {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
    margin: 10px 0;
}

.mt-2 {
    margin-top: 20px;
}

.game-over-console {
    opacity: 0.3;
    filter: grayscale(100%);
}

.offline-console {
    max-width: 100%;
    height: auto;
    border: 3px solid var(--neon-magenta);
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(255, 0, 110, 0.5);
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 968px) {
    .game-container {
        width: 100%;
        max-width: 880px;
    }
    
    .game-content {
        left: 12.05%;
        top: 2.71%;
    }
    
    .game-content iframe,
    .crt-overlay {
        width: 77.27%;
        height: auto;
        aspect-ratio: 680 / 390;
    }
    
    .game-controls {
        left: 5.68%;
    }
}

@media (max-width: 640px) {
    .arcade-title h1 {
        font-size: 1rem;
    }
    
    .subtitle {
        font-size: 0.5rem;
    }
    
    .game-container {
        padding: 15px;
    }
    
    .led-bar {
        transform: translateX(-50%) scale(0.8);
    }
    
    .game-controls {
        left: 10px;
        top: 10px;
        padding: 8px 12px;
        gap: 8px;
    }
    
    .arcade-btn {
        padding: 8px 12px;
        font-size: 0.5rem;
    }
    
    .btn-icon {
        font-size: 1rem;
    }
    
    .btn-text {
        font-size: 0.4rem;
    }
    
    .game-content {
        left: 10px;
        top: 60px;
        width: calc(100% - 20px);
    }
    
    .game-content iframe,
    .crt-overlay {
        width: 100%;
        height: 300px;
    }
    
    .arcade-score {
        position: static;
        transform: none;
        margin-top: 20px;
        gap: 20px;
        padding: 10px 20px;
    }
    
    .score-value {
        font-size: 1rem;
    }
    
    .coin-slot {
        margin-top: 20px;
        padding: 12px 25px;
    }
    
    .coin-icon {
        font-size: 1.5rem;
    }
    
    .coin-text {
        font-size: 0.6rem;
    }
}

/* ==================== REDUCED STATE ==================== */

.game-container.reduced .game-content {
    display: none;
}

.game-container.reduced .console-bg {
    opacity: 0.3;
    filter: grayscale(100%);
}

.game-container.reduced .console-glow {
    animation: none;
    opacity: 0.2;
}

/* ==================== ACCESSIBILITY ==================== */

.arcade-btn:focus {
    outline: 3px solid var(--neon-cyan);
    outline-offset: 4px;
}

/* ==================== PRINT STYLES ==================== */

@media print {
    .arcade-bg,
    .game-controls,
    .coin-slot,
    .led-bar {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .game-container {
        border: 2px solid black;
        box-shadow: none;
    }
}


/* ============================================================
   POPUP INTERNE — Modal overlay + borne arcade
   Popup 700×700px, borne portrait 1023×1537 → 466×700px
   Écran mesuré pixel à pixel :
     left 10.17%  top 4.42%  width 79.18%  height 47.63%
   ============================================================ */

/* Empêche le scroll de la page derrière la modal */
body.modal-open {
    overflow: hidden !important;
}

/* ── Éléments cachés dans la modal ── */
.arcade-modal .led-bar,
.arcade-modal .btn-reduce,
.arcade-modal .controls-divider,
.arcade-modal .minimize,
.arcade-modal .minimise,
.arcade-modal .arcade-score,
.arcade-modal .coin-slot,
.arcade-modal .arcade-title,
.arcade-modal .console-glow,
.arcade-modal .corner {
    display: none !important;
}

/* ── Overlay plein écran ── */
.arcade-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    align-items: center;
    justify-content: center;
}

.arcade-modal.arcade-modal--open {
    display: flex;
}

/* Fond sombre semi-transparent */
.arcade-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    cursor: pointer;
}

/* Boîte de la popup : 700×700px, centrée */
.arcade-modal__box {
    position: relative;
    width: 700px;
    height: 700px;
    z-index: 9001;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Animation d'entrée */
    animation: modalDrop 0.25s ease-out;
}

@keyframes modalDrop {
    from { opacity: 0; transform: scale(0.88) translateY(-30px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);     }
}

/* ── Conteneur interne ── */
.arcade-modal .game-container {
    position: relative !important;
    width: auto !important;
    height: 700px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    cursor: default;
}

/* ── Borne : ratio exact 1023/1537, hauteur 700px ── */
.arcade-modal .game-console {
    position: relative !important;
    height: 700px !important;
    width: auto !important;
    aspect-ratio: 1023 / 1537 !important;
    margin: 0 !important;
    margin-top: 0 !important;
}

/* ── Image de la borne (couleurs préservées) ── */
.arcade-modal .console-bg {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    border-radius: 0 !important;
    filter: none !important;
}

/* ── Bouton fermeture ── */
.arcade-modal .game-controls {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    z-index: 9100 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.arcade-modal .arcade-close-btn {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    z-index: 9200 !important;
    width: 26px !important;
    height: 26px !important;
    border: 2px solid #fff !important;
    border-radius: 4px !important;
    background: #cc0000 !important;
    color: #fff !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 20px !important;
    line-height: 22px !important;
    font-weight: 900 !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    box-shadow: 0 0 8px rgba(255, 0, 0, .8) !important;
    text-align: center !important;
    text-shadow: none !important;
}

.arcade-modal .arcade-close-btn:hover {
    background: #ff2020 !important;
    transform: none !important;
}

/* ── Écran / iframe ──
   Mesures pixel à pixel sur https://www.jmpil.com/gp3/gp3/arcade_new.png (1023×1537) :
     x: 104→914 (810px) → left 10.17%  width 79.18%
     y:  68→800 (732px) → top   4.42%  height 47.63%
   À 700px de haut → écran ≈ 369×333px                 */
.arcade-modal .game-content {
    position: absolute !important;
    left:   10.17% !important;
    top:     4.42% !important;
    width:  79.18% !important;
    height: 47.63% !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    z-index: 9050 !important;
    background: #000 !important;
}

.arcade-modal .game-content iframe {
    width:  100% !important;
    height: 100% !important;
    border: 0 !important;
    display: block !important;
    background: #000 !important;
}

/* Overlay CRT sur l'écran */
.arcade-modal .crt-overlay {
    position: absolute !important;
    inset: 0 !important;
    width:  100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 9060 !important;
}

/* ── Launcher : aperçu de la borne cliquable ── */
.game-container--launcher {
    cursor: pointer;
    transition: transform 0.15s ease;
}

.game-container--launcher:hover {
    transform: scale(1.02);
}

/* Bouton INSERT COIN stylé */
.arcade-launch-btn {
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.8rem !important;
    color: var(--neon-yellow) !important;
    text-shadow: 0 0 10px var(--neon-yellow) !important;
    letter-spacing: 0.1em !important;
    animation: blink 1s infinite !important;
    padding: 0 !important;
}

.arcade-launch-btn:hover {
    color: #fff !important;
    text-shadow: 0 0 20px var(--neon-yellow) !important;
    animation: none !important;
}

/* ── Ancien bloc COPY FIX (page normale, hors modal) ── */
.led-bar,
.btn-reduce,
.controls-divider,
.minimize,
.minimise {
    display: none !important;
}



/* ============================================================
   CSS RESTORED FINAL PATCH
   Base = CSS complet original restauré.
   Patch = machine arcade, insert coin écran, scores connectés, myprofilebubble.
   ============================================================ */

.led-bar,
.btn-reduce,
.controls-divider,
.minimize,
.minimise,
.arcade-real-panel {
    display: none !important;
}

.arcade-container {
    padding: 8px !important;
}

.arcade-title {
    padding: 8px 10px 5px !important;
}

.arcade-title h1 {
    font-size: clamp(.8rem, 3vw, 1.35rem) !important;
}

.subtitle,
.arcade-score,
.coin-slot,
.console-glow,
.corner {
    display: none !important;
}

.game-container {
    position: relative !important;
    width: min(96vw, 780px) !important;
    max-width: 780px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

.game-console {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 1024 / 1536 !important;
    margin: 0 auto !important;
}

.console-bg {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    border-radius: 0 !important;
    filter: drop-shadow(0 0 22px rgba(0,243,255,.23)) !important;
}

.game-controls {
    position: absolute !important;
    top: 18px !important;
    right: 18px !important;
    left: auto !important;
    z-index: 5000 !important;
    display: block !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.arcade-close-btn {
    width: 38px !important;
    height: 38px !important;
    border: 2px solid #fff !important;
    border-radius: 7px !important;
    background: #e00000 !important;
    color: #fff !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 30px !important;
    line-height: 30px !important;
    font-weight: 900 !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    box-shadow: 0 0 12px rgba(255,0,0,.85) !important;
    text-align: center !important;
    text-shadow: none !important;
}

.game-content {
    position: absolute !important;
    left: 10.74% !important;
    top: 7.29% !important;
    width: 78.71% !important;
    height: 56.32% !important;
    overflow: hidden !important;
    border-radius: 2px !important;
    z-index: 20 !important;
    background: #000 !important;
}

.game-content iframe {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    border: 0 !important;
    display: block !important;
    background: #000 !important;
}

.crt-overlay {
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 25 !important;
}

/* Insert coin dans l'écran */
.arcade-screen-menu {
    position: absolute;
    inset: 0;
    z-index: 80;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 16px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 35%, rgba(0,243,255,.18), transparent 45%),
        linear-gradient(180deg, rgba(0,0,0,.92), rgba(5,8,24,.96));
    color: var(--neon-cyan);
    font-family: 'Press Start 2P', monospace;
    transition: opacity .25s ease, transform .25s ease;
}

.arcade-screen-menu.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.04);
}

.screen-title {
    font-size: clamp(.8rem, 2vw, 1.3rem);
    color: var(--neon-yellow);
    text-shadow: 0 0 12px var(--neon-yellow);
    letter-spacing: .08em;
}

.screen-subtitle,
.screen-credit-line,
.screen-status-line {
    font-size: clamp(.45rem, 1.1vw, .65rem);
    color: var(--neon-cyan);
    text-shadow: 0 0 8px var(--neon-cyan);
    letter-spacing: .06em;
}

.screen-game-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    width: min(92%, 340px);
    margin: 5px auto;
}

.screen-game-btn {
    border: 1px solid var(--neon-cyan);
    border-radius: 7px;
    background: rgba(0,243,255,.08);
    color: var(--neon-cyan);
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(.42rem, 1vw, .58rem);
    padding: 8px 5px;
    cursor: pointer;
    text-shadow: 0 0 7px var(--neon-cyan);
    box-shadow: inset 0 0 8px rgba(0,243,255,.12);
}

.screen-game-btn.active,
.screen-game-btn:hover {
    border-color: var(--neon-yellow);
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
    box-shadow: 0 0 12px rgba(255,234,0,.35), inset 0 0 8px rgba(255,234,0,.12);
}

.screen-insert-coin {
    margin-top: 4px;
    border: 2px solid var(--neon-yellow);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(255,234,0,.22), rgba(5,8,24,.88));
    color: var(--neon-yellow);
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(.58rem, 1.25vw, .78rem);
    padding: 10px 18px;
    cursor: pointer;
    text-shadow: 0 0 12px var(--neon-yellow);
    box-shadow: 0 0 18px rgba(255,234,0,.45), inset 0 0 10px rgba(255,234,0,.12);
    animation: blink 1.2s infinite;
}

.screen-insert-coin:hover {
    color: #fff;
    animation: none;
}

.screen-insert-coin:disabled {
    opacity: .6;
    cursor: wait;
}

.screen-status-line.ready {
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
}

/* Scores connectés */
.screen-score-box {
    margin-top: 4px;
    padding: 6px 8px;
    border: 1px solid rgba(0,243,255,.45);
    border-radius: 8px;
    background: rgba(0,0,0,.35);
    color: var(--neon-cyan);
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(.38rem, .9vw, .54rem);
    line-height: 1.55;
    text-shadow: 0 0 7px var(--neon-cyan);
}

.screen-score-box .score-connected {
    color: var(--neon-green);
    text-shadow: 0 0 8px var(--neon-green);
}

.screen-score-box .score-guest {
    color: var(--neon-magenta);
    text-shadow: 0 0 8px var(--neon-magenta);
}

.screen-score-save {
    margin-top: 5px;
    border: 1px solid var(--neon-green);
    border-radius: 7px;
    background: rgba(0,255,65,.10);
    color: var(--neon-green);
    font-family: 'Press Start 2P', monospace;
    font-size: .48rem;
    padding: 5px 8px;
    cursor: pointer;
    text-shadow: 0 0 7px var(--neon-green);
}

.arcade-connected-scoreboard {
    width: min(96vw, 780px);
    margin: 8px auto 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
    padding: 9px 14px;
    border: 1px solid rgba(0,243,255,.35);
    border-radius: 12px;
    background: rgba(5,8,24,.86);
    color: var(--neon-cyan);
    font-family: 'Press Start 2P', monospace;
    font-size: .58rem;
    text-shadow: 0 0 8px var(--neon-cyan);
}

.arcade-connected-scoreboard b {
    color: var(--neon-yellow);
    text-shadow: 0 0 8px var(--neon-yellow);
}

/* myprofilebubble haut gauche */
#mpbFrame {
    position: fixed !important;
    top: 14px !important;
    left: 14px !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 9300 !important;
}

#mpb-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 50% 40%, rgba(0,243,255,.12), transparent 42%),
        rgba(2,6,23,.48);
    z-index: 9100;
    display: none;
    backdrop-filter: blur(2px);
}

#myprofilebubble:not([aria-hidden="true"]) #mpb-overlay {
    display: block;
}

/* Par défaut : popup ovale / miroir.
   Pour rectangle : mettre class="mpb-shape-rect" sur #myprofilebubble
   ou appeler arcade/index.php?mpb_shape=rect. */
#mpb-dialog {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: min(500px, calc(100vw - 24px));
    height: min(600px, calc(100vh - 92px));
    max-height: calc(100vh - 92px);
    background:
        radial-gradient(ellipse at 50% 12%, rgba(255,255,255,.98) 0%, rgba(255,255,255,.82) 22%, rgba(235,245,255,.88) 58%, rgba(214,230,255,.94) 100%);
    border: 2px solid rgba(255,255,255,.92);
    border-radius: 50% / 46%;
    box-shadow:
        0 34px 100px rgba(0,0,0,.42),
        0 0 42px rgba(0,243,255,.25),
        inset 0 5px 26px rgba(255,255,255,.90),
        inset 0 -30px 60px rgba(59,130,246,.10);
    overflow: hidden;
    z-index: 9200;
    display: none;
    flex-direction: column;
}

#mpb-dialog::before {
    content: '';
    position: absolute;
    inset: 9px 18px 18px;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,.72), rgba(255,255,255,0) 36%, rgba(0,243,255,.12) 100%);
    z-index: 0;
}

#mpb-dialog > * {
    position: relative;
    z-index: 1;
}

#myprofilebubble:not([aria-hidden="true"]) #mpb-dialog {
    display: flex;
}

#mpb-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 62px;
    padding: 18px 72px 8px;
    background: linear-gradient(180deg, rgba(255,255,255,.56), rgba(255,255,255,.16));
    border-bottom: 0;
    cursor: move;
    user-select: none;
    flex: 0 0 auto;
}

#mpb-title {
    font-weight: 800;
    font-size: 15px;
    color: #0f172a;
    text-align: center;
    text-shadow: 0 1px 0 rgba(255,255,255,.65);
}

.mpb-head-btns {
    position: absolute;
    top: 16px;
    right: 58px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.mpb-head-btns button {
    appearance: none;
    border: 1px solid rgba(255,255,255,.72);
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(226,232,240,.72);
    color: #0f172a;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 16px rgba(15,23,42,.12);
}

.mpb-head-btns button:hover {
    background: rgba(255,255,255,.92);
}

#mpb-body {
    flex: 1;
    overflow: hidden;
    padding: 0 54px 48px;
    background: transparent !important;
}

#myprofilebubbleinfo {
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 9300;
    border-radius: inherit;
    overflow: hidden;
    display: none;
}

#myprofilebubbleinfo.mpbinfo-open {
    display: block;
}

/* Mode rectangle conservé pour debug/compatibilité */
#myprofilebubble.mpb-shape-rect #mpb-dialog {
    width: min(420px, calc(100vw - 24px));
    height: auto;
    max-height: calc(100vh - 40px);
    border-radius: 22px;
    background: linear-gradient(180deg,#fff,#f7fbff);
    border: 1px solid rgba(148,163,184,.45);
    box-shadow: 0 28px 80px rgba(15,23,42,.30);
}

#myprofilebubble.mpb-shape-rect #mpb-dialog::before {
    display: none;
}

#myprofilebubble.mpb-shape-rect #mpb-handle {
    justify-content: space-between;
    min-height: 0;
    padding: 12px 14px;
    background: linear-gradient(135deg,rgba(22,163,74,.10),rgba(59,130,246,.08));
    border-bottom: 1px solid rgba(148,163,184,.28);
}

#myprofilebubble.mpb-shape-rect .mpb-head-btns {
    position: static;
}

#myprofilebubble.mpb-shape-rect .mpb-head-btns button {
    border: 0;
    border-radius: 10px;
    background: #e2e8f0;
    box-shadow: none;
}

#myprofilebubble.mpb-shape-rect #mpb-body {
    padding: 0;
}

@media (max-width:640px) {
    .arcade-container {
        padding: 0 !important;
    }

    .game-container {
        width: 100vw !important;
        max-width: 100vw !important;
    }

    .game-controls {
        top: 10px !important;
        right: 10px !important;
    }

    .arcade-close-btn {
        width: 34px !important;
        height: 34px !important;
        font-size: 26px !important;
        line-height: 26px !important;
    }

    .arcade-screen-menu {
        gap: 5px;
        padding: 9px;
    }

    .screen-game-list {
        gap: 5px;
        width: 96%;
    }

    .screen-game-btn {
        padding: 7px 4px;
    }

    .screen-insert-coin {
        padding: 8px 12px;
    }
}

/* ============================================================
   MYPROFILEBUBBLE LOGIN BRIDGE — arcade/index.php
   Conforme à helplogin.php : iframe nommée + POST caché.
   ============================================================ */
.mpb-floating-btn {
    position: fixed !important;
    top: 14px !important;
    left: 14px !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 9300 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 42px !important;
    padding: 7px 12px !important;
    border: 2px solid var(--neon-cyan) !important;
    border-radius: 999px !important;
    background: rgba(5, 8, 24, .92) !important;
    color: var(--neon-cyan) !important;
    font-family: 'Orbitron', monospace !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    cursor: pointer !important;
    box-shadow: 0 0 16px rgba(0, 243, 255, .55), inset 0 0 10px rgba(0, 243, 255, .10) !important;
    text-shadow: 0 0 8px var(--neon-cyan) !important;
}

.mpb-floating-btn:hover {
    color: var(--neon-yellow) !important;
    border-color: var(--neon-yellow) !important;
    box-shadow: 0 0 18px rgba(255, 234, 0, .55), inset 0 0 10px rgba(255, 234, 0, .12) !important;
}

.mpb-avatar-dot {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: radial-gradient(circle, rgba(0, 243, 255, .32), rgba(0, 0, 0, .15)) !important;
    border: 1px solid currentColor !important;
    font-size: 10px !important;
}

.mpb-user-id {
    letter-spacing: .08em !important;
}

#myprofilebubble[aria-hidden="true"] #mpb-overlay,
#myprofilebubble[aria-hidden="true"] #mpb-dialog {
    display: none !important;
}

#myprofilebubble:not([aria-hidden="true"]) #mpb-overlay {
    display: block !important;
}

#myprofilebubble:not([aria-hidden="true"]) #mpb-dialog {
    display: flex !important;
}

#mpb-body {
    min-height: 0 !important;
}

#mpb-main-frame {
    width: 100% !important;
    height: 100% !important;
    min-height: 470px !important;
    border: 0 !important;
    display: block !important;
    background: transparent !important;
    border-radius: 32px !important;
}

#myprofilebubble.mpb-shape-rect #mpb-body {
    min-height: 520px !important;
    background: #fff !important;
}

#myprofilebubble.mpb-shape-rect #mpb-main-frame {
    height: 520px !important;
    background: #fff !important;
    border-radius: 0 !important;
}

#mpb-refresh {
    font-size: 18px !important;
}

@media (max-width: 640px) {
    .mpb-floating-btn {
        top: 8px !important;
        left: 8px !important;
        min-height: 38px !important;
        padding: 6px 9px !important;
        font-size: 10px !important;
    }

    #mpb-dialog {
        top: 58px !important;
        width: calc(100vw - 16px) !important;
        height: calc(100vh - 70px) !important;
        max-height: calc(100vh - 70px) !important;
        border-radius: 34% / 28% !important;
    }

    #mpb-handle {
        min-height: 54px !important;
        padding: 14px 62px 6px !important;
    }

    .mpb-head-btns {
        right: 28px !important;
        top: 12px !important;
    }

    #mpb-body {
        padding: 0 22px 34px !important;
    }

    #mpb-main-frame {
        min-height: calc(100vh - 160px) !important;
    }

    #myprofilebubble.mpb-shape-rect #mpb-dialog {
        height: auto !important;
        border-radius: 22px !important;
    }

    #myprofilebubble.mpb-shape-rect #mpb-body,
    #myprofilebubble.mpb-shape-rect #mpb-main-frame {
        height: calc(100vh - 126px) !important;
        min-height: 360px !important;
    }
}
