/* ============================================================================
   MathGuru — shared practice-page styles.

   Per-page accent contract — every consuming page MUST define these:
     --op-accent        the page's primary hue
     --op-accent-2      its secondary/gradient partner
     --op-accent-soft   a translucent wash of the primary
   ============================================================================ */

:root {
    /* Fallback hues, so a page that forgets the accent variables
       still renders styled rather than unstyled. */
    --op-accent:      #667eea;
    --op-accent-2:    #764ba2;
    --op-accent-soft: rgba(102, 126, 234, 0.2);
}


/* ==========================================================================
   Identical across all four operation pages — copied verbatim. */

#problemDisplay {
    display: none !important;
}
#verticalMode .subtitle {
    display: none !important;
}
* {
    box-sizing: border-box;
}
.auth-link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    transition: background 0.15s;
}
.auth-link-primary {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #0f172a;
    border-color: transparent;
}
.auth-link:hover {
    background: rgba(255, 255, 255, 0.06);
}
.auth-username {
    color: #cbd5e1;
    font-size: 0.85rem;
    font-weight: 600;
}
.btn-pdf {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    margin: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    text-decoration: none;
    display: inline-block;
}
.btn-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
}
.container {
    background: transparent;
}
.horizontal-problem {
    display: none;
    text-align: center;
    padding: 30px;
}
.level-badge {
    position: relative;
    display: inline-block;
    padding-top: 15px;
}
.level-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.level-display {
    text-align: center;
    margin: 25px auto;
    user-select: none;
    perspective: 1000px;
}
.level-down-effect {
    animation: levelDownShake 0.4s ease;
}
.level-info {
    text-align: center;
    min-width: 180px;
    position: relative;
}
.level-input-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}
.level-label {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 5px;
    font-weight: 700;
}
.level-number {
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    display: inline-block;
    min-width: 80px;
    position: relative;
    color: white;
}
.level-number.scroll-down {
    animation: scrollDown 0.2s ease-out;
}
.level-number.scroll-up {
    animation: scrollUp 0.2s ease-out;
}
.level-number:hover {
    transform: scale(1.1);
}
.level-number:hover .level-value {
    text-shadow: 0 0 30px rgba(255,255,255,0.8), 0 4px 15px rgba(0,0,0,0.3);
}
.level-selector-popup.show {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.level-star {
    font-size: 1rem;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255,215,0,0.8);
}
.level-stars {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
}
.level-up-effect {
    animation: levelUpCelebrate 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.level-value {
    display: block;
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
    color: #fff;
    text-shadow: 0 0 20px rgba(255,255,255,0.5), 0 4px 10px rgba(0,0,0,0.3);
}
.navigation .nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}
.overlay.show {
    display: block;
}
.phase-popup .btn {
    margin: 5px;
}
.phase-popup .result {
    font-size: 2em;
    font-weight: bold;
    margin: 15px 0;
}
.phase-popup.show {
    transform: translate(-50%, -50%) scale(1);
}
.phase-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.premium-wall {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(145deg, rgba(30,30,60,0.98), rgba(20,20,45,0.98));
    padding: 38px 32px;
    border-radius: 25px;
    border: 1px solid rgba(167,139,250,0.35);
    box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 40px rgba(167,139,250,0.25);
    z-index: 1003;
    max-width: 420px;
    width: 90%;
    text-align: center;
    display: none;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275), opacity 0.3s ease;
}
.premium-wall .pw-cta {
    display: block;
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #5b6ee1, #7c5fd3);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 1.05rem;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(91,110,225,0.4);
}
.premium-wall .pw-dismiss {
    display: block;
    width: 100%;
    padding: 11px;
    background: transparent;
    color: #94a3b8;
    border: 1px solid rgba(148,163,184,0.3);
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
}
.premium-wall .pw-emoji {
    font-size: 3rem;
    margin-bottom: 6px;
}
.premium-wall h2 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 1.55rem;
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.premium-wall p {
    color: #cbd5e1;
    font-size: 1.05rem;
    line-height: 1.5;
    margin: 0 0 24px;
}
.premium-wall.show {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.score-panel .score-correct .score-value {
    color: #4ade80;
    text-shadow: 0 0 15px rgba(74, 222, 128, 0.5);
}
.score-panel .score-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 12px 20px;
}
.score-panel .score-value {
    color: #fff;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}
.sparkle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #ffd700 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: sparkleFloat 1s ease-out forwards;
}
.streak-popup.show {
    transform: translate(-50%, -50%) scale(1);
}
.user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.wrong-actions .action-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
@keyframes levelContainerFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
@keyframes levelDownShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}
@keyframes levelUpCelebrate {
    0% { transform: scale(1); }
    25% { transform: scale(1.3) rotate(-5deg); }
    50% { transform: scale(1.4) rotate(5deg); filter: drop-shadow(0 0 30px rgba(255,215,0,0.8)); }
    75% { transform: scale(1.2) rotate(-3deg); }
    100% { transform: scale(1); }
}
@keyframes scrollDown {
    0% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(15px); opacity: 0.5; }
    100% { transform: translateY(0); opacity: 1; }
}
@keyframes scrollUp {
    0% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(-15px); opacity: 0.5; }
    100% { transform: translateY(0); opacity: 1; }
}
@keyframes sparkleFloat {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}
@keyframes starTwinkle {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}
@media (max-width: 768px) {
    .horizontal-problem .answer-section {
        font-size: 1.8rem;
    }
}

