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

:root {
    --bg-dark: #161226;
    --bg-card: #221a3d;
    --bg-card-light: #2c224e;
    --primary: #cbbaff;
    --primary-glow: rgba(203, 186, 255, 0.25);
    --secondary: #ff9b85;
    --secondary-glow: rgba(255, 155, 133, 0.35);
    --text-main: #fcfbfe;
    --text-muted: #a49ebd;
    --success: #5bf3c3;
    --border-color: rgba(255, 255, 255, 0.08);
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Abacus Styling */
    --abacus-frame: #1b1633;
    --abacus-beam: #2c254e;
    --abacus-rod: #5e5781;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* App Container - Responsive Desktop Layout */
.app-container {
    width: 100%;
    max-width: 900px; /* Wide desktop container */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    background-color: #161226;
    border-left: 1px solid rgba(255,255,255,0.02);
    border-right: 1px solid rgba(255,255,255,0.02);
}

/* Header & Top Navigation */
header {
    padding: 10px 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.header-title-container {
    display: flex;
    flex-direction: column;
}

.header-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.header-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Top Desktop Nav Links */
.top-nav {
    display: flex;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
}

.nav-link {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-link.active {
    background-color: var(--primary);
    color: #161226;
}

.nav-link:hover:not(.active) {
    color: var(--text-main);
    background-color: rgba(255,255,255,0.05);
}

.save-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}

.save-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Main Content Grid */
main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.view {
    display: none;
    animation: fadeIn 0.25s ease-out forwards;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dashboard & Setup Split Screen for Desktop */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .split-layout {
        grid-template-columns: 1fr;
    }
    .app-container {
        padding: 16px;
    }
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.card-buddy {
    background: linear-gradient(135deg, rgba(82, 60, 163, 0.2) 0%, rgba(32, 26, 60, 0.2) 100%);
    border: 1px solid rgba(203, 186, 255, 0.15);
    display: flex;
    gap: 16px;
    align-items: center;
}

.buddy-icon {
    font-size: 32px;
}

.buddy-text {
    font-size: 14px;
    color: var(--text-muted);
}

.buddy-title {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

/* Mode Buttons */
.mode-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.mode-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.mode-btn.active {
    background-color: var(--primary);
    color: #161226;
    font-weight: 700;
    box-shadow: 0 4px 15px var(--primary-glow);
    border-color: transparent;
}

.mode-icon {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.mode-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mode-btn.active .mode-label {
    color: #161226;
}

/* Row settings */
.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.settings-row:last-child {
    border-bottom: none;
}

.setting-info {
    display: flex;
    flex-direction: column;
}

.setting-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.setting-sublabel {
    font-size: 13px;
    color: var(--text-muted);
}

/* Selectors (multi-select / pills) */
.selector-group {
    display: flex;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.selector-pill {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    background: none;
    border: none;
}

.selector-pill.active {
    background-color: var(--primary);
    color: #161226;
}

/* Custom Increments (- / +) */
.increment-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.inc-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.inc-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.inc-btn:active {
    transform: scale(0.9);
}

.inc-value {
    font-size: 18px;
    font-weight: 700;
    width: 24px;
    text-align: center;
}

/* Switch (Toggles) */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .25s;
    border-radius: 34px;
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .25s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
    background-color: #161226;
}

/* Dropdowns / Inputs */
.custom-select {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 32px 8px 14px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    text-align: right;
}

.dropdown-container {
    position: relative;
}

.dropdown-container:after {
    content: "▼";
    font-size: 9px;
    color: var(--text-muted);
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-number-seconds {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 12px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    width: 80px;
    text-align: center;
    outline: none;
}

/* Info Icon */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background-color: var(--text-muted);
    color: var(--bg-dark);
    font-size: 10px;
    font-weight: 800;
    border-radius: 50%;
    margin-left: 6px;
}

/* Let's Practice Button */
.btn-primary {
    background-color: var(--secondary);
    color: #161226;
    border: none;
    border-radius: 20px;
    padding: 18px;
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 6px 20px var(--secondary-glow);
    transition: all 0.2s;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 155, 133, 0.55);
}

/* Auditory settings */
.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.checkbox-custom {
    position: relative;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.checkbox-custom input {
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 6px;
}

.checkbox-custom input:checked + .checkbox-box {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkbox-box:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 11px;
    border: solid #161226;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-custom input:checked + .checkbox-box:after {
    display: block;
}


/* ==========================================================================
   2ND SCREEN (PLAYING PRACTICE VIEW) STYLING - Split Layout for Desktop
   ========================================================================== */
.play-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: flex-start;
}

@media (max-width: 768px) {
    .play-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Header Elements for 2nd Screen */
.play-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 18px;
    font-size: 18px;
    font-weight: 700;
}

/* Text Size Adjuster: - A + */
.text-size-control {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2px 12px;
}

.size-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 8px;
}

.size-label {
    font-size: 16px;
    color: var(--text-main);
    font-weight: 700;
}

.play-timer {
    color: var(--text-muted);
}

/* Vertical Stack Display Box */
.vertical-display-box {
    width: 100%;
    height: 380px;
    background-color: #0f0c1a;
    border: 2.5px solid #2d2353;
    border-radius: 24px;
    padding: 24px 36px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end; /* Align numbers to the right! */
    overflow-y: auto;
    gap: 10px;
    position: relative;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

/* Individual Stacked Number styling */
.stacked-number {
    font-size: 42px; /* Adjustable dynamically */
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 0.5px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stacked-number.negative {
    color: var(--secondary);
}

.stacked-number.answer-state {
    font-size: 32px;
    color: var(--primary);
    align-self: center;
    margin-top: auto;
    margin-bottom: auto;
}

/* Side navigation handles in mockup */
.display-side-indicator {
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: rgba(255,255,255,0.1);
    top: 50%;
}
.display-side-indicator.left { left: 16px; }
.display-side-indicator.right { right: 16px; }

/* ==========================================================================
   KIDS FRIENDLY NUMERIC KEYPAD
   ========================================================================== */
.kids-keypad-card {
    background-color: #1b162f;
    border: 2px solid rgba(255,255,255,0.06);
    border-radius: 24px;
    padding: 16px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Keypad Top Row (Clear - AnswerBox - Submit) */
.keypad-top-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 10px;
    align-items: center;
}

.btn-keypad-clear {
    background-color: #312b48;
    color: var(--text-muted);
    border: none;
    border-radius: 14px;
    padding: 16px 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    text-align: center;
}

.btn-keypad-clear:hover {
    background-color: #3f385c;
    color: var(--text-main);
}

.keypad-answer-box {
    background-color: rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 14px;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    text-align: center;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.btn-keypad-submit {
    background-color: #ffb1bf; /* Light Pink/Peach */
    color: #161226;
    border: none;
    border-radius: 14px;
    padding: 16px 8px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    text-align: center;
}

.btn-keypad-submit:hover {
    background-color: #ffc4cf;
}

.btn-keypad-submit:active {
    transform: scale(0.97);
}

/* Numeric Keys Grid (3x4) */
.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.key-btn {
    background-color: #f7f7f9;
    color: #161226;
    border: none;
    border-radius: 14px;
    padding: 16px 0;
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transition: transform 0.05s, background-color 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key-btn:hover {
    background-color: #ffffff;
}

.key-btn:active {
    transform: scale(0.94);
    background-color: #e3e3e7;
}

.key-btn.backspace-key {
    background-color: #ffffff;
    font-size: 18px;
}

/* Keypad Bottom Row (End - Skip) */
.keypad-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 12px;
    margin-top: 4px;
}

.btn-keypad-end {
    background: linear-gradient(135deg, #e39d9d 0%, #db8686 100%);
    color: #161226;
    border: none;
    border-radius: 16px;
    padding: 16px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.btn-keypad-end:hover {
    filter: brightness(1.05);
}

.btn-keypad-skip {
    background: linear-gradient(135deg, #c5b5ee 0%, #b29de2 100%);
    color: #161226;
    border: none;
    border-radius: 16px;
    padding: 16px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.btn-keypad-skip:hover {
    filter: brightness(1.05);
}

/* ==========================================================================
   VIRTUAL ABACUS (Practice page optional element)
   ========================================================================== */
.virtual-abacus-container {
    width: 100%;
    margin-top: 16px;
    background-color: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 20px;
}

.abacus-title {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.abacus-value-hud {
    color: var(--primary);
    font-weight: 800;
}

.abacus-board {
    width: 100%;
    background-color: var(--abacus-frame);
    border: 8px solid #2b2447;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    padding: 8px 4px;
    position: relative;
    touch-action: none;
}

.abacus-rods {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    height: 160px;
    position: relative;
}

.abacus-rod-col {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.abacus-rod-wire {
    position: absolute;
    width: 3px;
    height: 100%;
    background: linear-gradient(90deg, #443c68 0%, #7d75a8 50%, #443c68 100%);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.abacus-beam-divider {
    position: absolute;
    top: 42px;
    left: -4px;
    right: -4px;
    height: 8px;
    background: linear-gradient(180deg, #373059 0%, #1e1936 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.5);
    z-index: 5;
}

.abacus-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: var(--text-main);
    border-radius: 50%;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
}

.abacus-bead {
    width: 82%;
    max-width: 38px;
    height: 20px;
    background: radial-gradient(ellipse at center, #d8cbff 0%, #7d6abf 60%, #483b80 100%);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    z-index: 10;
    cursor: pointer;
    position: absolute;
    transition: transform 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.abacus-bead.active {
    background: radial-gradient(ellipse at center, #ffcfb7 0%, #ff855f 60%, #cc4923 100%);
}

.abacus-bead.upper { top: 2px; }
.abacus-bead.lower-1 { top: 54px; }
.abacus-bead.lower-2 { top: 76px; }
.abacus-bead.lower-3 { top: 98px; }
.abacus-bead.lower-4 { top: 120px; }

.abacus-bead.upper.active { transform: translateY(18px); }
.abacus-bead.lower-1.active { transform: translateY(-18px); }
.abacus-bead.lower-2.active { transform: translateY(-18px); }
.abacus-bead.lower-3.active { transform: translateY(-18px); }
.abacus-bead.lower-4.active { transform: translateY(-18px); }

.abacus-rod-label {
    position: absolute;
    bottom: -6px;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
}

.abacus-reset-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    transition: color 0.2s;
    font-size: 12px;
}

.abacus-reset-btn:hover {
    color: var(--secondary);
}

/* ==========================================================================
   RESULTS VIEW STYLING
   ========================================================================== */
.results-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
}

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #7058cc 100%);
    box-shadow: 0 10px 25px var(--primary-glow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 10px 0 24px;
}

.score-num {
    font-size: 40px;
    font-weight: 800;
    color: #161226;
    line-height: 1;
}

.score-lbl {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #161226;
    opacity: 0.8;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
    margin-bottom: 24px;
}

.stat-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
}

.stat-value.success {
    color: var(--success);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-list {
    width: 100%;
    margin-bottom: 24px;
}

.review-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.review-item {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 20px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-equation {
    font-size: 16px;
    font-weight: 600;
}

.review-answers {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
}

.review-answer-user {
    font-weight: 700;
    color: var(--secondary);
}

.review-answer-user.correct {
    color: var(--success);
}

.review-answer-correct {
    font-weight: 600;
    color: var(--text-muted);
}

.btn-group {
    display: flex;
    gap: 16px;
    width: 100%;
}

.btn-secondary {
    background-color: rgba(255,255,255,0.04);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: rgba(255,255,255,0.08);
}

/* ==========================================================================
   DASHBOARD VIEW STYLING
   ========================================================================== */
.dash-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.avatar {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background-color: var(--primary);
    color: #161226;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.dash-welcome {
    font-size: 20px;
    font-weight: 700;
}

.dash-points {
    font-size: 14px;
    color: var(--text-muted);
}

.stats-grid-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.dash-stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 10px;
    text-align: center;
}

.dash-stat-val {
    font-size: 20px;
    font-weight: 800;
}

.dash-stat-lbl {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 4px;
}

.history-card {
    padding: 20px;
}

.history-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 14px;
}

.history-item:last-child {
    border-bottom: none;
}

.history-meta {
    display: flex;
    flex-direction: column;
}

.history-mode {
    font-weight: 600;
}

.history-date {
    color: var(--text-muted);
    font-size: 12px;
}

.history-score {
    font-weight: 700;
    color: var(--success);
    align-self: center;
}

.history-score.fail {
    color: var(--secondary);
}

@media (max-width: 768px) {
    /* Make vertical numbers display box shorter on mobile to avoid scrolling */
    .vertical-display-box {
        height: 190px;
        padding: 12px 24px;
        border-radius: 16px;
        gap: 6px;
    }
    
    /* Make stacked numbers slightly smaller on mobile by default */
    .stacked-number {
        font-size: 32px;
    }
    
    /* Make keypad card more compact on mobile */
    .kids-keypad-card {
        padding: 12px;
        gap: 8px;
        border-radius: 18px;
    }
    
    .keypad-answer-box {
        padding: 10px;
        font-size: 18px;
        min-height: 44px;
    }
    
    .key-btn {
        padding: 12px 0;
        font-size: 20px;
        border-radius: 10px;
    }
    
    .btn-keypad-clear, .btn-keypad-submit {
        padding: 12px 8px;
        font-size: 14px;
        border-radius: 10px;
    }
    
    .btn-keypad-end, .btn-keypad-skip {
        padding: 12px;
        font-size: 15px;
        border-radius: 12px;
    }

    /* Ensure container has less padding on mobile */
    .app-container {
        padding: 10px;
    }
}

