/* Theme variables - will be set dynamically by JavaScript */
:root {
    --theme-background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    --theme-primary: #7c3aed;
    --theme-secondary: #8b5cf6;
    --theme-accent: #a78bfa;
    --theme-question: linear-gradient(135deg, #ddd6fe 0%, #ede9fe 100%);
    --theme-success: #c4b5fd;
    --theme-danger: #6d28d9;
    --theme-info: #ddd6fe;
    --theme-title: #5b21b6;
    --theme-progress: #c4b5fd;
    --theme-score: #a78bfa;
}

/* Override Bulma column padding */
.column {
    padding: 0 !important;
}

body {
    background: var(--theme-background);
    min-height: 100vh;
    font-family: 'Karla', sans-serif;
    color: var(--theme-primary);
}

/* Section styling for proper spacing with header/footer */
.section {
    padding: 3rem 1.5rem;
}

/* Match top spacing with Add One game on mobile */
@media screen and (max-width: 480px) {
    .section {
        padding-top: 1.5rem;
    }
}

.box.game-container {
    background: var(--theme-question);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 4px solid var(--theme-accent);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.game-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--theme-accent) 0%, transparent 70%);
    opacity: 0.05;
    transform: rotate(45deg);
    pointer-events: none;
}

.title {
    color: var(--theme-primary);
    font-family: 'Comic Neue', cursive !important;
    font-weight: 400 !important;
    letter-spacing: 0.02em;
}

/* Specific game title */
.game-container h1.title {
    font-family: 'Comic Neue', cursive !important;
    font-weight: 400 !important;
    margin-bottom: 2rem !important;
}

.subtitle {
    color: var(--theme-primary);
    opacity: 0.9;
}

/* Add subtle pattern overlay */
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;
}

.progress-info {
    margin-bottom: 2rem;
}

/* Progress bar styles */
.progress-bar-container {
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 32px;
    background: var(--theme-progress);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    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;
    width: 10%; /* Will be updated dynamically */
    transition: width 0.3s ease;
}

.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-container {
    background: var(--theme-primary);
    padding: 1rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    border: 2px solid var(--theme-secondary);
}

#question-text {
    font-family: 'Inter', sans-serif;
    color: white;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.dollar-bill-display {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    margin-bottom: 2rem;
    min-height: 200px;
    border: 3px solid var(--theme-accent);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dollar-bill-item {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    animation: fadeIn 0.5s ease-in;
    width: 100%;
    max-width: 400px;
}

.dollar-bill-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Multiple choice specific styles */
.choices-section {
    margin-top: 2rem;
    text-align: center;
}

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

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

.choice-button::before {
    content: "$";
    margin-right: 0.2rem;
}

.choice-button:hover:not(:disabled) {
    background: var(--theme-accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.choice-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.choice-button.selected {
    background: var(--theme-primary);
    color: white;
    border-color: var(--theme-secondary);
}

.choice-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.choice-button.correct {
    background: #22c55e;
    border-color: #16a34a;
    color: white;
    animation: pulse 0.5s ease-in-out;
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.feedback-message {
    margin: 2rem auto;
    max-width: 600px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-size: 1.2rem;
    text-align: center;
    font-weight: 600;
}

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

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

#next-btn {
    background: var(--theme-primary);
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

#next-btn:hover {
    background: var(--theme-secondary);
    transform: translateY(-2px);
}

.result-card {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
}

#final-score {
    color: var(--theme-score);
    font-weight: 700;
    margin: 1rem 0;
}

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

.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);
}

#play-again-btn {
    background: var(--theme-primary);
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    padding: 1rem 2rem;
    transition: all 0.3s ease;
}

#play-again-btn:hover {
    background: var(--theme-secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    .box.game-container {
        padding: 1.5rem;
        border-width: 3px;
    }
    
    .game-container h1.title {
        font-size: 1.75rem;
    }
    
    .dollar-bill-display {
        padding: 1.5rem;
    }
    
    .dollar-bill-item {
        padding: 0.5rem;
    }
    
    .choice-button {
        min-width: 100px;
        height: 70px;
        font-size: 1.5rem;
        padding: 0 1.25rem;
    }
    
    .choices-grid {
        gap: 1rem;
    }
}

@media screen and (max-width: 480px) {
    .game-container h1.title {
        font-size: 1.5rem;
    }
    
    .dollar-bill-display {
        padding: 1rem;
        min-height: 150px;
    }
    
    #question-text {
        font-size: 1.25rem !important;
    }
    
    .choice-button {
        min-width: 80px;
        height: 60px;
        font-size: 1.3rem;
        padding: 0 1rem;
    }
    
    .choices-grid {
        gap: 0.5rem;
    }
}

/* iPhone 4 and very small screens */
@media (max-width: 320px) {
    .choice-button {
        min-width: 70px;
        height: 50px;
        font-size: 1.1rem;
        padding: 0 0.75rem;
    }
    
    .choices-grid {
        gap: 0.4rem;
        padding: 0 0.25rem;
    }
    
    .choices-section {
        padding: 0 0.5rem;
    }
}

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