/* MAZE GAME - REBORN */
#maze-game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(15px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    padding: 20px;
    box-sizing: border-box;
}

#maze-game-modal.active { display: flex; }

#maze-game-container {
    background: #1a1a1a;
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

#maze-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    transform: rotate(0deg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* Perfect CSS X */
#maze-close-btn::before,
#maze-close-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background-color: #888;
    border-radius: 2px;
    transition: background-color 0.3s;
}

#maze-close-btn::before { transform: translate(-50%, -50%) rotate(45deg); }
#maze-close-btn::after { transform: translate(-50%, -50%) rotate(-45deg); }

#maze-close-btn:hover {
    background: rgba(255, 50, 50, 0.2);
    border-color: rgba(255, 50, 50, 0.5);
    box-shadow: 0 0 20px rgba(255, 50, 50, 0.4);
    transform: rotate(90deg);
}

#maze-close-btn:hover::before,
#maze-close-btn:hover::after {
    background-color: #ff5555;
}

.game-layout {
    display: flex;
    align-items: center;
    gap: 3rem;
    transition: filter 0.3s;
}

.game-layout.blur { filter: blur(8px); pointer-events: none; }

#maze {
    width: 350px;
    height: 350px;
    background: #000;
    border-radius: 12px;
    transform-style: preserve-3d;
}

#maze-win-screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 500;
    border-radius: 24px;
}

#maze-win-screen.active { display: flex; }

#maze-win-screen h2 {
    font-size: 3rem;
    background: linear-gradient(to right, #00d2ff, #9d50bb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.win-btn {
    background: #00d2ff;
    color: #000;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
}

.controls-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 180px;
}

.timer-box {
    background: #000;
    padding: 15px 25px;
    border-radius: 15px;
    border: 1px solid rgba(0, 210, 255, 0.2);
}

#maze-timer { font-size: 1.8rem; color: #00d2ff; font-weight: 800; }

#joystick {
    width: 100px; height: 100px;
    background: #000;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}

#joystick-head {
    width: 40px; height: 40px;
    background: radial-gradient(circle at 30% 30%, #00d2ff, #0055ff);
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    position: absolute;
    z-index: 10;
}

#note { font-size: 0.8rem; color: #666; text-align: center; }

/* Rotate Device Notice */
#maze-rotate-notice {
    display: none;
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    border-radius: 24px;
}

@media (max-width: 1024px) and (orientation: portrait) {
    #maze-rotate-notice {
        display: flex;
    }
}

.rotate-icon {
    width: 50px;
    height: 80px;
    border: 3px solid #00d2ff;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    position: relative;
    animation: rotateDevice 2s infinite ease-in-out;
}

.rotate-icon::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00d2ff;
}

@keyframes rotateDevice {
    0% { transform: rotate(0deg); }
    40% { transform: rotate(90deg); }
    60% { transform: rotate(90deg); }
    100% { transform: rotate(0deg); }
}

#maze-rotate-notice p {
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    max-width: 200px;
}

