:root {
    --app-accent: #4A7CF7; /* Blue — matches landing page algebra card */
}

/* Algebra-specific question sizing */
.question-text {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
}

/* Algebra-specific styles */

.algebra-question {
    display: block;
    text-align: center;
}

.problem-line {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    overflow: visible !important;
}

.answer-line {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
}

.equals-sign {
    font-size: 2rem;
    color: #4b5563;
    margin: 0 0.5rem 0 -2rem;
}

/* Selectively reset Tailwind preflight styles inside MathQuill containers */
.mathquill-editable {
    /* Reset problematic Tailwind preflight resets */
    margin: 0;
    border: 2px solid #3b82f6;
    padding: 10px;
    line-height: normal;
}

/* Preserve MathQuill's essential styles for math rendering */
.mq-root-block {
    display: inline-block !important;
    width: 100% !important;
    padding: 12px !important;
    margin: 0 !important;
}

.mq-cursor {
    display: inline-block !important;
    vertical-align: text-bottom !important;
}

.mq-sqrt-prefix {
    display: inline-block !important;
    font-family: Symbola, serif !important;
}

sup,
sub {
    vertical-align: baseline !important;
    position: relative !important;
    font-size: 0.8em !important;
}

sup {
    bottom: 0.6em !important;
}

sub {
    top: 0.6em !important;
}

/* MathQuill nthroot index spacing */
sup.mq-nthroot {
    font-size: 80% !important;
    vertical-align: 0.3em !important;
    padding-top: 0.4em;
}

/* Keep aria-alert hidden (accessibility text for screen readers) */
.mq-aria-alert {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Additional MathQuill input styling */
.mathquill-editable {
    width: 100%;
    min-height: 40px;
    border-radius: 5px;
    box-sizing: border-box;
    background-color: white;
    text-align: left;
}

.mathquill-editable.mq-focused {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.1) !important;
    outline: none !important;
}

.mathquill-editable.correct {
    border-color: #10b981 !important;
    background-color: rgba(16, 185, 129, 0.08) !important;
}

.mathquill-editable.incorrect {
    border-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.08) !important;
}

/* Timer visibility control */
.timer-hidden {
    display: none !important;
}

/* Mobile keyboard active state - shift game card up */
#game-screen.keyboard-active {
    transform: translateY(-250px);
    transition: transform 0.3s ease-in-out;
}

/* Smooth transition when keyboard deactivates */
#game-screen {
    transition: transform 0.3s ease-in-out;
}

/* Toggle Keyboard Button - Desktop Only */
#toggle-keyboard-btn {
    display: none;
    background: #ffffff;
    color: #ffffff;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 2rem;
    transition: all 0.2s ease-in-out;
    min-width: 64px;
    height: 64px;
    flex-shrink: 0;
}

#toggle-keyboard-btn:hover {
    background: #5b9aff;
    transform: translateY(-1px);
}

#toggle-keyboard-btn:active {
    transform: translateY(0);
}

/* Show button on desktop (screens wider than 1024px) */
@media (min-width: 1025px) {
    #toggle-keyboard-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
