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

body {
    font-family: 'Courier New', monospace;
    background: #000;
    color: #0f0;
    overflow-x: hidden;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 25% 25%, #111 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, #222 0%, transparent 50%);
}

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

/* Arcade Machine Styles */
.arcade-machine {
    position: relative;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 20px 20px 0 0;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 20px;
    margin-bottom: 30px;
    width: 800px;
    max-width: 90vw;
}

.machine-top {
    height: 40px;
    background: linear-gradient(90deg, #444, #333, #444);
    border-radius: 20px 20px 0 0;
    border: 2px solid #555;
    position: relative;
    margin: -20px -20px 20px -20px;
}

.machine-top::before {
    content: "RETRO ARCADE";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #0f0;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 0 10px #0f0;
}

/* Screen Frame */
.machine-screen-frame {
    background: linear-gradient(145deg, #333, #111);
    padding: 30px;
    border-radius: 15px;
    border: 3px solid #555;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.machine-screen {
    width: 100%;
    height: 450px;
    background: #000;
    border: 5px solid #222;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        inset 0 0 50px rgba(0, 255, 0, 0.1),
        0 0 20px rgba(0, 0, 0, 0.8);
}

/* Game Display */
.game-display {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    background: 
        linear-gradient(45deg, transparent 49%, rgba(0, 255, 0, 0.03) 50%, transparent 51%),
        linear-gradient(-45deg, transparent 49%, rgba(0, 255, 0, 0.03) 50%, transparent 51%);
    background-size: 20px 20px;
}

.welcome-screen h1 {
    font-size: 3em;
    color: #0f0;
    text-shadow: 
        0 0 10px #0f0,
        0 0 20px #0f0,
        0 0 30px #0f0;
    margin-bottom: 20px;
    animation: glow 2s ease-in-out infinite alternate;
}

.welcome-screen p {
    font-size: 1.2em;
    color: #0a0;
    margin-bottom: 30px;
}

.arcade-logo {
    font-size: 4em;
    animation: bounce 2s infinite;
}

@keyframes glow {
    from { text-shadow: 0 0 10px #0f0, 0 0 20px #0f0, 0 0 30px #0f0; }
    to { text-shadow: 0 0 15px #0f0, 0 0 25px #0f0, 0 0 35px #0f0; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Control Panel */
.machine-controls {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(145deg, #444, #222);
    border-radius: 10px;
    border: 2px solid #555;
}

.control-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
}

.joystick {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #666, #333);
    border-radius: 50%;
    border: 3px solid #777;
    position: relative;
    box-shadow: 
        0 5px 10px rgba(0, 0, 0, 0.5),
        inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.joystick::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, #888, #444);
    border-radius: 50%;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.buttons {
    display: flex;
    gap: 10px;
}

.button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #555;
    box-shadow: 
        0 5px 10px rgba(0, 0, 0, 0.5),
        inset 0 2px 5px rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.1s ease;
}

.button:active {
    transform: translateY(2px);
    box-shadow: 
        0 3px 8px rgba(0, 0, 0, 0.5),
        inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.button.red { background: radial-gradient(circle, #ff4444, #aa0000); }
.button.yellow { background: radial-gradient(circle, #ffff44, #aaaa00); }
.button.blue { background: radial-gradient(circle, #4444ff, #0000aa); }

.machine-bottom {
    height: 30px;
    background: linear-gradient(90deg, #333, #222, #333);
    border-radius: 0 0 20px 20px;
    border: 2px solid #444;
    margin: 20px -20px -20px -20px;
}

/* Game Carousel */
.game-carousel {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 800px;
}

.carousel-arrow {
    background: linear-gradient(145deg, #444, #222);
    border: 2px solid #555;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    color: #0f0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.carousel-arrow:hover {
    background: linear-gradient(145deg, #555, #333);
    color: #0ff;
    box-shadow: 
        0 0 15px rgba(0, 255, 255, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.5);
}

.carousel-arrow:active {
    transform: scale(0.95);
}

.carousel-container {
    flex: 1;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(145deg, #333, #111);
    border: 2px solid #555;
    padding: 10px;
}

.carousel-track {
    display: flex;
    gap: 15px;
    transition: transform 0.3s ease;
    padding: 10px 0;
}

.game-thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    background: #222;
    border: 2px solid #444;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-thumbnail:hover {
    border-color: #0f0;
    box-shadow: 
        0 0 15px rgba(0, 255, 0, 0.5),
        inset 0 0 10px rgba(0, 255, 0, 0.1);
    transform: scale(1.05);
}

.game-thumbnail.active {
    border-color: #0ff;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.7),
        inset 0 0 15px rgba(0, 255, 255, 0.2);
    background: #001a1a;
}

.game-thumbnail img {
    width: 100%;
    height: 70%;
    object-fit: cover;
    border-radius: 4px;
}

.game-thumbnail .game-name {
    font-size: 10px;
    color: #0f0;
    text-align: center;
    padding: 5px;
    background: rgba(0, 0, 0, 0.8);
    width: 100%;
    position: absolute;
    bottom: 0;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Game Info Panel */
.game-info {
    background: linear-gradient(145deg, #333, #111);
    border: 2px solid #555;
    border-radius: 10px;
    padding: 20px;
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.game-info h3 {
    color: #0f0;
    font-size: 1.5em;
    margin-bottom: 10px;
    text-shadow: 0 0 10px #0f0;
}

.game-info p {
    color: #0a0;
    line-height: 1.6;
}

/* Loading States */
.loading-games {
    color: #0a0;
    text-align: center;
    padding: 30px;
    font-style: italic;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #333;
    border-top: 3px solid #0f0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: #0f0;
    font-size: 1.2em;
    text-shadow: 0 0 10px #0f0;
}

/* SWF Game Container */
.game-swf {
    width: 100%;
    height: 100%;
}

.game-swf object,
.game-swf embed {
    width: 100%;
    height: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .arcade-machine {
        width: 100%;
        padding: 15px;
    }
    
    .machine-screen {
        height: 300px;
    }
    
    .welcome-screen h1 {
        font-size: 2em;
    }
    
    .control-panel {
        transform: scale(0.8);
    }
    
    .game-thumbnail {
        width: 100px;
        height: 75px;
    }
    
    .carousel-arrow {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .arcade-container {
        padding: 10px;
    }
    
    .machine-screen {
        height: 250px;
    }
    
    .welcome-screen h1 {
        font-size: 1.5em;
    }
    
    .game-thumbnail {
        width: 80px;
        height: 60px;
    }
    
    .game-carousel {
        gap: 10px;
    }
}