/* Arcade Page Styles - Futuristic Neon Theme */

/* Page background */
.arcade-page::before {
    background:
        radial-gradient(circle at 20% 20%, rgba(0, 255, 255, 0.15), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(170, 68, 255, 0.15), transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(255, 170, 0, 0.1), transparent 60%);
}

.arcade-page {
    background: linear-gradient(180deg, #0a0a1a 0%, #1a1a2e 50%, #0d0d20 100%);
}

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

/* Hero Section (description below stage) */
.arcade-hero {
    text-align: center;
    margin-top: 25px;
    margin-bottom: 15px;
}

.arcade-title {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 0.3em;
    background: linear-gradient(90deg, #00ffff, #aa44ff, #ffaa00, #00ffff);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleShimmer 4s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    margin: 0;
    z-index: 10;
}

@keyframes titleShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.arcade-subtitle {
    position: absolute;
    top: 85px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: #888;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin: 0;
    z-index: 10;
}

.arcade-description {
    max-width: 850px;
    margin: 0 auto;
    color: #999;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}

/* Arcade Stage */
#arcade-stage {
    position: relative;
    width: 900px;
    height: 550px;
    background: linear-gradient(180deg, #0a0a15 0%, #151525 60%, #1a1a30 100%);
    border: 3px solid #333;
    border-radius: 15px;
    overflow: hidden;
    box-shadow:
        0 0 50px rgba(0, 255, 255, 0.2),
        0 0 100px rgba(170, 68, 255, 0.1),
        inset 0 0 100px rgba(0, 0, 0, 0.5);
}

/* Floor Grid */
.floor-grid {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background:
        linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(0deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg);
    transform-origin: bottom center;
    opacity: 0.6;
}

.floor-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 255, 255, 0.05) 100%);
}

/* Ceiling Lights */
.ceiling-lights {
    position: absolute;
    top: 120px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    padding: 0 100px;
}

.neon-tube {
    width: 150px;
    height: 8px;
    background: linear-gradient(90deg, transparent, #00ffff, transparent);
    border-radius: 4px;
    box-shadow:
        0 0 20px #00ffff,
        0 0 40px rgba(0, 255, 255, 0.5),
        0 0 60px rgba(0, 255, 255, 0.3);
    animation: flicker 3s ease-in-out infinite;
}

.neon-tube:nth-child(2) {
    background: linear-gradient(90deg, transparent, #aa44ff, transparent);
    box-shadow:
        0 0 20px #aa44ff,
        0 0 40px rgba(170, 68, 255, 0.5),
        0 0 60px rgba(170, 68, 255, 0.3);
    animation-delay: 1s;
}

.neon-tube:nth-child(3) {
    background: linear-gradient(90deg, transparent, #ffaa00, transparent);
    box-shadow:
        0 0 20px #ffaa00,
        0 0 40px rgba(255, 170, 0, 0.5),
        0 0 60px rgba(255, 170, 0, 0.3);
    animation-delay: 2s;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
    52% { opacity: 1; }
    54% { opacity: 0.9; }
}

/* Machines Container */
#machines-container {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 0 40px;
}

/* Individual Machine */
.arcade-machine {
    position: relative;
    width: 160px;
    height: 240px;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    background: transparent;
    border: none;
    padding: 0;
}

.arcade-machine:hover {
    transform: translateY(-15px) scale(1.05);
}

.arcade-machine:hover .machine-svg {
    filter: brightness(1.3) drop-shadow(0 0 20px var(--machine-glow, #00ffff));
}

.arcade-machine:focus {
    outline: none;
}

.arcade-machine:focus .machine-svg {
    filter: brightness(1.3) drop-shadow(0 0 25px var(--machine-glow, #00ffff));
}

.machine-svg {
    width: 100%;
    height: 100%;
    transition: filter 0.3s ease;
}

/* Machine glow colors */
.arcade-machine[data-id="bubble-shooter"] { --machine-glow: #06b6d4; }
.arcade-machine[data-id="lucky-fish"] { --machine-glow: #dc2626; }
.arcade-machine[data-id="hex-jump"] { --machine-glow: #9333ea; }
.arcade-machine[data-id="cup-shuffle"] { --machine-glow: #f97316; }

/* Machine label */
.machine-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.arcade-machine:hover .machine-label {
    opacity: 1;
    color: var(--machine-glow, #00ffff);
}

/* Tooltip */
#arcade-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
    border: 1px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
    transform: translateX(-50%);
}

#arcade-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* Modal Overlay */
#game-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    overflow: hidden;
}

#game-modal {
    background: linear-gradient(180deg, #1a1a2e 0%, #0d0d1a 100%);
    border: 2px solid #333;
    border-radius: 15px;
    box-shadow:
        0 0 50px rgba(0, 255, 255, 0.2),
        0 0 100px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform-origin: center center;
}

#game-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(90deg, #1a1a30, #2a2a4a, #1a1a30);
    border-bottom: 1px solid #333;
}

#game-modal-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #00ffff;
    letter-spacing: 0.1em;
}

#game-modal-close {
    background: none;
    border: none;
    color: #666;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 0 8px;
    transition: color 0.2s, text-shadow 0.2s;
}

#game-modal-close:hover {
    color: #ff4444;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

#game-modal-close:focus {
    outline: 2px solid #00ffff;
    outline-offset: 2px;
}

#game-modal-content {
    position: relative;
    width: 900px;
    height: 700px;
    background: #0a0a15;
    overflow: hidden;
    flex-shrink: 0;
}

#game-iframe {
    width: 900px;
    height: 700px;
    border: none;
    display: block;
}

/* Loading indicator */
#game-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0a0a15;
    z-index: 10;
}

.arcade-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #1a1a30;
    border-top-color: #00ffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#game-loading p {
    margin-top: 20px;
    font-family: 'Orbitron', sans-serif;
    color: #666;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

/* Error state */
#game-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0a0a15;
    z-index: 10;
}

#game-error p {
    font-family: 'Orbitron', sans-serif;
    color: #ff4444;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

#game-error a, #game-modal-footer a {
    font-family: 'Orbitron', sans-serif;
    color: #00ffff;
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: color 0.2s, text-shadow 0.2s;
}