/* ==========================================================================
   Shared popup and button styles. */

.btn-next {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #0f0f23;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -4px 0 rgba(0, 0, 0, 0.2), 0 5px 0 #15803d, 0 8px 14px rgba(0, 0, 0, 0.18) !important;
    position: relative !important;
    border-radius: 14px !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15) !important;
    transition: transform 0.08s ease, box-shadow 0.08s ease !important;
}
.btn-reset {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -4px 0 rgba(0, 0, 0, 0.2), 0 5px 0 #b45309, 0 8px 14px rgba(0, 0, 0, 0.18) !important;
    position: relative !important;
    border-radius: 14px !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15) !important;
    transition: transform 0.08s ease, box-shadow 0.08s ease !important;
}
.btn-retry {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -4px 0 rgba(0, 0, 0, 0.2), 0 5px 0 #4338ca, 0 8px 14px rgba(0, 0, 0, 0.18) !important;
    position: relative !important;
    border-radius: 14px !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15) !important;
    transition: transform 0.08s ease, box-shadow 0.08s ease !important;
}
.cell {
    background: linear-gradient(145deg, rgba(30, 30, 60, 0.9), rgba(20, 20, 45, 0.9)) !important;
    border: 2px solid rgba(102, 126, 234, 0.3) !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 15px rgba(102, 126, 234, 0.1) !important;
}
.daily-limit-box {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    margin: 20px auto;
    max-width: 400px;
    display: none;
}
.header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    padding: 14px 28px !important;
    margin-bottom: 1.5rem !important;
}
.header .logo h1 {
    background: linear-gradient(135deg, #a78bfa 0%, #c084fc 50%, #f472b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.horizontal-problem .answer-input {
    width: 120px;
    height: 70px;
    font-size: 2rem;
    text-align: center;
    border: 2px solid rgba(74, 222, 128, 0.5);
    border-radius: 15px;
    background: rgba(74, 222, 128, 0.1);
    font-weight: bold;
    outline: none;
    color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.horizontal-problem .answer-input:focus {
    border-color: #4ade80;
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.4);
    background: rgba(74, 222, 128, 0.15);
}
.horizontal-problem .answer-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 2.5rem;
}
.horizontal-problem .equals-sign {
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
}
.horizontal-problem .problem-text {
    font-size: 3rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    -webkit-font-smoothing: antialiased;
}
.level-btn {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    border: 2px solid rgba(167, 139, 250, 0.4);
    color: white;
    font-size: 1.8rem;
    width: 55px;
    height: 55px;
    border-radius: 12px !important;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 15px rgba(102, 126, 234, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800 !important;
    position: relative !important;
}
.level-btn:active {
    transform: translateY(3px) !important;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.2), 0 1px 0 rgba(0, 0, 0, 0.3), 0 3px 6px rgba(0, 0, 0, 0.18) !important;
}
.level-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.5), rgba(118, 75, 162, 0.5));
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 25px rgba(102, 126, 234, 0.4);
    border-color: rgba(167, 139, 250, 0.6);
}
.level-cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 14px 35px;
    border-radius: 30px;
    cursor: pointer;
    margin: 8px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.level-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: #fff;
}
.level-container {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(145deg, rgba(30, 30, 60, 0.9), rgba(20, 20, 45, 0.95));
    padding: 1.5rem 1rem !important;
    border-radius: 25px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(102, 126, 234, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.level-go-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    margin: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4), 0 0 20px rgba(102, 126, 234, 0.2);
}
.level-go-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5), 0 0 30px rgba(102, 126, 234, 0.3);
}
.level-input {
    width: 90px;
    height: 60px;
    font-size: 1.8rem;
    text-align: center;
    border: 2px solid rgba(167, 139, 250, 0.5);
    border-radius: 15px;
    outline: none;
    font-weight: bold;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.level-input:focus {
    border-color: #a78bfa;
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.4);
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.15);
}
.level-max {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}
.level-name {
    font-size: 1rem !important;
    color: #1a1a2e;
    margin-top: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 16px !important;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.5), 0 0 25px rgba(251, 191, 36, 0.3);
    display: inline-block;
}
.level-selector-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(145deg, rgba(30, 30, 60, 0.98), rgba(20, 20, 45, 0.98));
    padding: 35px;
    border-radius: 25px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(102, 126, 234, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 1002;
    max-width: 380px;
    width: 90%;
    text-align: center;
    display: none;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}
