@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

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

body {
    background: #5a6a7a;
    font-family: 'VT323', monospace;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#mac-window {
    width: calc(100vw - 40px);
    height: calc(100vh - 100px);
    max-width: 1200px;
    max-height: 800px;
    background: #000;
    border: 3px solid #fff;
    border-radius: 0;
    box-shadow: 
        inset 0 0 0 1px #000,
        4px 4px 0 rgba(0,0,0,0.3);
    overflow: hidden;
    position: relative;
}

#title-bar {
    height: 24px;
    background: linear-gradient(180deg, #fff 0%, #ccc 50%, #999 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 8px;
    border-bottom: 2px solid #000;
    position: relative;
}

.title-bar-lines {
    flex: 1;
    height: 10px;
    background: repeating-linear-gradient(
        0deg,
        #000 0px,
        #000 1px,
        transparent 1px,
        transparent 3px
    );
}

.title-text {
    font-family: 'VT323', monospace;
    font-size: 16px;
    color: #000;
    padding: 0 12px;
    white-space: nowrap;
}

.close-box {
    width: 14px;
    height: 14px;
    background: #fff;
    border: 2px solid #000;
    position: absolute;
    left: 8px;
    cursor: pointer;
}

#scene-container {
    width: 100%;
    height: calc(100% - 24px);
    background: #0000ff;
}

#scene-container canvas {
    display: block;
}

#controls-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(180deg, #ddd 0%, #bbb 100%);
    border: 2px solid #000;
    padding: 0;
    width: 200px;
    box-shadow: 
        inset 1px 1px 0 #fff,
        inset -1px -1px 0 #888,
        3px 3px 0 rgba(0,0,0,0.2);
    z-index: 100;
}

.panel-header {
    background: linear-gradient(180deg, #000080 0%, #0000aa 100%);
    color: #fff;
    padding: 6px 10px;
    font-size: 14px;
    text-align: center;
    border-bottom: 1px solid #000;
}

.control-group {
    padding: 10px 12px;
    border-bottom: 1px solid #999;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    font-size: 14px;
    color: #000;
}

.control-group button {
    background: linear-gradient(180deg, #fff 0%, #ccc 100%);
    border: 2px solid #000;
    padding: 6px 12px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 
        inset 1px 1px 0 #fff,
        inset -1px -1px 0 #888;
}

.control-group button:active {
    box-shadow: 
        inset -1px -1px 0 #fff,
        inset 1px 1px 0 #888;
}

.control-group input[type="range"] {
    width: 100%;
    height: 20px;
    -webkit-appearance: none;
    background: #fff;
    border: 2px inset #888;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 20px;
    background: linear-gradient(180deg, #ddd 0%, #999 100%);
    border: 1px solid #000;
    cursor: pointer;
}

.control-group select {
    width: 100%;
    padding: 4px;
    font-family: 'VT323', monospace;
    font-size: 14px;
    background: #fff;
    border: 2px inset #888;
}

#speed-value {
    font-size: 14px;
    color: #000;
    text-align: center;
}

.stats-display {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    background: #000;
}

.stat {
    flex: 1;
    text-align: center;
    color: #0f0;
    font-size: 12px;
}

.stat-label {
    display: block;
    color: #0a0;
    font-size: 10px;
}

.stat span:last-child {
    font-size: 18px;
}

#footer {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #333;
    background: rgba(255,255,255,0.8);
    padding: 6px 16px;
    border-radius: 4px;
}

#footer a {
    color: #ff0066;
    text-decoration: none;
}

#footer a:hover {
    text-decoration: underline;
}

#mobile-controls {
    display: none;
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

#mobile-controls button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: 3px solid #000;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    #mac-window {
        width: 100vw;
        height: calc(100vh - 60px);
        border: none;
        border-radius: 0;
    }
    
    #controls-panel {
        display: none;
    }
    
    #mobile-controls {
        display: block;
    }
    
    #footer {
        flex-direction: column;
        text-align: center;
        gap: 4px;
        font-size: 10px;
        padding: 4px 12px;
    }
}

@media (max-width: 480px) {
    #title-bar {
        height: 20px;
    }
    
    .title-text {
        font-size: 12px;
    }
}