/* ============================================================
   Short Multiplication — Per-Game Styles
   ============================================================ */

/* ===== COLOUR SCHEME ===== */
:root {
    --primary-color:       #6473df;
    --primary-hover:       #4d5ec9;
    --primary-light:       rgba(100, 115, 223, 0.12);
    --primary-shadow:      rgba(100, 115, 223, 0.35);
    --btn-text-color:      #fff;
    --hero-gradient-start: rgba(100, 115, 223, 0.18);
    --hero-gradient-end:   rgba(144, 223, 204, 0.12);
}

/* ===== GAME-SPECIFIC: question text ===== */

.question-text {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
}

/* ===== GAME-SPECIFIC: instructions ===== */

.sd-instructions {
    text-align: center;
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1rem;
    padding: 0.6rem 1rem;
    background: var(--primary-light);
    border-radius: 0.5rem;
}

/* ===== GAME-SPECIFIC: level cards ===== */

.sm-level-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.sm-level-card {
    border: 3px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.sm-level-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-shadow);
}

.sm-level-card.active {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.sm-level-number {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 auto 0.75rem;
}

.sm-level-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.sm-level-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    color: #6b7280;
    text-align: left;
}

.sm-level-card ul li::before { content: '• '; color: var(--primary-color); }

@media (max-width: 576px) {
    .sm-level-cards { grid-template-columns: 1fr; }
}

/* ===== GAME-SPECIFIC: column multiplication table ===== */

.problem-container {
    display: flex;
    justify-content: center;
    padding: 1.5rem 0;
}

.column-multiplication {
    display: inline-block;
    font-family: 'Courier New', monospace;
}

.number-row, .multiplier-row, .answer-row, .carry-row {
    display: flex;
    align-items: center;
}

.digit-cell, .carry-cell {
    width: 4rem;
    text-align: center;
    position: relative;
}

.number-display {
    font-size: 2.8rem;
    font-weight: 700;
    color: #1f2937;
}

.operator {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.multiplier-row {
    border-bottom: 4px solid #1f2937;
    padding-bottom: 4px;
    margin-bottom: 4px;
}

.digit-input {
    width: 3.2rem;
    height: 3.2rem;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    border: 3px solid var(--primary-color);
    border-radius: 0.4rem;
    background: rgba(100, 115, 223, 0.08);
    color: #1f2937;
    outline: none;
}

.digit-input:focus { border-color: var(--primary-hover); box-shadow: 0 0 0 3px var(--primary-shadow); }
.digit-input.correct   { background: #d4edda; border-color: #28a745; color: #155724; }
.digit-input.incorrect { background: #f8d7da; border-color: #dc3545; color: #721c24; }

.carry-input {
    width: 2rem;
    height: 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    border: 2px solid #ff9800;
    border-radius: 0.3rem;
    background: #fff8e1;
    color: #e65100;
    outline: none;
}

.carry-input.correct   { background: #d4edda; border-color: #28a745; color: #155724; }
.carry-input.incorrect { background: #f8d7da; border-color: #dc3545; color: #721c24; }

/* ===== GAME-SPECIFIC: feedback ===== */

.feedback {
    margin: 12px auto;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    text-align: center;
    width: fit-content;
    max-width: 90%;
}

.feedback.success { background: #e6ffed; color: #00702d; border: 2px solid #00c04f; }
.feedback.error   { background: #ffe6e6; color: #a30000; border: 2px solid #ff3333; }

/* ===== GAME-SPECIFIC: controls (shared with shortdivision pattern) ===== */

.sd-controls { margin-top: 1.25rem; }

.sd-btn-row {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.sd-check-btn {
    flex: 3;
    max-width: 400px;
}

.sd-clear-btn {
    flex: 1;
    max-width: 140px;
    background: white !important;
    border: 2px solid #adb5bd !important;
    color: #374151 !important;
    box-shadow: none !important;
}

.sd-clear-btn:hover {
    background: #f8f9fa !important;
    border-color: #6c757d !important;
    color: #212529 !important;
    box-shadow: none !important;
    transform: none !important;
}

/* ===== GAME-SPECIFIC: flash ===== */

@keyframes flash-correct {
    0%, 100% { background-color: transparent; }
    50%       { background-color: rgba(76,175,80,0.2); }
}

@keyframes flash-incorrect {
    0%, 100% { background-color: transparent; }
    50%       { background-color: rgba(244,67,54,0.2); }
}

.gs-game-card.flash-correct   { animation: flash-correct   0.6s ease; }
.gs-game-card.flash-incorrect { animation: flash-incorrect 0.6s ease; }

/* ===== UTILITIES ===== */

input[type=text]::-webkit-inner-spin-button,
input[type=text]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }