/* 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;
    padding-bottom: 1.5rem;
    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;
}

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

/* Start screen removed - game starts automatically */

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

.addition-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.fingers-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    border: 3px solid var(--theme-accent);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 120px;
    width: 180px;
    justify-content: center;
    align-content: center;
    align-items: center;
    overflow: hidden;
}

.finger-item {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease-in;
}

.finger-image {
    height: 100px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.plus-sign {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--theme-primary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1;
}

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

.answer-section {
    text-align: center;
}

.answer-controls {
    display: inline-flex;
    align-items: stretch;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#answer-input {
    font-size: 1.5rem;
    font-family: 'Karla', sans-serif;
    text-align: center;
    width: 150px;
    border: 3px solid var(--theme-primary);
    border-right: none;
    border-radius: 10px 0 0 10px;
    height: 50px;
    -moz-appearance: textfield; /* Firefox */
    -webkit-appearance: none;
    box-sizing: border-box;
    margin: 0;
    padding: 0 1rem;
    outline: none;
    background: white;
    color: var(--theme-primary);
}

/* Remove number input arrows */
#answer-input::-webkit-outer-spin-button,
#answer-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#answer-input:focus {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 3px rgba(var(--theme-accent), 0.2);
    z-index: 1;
}

#submit-btn {
    font-size: 1.2rem;
    font-family: 'Karla', sans-serif;
    border-radius: 0 10px 10px 0;
    background: linear-gradient(45deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    color: white;
    border: none;
    height: 50px;
    padding: 0 1.5rem;
    box-sizing: border-box;
    margin: 0;
    cursor: pointer;
    white-space: nowrap;
}

#submit-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, var(--theme-accent) 0%, var(--theme-primary) 100%);
}

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

.feedback-message {
    margin-top: 1rem;
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    border-radius: 10px;
    animation: slideIn 0.3s ease-out;
    border: 2px solid currentColor;
    text-align: center;
    font-weight: 600;
}

.notification.is-success {
    background-color: var(--theme-success);
    color: var(--theme-primary);
    border: 2px solid var(--theme-secondary);
}

.notification.is-danger {
    background-color: var(--theme-danger);
    color: white;
    border: 2px solid var(--theme-primary);
}

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

#next-btn {
    margin-top: 1rem;
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    background: linear-gradient(45deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

#next-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(45deg, var(--theme-accent) 0%, var(--theme-primary) 100%);
}

.result-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 3px solid var(--theme-primary);
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#final-score {
    font-size: 3rem;
    margin: 1rem 0;
    animation: zoomIn 0.5s ease-out;
    color: var(--theme-primary);
    font-weight: 900;
}

@keyframes zoomIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.result-message {
    font-size: 1.3rem;
    color: var(--theme-primary);
    margin: 1.5rem 0;
}

#play-again-btn {
    margin: 1.5rem 0 0;
    font-size: 1.2rem;
    padding: 1rem 2.5rem;
    border-radius: 30px;
    background: linear-gradient(45deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    color: white;
    border: none;
    transition: all 0.3s ease;
    display: inline-block;
}

#play-again-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(45deg, var(--theme-accent) 0%, var(--theme-primary) 100%);
}

/* Theme-based styling for all text elements */
#result-screen .title {
    color: var(--theme-primary);
}

#result-screen .subtitle {
    color: var(--theme-secondary);
}

/* Style time display */
#time-taken {
    color: var(--theme-primary);
    background: var(--theme-info);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    display: inline-block;
}

/* Progress bar effect for tags */


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

/* Style feedback notification text */

/* Mobile text abbreviation */
@media (max-width: 768px) {
    #question-text {
        font-size: 1.2rem;
    }

    #play-again-btn {
        font-size: 1.1rem;
        padding: 0.75rem 2rem;
        width: auto;
        min-width: 150px;
    }
    
    .plus-sign {
        font-size: 3rem;
    }

/* Extra small screens */
@media (max-width: 480px) {
    #question-text {
        font-size: 1.1rem;
    }

    #play-again-btn {
        font-size: 1rem;
        padding: 0.6rem 1.5rem;
        min-width: 120px;
    }
    
    .addition-display {
        gap: 1rem;
    }
    
    .fingers-cell {
        width: 100%;
        max-width: 280px;
        padding: 1rem;
        gap: 0.4rem;
        min-height: 100px;
    }
    
    .finger-image {
        height: 80px;
    }
    
    .plus-sign {
        font-size: 2.5rem;
        width: 100%;
        text-align: center;
    }
    
    .game-container .title {
        font-size: 1rem;
    }
    
    #question-text {
    font-family: 'Inter', sans-serif;
        font-size: 1.1rem;
    }
    
    .tag {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    #final-score {
        font-size: 2.5rem;
    }
}

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

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

/* Title responsive font sizes */
@media (max-width: 768px) {
    .game-container .title,
    .game-container h1.title {
        font-size: 1.1rem !important;
    }
}

@media (max-width: 480px) {
    .game-container .title,
    .game-container h1.title {
        font-size: 1rem !important;
    }
}

/* Very small screens */
@media screen and (max-width: 360px) {
    .box.game-container {
        padding: 0.75rem;
        padding-bottom: 1.5rem;
    }
    
    .addition-display {
        gap: 0.75rem;
    }
    
    .fingers-cell {
        padding: 0.75rem;
        gap: 0.3rem;
        min-height: 90px;
    }
    
    .finger-image {
        height: 70px;
    }
    
    .plus-sign {
        font-size: 2rem;
    }
}
}

/* Progress bar responsive styles */
@media (max-width: 768px) {
    .progress-bar {
        height: 28px;
    }
    
    .progress-timer {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .progress-bar {
        height: 26px;
    }
    
    .progress-timer {
        font-size: 1rem;
    }
}

@media screen and (max-width: 360px) {
    .progress-bar {
        height: 24px;
    }
    
    .progress-timer {
        font-size: 0.9rem;
    }
}