/* Enhanced Quiz Styles with Music Controls */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --secondary-color: #06b6d4;
    --secondary-dark: #0891b2;
    --success-color: #10b981;
    --success-light: #6ee7b7;
    --error-color: #ef4444;
    --error-light: #fca5a5;
    --warning-color: #f59e0b;
    --warning-light: #fcd34d;
    --background: #0f172a;
    --background-light: #1e293b;
    --surface: #1e293b;
    --surface-light: #334155;
    --surface-lighter: #475569;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --border-radius-lg: 24px;
    --shadow: 0 20px 25px -5px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 25px 50px -12px rgb(0 0 0 / 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Globale Animationen */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translateY(0); }
    40%, 43% { transform: translateY(-30px); }
    70% { transform: translateY(-15px); }
    90% { transform: translateY(-4px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

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

/* Utility Classes */
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.5s ease; }
.slide-up { animation: slideInUp 0.6s ease; }
.slide-down { animation: slideInDown 0.6s ease; }

/* Partikel-Hintergrund */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    opacity: 0.4;
    animation: float 25s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.4; }
    90% { opacity: 0.4; }
    100% {
        transform: translateY(-100vh) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

/* Header */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    position: relative;
}

.logo-link {
    text-decoration: none;
    display: block;
}

.logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.logo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(255,255,255,0.3), transparent);
    animation: spin 4s linear infinite;
}

.logo-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    z-index: 1;
    position: relative;
}

.logo:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Progress Bar */
.progress-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.progress-wrapper {
    position: relative;
    background: var(--surface);
    border-radius: 50px;
    height: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 50px;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    text-align: center;
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Timer */
.timer-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100;
    animation: slideInDown 0.6s ease;
}

.timer-circle {
    position: relative;
    width: 80px;
    height: 80px;
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: var(--surface-light);
    stroke-width: 2;
}

.timer-progress {
    fill: none;
    stroke: var(--warning-color);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--warning-color);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Sound Toggle */
.sound-toggle {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 100;
    background: var(--surface);
    border: 1px solid var(--surface-light);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.sound-toggle:hover {
    background: var(--surface-light);
    transform: scale(1.1);
}

.sound-icon {
    font-size: 1.2rem;
}

/* Game Container */
.game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

/* Intro Screen */
.intro {
    text-align: center;
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    padding: 3rem 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--surface-light);
    position: relative;
    overflow: hidden;
}

.intro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.intro-header {
    margin-bottom: 2rem;
}

.category-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.intro-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto;
}

/* Game Stats */
.game-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    background: var(--surface-light);
    padding: 1.5rem 1rem;
    border-radius: var(--border-radius);
    min-width: 120px;
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-3px);
    background: var(--surface-lighter);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Start Button */
.start-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 1.25rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 2rem auto;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.start-btn:active {
    transform: translateY(-1px);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.start-btn:hover .btn-glow {
    left: 100%;
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-text {
    font-weight: 600;
}

/* Difficulty Selector */
.difficulty-selector {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--surface-light);
}

.difficulty-selector label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.difficulty-selector select {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--surface-lighter);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.difficulty-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Question Card */
.question-card {
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--surface-light);
    position: relative;
    overflow: hidden;
}

