/* Moon Cresta - Retro Arcade CSS */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    background-color: #0b0c10;
    background-image: 
        radial-gradient(circle at 50% 30%, #1f2833 0%, #0b0c10 70%),
        repeating-linear-gradient(45deg, #111 0px, #111 2px, #0b0c10 2px, #0b0c10 8px);
    color: #e0e6ed;
    font-family: 'Press Start 2P', monospace, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    padding: 10px;
}

.arcade-cabinet {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, #1f1f2e 0%, #0e0e17 50%, #1a1a2b 100%);
    border: 4px solid #3d405b;
    border-radius: 18px;
    box-shadow: 
        0 0 30px rgba(0, 0, 0, 0.9),
        0 0 50px rgba(78, 205, 196, 0.2),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
    padding: 16px;
    max-width: 580px;
    width: 100%;
    position: relative;
    touch-action: none !important;
}

/* Horní nápis / Marquee */
.cabinet-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.marquee-title {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 4px;
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
    background: #000;
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid #555;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3), 0 0 15px rgba(255, 107, 107, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

.marquee-title .space {
    width: 16px;
}

.letter-m  { color: #ff3366; }
.letter-o1 { color: #ff9933; }
.letter-o2 { color: #ffff33; }
.letter-n  { color: #33ff66; }
.letter-c  { color: #33ffff; }
.letter-r  { color: #3399ff; }
.letter-e  { color: #9933ff; }
.letter-s  { color: #ff33ff; }
.letter-t  { color: #ff3366; }
.letter-a  { color: #ffcc00; }

.header-controls {
    display: flex;
    gap: 8px;
}

.arcade-btn {
    background: linear-gradient(180deg, #444 0%, #222 100%);
    color: #eee;
    border: 2px solid #666;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 3px 0 #111;
    transition: all 0.1s ease;
}

.arcade-btn:hover {
    background: linear-gradient(180deg, #555 0%, #333 100%);
    color: #4ecdc4;
}

.arcade-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #111;
}

.arcade-btn.active {
    border-color: #4ecdc4;
    color: #4ecdc4;
    box-shadow: 0 0 8px rgba(78, 205, 196, 0.4);
}

/* Obrazovka a CRT Efekt */
.screen-frame {
    position: relative;
    background: #000;
    border: 6px solid #14151a;
    border-radius: 12px;
    box-shadow: 
        inset 0 0 30px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

canvas#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
    max-width: 480px;
    aspect-ratio: 3 / 4;
    background: #000;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    touch-action: none !important;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    cursor: crosshair;
    position: relative;
    z-index: 2;
}

/* CRT Scanlines a Glow - přísně pointer-events: none pro bezchybný dotyk na plátno */
.crt-overlay,
.crt-overlay *,
.scanlines,
.crt-glow {
    pointer-events: none !important;
}

.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    transition: opacity 0.2s ease;
}

.crt-overlay.hidden {
    opacity: 0;
}

.scanlines {
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.35) 50%
    );
    background-size: 100% 4px;
}

.crt-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 50px rgba(0, 255, 180, 0.08), inset 0 0 15px rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

/* Spodní panel a instrukce */
.cabinet-footer {
    width: 100%;
    margin-top: 14px;
    text-align: center;
}

.instructions-panel {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #333;
    padding: 10px 14px;
    border-radius: 8px;
}

.ctrl-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 14px;
    font-size: 9px;
    line-height: 1.6;
    color: #bbb;
}

.badge {
    background: #ff5964;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 8px;
    font-weight: bold;
}

.history-note {
    margin-top: 8px;
    font-size: 8px;
    color: #777;
    letter-spacing: 1px;
}
