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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1200px;
    width: 100%;
    position: relative;
}

.back-button {
    display: inline-block;
    padding: 10px 20px;
    background: #f8f9fa;
    color: #667eea;
    text-decoration: none;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 20px;
    transition: all 0.3s;
    border: 2px solid #e9ecef;
}

.back-button:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateX(-5px);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.score-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.score-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.score-label {
    margin-right: 10px;
}

.score-number {
    font-size: 1.5rem;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-reset {
    padding: 10px 20px;
    font-size: 0.9rem;
    border: 2px solid #e53e3e;
    background: white;
    color: #e53e3e;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-reset:hover {
    background: #e53e3e;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.grid-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 30px auto;
    padding: 20px;
    max-width: 1200px;
}

.single-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    gap: 3px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 180px;
    height: 180px;
    position: relative;
}

.single-grid.invisible-placeholder {
    background: transparent;
    box-shadow: none;
    visibility: hidden;
}

.single-grid::before,
.single-grid::after {
    content: '';
    position: absolute;
    background: rgba(102, 126, 234, 0.25);
    z-index: 1;
    pointer-events: none;
}

/* Vertical divider line between columns 5 and 6 */
.single-grid::before {
    left: calc(50% - 1px);
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: repeating-linear-gradient(
        to bottom,
        rgba(102, 126, 234, 0.3) 0px,
        rgba(102, 126, 234, 0.3) 4px,
        transparent 4px,
        transparent 8px
    );
}

/* Horizontal divider line between rows 5 and 6 */
.single-grid::after {
    top: calc(50% - 1px);
    left: 10px;
    right: 10px;
    height: 2px;
    background: repeating-linear-gradient(
        to right,
        rgba(102, 126, 234, 0.3) 0px,
        rgba(102, 126, 234, 0.3) 4px,
        transparent 4px,
        transparent 8px
    );
}

.dot {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #667eea;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.dot.visible {
    animation: popIn 0.3s ease-out;
}

.dot.empty {
    background: transparent;
    box-shadow: none;
}

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

.single-grid.correct-answer {
    animation: correctPulse 0.6s ease-out;
    box-shadow: 0 0 30px rgba(72, 187, 120, 0.8), inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

@keyframes correctPulse {
    0% {
        transform: scale(1);
        box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(72, 187, 120, 1), inset 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 30px rgba(72, 187, 120, 0.8), inset 0 2px 10px rgba(0, 0, 0, 0.1);
    }
}

.answer-section {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

#answerInput {
    padding: 15px 20px;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    width: 250px;
    text-align: center;
    transition: border-color 0.3s;
}

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

#answerInput[type=number] {
    -moz-appearance: textfield;
}

#answerInput:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary,
.btn-secondary {
    padding: 15px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #48bb78;
    color: white;
}

.btn-secondary:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

.feedback {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    min-height: 40px;
    padding: 15px;
    border-radius: 10px;
    transition: all 0.3s;
}

.feedback.correct {
    color: #38a169;
    background: #c6f6d5;
    animation: celebrate 0.5s ease-out;
}

.feedback.incorrect {
    color: #e53e3e;
    background: #fed7d7;
    animation: shake 0.5s ease-out;
}

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

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

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .score-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .score-display {
        font-size: 1rem;
        padding: 12px 25px;
    }
    
    .score-number {
        font-size: 1.3rem;
    }
    
    .single-grid {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        gap: 5px;
        padding: 15px;
    }
    
    #answerInput {
        width: 100%;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}

