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

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

body {
    background: #000000;
    color: #00FFFF;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    overflow-x: auto;
    min-height: 100vh;
}

.container {
    min-height: 100vh;
    background: linear-gradient(45deg, #000000 0%, #0a0a0a 50%, #000000 100%);
    position: relative;
}

/* Header */
.header {
    text-align: center;
    padding: 20px;
    border-bottom: 2px solid #00FFFF;
    background: rgba(0, 255, 255, 0.05);
}

.title-glow {
    font-size: 2.5rem;
    font-weight: bold;
    color: #00FFFF;
    text-shadow: 0 0 1px #00FFFF, 0 0 20px #00FFFF40, 0 0 30px #00FFFF20;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1rem;
    color: #00FF00;
    text-shadow: 0 0 5px #00FF00;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Left Panel */
.left-panel {
    background: rgba(26, 26, 26, 0.8);
    border: 2px solid #00FFFF;
    border-radius: 8px;
    padding: 20px;
}

.prompt-section {
    margin-bottom: 30px;
}

.prompt-label {
    display: block;
    color: #00FF00;
    margin-bottom: 10px;
    font-weight: bold;
    text-shadow: 0 0 1px #00FF00;
}

.prompt-input {
    width: 100%;
    height: 120px;
    background: #1a1a1a;
    border: 2px solid #00FFFF;
    border-radius: 4px;
    color: #00FFFF;
    font-family: inherit;
    font-size: 14px;
    padding: 10px;
    resize: vertical;
    margin-bottom: 10px;
}

.prompt-input:focus {
    outline: none;
    border-color: #00FF00;
    box-shadow: 0 0 10px #00FF0050;
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: #00FF00;
    margin-bottom: 15px;
}

.retro-button {
    background: linear-gradient(145deg, #C0C0C0, #A0A0A0);
    border: 2px outset #C0C0C0;
    color: #000000;
    font-family: inherit;
    font-weight: bold;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    letter-spacing: 1px;
    transition: all 0.1s;
    position: relative;
    overflow: hidden;
}

.retro-button:hover {
    background: linear-gradient(145deg, #D0D0D0, #B0B0B0);
    transform: translateY(-1px);
}

.retro-button:active {
    border: 2px inset #C0C0C0;
    transform: translateY(1px);
}

.retro-button.small {
    padding: 8px 12px;
    font-size: 12px;
}

/* Examples Section */
.examples-section {
    border-top: 1px solid #00FFFF;
    padding-top: 20px;
}

.section-title {
    color: #FF00FF;
    margin-bottom: 15px;
    text-shadow: 0 0 5px #FF00FF;
    font-size: 16px;
}

.examples-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.example-item {
    background: #2a2a2a;
    border: 1px solid #00FFFF;
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.example-item:hover {
    background: #3a3a3a;
    border-color: #00FF00;
    transform: translateY(-2px);
}

.example-thumb {
    background: #1a1a1a;
    border: 1px solid #666;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 10px;
    color: #00FFFF;
}

.example-item span {
    font-size: 12px;
    color: #00FF00;
}

/* Center Panel */
.center-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.canvas-container {
    position: relative;
    background: #1a1a1a;
    border: 4px solid #C0C0C0;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 20px;
    box-shadow: 
        inset 0 0 0 2px #666,
        0 0 20px rgba(0, 255, 255, 0.3);
    width: 100%;
    max-width: 100%;
}

.canvas-container iframe {
    display: block;
    border: 2px solid #333;
    background: #000000;
    width: 100%;
    height: auto;
    aspect-ratio: 320 / 200;
}

#gameCanvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    background: #000000;
    border: 2px solid #333;
}

.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(0, 255, 255, 0.03) 2px,
        rgba(0, 255, 255, 0.03) 4px
    );
    border-radius: 8px;
}

.loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.dos-prompt {
    color: #00FF00;
    font-size: 14px;
    text-align: center;
}

.cursor {
    display: inline-block;
    animation: blink 1s infinite;
    margin-left: 5px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.game-info {
    display: flex;
    gap: 30px;
    justify-content: center;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid #00FFFF;
    border-radius: 4px;
    padding: 10px 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.info-item .label {
    font-size: 10px;
    color: #FFFF00;
}

.info-item .value {
    font-size: 16px;
    color: #00FF00;
    font-weight: bold;
    text-shadow: 0 0 5px #00FF00;
}

/* Right Panel */
.right-panel {
    background: rgba(26, 26, 26, 0.8);
    border: 2px solid #00FFFF;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Controls */
.controls-section .control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 5px;
    margin-bottom: 10px;
}

.control-row {
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
}

.control-key {
    background: #2a2a2a;
    border: 2px outset #666;
    color: #00FFFF;
    padding: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

.control-key.wide {
    width: 120px;
}

.control-key.active {
    background: #00FFFF;
    color: #000000;
    border: 2px inset #00FFFF;
    box-shadow: 0 0 10px #00FFFF;
}

.control-spacer {
    /* Empty grid cell */
}

/* Palette */
.palette-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    margin-bottom: 15px;
}

.palette-swatch {
    width: 20px;
    height: 20px;
    border: 1px solid #333;
    cursor: pointer;
    transition: transform 0.1s;
}

.palette-swatch:hover {
    transform: scale(1.1);
    border-color: #00FFFF;
}

/* Actions */
.actions-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    border-top: 2px solid #00FFFF;
    background: rgba(0, 255, 255, 0.05);
    color: #00FF00;
    font-size: 12px;
}

.footer a {
    color: #FF00FF;
    text-decoration: none;
    text-shadow: 0 0 5px #FF00FF;
}

.footer a:hover {
    color: #FFFF00;
    text-shadow: 0 0 5px #FFFF00;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .title-glow {
        font-size: 2rem;
    }
    
    .examples-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 10px;
        gap: 15px;
    }
    
    .title-glow {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .left-panel, .right-panel {
        padding: 15px;
    }
    
    .examples-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .control-grid {
        gap: 3px;
    }
    
    .control-key {
        padding: 6px;
        font-size: 11px;
        min-height: 30px;
    }
    
    .palette-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .palette-swatch {
        width: 18px;
        height: 18px;
    }
}

/* CRT Effect */
@media (min-width: 769px) {
    .canvas-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.1) 100%);
        pointer-events: none;
        border-radius: 8px;
    }
}

/* Additional VGA-style animations */
.retro-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.retro-button:hover::after {
    left: 100%;
}