: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;
}

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

/* 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;
}

.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 2rem 0 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;
}

/* Override Bulma title styling */
h1.title {
    font-family: 'Comic Neue', cursive !important;
    font-weight: 400 !important;
    text-shadow: none !important;
}

.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;
    font-weight: 400;
}

/* Section styling */
.section {
    padding: 3rem 1.5rem;
}

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

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

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

.progress-bar {
    width: 100%;
    height: 32px;
    background: var(--theme-info);
    border-radius: 16px;
    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%;
    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;
}

/* Timer styling */
#timer {
    font-family: 'Karla', sans-serif;
}

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

.question-container .subtitle {
    color: white;
    font-family: 'Comic Neue', cursive;
    font-weight: 400;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Pattern Container */
.pattern-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 3px solid var(--theme-accent);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pattern-sequence {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.pattern-item {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pattern-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pattern-item.question-mark {
    font-size: 3rem;
    color: var(--theme-primary);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    border: 3px dashed var(--theme-accent);
}

/* Shape Options */
.shape-options-container {
    margin-bottom: 2rem;
}

.shape-options {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.shape-option {
    width: 100px;
    height: 100px;
    padding: 1rem;
    background: white;
    border: 3px solid #e5e7eb;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.shape-option img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.shape-option:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.shape-option.selected {
    border-color: var(--theme-primary);
    background: var(--theme-info);
    transform: scale(1.05);
}

.shape-option.correct {
    border-color: #22c55e;
    background: #dcfce7;
    animation: correctPulse 0.6s ease;
}

.shape-option.incorrect {
    border-color: #ef4444;
    background: #fee2e2;
    animation: shake 0.5s ease;
}

.shape-option:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Submit Button */
.submit-container {
    margin: 2rem 0;
}

#submit-btn {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: white;
    font-weight: 400;
    font-size: 1.25rem;
    padding: 1.5rem 3rem;
    transition: all 0.3s ease;
}

#submit-btn:hover:not(:disabled) {
    background: var(--theme-secondary);
    border-color: var(--theme-secondary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

#submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.feedback-message.notification {
    font-weight: 300 !important;
}

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

.feedback-message.is-danger {
    background: var(--theme-info);
    color: var(--theme-danger);
    border: 2px solid var(--theme-accent);
}

/* Next Button */
#next-btn-container {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

#next-btn {
    background: #10b981;
    border-color: #10b981;
    color: white;
    font-weight: 400;
    font-size: 1.25rem;
    padding: 1.5rem 3rem;
}

#next-btn:hover {
    background: #059669;
    border-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Result Screen */
.result-stats {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

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

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

#play-again-btn {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: white;
    font-weight: 400;
    font-size: 1.25rem;
    padding: 1.5rem 3rem;
    margin-bottom: 2rem;
}

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

/* Animations */
@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(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) {
    .box.game-container {
        padding: 1.5rem 1.5rem 0 1.5rem;
        border-width: 3px;
    }
    
    .game-container .title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem !important;
    }
    
    .pattern-container {
        padding: 1.5rem;
    }
    
    .pattern-sequence {
        gap: 1rem;
    }
    
    .pattern-item {
        width: 60px;
        height: 60px;
    }
    
    .pattern-item.question-mark {
        font-size: 2.5rem;
    }
    
    .shape-options {
        gap: 1.5rem;
    }
    
    .shape-option {
        width: 80px;
        height: 80px;
        padding: 0.75rem;
    }
    
    #submit-btn, #next-btn, #play-again-btn {
        font-size: 1.1rem;
        padding: 1.25rem 2.5rem;
    }
}

@media screen and (max-width: 480px) {
    .game-container .title {
        font-size: 1.25rem;
    }
    
    .question-container .subtitle {
        font-size: 1.5rem !important;
    }
    
    .pattern-container {
        padding: 1rem;
    }
    
    .pattern-sequence {
        gap: 0.75rem;
    }
    
    .pattern-item {
        width: 45px;
        height: 45px;
    }
    
    .pattern-item.question-mark {
        font-size: 2rem;
        border-width: 2px;
    }
    
    .shape-options {
        gap: 1rem;
    }
    
    .shape-option {
        width: 70px;
        height: 70px;
        padding: 0.5rem;
        border-width: 2px;
    }
    
    #submit-btn, #next-btn, #play-again-btn {
        font-size: 1rem;
        padding: 1rem 2rem;
    }
    
    .progress-bar {
        height: 28px;
    }
    
    .progress-timer {
        font-size: 1rem;
    }
}

/* Very small screens */
@media screen and (max-width: 360px) {
    .section {
        padding: 1.5rem 0.75rem;
    }
    
    .box.game-container {
        padding: 0.75rem 0.75rem 0 0.75rem;
    }
    
    .game-container .title {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .question-container .subtitle {
        font-size: 1.25rem !important;
    }
    
    .pattern-item {
        width: 40px;
        height: 40px;
    }
    
    .pattern-item.question-mark {
        font-size: 1.75rem;
    }
    
    .shape-option {
        width: 60px;
        height: 60px;
    }
    
    .progress-bar {
        height: 24px;
    }
    
    .progress-timer {
        font-size: 0.9rem;
    }
}

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