/* Dynamic theme system */
:root {
    --theme-background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --theme-primary: #667eea;
    --theme-secondary: #764ba2;
    --theme-accent: #8b5cf6;
    --theme-question: linear-gradient(135deg, #e9d5ff 0%, #f3e8ff 100%);
    --theme-success: #d8b4fe;
    --theme-danger: #7c3aed;
    --theme-info: #e9d5ff;
    --theme-title: #581c87;
    --theme-progress: #d8b4fe;
    --theme-score: #a78bfa;
    --theme-svg-fill: #667eea;
}

/* Base styles */
body {
    background: var(--theme-background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* Theme indicator line at top */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--theme-secondary);
    z-index: 9999;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, var(--theme-accent) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, var(--theme-primary) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, var(--theme-secondary) 0%, transparent 50%);
    opacity: 0.1;
    pointer-events: none;
    z-index: -1;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* Title styling */
.title.is-2 {
    color: var(--theme-primary) !important;
    font-family: 'Comic Neue', cursive !important;
    font-weight: 400 !important;
    margin-bottom: 2rem !important;
    letter-spacing: 0.02em;
}

/* Progress bar */
.progress-info {
    margin-bottom: 2rem;
}

.progress-bar-container {
    width: 100%;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 32px;
    background: var(--theme-info);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    border-radius: 20px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Karla', sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    color: white;
    z-index: 10;
}

/* Question styling */
.question-container {
    background: var(--theme-primary);
    padding: 1rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    text-align: center;
    border: 2px solid var(--theme-secondary);
}

.subtitle.is-3 {
    color: white !important;
    font-family: 'Inter', sans-serif;
    font-weight: 600 !important;
    margin: 0 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Roman numeral display */
.roman-display {
    margin-bottom: 2rem;
}

.roman-numeral-container {
    background: var(--theme-question);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    border: 3px solid var(--theme-accent);
}

.roman-numeral-container:hover {
    transform: scale(1.02);
}

.roman-numeral-container img {
    max-width: 300px;
    max-height: 200px;
    width: auto;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* SVG Roman Numeral Styling */
.roman-svg {
    max-width: 300px;
    max-height: 200px;
    width: auto;
    height: auto;
    transition: all 0.3s ease;
}

/* Choices section */
.choices-section {
    margin-bottom: 2rem;
}

.choices-grid {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: nowrap;
}

.choice-btn {
    min-width: 120px;
    height: 80px;
    font-size: 2rem;
    font-family: 'Karla', sans-serif;
    font-weight: 600;
    background: white;
    border: 3px solid var(--theme-accent);
    color: var(--theme-primary);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
}

.choice-btn:hover:not(:disabled) {
    background: var(--theme-info);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--theme-primary);
}

.choice-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.choice-btn.selected {
    background: var(--theme-primary);
    color: white;
    border-color: var(--theme-primary);
    transform: scale(1.05);
}

.choice-btn.correct {
    background: #22c55e !important;
    color: white !important;
    border-color: #22c55e !important;
    animation: correctPulse 0.6s ease;
}

.choice-btn.incorrect {
    background: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
    animation: shake 0.5s ease-in-out;
}

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

/* Feedback message */
.feedback-message {
    margin: 2rem auto;
    max-width: 600px;
    font-family: 'Karla', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    text-align: center;
    border-radius: 10px;
    padding: 1rem 1.5rem;
}

.feedback-message.is-success {
    background: var(--theme-success);
    color: white;
}

.feedback-message.is-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 2px solid #fca5a5;
}

/* Buttons */
.button {
    font-family: 'Karla', sans-serif;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: none;
}

.button.is-info {
    background: var(--theme-primary);
    color: white;
}

.button.is-info:hover {
    background: var(--theme-secondary);
    transform: translateY(-2px);
}

.button.is-primary {
    background: var(--theme-primary);
    color: white;
}

.button.is-primary:hover {
    background: var(--theme-secondary);
    transform: translateY(-2px);
}

/* Result screen */
.result-card {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    margin: 0 auto;
}

#final-score {
    color: var(--theme-score) !important;
    font-family: 'Concert One', cursive;
    margin: 1rem 0 !important;
}

.result-message {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
}

.result-message.is-success {
    background: #d1fae5;
    color: #10b981;
}

.result-message.is-warning {
    background: #fef3c7;
    color: #f59e0b;
}

.result-message.is-info {
    background: var(--theme-info);
    color: var(--theme-primary);
}

/* Animations */
@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

/* Responsive design */
@media screen and (max-width: 768px) {
    .game-container {
        padding: 1.5rem;
    }
    
    .title.is-2 {
        font-size: 1.5rem !important;
    }
    
    .subtitle.is-3 {
        font-size: 1.25rem !important;
    }
    
    .roman-numeral-container {
        padding: 2rem;
        min-height: 200px;
    }
    
    .roman-numeral-container img,
    .roman-svg {
        max-width: 250px;
        max-height: 160px;
    }
    
    .choices-grid {
        gap: 1rem;
    }
    
    .choice-btn {
        min-width: 100px;
        height: 70px;
        font-size: 1.75rem;
    }
}

@media screen and (max-width: 480px) {
    .game-container {
        padding: 1rem;
    }
    
    .title.is-2 {
        font-size: 1.25rem !important;
    }
    
    .roman-numeral-container {
        padding: 1.5rem;
        min-height: 180px;
    }
    
    .roman-numeral-container img,
    .roman-svg {
        max-width: 200px;
        max-height: 140px;
    }
    
    .choices-grid {
        gap: 0.75rem;
    }
    
    .choice-btn {
        min-width: 80px;
        height: 60px;
        font-size: 1.5rem;
        padding: 0 1rem;
    }
    
    .progress-bar {
        height: 28px;
    }
    
    .progress-timer {
        font-size: 1rem;
    }
}

/* Very small screens */
@media screen and (max-width: 360px) {
    .title.is-2 {
        font-size: 1.1rem !important;
    }
    
    .subtitle.is-3 {
        font-size: 1.1rem !important;
    }
    
    .roman-numeral-container {
        padding: 1rem;
        min-height: 150px;
    }
    
    .roman-numeral-container img,
    .roman-svg {
        max-width: 180px;
        max-height: 120px;
    }
    
    .choice-btn {
        min-width: 70px;
        height: 50px;
        font-size: 1.25rem;
        border-width: 2px;
    }
}

/* Hide elements */
.is-hidden {
    display: none !important;
}

/* Sticky footer styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}