.question-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.question-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.question-number {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.category-badge {
    background: var(--surface-light);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

.score-display {
    background: var(--success-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.score-icon {
    font-size: 1rem;
}

/* Question Content */
.question-content {
    margin-bottom: 2.5rem;
}

.question-text {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    color: var(--text-primary);
    margin: 0 auto;
    max-width: 700px;
}

/* Choices Grid */
.choices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.choice-btn {
    background: var(--surface-light);
    border: 2px solid transparent;
    color: var(--text-primary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    text-align: left;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.choice-btn:hover:not(.disabled) {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.choice-btn.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.choice-letter {
    background: var(--surface-lighter);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.choice-btn:hover:not(.disabled) .choice-letter {
    background: rgba(255,255,255,0.2);
    color: white;
}

.choice-text {
    flex: 1;
    font-weight: 500;
    line-height: 1.4;
}

.choice-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.choice-btn:hover:not(.disabled) .choice-glow {
    left: 100%;
}

/* Answer States */
.choice-btn.correct {
    background: var(--success-color) !important;
    border-color: var(--success-light);
    animation: correctPulse 0.8s ease;
}

.choice-btn.correct .choice-letter {
    background: rgba(255,255,255,0.3);
    color: white;
}

.choice-btn.wrong {
    background: var(--error-color) !important;
    border-color: var(--error-light);
    animation: wrongShake 0.6s ease;
}

.choice-btn.wrong .choice-letter {
    background: rgba(255,255,255,0.3);
    color: white;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.02); }
    50% { transform: scale(1.05); }
    75% { transform: scale(1.02); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

/* Result Container */
.result-container {
    margin: 1.5rem 0;
}

.result {
    background: var(--surface-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    border: 2px solid transparent;
    animation: fadeIn 0.6s ease;
}

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

.result.wrong {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error-color);
    color: var(--error-light);
}

.result-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.result-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.result-explanation {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--surface-lighter);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.next-btn, .skip-btn {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skip-btn {
    background: var(--surface-light);
    color: var(--text-secondary);
    box-shadow: none;
}

.next-btn:hover, .skip-btn:hover {
    transform: translateY(-2px);
}

.next-btn:hover {
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.3);
}

.skip-btn:hover {
    background: var(--surface-lighter);
    color: var(--text-primary);
}

/* End Screen */
.result-card {
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    padding: 3rem 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--surface-light);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--success-color), var(--primary-color));
}

.final-result-header {
    margin-bottom: 2rem;
}

.result-trophy {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.final-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--success-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.final-category {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Score Breakdown */
.score-breakdown {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    align-items: center;
    margin: 2rem 0;
    padding: 2rem;
    background: var(--surface-light);
    border-radius: var(--border-radius);
}

.final-score-display {
    text-align: center;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success-color), var(--primary-color));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    box-shadow: var(--shadow);
}

.score-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.score-total {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.8);
    font-weight: 600;
}

.score-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--surface-lighter);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Performance Badge */
.performance-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    margin: 2rem 0;
    background: linear-gradient(135deg, var(--warning-color), var(--success-color));
    border-radius: var(--border-radius);
    color: white;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.badge-icon {
    font-size: 2rem;
}

.badge-text {
    font-size: 1.2rem;
}

/* Highscore Entry */
.highscore-entry {
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(16, 185, 129, 0.1));
    border-radius: var(--border-radius);
    border: 1px solid var(--primary-color);
}

.highscore-prompt h3 {
    color: var(--success-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.highscore-prompt p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.name-input-container {
    display: flex;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.name-input {
    flex: 1;
    background: var(--surface-light);
    border: 2px solid var(--surface-lighter);
    color: var(--text-primary);
    padding: 1rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    min-width: 200px;
}

.name-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.submit-score-btn {
    background: linear-gradient(135deg, var(--success-color), var(--primary-color));
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.submit-score-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

/* Highscore Section */
.highscore-section {
    margin: 2rem 0;
}

.highscore-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-primary);
}

.highscore-table-container {
    background: var(--surface-light);
    border-radius: var(--border-radius);
    padding: 1rem;
    overflow-x: auto;
}

.highscore-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.highscore-table th,
.highscore-table td {
    padding: 1rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--surface-lighter);
}

.highscore-table th {
    background: var(--surface-lighter);
    color: var(--text-primary);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.highscore-table tr:hover {
    background: var(--surface-lighter);
}

.highscore-table tr:first-child td {
    color: var(--warning-color);
    font-weight: 600;
}

.highscore-table tr:nth-child(2) td {
    color: var(--text-secondary);
    font-weight: 600;
}

.highscore-table tr:nth-child(3) td {
    color: var(--error-light);
    font-weight: 600;
}

/* Final Actions */
.final-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.action-btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow);
}

.action-btn.secondary {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--surface-lighter);
}

.action-btn.tertiary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--surface-lighter);
}

.action-btn:hover {
    transform: translateY(-2px);
}

.action-btn.primary:hover {
    box-shadow: var(--shadow-lg);
}

.action-btn.secondary:hover {
    background: var(--surface-lighter);
}

.action-btn.tertiary:hover {
    color: var(--text-primary);
    background: var(--surface-light);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 50%;
    transform: translateX(50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--surface-light);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow);
    color: var(--text-primary);
    font-weight: 500;
    opacity: 0;
    transform: translateY(-20px);
    transition: var(--transition);
    max-width: 300px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast.toast-error {
    border-left: 4px solid var(--error-color);
}

.toast.toast-warning {
    border-left: 4px solid var(--warning-color);
}

