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

:root {
    /* Vibrant Cyan & Purple Theme (Unique Aesthetic) */
    --bg-color: #090a0f;
    --panel-bg: rgba(255, 255, 255, 0.03);
    --panel-bg-hover: rgba(255, 255, 255, 0.08);
    --panel-border: rgba(255, 255, 255, 0.05);

    --main-color: #00e5ff;
    /* Cyan */
    --main-hover: #00b8cc;
    --caret-color: #00e5ff;
    --sub-color: #7b7e85;
    --text-color: #e6edf3;

    --error-color: #fb5151;
    --error-extra-color: #bf3f3f;
    --accent-color: #a371f7;
    /* Purple */

    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Outfit', sans-serif;
    --transition: 0.3s ease;
    --max-width: 1200px;
}

:root[data-theme="light"] {
    --bg-color: #f0f4f8;
    --panel-bg: #ffffff;
    --panel-bg-hover: rgba(0, 0, 0, 0.05);
    --panel-border: rgba(0, 0, 0, 0.1);

    --main-color: #007bb5;
    --main-hover: #005a85;
    --caret-color: #007bb5;
    --sub-color: #6e7781;
    --text-color: #24292f;

    --error-color: #cf222e;
    --error-extra-color: #a41e26;
    --accent-color: #8250df;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at top left, rgba(0, 229, 255, 0.05), transparent 40%),
        radial-gradient(circle at bottom right, rgba(163, 113, 247, 0.05), transparent 40%);
    color: var(--text-color);
    font-family: var(--font-sans);
    height: 100vh;
    max-height: 100vh;
    display: flex;
    transition: background-color var(--transition), color var(--transition);
    overflow: hidden;
}

[data-theme="light"] body {
    background-image: radial-gradient(circle at top left, rgba(0, 123, 181, 0.03), transparent 40%),
        radial-gradient(circle at bottom right, rgba(130, 80, 223, 0.03), transparent 40%);
}

/* --- Dashboard Layout --- */
.dashboard-layout {
    display: flex;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.dashboard-sidebar {
    width: 260px;
    background: transparent;
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    z-index: 10;
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 2.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    cursor: pointer;
}

.logo i {
    font-size: 2rem;
    color: var(--main-color);
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.4));
}

.logo-text h1 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-text .version {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 600;
}

.menu-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--sub-color);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.menu-label.mt-2 {
    margin-top: 2rem;
}

.sidebar-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sidebar-btn {
    background: transparent;
    border: none;
    color: var(--sub-color);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    text-align: left;
    font-size: 1rem;
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-btn i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-btn:hover {
    color: var(--text-color);
    background-color: var(--panel-bg-hover);
}

.sidebar-btn.active {
    color: var(--text-color);
    background-color: var(--panel-bg);
    border-left: 3px solid var(--main-color);
    border-radius: 0 8px 8px 0;
}

.sidebar-dropdown {
    display: flex;
    flex-direction: column;
}

.sidebar-btn.dropdown-toggle {
    justify-content: space-between;
}

.sidebar-btn .chevron {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.sidebar-btn.open .chevron {
    transform: rotate(180deg);
}

.dropdown-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding-left: 2.5rem;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease, margin 0.3s ease;
}

.dropdown-content.open {
    max-height: 300px;
    margin-top: 0.5rem;
}

.dropdown-item {
    background: transparent;
    border: none;
    color: var(--sub-color);
    padding: 0.6rem;
    border-radius: 6px;
    text-align: left;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.dropdown-item:hover,
.dropdown-item.active {
    color: var(--main-color);
    background-color: var(--panel-bg);
}

.sidebar-footer {
    margin-top: auto;
}

/* Dashboard Content Wrapper */
.dashboard-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 3rem;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.dashboard-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-bottom: 3rem;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.mobile-only {
    display: none;
}

/* Inline Config */
.inline-config {
    display: flex;
    align-items: center;
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    gap: 1.5rem;
}

.config-group {
    display: flex;
    gap: 0.5rem;
}

.divider {
    width: 2px;
    height: 20px;
    background-color: var(--panel-border);
}

.config-btn {
    background: transparent;
    border: none;
    color: var(--sub-color);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.config-btn:hover {
    color: var(--text-color);
    background-color: var(--panel-bg-hover);
}

.config-btn.active {
    color: var(--main-color);
    background-color: var(--panel-bg-hover);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--sub-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0.6rem;
    border-radius: 8px;
}

.icon-btn:hover {
    color: var(--text-color);
    background-color: var(--panel-bg);
}

/* Dashboard Main */
.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    position: relative;
    min-height: calc(100vh - 140px);
}

/* Typing Screen Elements */
#typing-screen {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    width: 100%;
}

/* Live Stats */
#live-stats {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--main-color);
    opacity: 1;
    transition: opacity var(--transition);
}

