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

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

.container {
    max-width: 900px;
    width: 100%;
}

.screen {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    color: #333;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

.title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
}

.setup-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-group label {
    font-weight: 600;
    color: #555;
}

.difficulty-select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.difficulty-select:hover,
.difficulty-select:focus {
    border-color: #f093fb;
    outline: none;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    width: 100%;
    margin-bottom: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(240, 147, 251, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    width: 100%;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-hint {
    background: #ffd700;
    color: #333;
    padding: 10px 20px;
    font-size: 0.9rem;
}

.btn-hint:hover {
    background: #ffed4e;
}

/* Game Screen */
.game-header {
    margin-bottom: 30px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
    color: #555;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.game-content {
    text-align: center;
}

.problem-display {
    margin: 30px 0 20px 0;
}

.instruction-text {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 15px;
    font-weight: 500;
}

.problem-text {
    font-size: 2rem;
    color: #333;
    font-weight: 700;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 0 auto;
    max-width: 600px;
}

/* Place Value Visual */
.place-value-visual {
    margin: 20px auto;
    max-width: 600px;
}

.place-value-chart {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.place-value-box {
    background: white;
    border: 3px solid #f093fb;
    border-radius: 8px;
    padding: 15px 10px;
    text-align: center;
}

.place-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

.place-digit {
    font-size: 2rem;
    color: #f5576c;
    font-weight: 700;
}

/* Answer Section */
.answer-section {
    margin: 20px 0;
}

.answer-input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.answer-input {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    padding: 15px;
    font-size: 1.5rem;
    border: 3px solid #ddd;
    border-radius: 10px;
    text-align: center;
}

.answer-input:focus {
    outline: none;
    border-color: #f093fb;
}

.submit-btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.4);
}

.answer-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.choice-btn {
    padding: 20px;
    font-size: 1.2rem;
    background: white;
    border: 3px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    color: #333;
}

.choice-btn:hover {
    border-color: #f093fb;
    background: #fef5ff;
    transform: translateY(-2px);
}

.choice-btn.selected {
    background: #f093fb;
    border-color: #f093fb;
    color: white;
}

.feedback {
    min-height: 60px;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.hint-section {
    margin-top: 20px;
}

.hint-content {
    margin-top: 15px;
    padding: 15px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    display: none;
    text-align: left;
    color: #856404;
    line-height: 1.6;
}

.hint-content.show {
    display: block;
}

/* Results Screen */
.results-content {
    margin: 30px 0;
}

.score-summary {
    text-align: center;
    margin-bottom: 30px;
}

.score-summary h2 {
    font-size: 3rem;
    color: #f093fb;
    margin-bottom: 10px;
}

.score-summary p {
    font-size: 1.5rem;
    color: #666;
}

.result-message {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 20px;
    color: #333;
}

.missed-problems {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.missed-problems h3 {
    color: #555;
    margin-bottom: 15px;
}

.missed-problem {
    padding: 10px;
    background: white;
    margin-bottom: 10px;
    border-radius: 5px;
    border-left: 4px solid #dc3545;
    text-align: left;
}

.results-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Responsive */
@media (max-width: 600px) {
    .screen {
        padding: 20px;
    }

    .title {
        font-size: 2rem;
    }

    .problem-text {
        font-size: 1.5rem;
        padding: 15px;
    }

    .instruction-text {
        font-size: 1.1rem;
    }

    .place-value-chart {
        grid-template-columns: repeat(2, 1fr);
    }

    .place-digit {
        font-size: 1.5rem;
    }

    .answer-choices {
        grid-template-columns: 1fr;
    }

    .score-summary h2 {
        font-size: 2rem;
    }
}