#game-error a:hover, #game-modal-footer a:hover {
    color: #44ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

#game-modal-footer {
    padding: 12px 20px;
    background: linear-gradient(90deg, #1a1a30, #2a2a4a, #1a1a30);
    border-top: 1px solid #333;
    text-align: center;
}

/* When iframe is loaded, hide loading */
#game-modal-content.loaded #game-loading {
    display: none;
}

/* When error, hide iframe */
#game-modal-content.error #game-iframe {
    visibility: hidden;
}

#game-modal-content.error #game-loading {
    display: none;
}

#game-modal-content.error #game-error {
    display: flex;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 950px) {
    #arcade-stage {
        width: 95vw;
        height: auto;
        aspect-ratio: 9 / 5;
    }

    #machines-container {
        gap: 20px;
        padding: 0 20px;
    }

    .arcade-machine {
        width: 120px;
        height: 180px;
    }

    .arcade-title {
        font-size: 2.5rem;
        letter-spacing: 0.15em;
    }

    .ceiling-lights {
        padding: 0 50px;
    }

    .neon-tube {
        width: 100px;
    }
}

@media (max-width: 700px) {
    #machines-container {
        flex-wrap: wrap;
        gap: 15px;
        bottom: 40px;
    }

    .arcade-machine {
        width: 100px;
        height: 150px;
    }

    .machine-label {
        font-size: 0.6rem;
        bottom: -20px;
    }

    .arcade-title {
        font-size: 2rem;
        top: 40px;
    }

    .arcade-subtitle {
        font-size: 0.85rem;
        top: 90px;
    }

    .ceiling-lights {
        padding: 0 20px;
        top: 120px;
    }

    .neon-tube {
        width: 70px;
        height: 6px;
    }

    #game-modal-content,
    #game-iframe {
        width: 95vw;
        height: 70vh;
    }
}

@media (max-width: 500px) {
    .arcade-machine {
        width: 80px;
        height: 120px;
    }

    .arcade-title {
        font-size: 1.5rem;
        top: 30px;
    }

    .arcade-subtitle {
        top: 70px;
        font-size: 0.7rem;
    }

    .ceiling-lights {
        top: 100px;
    }

    #arcade-stage {
        height: 450px;
    }

    .floor-grid {
        height: 150px;
    }
}
