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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    color: #fff;
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

/* Image Display Area */
#image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    position: relative;
    overflow: hidden;
}

#current-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

#no-images-message {
    font-size: 2rem;
    color: #666;
    text-align: center;
    padding: 2rem;
}

/* State Message Overlay - moved to top left */
#state-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    pointer-events: none;
    text-align: left;
}

#state-message {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 
        2px 2px 4px rgba(0,0,0,0.8),
        0 0 20px rgba(255,255,255,0.3);
    padding: 0.5rem 1rem;
    background: rgba(0,0,0,0.7);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.2);
    animation: pulse 2s infinite;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

#state-countdown {
    font-size: 1.5rem;
    font-weight: normal;
    color: #ffd700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Timer Display */
#timer-display {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
    background: rgba(0,0,0,0.8);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    border: 2px solid #444;
}

#timer-text {
    font-size: 2rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    color: #0ff;
}

/* Control Panel */
#control-panel {
    background: rgba(20,20,20,0.95);
    padding: 1rem;
    border-top: 2px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
    gap: 1rem;
}

#main-controls {
    display: flex;
    gap: 1rem;
}

.control-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #333;
    color: #fff;
    border: 2px solid #555;
}

.control-btn:hover:not(:disabled) {
    background: #444;
    border-color: #666;
    transform: translateY(-2px);
}

.control-btn:active:not(:disabled) {
    transform: translateY(0);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.control-btn.primary {
    background: #0a84ff;
    border-color: #0a84ff;
}

.control-btn.primary:hover:not(:disabled) {
    background: #0056cc;
    border-color: #0056cc;
}

/* Volume Control */
#volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ccc;
}

#volume-slider {
    width: 100px;
    height: 5px;
    background: #333;
    outline: none;
    border-radius: 5px;
}

#volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 15px;
    height: 15px;
    background: #0a84ff;
    border-radius: 50%;
    cursor: pointer;
}

#volume-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #0a84ff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#volume-display {
    min-width: 40px;
    text-align: right;
    font-weight: bold;
}

/* Image Controls */
#image-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

#image-count {
    font-size: 0.9rem;
    color: #999;
}

/* Instructions - hidden by default */
#instructions {
    display: none;
}

#instructions h3 {
    margin-bottom: 0.5rem;
    color: #0a84ff;
}

#instructions ul {
    list-style-position: inside;
    line-height: 1.4;
}

#instructions li {
    margin-bottom: 0.25rem;
    color: #ccc;
}

/* State-specific styling */
.state-hands-off #state-message {
    color: #999;
    animation: none;
}

.state-stroke #state-message {
    color: #ff6b35;
    animation: pulse 0.5s infinite;
}

.state-bonus-stroke #state-message {
    color: #ffd700;
    animation: pulse 0.5s infinite;
}

.state-final-countdown #state-message {
    color: #ff0040;
    animation: pulse 0.3s infinite;
    font-size: 2.5rem;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    #control-panel {
        flex-direction: column;
        align-items: stretch;
    }
    
    #main-controls {
        justify-content: center;
    }
    
    #instructions {
        position: relative;
        bottom: auto;
        right: auto;
        max-width: none;
        margin: 1rem 0;
    }
}

@media (max-width: 768px) {
    #state-message {
        font-size: 1.5rem;
    }
    
    #timer-text {
        font-size: 1.5rem;
    }
    
    .control-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    #instructions {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
}

/* Utility classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.fade-out {
    animation: fadeOut 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}