/**
 * Abacus Master Game Styles - Updated: result shown in central flashing area
 */

:root {
    --primary: #4f46e5;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #eab308;
    --bg: #f9fafb;
    --card-bg: white;
    --text: #111827;
    --shadow: 0 4px 12px rgba(0,0,0,0.06);
    --radius: 12px;
}

.abacus-master {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.game-header {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    border-radius: var(--radius) var(--radius) 0 0;
}

.game-title {
    margin: 0;
    font-size: 2.4rem;
}

.game-description {
    margin: 0.5rem 0 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

.setup-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.form-field label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
}

.start-area {
    text-align: center;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
}

.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger  { background: var(--danger);  color: white; }
.btn-warning { background: var(--warning); color: var(--text); }

.game-area .game-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2rem;
}

@media (max-width: 850px) {
    .game-grid {
        grid-template-columns: 1fr;
    }
}

.panel-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.numbers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 1rem;
    background: #f3f4f6;
    border-radius: 10px;
    min-height: 80px;
    margin-bottom: 1.5rem;
}

.number-item {
    padding: 0.6rem 1.2rem;
    background: var(--primary);
    color: white;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1.1rem;
}

.number-item.addition-item    { background: var(--success); }
.number-item.subtraction-item { background: #f87171; }

.current-display {
    font-size: 5rem;
    font-weight: bold;
    text-align: center;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: all 0.4s ease;
}

.progress-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

progress {
    flex: 1;
    height: 10px;
    border-radius: 999px;
    background: #e5e7eb;
}

progress::-webkit-progress-value,
progress::-moz-progress-bar {
    background: var(--primary);
    border-radius: 999px;
}

.progress-label {
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

.answer-input {
    width: 100%;
    font-size: 2.2rem;
    text-align: center;
    padding: 1rem;
    margin: 1rem 0 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    transition: border-color 0.3s;
}

.answer-input:focus {
    border-color: var(--primary);
    outline: none;
}

.game-controls-inline {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
    justify-content: center;
}

.timer-box {
    text-align: center;
    margin-top: 1.5rem;
}

.timer-label {
    font-size: 1.1rem;
    color: #6b7280;
}

.timer-value {
    font-size: 2.8rem;
    font-family: monospace;
    color: var(--primary);
    font-weight: bold;
}

/* ── RESULT SHOWN IN CENTRAL AREA ─────────────────────────────────────── */

#current-number.result-correct,
#current-number.result-incorrect {
    font-size: 1.9rem;
    line-height: 1.45;
    padding: 1.5rem 2rem;
    border-radius: 16px;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    animation: resultFadeIn 0.5s ease-out;
}

#current-number.result-correct {
    background: #ecfdf5;
    color: #065f46;
    border: 3px solid #10b981;
}

#current-number.result-incorrect {
    background: #fef2f2;
    color: #991b1b;
    border: 3px solid #ef4444;
}

#current-number.result-correct strong,
#current-number.result-incorrect strong {
    font-size: 2.4rem;
    display: block;
    margin: 0.4rem 0;
}

@keyframes resultFadeIn {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}

/* Accessibility */
button:focus, input:focus, select:focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}