.level-selector-popup h3 {
    margin: 0 0 25px 0;
    color: #fff;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none;
}
.phase-indicator {
    background: linear-gradient(145deg, rgba(17, 153, 142, 0.2) 0%, rgba(56, 239, 125, 0.2) 100%);
    border: 1px solid rgba(56, 239, 125, 0.3);
    color: white;
    padding: 15px 25px;
    border-radius: 15px;
    text-align: center;
    margin: 15px auto;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(56, 239, 125, 0.15);
}
.phase-indicator h3 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    color: #4ade80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}
.phase-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(145deg, rgba(30, 30, 60, 0.98), rgba(20, 20, 45, 0.98));
    border: 1px solid rgba(102, 126, 234, 0.3);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    z-index: 1001;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(102, 126, 234, 0.2);
    transition: transform 0.3s ease;
    max-width: 400px;
}
.phase-popup .result.fail {
    color: #ef4444;
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}
.phase-popup .result.success {
    color: #4ade80;
    text-shadow: 0 0 15px rgba(74, 222, 128, 0.5);
}
.phase-popup h2 {
    margin: 0 0 15px 0;
    font-size: 1.8em;
    color: #fff;
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.phase-popup p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}
.phase-progress-bar {
    flex: 1;
    max-width: 200px;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.phase-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    border-radius: 5px;
    transition: width 0.3s;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}
.phase-stats {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
}
.problem-display {
    text-align: center;
    font-size: 1.25rem !important;
    color: rgba(255, 255, 255, 0.88) !important;
    margin-bottom: 1rem !important;
    font-weight: 600 !important;
}
.progress-info {
    text-align: center;
    margin: 10px 0;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
}
.score-panel .score-label {
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    font-size: 0.78rem !important;
    letter-spacing: 0.08em !important;
    opacity: 0.9;
}
.streak-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(145deg, rgba(74, 222, 128, 0.2), rgba(34, 197, 94, 0.2));
    border: 1px solid rgba(74, 222, 128, 0.4);
    color: #4ade80;
    padding: 30px 50px;
    border-radius: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(74, 222, 128, 0.3);
    transition: transform 0.3s ease;
}
.upgrade-link {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 25px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1a1a2e;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}
.wrong-actions {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 12px;
    padding: 15px;
    margin: 15px auto;
    max-width: 400px;
    text-align: center;
    display: none;
}
.wrong-actions .hint {
    color: #fbbf24;
    margin-bottom: 10px;
    font-size: 1.1em;
}
@keyframes nameGlow {
    0% { box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4), 0 0 20px rgba(251, 191, 36, 0.2); }
    100% { box-shadow: 0 4px 25px rgba(251, 191, 36, 0.6), 0 0 30px rgba(251, 191, 36, 0.4); }
}
body {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #0d0d1f 100%);
    background-attachment: scroll;
    min-height: 100vh;
}
body #problemArea .cell {
    font-family: "Baloo 2", system-ui, sans-serif !important;
    font-weight: 800 !important;
    font-size: 5rem !important;
}
@media (max-width: 768px) {
    .horizontal-problem .answer-input {
        width: 100px;
        height: 60px;
        font-size: 1.5rem;
    }
}
@media (max-width: 768px) {
    .horizontal-problem .problem-text {
        font-size: 2rem;
    }
}

