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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: url('background.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--text-primary);
}

.container {
    width: 100%;
    max-width: 700px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(15, 23, 42, 0.75);
    padding: 20px 30px;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-primary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.game-screen,
.success-screen {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.hidden {
    display: none !important;
}

/* Progress Bar */
.progress-bar {
    position: relative;
    height: 8px;
    background: var(--surface-light);
    border-radius: 10px;
    margin-bottom: 25px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 12.5%;
}

.progress-text {
    position: absolute;
    top: 15px;
    right: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Image Container */
.image-container {
    position: relative;
    width: 100%;
    height: 350px;
    background: var(--background);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 25px;
}

.game-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-image.loaded {
    opacity: 1;
}

.image-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--background);
    color: var(--text-secondary);
}

.image-loader.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--surface-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form */
.guess-form {
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    background: var(--background);
    border: 2px solid var(--surface-light);
    border-radius: 8px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--surface);
}

.input-group input.correct {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.input-group input.incorrect {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
}

.input-group input.partial {
    border-color: var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
}

.feedback {
    display: none;
    position: absolute;
    right: 12px;
    top: 44px;
    font-size: 1.3rem;
}

.feedback.show {
    display: block;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.submit-btn {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

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

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Category Selector */
.category-selector {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--surface-light);
}

.category-selector label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.category-selector select {
    flex: 1;
    padding: 10px 14px;
    font-size: 0.95rem;
    background: var(--background);
    border: 2px solid var(--surface-light);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
}

.category-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.restart-btn {
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    background: var(--surface-light);
    color: var(--text-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.restart-btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* Success Screen */
.success-content {
    text-align: center;
}

.success-header {
    margin-bottom: 30px;
}

.success-header h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--success-color), #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.success-message {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.song-info {
    background: var(--background);
    padding: 25px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.song-info h3 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.song-info p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.guess-count {
    font-size: 1rem !important;
    color: var(--primary-color) !important;
    font-weight: 600;
    margin-bottom: 0 !important;
}

.guess-count span {
    font-size: 1.3rem;
    font-weight: 700;
}

.video-container {
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 30px;
    background: var(--background);
}

.video-container iframe {
    display: block;
    width: 100%;
}

.share-results-btn {
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.share-results-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

.share-results-btn:active {
    transform: scale(0.98);
}

.share-hint {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Error Message */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: var(--error-color);
    color: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    font-weight: 600;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 2.2rem;
    }

    .game-screen,
    .success-screen {
        padding: 20px;
    }

    .image-container {
        height: 250px;
    }

    .category-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .category-selector select {
        width: 100%;
    }
}