#live-stats.hidden {
    opacity: 0;
    pointer-events: none;
}

.live-metrics {
    display: flex;
    gap: 2rem;
    color: var(--sub-color);
}

/* Typing Area */
#typing-area {
    position: relative;
    width: 100%;
    font-family: var(--font-mono);
    font-size: 1.8rem;
    line-height: 1.6;
    min-height: 120px;
    max-height: 170px;
    overflow: hidden;
    cursor: text;
}

#words-container {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    width: 100%;
    height: 100%;
    color: var(--sub-color);
    transition: filter 0.2s ease;
}

#words-container {
    will-change: filter;
}
#words-container.blur {
    filter: blur(4px);
}

.word {
    margin-right: 0.6em;
    margin-bottom: 0.4em;
    display: inline-flex;
    border-bottom: 2px solid transparent;
}

.word.error {
    border-bottom: 2px solid var(--error-color);
}

.letter {
    display: inline-block;
    transition: color 0.1s ease, text-shadow 0.1s ease;
}

/* Letter States */
.letter.correct {
    color: var(--text-color);
}

.letter.incorrect {
    color: var(--error-color);
    text-shadow: 0 0 5px rgba(251, 81, 81, 0.4);
}

.letter.extra {
    color: var(--error-extra-color);
}

.letter.incorrect.extra {
    color: var(--error-extra-color);
}

/* Smooth Caret */
#caret {
    position: absolute;
    width: 2px;
    height: 2.2rem;
    background-color: var(--caret-color);
    border-radius: 2px;
    top: 0;
    left: 0;
    transition: left 0.1s ease, top 0.1s ease;
    z-index: 10;
    animation: blink 1s infinite alternate;
    box-shadow: 0 0 5px var(--caret-color);
}

#caret.hidden {
    opacity: 0;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

#caret.typing {
    animation: none;
    opacity: 1;
}

/* Hidden Input */
#hidden-input {
    position: absolute;
    top: -1000px;
    opacity: 0;
}

/* Focus Overlay */
#focus-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-size: 1.2rem;
    color: var(--text-color);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 20;
}

#focus-overlay.visible {
    opacity: 1;
}

/* Restart Button */
.restart-container {
    margin-top: 5.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    transition: opacity var(--transition);
}

.restart-shortcuts {
    font-size: 0.85rem;
    color: var(--sub-color);
    font-family: var(--font-mono);
    pointer-events: none;
    text-align: center;
}

.restart-shortcuts .key-shortcut {
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
    color: var(--text-color);
}

#restart-btn {
    font-size: 1.5rem;
    padding: 1rem;
    border-radius: 50%;
    background-color: var(--panel-bg);
}

#restart-btn:hover {
    background-color: var(--panel-bg-hover);
    color: var(--main-color);
    transform: rotate(180deg);
    transition: transform 0.4s ease, background 0.2s ease, color 0.2s ease;
}

/* Interactive Keyboard Styling */
.interactive-keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--panel-border);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    width: 100%;
    margin-bottom: 1rem;
    overflow: hidden;
}

#intro-keyboard {
    transform: scale(0.85);
    transform-origin: top center;
    margin-bottom: -4rem;
}

.mini-keyboard {
    transform: scale(0.65);
    transform-origin: top center;
    margin-bottom: -15rem; /* offset the layout height of scaled container */
    box-shadow: none; /* simplify looks for lesson mode */
    border: none;
    background: transparent;
}

#lesson-keyboard-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    margin-top: -2rem;
    height: 12rem; /* physical space reserved */
    position: relative;
    z-index: 5;
}

#lesson-keyboard-container.hidden {
    display: none;
}

.kb-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    min-width: max-content;
}

.key {
    background: rgba(128, 128, 128, 0.05);
    border: 2px solid rgba(128, 128, 128, 0.1);
    border-radius: 8px;
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 3.5rem;
    height: 3.5rem;
    position: relative;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    -webkit-user-select: none;
    user-select: none;
}

.key.wide { width: 5.5rem; }
.key.wide-backslash { width: 4.5rem; }
.key.caps { width: 6.2rem; }
.key.enter { width: 7.3rem; }
.key.shift-l { width: 8.5rem; }
.key.shift-r { width: 9.5rem; }
.key.extra-wide { width: 22rem; }
.key.ctrl, .key.win, .key.alt { width: 4.5rem; font-size: 0.9rem; }