/* ==========================================================================
   PER-PAGE ACCENT — these deliberately differ per page and are the ONE
   thing a consuming page overrides. The rules below are wired to --op-* so
   the same rule serves every page.
   ========================================================================== */

.navigation .nav-btn:hover {
    background: linear-gradient(135deg, var(--op-accent-soft), rgba(0, 0, 0, 0));
    border-color: var(--op-accent);
    color: #fff;
}

.navigation .nav-btn.active {
    background: linear-gradient(135deg, var(--op-accent), var(--op-accent-2));
    border-color: var(--op-accent);
    color: #fff;
}

.score-panel {
    border: 1px solid var(--op-accent-soft);
}

.score-panel .score-accuracy .score-value {
    color: var(--op-accent-light, var(--op-accent));
    text-shadow: 0 0 15px var(--op-accent-soft);
}


/* ==========================================================================
   Two-column practice layout — from 1024px the game box sits beside the
   stats sidebar in a grid; below that breakpoint they stack.
   ========================================================================== */
:root {
    /* Height of the game box. "Almost the laptop's vertical length" — the
       viewport minus the header, the operation nav and the page padding.
       Override this ONE variable to make the box taller or shorter. */
    --practice-box-h: calc(100vh - 168px);
}

@media (min-width: 1024px) {
    .container {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 0 22px;
        align-items: stretch;   /* sidebar stretches to the box's height */
        max-width: 1280px;
    }
    .container > .navigation { grid-column: 1 / -1; }

    /* The box is an empty slot: whatever a page puts in {% block game %}
       lands here, and the box holds its height whether that content is a
       column sum, a clock face or nothing at all. */
    #problemArea {
        grid-column: 1;
        grid-row: 2 / 6;
        min-height: var(--practice-box-h);
        display: flex;
        flex-direction: column;
    }
    /* The sidebar is ONE vertical column whose total height equals the game
       box's, and every card in it is the SAME size — `flex: 1 1 0` gives each
       an equal share of that height regardless of how much content it holds.
       (operation-shell.css sets `justify-content: space-between`, which spread
       differently-sized cards to the corners; equal shares supersede it.) */
    #sidebarCol {
        min-height: var(--practice-box-h);
        justify-content: flex-start !important;
        gap: 14px !important;
    }
    #sidebarCol > * {
        flex: 1 1 0 !important;
        min-height: 0;
        margin: 0 !important;
        display: flex;
        flex-direction: column;
        justify-content: center;   /* content centred inside an equal-size card */
    }
}

/* Below the two-column breakpoint the box still wants real height, just not
   the sidebar's. */
@media (max-width: 1023px) {
    #problemArea { min-height: calc(100vh - 210px); display: flex; flex-direction: column; }
}

/* The dark theme never gave #problemArea a surface of its own — addition
   styles it for theme-light only, and `.container` is transparent. That is why
   the "game box" reads as missing on dark. This gives it the same panel
   language the sidebar cards already use. */