.toast.toast-info {
    border-left: 4px solid var(--primary-color);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

.loading-text {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
}

/* MUSIC CONTROLS - Enhanced Integration for Quiz */
.music-controls {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 1000;
    background: var(--surface);
    border: 1px solid var(--surface-light);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    animation: slideUp 0.8s ease-out;
}

.music-controls:hover {
    transform: translateY(-3px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.4);
    border-color: var(--primary-color);
}

.music-toggle {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.music-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.music-toggle:hover::before {
    left: 100%;
}

.music-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.music-toggle.muted {
    background: linear-gradient(135deg, var(--error-color), #dc2626);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.music-toggle.muted:hover {
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.music-icon {
    font-size: 1rem;
    transition: var(--transition);
}

.music-text {
    font-size: 0.85rem;
    font-weight: 600;
}

.music-toggle:hover .music-icon {
    transform: scale(1.1) rotate(5deg);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.volume-icon {
    color: var(--text-secondary);
    font-size: 1rem;
    transition: var(--transition);
}

.music-controls:hover .volume-icon {
    color: var(--primary-color);
}

.volume-slider {
    width: 80px;
    height: 6px;
    background: var(--surface-light);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    appearance: none;
    transition: var(--transition);
    position: relative;
}

.volume-slider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    width: var(--volume-width, 30%);
    transition: var(--transition);
}

.volume-slider:hover {
    height: 8px;
    margin: -1px 0;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
    border: 2px solid white;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Music Controls Animation States */
.music-controls.playing .music-icon {
    animation: musicPulse 2s ease-in-out infinite;
}

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

.music-controls.volume-changing {
    transform: scale(1.02);
}

.music-visualizer {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 0.5rem;
    opacity: 0;
    transition: var(--transition);
}

.music-controls.playing .music-visualizer {
    opacity: 1;
}

.visualizer-bar {
    width: 2px;
    height: 8px;
    background: linear-gradient(to top, var(--primary-color), var(--secondary-color));
    border-radius: 1px;
    animation: visualize 1.5s ease-in-out infinite;
}

.visualizer-bar:nth-child(2) { animation-delay: 0.1s; }
.visualizer-bar:nth-child(3) { animation-delay: 0.2s; }
.visualizer-bar:nth-child(4) { animation-delay: 0.3s; }

@keyframes visualize {
    0%, 100% { height: 4px; opacity: 0.4; }
    50% { height: 12px; opacity: 1; }
}

/* Game-specific Music Controls adjustments */
.music-controls.game-mode {
    /* Quiz-specific styling adjustments */
    border-color: var(--success-color);
}

.music-controls.game-mode .music-toggle {
    background: linear-gradient(135deg, var(--success-color), var(--secondary-color));
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.music-controls.game-mode .music-toggle:hover {
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.music-controls.game-mode .volume-slider::before {
    background: linear-gradient(90deg, var(--success-color), var(--secondary-color));
}

.music-controls.game-mode .volume-slider::-webkit-slider-thumb {
    background: linear-gradient(135deg, var(--success-color), var(--secondary-dark));
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.music-controls.game-mode .visualizer-bar {
    background: linear-gradient(to top, var(--success-color), var(--secondary-color));
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .logo {
        width: 80px;
        height: 80px;
        margin-bottom: 1rem;
    }

    .logo-img {
        width: 50px;
        height: 50px;
    }

    .category-title {
        font-size: 2rem;
    }

    .intro-description {
        font-size: 1rem;
    }

    .game-stats {
        gap: 1rem;
    }

    .stat-item {
        min-width: 100px;
        padding: 1rem 0.75rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .question-card {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }

    .question-text {
        font-size: 1.2rem;
    }

    .choices-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .choice-btn {
        padding: 1.2rem;
        font-size: 0.95rem;
    }

    .choice-letter {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .timer-container {
        top: 1rem;
        right: 1rem;
    }

    .timer-circle {
        width: 60px;
        height: 60px;
    }

    .timer-text {
        font-size: 1rem;
    }

    .sound-toggle {
        top: 1rem;
        left: 1rem;
        width: 40px;
        height: 40px;
    }

    .sound-icon {
        font-size: 1rem;
    }

    .score-breakdown {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .score-circle {
        width: 100px;
        height: 100px;
    }

    .score-number {
        font-size: 2rem;
    }

    .final-actions {
        flex-direction: column;
        align-items: center;
    }

    .action-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .name-input-container {
        flex-direction: column;
        align-items: center;
    }

    .name-input {
        width: 100%;
        max-width: 300px;
    }

    .submit-score-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .toast-container {
        right: 1rem;
        left: 1rem;
        transform: none;
    }

    .toast {
        max-width: none;
    }

    /* Mobile Music Controls */
    .music-controls {
        bottom: 1rem;
        left: 1rem;
        padding: 0.5rem 1rem;
        gap: 0.75rem;
    }

    .music-toggle {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        gap: 0.4rem;
    }

    .music-icon {
        font-size: 0.9rem;
    }

    .music-text {
        font-size: 0.75rem;
    }

    .volume-control {
        gap: 0.5rem;
    }

    .volume-icon {
        font-size: 0.9rem;
    }

    .volume-slider {
        width: 60px;
        height: 5px;
    }

    .volume-slider::-webkit-slider-thumb {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .intro {
        padding: 2rem 1rem;
    }

    .category-title {
        font-size: 1.75rem;
    }

    .question-card {
        padding: 1rem;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .choice-btn {
        padding: 1rem;
        gap: 0.75rem;
    }

    .result-card {
        padding: 2rem 1rem;
    }

    .final-title {
        font-size: 2rem;
    }

    .result-trophy {
        font-size: 3rem;
    }

    /* Ultra Mobile Music Controls */
    .music-controls {
        padding: 0.4rem 0.8rem;
        gap: 0.5rem;
    }

    .music-toggle {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }

    .volume-slider {
        width: 50px;
        height: 4px;
    }

    .music-visualizer {
        display: none;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
.start-btn:focus,
.choice-btn:focus,
.next-btn:focus,
.skip-btn:focus,
.action-btn:focus,
.music-toggle:focus,
.volume-slider:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --surface: #000000;
        --surface-light: #333333;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
    }
}