.key.bump::after {
    content: '';
    position: absolute;
    bottom: 8px;
    width: 14px;
    height: 3px;
    background: currentColor;
    border-radius: 2px;
    opacity: 0.5;
}

/* Colors for Fingers */
.l-pinky { border-color: rgba(251, 81, 81, 0.4); color: #fb5151; }
.l-ring { border-color: rgba(255, 152, 0, 0.4); color: #ff9800; }
.l-mid { border-color: rgba(255, 235, 59, 0.4); color: #cddc39; }
.l-index { border-color: rgba(76, 175, 80, 0.4); color: #4caf50; }

.r-index { border-color: rgba(0, 229, 255, 0.4); color: #00e5ff; }
.r-mid { border-color: rgba(63, 81, 181, 0.4); color: #5c6bc0; }
.r-ring { border-color: rgba(163, 113, 247, 0.4); color: #a371f7; }
.r-pinky { border-color: rgba(233, 30, 99, 0.4); color: #e91e63; }

.thumb { border-color: rgba(158, 158, 158, 0.4); color: #9e9e9e; }

/* Active State for Animation */
.key.active {
    transform: translateY(3px);
    box-shadow: 0 0 15px currentColor, inset 0 0 10px currentColor;
    color: #fff !important;
    text-shadow: 0 0 5px #fff;
    z-index: 10;
}

.key.active::before {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 20;
    color: #fff;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    font-family: var(--font-sans);
    text-shadow: none;
}

.l-pinky.active { background-color: #fb5151; }
.l-pinky.active::before { content: "L-Pinky"; background: #fb5151; }

.l-ring.active { background-color: #ff9800; }
.l-ring.active::before { content: "L-Ring"; background: #ff9800; }

.l-mid.active { background-color: #cddc39; }
.l-mid.active::before { content: "L-Middle"; background: #cddc39; color: #111; }

.l-index.active { background-color: #4caf50; }
.l-index.active::before { content: "L-Index"; background: #4caf50; }

.r-index.active { background-color: #00e5ff; }
.r-index.active::before { content: "R-Index"; background: #00e5ff; color: #111; }

.r-mid.active { background-color: #5c6bc0; }
.r-mid.active::before { content: "R-Middle"; background: #5c6bc0; }

.r-ring.active { background-color: #a371f7; }
.r-ring.active::before { content: "R-Ring"; background: #a371f7; }

.r-pinky.active { background-color: #e91e63; }
.r-pinky.active::before { content: "R-Pinky"; background: #e91e63; }

.thumb.active { background-color: #9e9e9e; color: #111 !important; text-shadow: none; }
.thumb.active::before { content: "Thumb"; background: #9e9e9e; color: #111; }

/* Legend */
.keyboard-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    background: var(--panel-bg);
    padding: 1rem 2rem;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

.color-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* Legend Backgrounds */
.bg-l-pinky { background-color: #fb5151; }
.bg-l-ring { background-color: #ff9800; }
.bg-l-mid { background-color: #cddc39; }
.bg-l-index { background-color: #4caf50; }
.bg-r-index { background-color: #00e5ff; }
.bg-r-mid { background-color: #5c6bc0; }
.bg-r-ring { background-color: #a371f7; }
.bg-r-pinky { background-color: #e91e63; }
.bg-thumb { background-color: #9e9e9e; }

/* Hand Slider & Fingers */
#hand-slider, #lesson-hand-slider {
    position: absolute; 
    top: 10.5rem; /* Exactly aligns with Row 3 given 2rem padding + row heights */
    left: 50%; 
    transform: translateX(-50%); 
    width: 53rem; /* Max width to fit fingers */
    height: 3.5rem; 
    transition: margin-top 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); 
    pointer-events: none; 
    z-index: 20;
}

.finger {
    position: absolute;
    top: 0;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    opacity: 0.85;
    border: 3px solid rgba(255,255,255,0.7);
    box-shadow: 0 10px 25px rgba(0,0,0,0.6), inset 0 0 15px rgba(255,255,255,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: rgba(255,255,255,0.9);
    filter: drop-shadow(0 0 8px currentColor);
    transform: perspective(200px) rotateX(20deg);
}

/* Results Screen */
#results-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    animation: fadeIn 0.5s ease;
}

#results-screen.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header h2 {
    color: var(--sub-color);
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.results-main {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.primary-stats {
    display: flex;
    gap: 5rem;
}

.result-group {
    display: flex;
    flex-direction: column;
}

.result-group .label {
    font-size: 2rem;
    color: var(--sub-color);
    margin-bottom: -10px;
}

.result-group .value {
    font-size: 5rem;
    font-family: var(--font-mono);
    color: var(--main-color);
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.results-secondary {
    width: 100%;
    max-width: 600px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.res-item {
    display: flex;
    flex-direction: column;
}

.res-label {
    color: var(--sub-color);
    font-size: 1rem;
}

.res-val {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    color: var(--text-color);
}

.char-breakdown span {
    font-size: 1.5rem;
}

.clr-correct {
    color: var(--text-color);
}

.clr-incorrect {
    color: var(--error-color);
}

.clr-extra {
    color: var(--error-extra-color);
}

.clr-missed {
    color: var(--sub-color);
}

.results-actions {
    display: flex;
    gap: 1rem;
}

.primary-btn {
    background-color: var(--panel-bg);
    color: var(--sub-color);
    border: 1px solid var(--panel-border);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    font-family: var(--font-sans);
    font-weight: 500;
}

.primary-btn:hover {
    background-color: var(--main-color);
    color: var(--bg-color);
    border-color: var(--main-color);
}

/* Footer */
.dashboard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--panel-border);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--sub-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--text-color);
}

/* Tooltip */
.tooltip,
.tooltip-btn {
    position: relative;
    cursor: pointer;
}

.tooltip::after,
.tooltip-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #000;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    font-family: var(--font-sans);
    z-index: 100;
}

.tooltip:hover::after,
.tooltip-btn:hover::after {
    opacity: 1;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal {
    background-color: var(--bg-color);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.modal-overlay.hidden .modal {
    transform: translateY(20px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--sub-color);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: var(--text-color);
}

.modal-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--panel-border);
}

.modal-tab {
    background: transparent;
    border: none;
    color: var(--sub-color);
    font-size: 1rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: color 0.2s ease;
    position: relative;
    font-family: var(--font-sans);
    font-weight: 500;
}

.modal-tab.active {
    color: var(--text-color);
}

.modal-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--main-color);
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-form.active-form {
    display: flex;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--sub-color);
}

.input-group input {
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-color);
    padding: 0.8rem;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-group input:focus {
    border-color: var(--main-color);
}

.modal-btn-primary {
    background-color: var(--main-color);
    color: #000;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
    font-family: var(--font-sans);
}

.modal-btn-primary:hover {
    opacity: 0.9;
}

/* Leaderboard Specific */
.lb-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.lb-filter {
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--sub-color);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.lb-filter:hover,
.lb-filter.active {
    background-color: var(--main-color);
    color: var(--bg-color);
    border-color: var(--main-color);
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
}

.lb-table th {
    text-align: left;
    color: var(--sub-color);
    font-weight: 500;
    padding: 0.5rem;
    border-bottom: 1px solid var(--panel-border);
}

.lb-table td {
    padding: 0.8rem 0.5rem;
    border-bottom: 1px solid var(--panel-border);
    font-family: var(--font-mono);
}

.clr-main {
    color: var(--main-color);
}

.mt-2 {
    margin-top: 1rem;
}

.bold {
    font-weight: 700;
}

/* Utilities */
.hidden {
    display: none !important;
}

.typing-active .dashboard-topbar,
.typing-active .dashboard-footer,
.typing-active .restart-container {
    opacity: 0;
    pointer-events: none;
}

.typing-active #live-stats {
    opacity: 1;
}

/* Game Styles */
#games-screen {
    width: 100%;
    background-color: var(--panel-bg);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    max-width: 800px;
}

.clicker-body {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-instructions {
    color: var(--sub-color);
    font-size: 1.1rem;
}

.clicker-duration-selector {
    margin: 1.5rem 0;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.game-stats {
    display: flex;
    gap: 3rem;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-family: var(--font-mono);
    font-weight: 600;
}

.clicker-btn {
    width: 100%;
    padding: 4rem;
    background-color: var(--panel-bg);
    border: 2px dashed var(--sub-color);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.1s, background 0.1s;
    font-family: var(--font-sans);
    font-weight: 600;
}

.clicker-btn:hover {
    border-color: var(--main-color);
    color: var(--main-color);
    background-color: var(--panel-bg-hover);
}

.game-results {
    text-align: center;
    margin-top: 2rem;
}

.game-results h4 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.game-results p {
    font-size: 1.2rem;
    color: var(--sub-color);
}

/* --- Sprint Game Specific Styles --- */
#sprint-screen {
    width: 100%;
    background-color: var(--panel-bg);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    max-width: 800px;
}

.sprint-word {
    font-family: var(--font-mono);
    font-size: 4rem;
    color: var(--text-color);
    margin: 2rem 0;
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.sprint-input {
    width: 80%;
    max-width: 400px;
    background-color: var(--bg-color);
    border: 2px solid var(--panel-border);
    color: var(--main-color);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 2rem;
    text-align: center;
    outline: none;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.sprint-input:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.sprint-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Urdu Text Styles --- */
.urdu-text {
    font-family: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', system-ui, Arial, sans-serif !important;
    font-size: 2.2rem !important;
    line-height: 2 !important;
    direction: rtl;
}

.urdu-text .word {
    margin-left: 0.6em;
    margin-right: 0;
}

@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }

    .dashboard-sidebar {
        display: none;
    }

    .dashboard-sidebar.mobile-open {
        display: flex;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 50;
    }

    .mobile-only {
        display: block;
    }

    .dashboard-content {
        padding: 0 1rem;
    }

    .dashboard-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .inline-config {
        flex-wrap: wrap;
    }

    .primary-stats {
        gap: 2rem;
    }

    .result-group .value {
        font-size: 3rem;
    }

    #typing-area {
        font-size: 1.4rem;
    }

    .dashboard-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-shortcuts {
        display: none;
    }
}
/* ===== FULLSCREEN FIX ===== */
html, body {
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dashboard-layout {
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
}

.dashboard-sidebar {
    height: 100vh !important;
    overflow-y: auto !important;
    flex-shrink: 0 !important;
}

.dashboard-content {
    flex: 1 !important;
    width: 0 !important;
    min-width: 0 !important;
    height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.dashboard-main {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 2rem !important;
}

#typing-screen {
    width: 100% !important;
    max-width: 100% !important;
}

#words-container, #words {
    width: 100% !important;
    max-width: 100% !important;
}

/* ===================== BLOG DROPDOWN ===================== */
.blog-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.blog-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    background-color: #13151f;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 0.5rem;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.8);
    animation: blogFadeIn 0.18s ease;
}

@keyframes blogFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.blog-dropdown-wrapper:hover .blog-dropdown,
.blog-dropdown-wrapper:focus-within .blog-dropdown {
    display: block;
}

.blog-dropdown-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--sub-color);
    padding: 0.4rem 0.6rem 0.3rem;
    text-transform: uppercase;
    margin: 0;
}

.blog-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.82rem;
    font-family: var(--font-sans);
    transition: background 0.15s ease, color 0.15s ease;
}

.blog-dropdown-item i {
    color: var(--main-color);
    font-size: 0.85rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.blog-dropdown-item:hover {
    background-color: var(--panel-bg-hover);
    color: var(--main-color);
}

.blog-dropdown-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== SCROLLBAR COMPLETELY HIDE ===== */
* {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
*::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* ===== THEME FIX ===== */
:root[data-theme="light"] {
    --bg-color: #f0f4f8 !important;
    --panel-bg: #ffffff !important;
    --panel-bg-hover: rgba(0, 0, 0, 0.05) !important;
    --panel-border: rgba(0, 0, 0, 0.1) !important;
    --main-color: #007bb5 !important;
    --main-hover: #005a85 !important;
    --caret-color: #007bb5 !important;
    --sub-color: #6e7781 !important;
    --text-color: #24292f !important;
    --error-color: #cf222e !important;
    --error-extra-color: #a41e26 !important;
    --accent-color: #8250df !important;
}

html[data-theme="light"],
html[data-theme="light"] body,
html[data-theme="light"] .dashboard-layout,
html[data-theme="light"] .dashboard-sidebar,
html[data-theme="light"] .dashboard-content,
html[data-theme="light"] .dashboard-main {
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
}

html[data-theme="light"] body {
    background-image: radial-gradient(circle at top left, rgba(0, 123, 181, 0.03), transparent 40%),
        radial-gradient(circle at bottom right, rgba(130, 80, 223, 0.03), transparent 40%) !important;
}

html[data-theme="light"] .blog-dropdown {
    background-color: #ffffff !important;
    border-color: rgba(0,0,0,0.1) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15) !important;
}

html[data-theme="light"] .interactive-keyboard {
    background: var(--bg-color) !important;
}

/* ===== SCROLLBAR COMPLETELY HIDDEN ===== */
html, body, * {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* ===== SC-WRAP LIGHT THEME ===== */
html[data-theme="light"] .sc-wrap {
    background: var(--bg-color) !important;
    border-top-color: var(--panel-border) !important;
}
