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

body {
    font-family: 'Courier New', monospace;
    background: #000000;
    color: #ffffff;
    overflow: hidden;
}

#app {
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Navigation */
#scene-nav {
    position: absolute;
    top: 0;
    left: 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-bottom-right-radius: 10px;
    z-index: 100;
}

#scene-nav h1 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Story Mode Button */
.story-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: 2px solid #FFD700;
    color: #000000;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.story-btn:hover {
    background: linear-gradient(135deg, #FFA500, #FFD700);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

.story-btn.playing {
    background: linear-gradient(135deg, #FF00FF, #00FFFF);
    border-color: #FF00FF;
    color: #FFFFFF;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 255, 255, 0.8);
    }
}

#scene-list {
    list-style: none;
}

#scene-list button {
    display: block;
    width: 150px;
    margin: 8px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #00ffff;
    color: #00ffff;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    font-size: 0.9rem;
}

#scene-list button:hover {
    background: rgba(0, 255, 255, 0.2);
    transform: translateX(5px);
}

#scene-list button.active {
    background: rgba(0, 255, 255, 0.3);
    border-color: #ff00ff;
    color: #ff00ff;
}

/* Info Panel */
#info-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    min-width: 250px;
    z-index: 100;
}

#scene-title {
    font-size: 1.3rem;
    color: #00ffff;
    margin-bottom: 10px;
}

#scene-description {
    font-size: 0.9rem;
    color: #cccccc;
    margin-bottom: 15px;
    line-height: 1.4;
}

#level-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

#level-controls label {
    flex: 1;
    color: #ff00ff;
}

#level-controls button {
    padding: 5px 15px;
    background: rgba(255, 0, 255, 0.2);
    border: 1px solid #ff00ff;
    color: #ff00ff;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

#level-controls button:hover {
    background: rgba(255, 0, 255, 0.4);
}

/* Mode Controls */
#mode-controls {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
}

#mode-controls label {
    display: block;
    color: #00ffff;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.mode-buttons {
    display: flex;
    gap: 8px;
}

.mode-buttons button {
    flex: 1;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #00ffff;
    color: #00ffff;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
    font-family: inherit;
}

.mode-buttons button:hover {
    background: rgba(0, 255, 255, 0.2);
}

.mode-buttons button.active {
    background: rgba(0, 255, 255, 0.4);
    color: #ffffff;
    border-color: #ff00ff;
}

/* Formation Controls */
#formation-controls {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 255, 255, 0.3);
}

#formation-controls label {
    display: block;
    color: #00ffff;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.formation-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.formation-buttons button {
    flex: 1;
    padding: 8px;
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid #00ffff;
    color: #00ffff;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.formation-buttons button:hover {
    background: rgba(0, 255, 255, 0.4);
}

#formation-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #aaaaaa;
}

#formation-stage {
    color: #ff00ff;
}

#formation-progress {
    color: #00ffff;
}

/* Canvas Container */
#canvas-container {
    width: 100%;
    height: 100%;
}

#canvas-container canvas {
    display: block;
}

/* Controls Info */
#controls-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    z-index: 100;
}

#controls-info p {
    font-size: 0.85rem;
    color: #aaaaaa;
}

/* UI Hiding */
.ui-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.5s ease !important;
}

#scene-nav, #info-panel, #controls-info {
    transition: opacity 0.5s ease;
}

/* Hide UI Button */
#hide-ui-btn {
    position: fixed;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    padding: 12px 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid #00FFFF;
    border-radius: 5px;
    color: #00FFFF;
    cursor: pointer;
    z-index: 101;
    font-size: 1.2rem;
    transition: all 0.3s;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

#hide-ui-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #FF00FF;
    color: #FF00FF;
}

#hide-ui-btn.ui-hidden {
    right: -50px;
}

/* Responsive */
@media (max-width: 768px) {
    #scene-nav {
        padding: 10px;
    }

    #scene-nav h1 {
        font-size: 1.2rem;
    }

    #scene-list button {
        width: 120px;
        padding: 8px;
        font-size: 0.8rem;
    }

    #info-panel {
        right: 10px;
        top: 10px;
        padding: 15px;
        min-width: 200px;
    }

    #hide-ui-btn {
        padding: 8px 6px;
        font-size: 1rem;
    }
}
