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

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

body {
    font-family: 'VT323', monospace;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #0F380F;
}

.gameboy-container {
    background: #9BBB0F;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.3),
        inset 0 2px 4px rgba(255,255,255,0.2),
        inset 0 -2px 4px rgba(0,0,0,0.2);
    max-width: 800px;
    width: 100%;
}

.screen-bezel {
    background: #0F380F;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    position: relative;
}

.lcd-screen {
    background: #F8F8F0;
    border-radius: 8px;
    padding: 10px;
    position: relative;
    overflow: hidden;
}

.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.1) 2px,
        rgba(0,0,0,0.1) 4px
    );
    pointer-events: none;
    z-index: 2;
}

#viewfinder {
    display: block;
    width: 100%;
    max-width: 512px;
    height: auto;
    border: 2px solid #0F380F;
    border-radius: 4px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.ui-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    z-index: 3;
    pointer-events: none;
}

.mode-display, .photo-counter {
    background: rgba(15, 56, 15, 0.8);
    color: #F8F8F0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}

.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mode-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.gb-button {
    background: #8BAC0F;
    color: #0F380F;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 
        0 4px 0 #6B8C0F,
        inset 0 2px 0 rgba(255,255,255,0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gb-button:hover {
    transform: translateY(1px);
    box-shadow: 
        0 3px 0 #6B8C0F,
        inset 0 2px 0 rgba(255,255,255,0.2);
}

.gb-button:active, .gb-button.active {
    transform: translateY(4px);
    box-shadow: 
        0 0 0 #6B8C0F,
        inset 0 2px 0 rgba(0,0,0,0.2);
    background: #6B8C0F;
    color: #F8F8F0;
}

.camera-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.effects-panel, .adjustment-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: center;
}

.gb-label {
    font-size: 14px;
    font-weight: bold;
    color: #0F380F;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gb-select {
    background: #F8F8F0;
    color: #0F380F;
    border: 2px solid #0F380F;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'VT323', monospace;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
}

.gb-slider {
    width: 120px;
    height: 8px;
    background: #0F380F;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.gb-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #F8F8F0;
    border: 2px solid #0F380F;
    border-radius: 50%;
    cursor: pointer;
}

.brightness-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gb-button-small {
    background: #8BAC0F;
    color: #0F380F;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-family: 'VT323', monospace;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 
        0 2px 0 #6B8C0F,
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.gb-button-small:active {
    transform: translateY(2px);
    box-shadow: inset 0 1px 0 rgba(0,0,0,0.2);
}

.brightness-value {
    font-size: 18px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.shot-button {
    background: radial-gradient(circle, #FF6B6B 0%, #C92A2A 100%);
    color: white;
    border: none;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 
        0 8px 0 #8B1538,
        inset 0 4px 0 rgba(255,255,255,0.3),
        0 12px 20px rgba(0,0,0,0.3);
    transition: all 0.1s ease;
    position: relative;
}

.shot-button:hover {
    transform: translateY(2px);
    box-shadow: 
        0 6px 0 #8B1538,
        inset 0 4px 0 rgba(255,255,255,0.3),
        0 10px 20px rgba(0,0,0,0.3);
}

.shot-button:active {
    transform: translateY(8px);
    box-shadow: 
        0 0 0 #8B1538,
        inset 0 4px 0 rgba(0,0,0,0.3);
}

.shot-text {
    font-family: 'VT323', monospace;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

.gallery-view {
    text-align: center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    min-height: 300px;
    align-items: start;
}

.gallery-thumbnail {
    background: #F8F8F0;
    border: 2px solid #0F380F;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.gallery-thumbnail:hover {
    transform: scale(1.05);
}

.gallery-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.thumbnail-label {
    font-size: 12px;
    font-weight: bold;
    margin-top: 5px;
    color: #0F380F;
}

.empty-gallery {
    grid-column: 1 / -1;
    color: #0F380F;
    font-size: 18px;
    font-weight: bold;
    padding: 50px;
    text-align: center;
}

.gallery-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.sound-controls {
    position: absolute;
    top: 20px;
    right: 20px;
}

.sound-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #9BBB0F;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 90vw;
    max-height: 90vh;
}

#modalCanvas {
    max-width: 100%;
    height: auto;
    border: 2px solid #0F380F;
    border-radius: 8px;
    margin-bottom: 20px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.modal-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.hidden {
    display: none !important;
}

.app-footer {
    margin-top: 40px;
    text-align: center;
    color: #8BAC0F;
    font-size: 14px;
    line-height: 1.6;
}

.app-footer a {
    color: #9BBB0F;
    text-decoration: none;
    font-weight: bold;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gameboy-container {
        padding: 20px;
    }
    
    .controls-panel {
        gap: 15px;
    }
    
    .effects-panel, .adjustment-panel {
        flex-direction: column;
        gap: 10px;
    }
    
    .gb-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .shot-button {
        width: 80px;
        height: 80px;
    }
    
    .shot-text {
        font-size: 16px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .gameboy-container {
        padding: 15px;
    }
    
    .screen-bezel {
        padding: 15px;
    }
    
    .mode-buttons {
        flex-direction: column;
    }
    
    .gallery-controls {
        flex-direction: column;
    }
    
    .shot-button {
        width: 70px;
        height: 70px;
    }
    
    .shot-text {
        font-size: 14px;
    }
}