body.theme-dark #problemArea,
body:not(.theme-light) #problemArea {
    background: linear-gradient(145deg, rgba(30, 30, 60, 0.8), rgba(20, 20, 45, 0.9));
    border: 1px solid var(--op-accent-soft);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    /* A thin accent bar along the top edge, the same device the game designs
       use to identify a screen. Ties the box to the page's accent. */
    position: relative;
    overflow: hidden;
}
body.theme-dark #problemArea::before,
body:not(.theme-light) #problemArea::before {
    content: "";
    position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--op-accent), rgba(0, 0, 0, 0) 55%);
    pointer-events: none;
}

/* ── The box's two parts ──────────────────────────────────────────────────
   #problemArea = .game-area (the game) + .game-buttons (the button shelf).
   The game area absorbs all leftover height, so the box's total height is
   unchanged whether or not a game supplies buttons — which is what keeps it
   equal to the sidebar column beside it. */
#problemArea {
    display: flex;
    flex-direction: column;
    padding: 22px;
    gap: 14px;
}
.game-area {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
/* Whatever a game drops in is centred by default — a clock face, a number
   line and a column sum all want the same treatment. Override inside your own
   markup if your game lays itself out differently. */
.game-area > * { margin-left: auto; margin-right: auto; }

.game-buttons {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding-top: 14px;
    border-top: 1px solid var(--op-accent-soft);
}

/* ==========================================================================
   SHORT WINDOW — give the game box the height the chrome was wasting
   Founder, 2026-08-21: the play controls must not sit below the fold unless the
   page is genuinely long. On a 1366x768 laptop (a ~650px viewport) the shell
   spent 210px above the box and 36px below it, and the Check button fell off
   the bottom.

   Every line here is CHROME, not game: the header band, the page padding, and
   a 30px grid ROW gap that `gap: 30px` was handing to an empty first row on
   pages that carry no operation nav. Nothing inside the box is touched, and a
   tall window keeps the shell exactly as designed.
   ========================================================================== */
@media (min-width: 1024px) and (max-height: 800px) {
    .header { padding: 8px 28px !important; margin-bottom: 0.75rem !important; }
    /* the shell also pins the container to `calc(100vh - 80px)`, which on a short
       window is TALLER than the space left under the header — let it be content-sized */
    .container { padding-top: 12px !important; padding-bottom: 12px !important; row-gap: 0 !important; min-height: 0 !important; }
    .container > .navigation { margin-bottom: 12px !important; }
}

/* ------------------------------------------------------------- scrollbars
   Where the game box or the sidebar has to scroll on a short window, the bar
   should look like part of the panel rather than a stray OS control. Same
   treatment as Place Value (founder, 2026-08-21: "the inner scrollbar ...
   is making this odd. Create a professional one"). 8px, no track, the page's
   own accent. Standard syntax first (Firefox, Chrome 121+), then -webkit- for
   older Chrome and Safari. */
#problemArea, #sidebarCol, #problemArea *, #sidebarCol * {
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--op-accent-rgb, 102, 126, 234), .45) transparent;
}
#problemArea::-webkit-scrollbar, #sidebarCol::-webkit-scrollbar,
#problemArea ::-webkit-scrollbar, #sidebarCol ::-webkit-scrollbar { width: 8px; height: 8px; }
#problemArea::-webkit-scrollbar-track, #sidebarCol::-webkit-scrollbar-track,
#problemArea ::-webkit-scrollbar-track, #sidebarCol ::-webkit-scrollbar-track { background: transparent; }
#problemArea::-webkit-scrollbar-thumb, #sidebarCol::-webkit-scrollbar-thumb,
#problemArea ::-webkit-scrollbar-thumb, #sidebarCol ::-webkit-scrollbar-thumb {
    background-color: rgba(var(--op-accent-rgb, 102, 126, 234), .42);
    border-radius: 999px; border: 2px solid transparent; background-clip: content-box;
}
#problemArea::-webkit-scrollbar-thumb:hover, #sidebarCol::-webkit-scrollbar-thumb:hover,
#problemArea ::-webkit-scrollbar-thumb:hover, #sidebarCol ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(var(--op-accent-rgb, 102, 126, 234), .68); background-clip: content-box;
}
#problemArea ::-webkit-scrollbar-corner, #sidebarCol ::-webkit-scrollbar-corner { background: transparent; }
