@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=JetBrains+Mono:wght@500;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #0f172a;
    color: #f1f5f9;
    touch-action: manipulation;
}

.mono-font { font-family: 'JetBrains Mono', monospace; }

.history-scroll::-webkit-scrollbar { width: 6px; }
.history-scroll::-webkit-scrollbar-track { background: #1e293b; }
.history-scroll::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
.shake { animation: shake 0.2s ease-in-out; }

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
.pop { animation: pop 0.1s ease-out; }

.slide-up { animation: slideUp 0.3s ease-out forwards; }
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }

.quick-start-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 0.5rem;
    border-radius: 0.75rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #334155;
    color: white;
    transition: all 0.2s;
    min-height: 60px;
}
.quick-start-btn:hover {
    background: #334155;
    border-color: #475569;
    transform: translateY(-1px);
}
.quick-start-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
}

/* Preset Grid Buttons */
.preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    border-radius: 0.875rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #334155;
    color: white;
    transition: all 0.2s;
    min-height: 72px;
}
.preset-btn:hover {
    background: #334155;
    border-color: #475569;
    transform: translateY(-1px);
}
.preset-btn:active {
    transform: scale(0.98);
}
.preset-name {
    font-size: 11px;
    font-weight: 700;
    color: white;
}
.preset-diff {
    font-size: 9px;
    font-weight: 600;
}

/* Larger preset buttons on laptop */
@media (min-width: 1024px) {
    .preset-btn {
        padding: 1rem 0.75rem;
        min-height: 100px;
        gap: 0.625rem;
    }
    .preset-name {
        font-size: 13px;
    }
    .preset-diff {
        font-size: 10px;
    }
}

/* Special preset accents */
.preset-practice {
    border-color: rgba(20, 184, 166, 0.4);
    background: rgba(20, 184, 166, 0.1);
}
.preset-practice:hover { border-color: rgba(20, 184, 166, 0.6); }

.preset-challenge {
    border-color: rgba(244, 63, 94, 0.4);
    background: rgba(244, 63, 94, 0.1);
}
.preset-challenge:hover { border-color: rgba(244, 63, 94, 0.6); }

.preset-exam {
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.1);
}
.preset-exam:hover { border-color: rgba(251, 191, 36, 0.6); }

.preset-mixed {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.1);
}
.preset-mixed:hover { border-color: rgba(168, 85, 247, 0.6); }

@keyframes screen-pulse {
    0%, 100% { box-shadow: inset 0 0 0 0 rgba(239, 68, 68, 0); }
    50% { box-shadow: inset 0 0 60px 10px rgba(239, 68, 68, 0.15); }
}

.urgency-pulse {
    animation: screen-pulse 0.5s ease-in-out infinite;
}

/* Desktop optimizations - removed view-start override, now handled inline */

/* Game view optimizations for 13" screens */
@media (min-width: 1024px) and (max-height: 800px) {
    #view-game { padding: 0.5rem 1rem; }
    #view-game .mb-4 { margin-bottom: 0.5rem; }
    #view-game .mb-3 { margin-bottom: 0.25rem; }
    #view-game .mb-2 { margin-bottom: 0.25rem; }
    #problem-card { min-height: 120px; }
    #problem-text { font-size: 2.5rem; }
    #input-display { height: 3rem; font-size: 1.75rem; }
    .key-btn { height: 2.5rem; font-size: 1rem; }
    #view-game .gap-2 { gap: 0.375rem; }
}

/* Even tighter for very small screens */
@media (min-width: 1024px) and (max-height: 700px) {
    #problem-card { min-height: 100px; }
    #problem-text { font-size: 2rem; }
    .key-btn { height: 2.25rem; }
}
