/* ===== Touch Typing Course Styles ===== */

/* Theme Variables */
:root {
    --bg-color: #ffffff;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #cbd5e1;
    /* Darkened for better key contrast */
    --text-color: #0f172a;
    --text-secondary: #475569;
    --border-color: #94a3b8;
    /* Sharper borders */
    --accent-color: #2563eb;

    --hand-color: #fde6d8;
    --hand-stroke: #92400e;
    --finger-pinky: #db2777;
    /* Saturated Pink */
    --finger-ring: #2563eb;
    /* Saturated Blue */
    --finger-middle: #16a34a;
    /* Saturated Green */
    --finger-index: #d97706;
    /* Saturated Amber (Better for white text) */
    --finger-thumb: #7c3aed;
    /* Saturated Purple */
}

[data-theme="dark"],
.dark-theme {
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-color: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #475569;
    --accent-color: #3b82f6;

    --hand-color: #8b5e3c;
    --hand-stroke: #5d4037;
    --finger-pinky: #f472b6;
    --finger-ring: #0ea5e9;
    --finger-middle: #22c55e;
    --finger-index: #eab308;
    --finger-thumb: #a78bfa;
}

/* ===== Layout ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
}

.course-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.25rem 1rem;
    gap: 0.15rem;
}

/* ===== Guest Banner ===== */
.guest-banner {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 90%;
    max-width: 600px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #4f46e5 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    animation: slideDownFade 0.5s ease;
}

@keyframes slideDownFade {
    from {
        transform: translate(-50%, -10px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@media (min-width: 768px) {
    .guest-banner {
        width: auto;
        max-width: 90%;
        white-space: nowrap;
        justify-content: center;
        gap: 1.5rem;
    }
}

.guest-banner a {
    color: white;
    text-decoration: underline;
    font-weight: 700;
    margin: 0 0.25rem;
}

.close-banner {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.8;
    padding: 0 0.5rem;
}

.close-banner:hover {
    opacity: 1;
}

/* ===== Header ===== */
.course-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    gap: 1rem;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
}

.logo-text .highlight {
    color: var(--accent-color);
}

.header-center {
    flex: 1;
    max-width: 400px;
    text-align: center;
}

.lesson-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    text-decoration: none;
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent-color);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

/* Theme toggle icons */
.sun-icon,
.moon-icon {
    position: absolute;
    transition: opacity 0.3s, transform 0.3s;
}

.sun-icon {
    opacity: 1;
    transform: rotate(0);
}

.moon-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

[data-theme="dark"] .sun-icon,
.dark-theme .sun-icon {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="dark"] .moon-icon,
.dark-theme .moon-icon {
    opacity: 1;
    transform: rotate(0);
}

/* ===== Exercise Section ===== */
.exercise-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.instruction-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-align: center;
}

.instruction-text strong {
    color: var(--accent-color);
    font-family: monospace;
    font-size: 1rem;
}

.typing-area {
    position: relative;
    width: 100%;
    max-width: 800px;
}

.text-to-type {
    font-family: 'Roboto Mono', 'Consolas', monospace;
    font-size: 1.8rem;
    letter-spacing: 0.15em;
    text-align: center;
    padding: 0.75rem;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    cursor: text;
}

.char {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.2em;
    padding: 0 2px;
    border-radius: 3px;
    transition: all 0.1s;
    line-height: 1;
}

.char.current {
    background: var(--accent-color);
    color: white;
    animation: pulse 1s infinite;
}

.char.correct {
    color: #22c55e;
}

.char.incorrect {
    color: #ffffff;
    background: #ef4444;
    border-radius: 4px;
    box-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
}

.char.space {
    width: 0.8em;
    border-bottom: 2px dashed var(--text-secondary);
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
    }
}

.hidden-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.stats-row {
    display: flex;
    gap: 1.5rem;
    /* Reduced from 2rem */
    margin-top: 0.5rem;
    /* Reduced from 0.75rem */
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
}

/* ===== Keyboard ===== */
.keyboard-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin-top: 5px;
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Reduced from 6px */
    padding: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.keyboard-row {
    display: flex;
    justify-content: flex-start;
    gap: 6px;
}

/* Row-specific staggering */
.keyboard-row:nth-child(2) {
    margin-left: 20px;
}

.keyboard-row:nth-child(3) {
    margin-left: 35px;
}

.keyboard-row:nth-child(4) {
    margin-left: 5px;
}

.keyboard-row:nth-child(5) {
    justify-content: center;
}

.key {
    min-width: 42px;
    /* Sweet spot for 110% feel */
    height: 42px;
    /* Sweet spot for 110% feel */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 2px 0 var(--border-color), 0 3px 5px rgba(0, 0, 0, 0.1);
}

.key .primary {
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 0.85rem;
}

.key .secondary {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Fix alignment for non-dual keys like Tab, Backspace */
.key:not(:has(.primary)) {
    padding: 0 5px;
}

[data-theme="dark"] .key,
.dark-theme .key {
    background-color: #1f2937;
    color: #f9fafb;
    border-color: #374151;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 1px 0 #374151;
}

.key:hover {
    filter: brightness(0.98);
}

.key.active {
    transform: translateY(2px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: var(--accent-color) !important;
    color: #ffffff !important;
}

.key.highlight {
    border-color: var(--accent-color);
    animation: keyGlow 0.8s ease infinite alternate;
    z-index: 10;
}

@keyframes keyGlow {
    from {
        box-shadow: 0 0 0 rgba(37, 99, 235, 0.4);
    }

    to {
        box-shadow: 0 0 15px 3px rgba(37, 99, 235, 0.6);
    }
}

/* Key sizes based on image */
.key-backspace {
    min-width: 90px;
    flex-grow: 1;
}

.key-tab {
    min-width: 55px;
}

.key-caps {
    min-width: 75px;
}

.key-enter {
    min-width: 80px;
    flex-grow: 1;
}

.key-shift-left {
    min-width: 95px;
}

.key-shift-right {
    min-width: 95px;
    flex-grow: 1;
}

.key-space {
    min-width: 320px;
}

/* Finger highlights - Premium Polished Look */
.pinky-left {
    background-color: color-mix(in srgb, var(--finger-pinky), white 85%) !important;
    border-bottom: 3px solid var(--finger-pinky) !important;
}

.ring-left {
    background-color: color-mix(in srgb, var(--finger-ring), white 85%) !important;
    border-bottom: 3px solid var(--finger-ring) !important;
}

.middle-left {
    background-color: color-mix(in srgb, var(--finger-middle), white 85%) !important;
    border-bottom: 3px solid var(--finger-middle) !important;
}

.index-left {
    background-color: color-mix(in srgb, var(--finger-index), white 85%) !important;
    border-bottom: 3px solid var(--finger-index) !important;
}

.index-right {
    background-color: color-mix(in srgb, var(--finger-index), white 85%) !important;
    border-bottom: 3px solid var(--finger-index) !important;
}

.middle-right {
    background-color: color-mix(in srgb, var(--finger-middle), white 85%) !important;
    border-bottom: 3px solid var(--finger-middle) !important;
}

.ring-right {
    background-color: color-mix(in srgb, var(--finger-ring), white 85%) !important;
    border-bottom: 3px solid var(--finger-ring) !important;
}

.pinky-right {
    background-color: color-mix(in srgb, var(--finger-pinky), white 85%) !important;
    border-bottom: 3px solid var(--finger-pinky) !important;
}

.thumb {
    background-color: color-mix(in srgb, var(--finger-thumb), white 85%) !important;
    border-bottom: 3px solid var(--finger-thumb) !important;
}

[data-theme="dark"] .key[class*="-"],
.dark-theme .key[class*="-"] {
    background-color: #1f2937 !important;
    /* Keep dark background, only tint border? */
}

/* Specific overrides for Dark Mode finger tints */
[data-theme="dark"] .pinky-left,
.dark-theme .pinky-left {
    background-color: color-mix(in srgb, var(--finger-pinky), black 50%) !important;
}

[data-theme="dark"] .ring-left,
.dark-theme .ring-left {
    background-color: color-mix(in srgb, var(--finger-ring), black 50%) !important;
}

[data-theme="dark"] .middle-left,
.dark-theme .middle-left {
    background-color: color-mix(in srgb, var(--finger-middle), black 50%) !important;
}

[data-theme="dark"] .index-left,
.dark-theme .index-left {
    background-color: color-mix(in srgb, var(--finger-index), black 50%) !important;
}

[data-theme="dark"] .index-right,
.dark-theme .index-right {
    background-color: color-mix(in srgb, var(--finger-index), black 50%) !important;
}

[data-theme="dark"] .middle-right,
.dark-theme .middle-right {
    background-color: color-mix(in srgb, var(--finger-middle), black 50%) !important;
}

[data-theme="dark"] .ring-right,
.dark-theme .ring-right {
    background-color: color-mix(in srgb, var(--finger-ring), black 50%) !important;
}

[data-theme="dark"] .pinky-right,
.dark-theme .pinky-right {
    background-color: color-mix(in srgb, var(--finger-pinky), black 50%) !important;
}

[data-theme="dark"] .thumb,
.dark-theme .thumb {
    background-color: color-mix(in srgb, var(--finger-thumb), black 50%) !important;
}

/* Active practice key highlight - Matches dynamic finger colors */
.key.highlight {
    animation: keyGlow 0.8s ease infinite alternate;
    z-index: 10;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 15px currentColor, inset 0 0 5px rgba(255, 255, 255, 0.5) !important;
}

@keyframes keyGlow {
    from {
        transform: scale(1.02);
        box-shadow: 0 0 5px currentColor;
    }

    to {
        transform: scale(1.05);
        box-shadow: 0 0 20px 5px currentColor;
    }
}

/* Vibrant highlights based on finger */
.key.highlight.pinky-left,
.key.highlight.pinky-right {
    background-color: var(--finger-pinky) !important;
    border-bottom-color: #ffffff !important;
}

.key.highlight.ring-left,
.key.highlight.ring-right {
    background-color: var(--finger-ring) !important;
    border-bottom-color: #ffffff !important;
}

.key.highlight.middle-left,
.key.highlight.middle-right {
    background-color: var(--finger-middle) !important;
    border-bottom-color: #ffffff !important;
}

.key.highlight.index-left,
.key.highlight.index-right {
    background-color: var(--finger-index) !important;
    border-bottom-color: #ffffff !important;
}

.key.highlight.thumb {
    background-color: var(--finger-thumb) !important;
    border-bottom-color: #ffffff !important;
}

/* In dark mode, ensure highlights are extra vibrant */
[data-theme="dark"] .key.highlight,
.dark-theme .key.highlight {
    box-shadow: 0 0 15px currentColor;
    filter: saturate(1.5) brightness(1.2);
}

/* Interactive Shift State */
.keyboard.shift-on .key {
    text-transform: uppercase;
}

.keyboard.shift-on .key .secondary {
    opacity: 1;
    color: var(--accent-color);
    font-weight: 700;
}

.keyboard.shift-on .key .primary {
    opacity: 0.3;
}

/* For labels that shouldn't be uppercased twice or modified */
.keyboard.shift-on .key-backspace,
.keyboard.shift-on .key-tab,
.keyboard.shift-on .key-caps,
.keyboard.shift-on .key-enter,
.keyboard.shift-on .key-shift-left,
.keyboard.shift-on .key-shift-right {
    text-transform: none;
}

/* Physical key press feedback (Darker/Pressed effect) */
.key.active {
    transform: translateY(2px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    filter: brightness(0.9) !important;
}

/* Home keys marker */
.home-key {
    position: relative;
}

.home-key::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 2px;
    background: currentColor;
    opacity: 0.3;
    border-radius: 1px;
}

/* ===== Hands Section ===== */
.hands-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    /* Increased gap for better separation */
    padding: 0.25rem;
}

.hand-container {
    flex: 0 0 auto;
}

.hand-svg {
    width: 110px;
    height: auto;
}

.finger {
    transition: all 0.2s ease;
}

.finger.active rect,
.finger.active ellipse,
.finger.active path {
    stroke-width: 3;
    animation: fingerPulse 0.5s ease infinite alternate;
}

@keyframes fingerPulse {
    from {
        filter: brightness(1.2);
    }


    to {
        filter: brightness(1.6) drop-shadow(0 0 10px currentColor);
    }
}

.finger-label {
    font-size: 14px;
    font-weight: 700;
    fill: var(--text-color);
    pointer-events: none;
}

[data-theme="dark"] .finger-label,
.dark-theme .finger-label {
    fill: #ffffff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.hand-label {
    font-size: 14px;
    fill: var(--text-secondary);
    font-weight: 600;
}

/* Finger Guide */
/* Finger Guide */
.finger-guide {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 2px solid var(--accent-color);
    /* Fixed width to prevent layout shift */
    width: 220px;
    height: 100px;
    flex-shrink: 0;
}

.guide-key {
    font-size: 2rem;
    font-weight: 700;
    font-family: monospace;
    color: var(--accent-color);
}

.guide-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ===== Lesson Navigation ===== */
.lesson-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    /* Reduced from 1rem */
    padding: 0.25rem;
    /* Reduced from 0.5rem */
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover:not(:disabled) {
    background: var(--accent-color);
    color: white;
    border-color: transparent;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn svg {
    width: 16px;
    height: 16px;
}

.lesson-dots {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.lesson-dot {
    width: 24px;
    /* Reduced from 28px */
    height: 24px;
    /* Reduced from 28px */
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.lesson-dot:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.lesson-dot.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.lesson-dot.completed {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

/* Status-specific coloring */
.lesson-dot.status-mastered {
    background: #22c55e;
    border-color: #16a34a;
    color: white;
}

.lesson-dot.status-good {
    background: #eab308;
    border-color: #ca8a04;
    color: white;
}

.lesson-dot.status-practice {
    background: #ef4444;
    border-color: #dc2626;
    color: white;
}


/* ===== Mobile Responsive ===== */
/* ===== Tablet & Mobile Responsive ===== */
@media (max-width: 1024px) {
    .course-container {
        padding: 0.25rem 0.5rem;
        gap: 0.25rem;
    }

    .logo-text {
        display: none;
    }

    .header-center {
        max-width: 200px;
    }

    .lesson-title {
        font-size: 0.85rem;
    }

    .instruction-text {
        font-size: 0.8rem;
    }

    .text-to-type {
        font-size: 1.3rem;
        padding: 0.75rem;
    }

    .keyboard {
        padding: 6px;
        gap: 3px;
    }

    .keyboard-row {
        gap: 3px;
    }

    .key {
        min-width: 31px;
        height: 38px;
        font-size: 0.75rem;
    }

    .key .primary {
        bottom: 4px;
        right: 5px;
    }

    .key .secondary {
        top: 2px;
        left: 4px;
    }

    .key-backspace {
        min-width: 55px;
    }

    .key-tab {
        min-width: 42px;
    }

    .key-caps {
        min-width: 52px;
    }

    .key-enter {
        min-width: 55px;
    }

    .key-shift-left {
        min-width: 60px;
    }

    .key-shift-right {
        min-width: 60px;
    }

    .key-space {
        min-width: 180px;
    }

    /* Reduced staggering for mobile fit */
    .keyboard-row:nth-child(2) {
        margin-left: 5px;
    }

    .keyboard-row:nth-child(3) {
        margin-left: 10px;
    }

    .hands-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "guide guide"
            "left right";
        gap: 1rem;
        justify-items: center;
        padding: 0.5rem;
    }

    .finger-guide {
        grid-area: guide;
        width: 100%;
        max-width: 280px;
        margin-bottom: 0.5rem;
        padding: 0.5rem;
    }

    .hand-container:first-of-type {
        grid-area: left;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .hand-container:last-of-type {
        grid-area: right;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .hand-svg {
        width: 100%;
        max-width: 140px;
        /* Slightly larger for tablets */
        height: auto;
    }

    .guide-key {
        font-size: 1.5rem;
    }

    .guide-text {
        font-size: 0.7rem;
    }

    .nav-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    .lesson-dot {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
    }

    .stats-row {
        gap: 1rem;
    }

    .stat-value {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .keyboard {
        gap: 2px;
        padding: 2px;
    }

    .keyboard-row {
        gap: 2px;
    }

    .key {
        min-width: 23px;
        height: 34px;
        font-size: 0.65rem;
    }

    .key .primary {
        bottom: 2px;
        right: 3px;
        font-size: 0.6rem;
    }

    .key .secondary {
        top: 1px;
        left: 2px;
        font-size: 0.55rem;
    }

    .key-backspace {
        min-width: 38px;
    }

    .key-tab {
        min-width: 28px;
    }

    .key-caps {
        min-width: 35px;
    }

    .key-enter {
        min-width: 40px;
    }

    .key-shift-left {
        min-width: 45px;
    }

    .key-shift-right {
        min-width: 45px;
    }

    .key-space {
        min-width: 100px;
    }

    .keyboard-row:nth-child(2) {
        margin-left: 3px;
    }

    .keyboard-row:nth-child(3) {
        margin-left: 6px;
    }

    .hands-section {
        gap: 0.5rem;
    }

    .finger-guide {
        margin-bottom: 0.25rem;
    }

    .lesson-dots {
        gap: 4px;
    }

    .lesson-dot {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 380px) {
    .course-container {
        padding: 0.25rem 0.25rem;
    }

    .keyboard {
        transform: scale(0.97);
        transform-origin: top center;
        width: 100%;
        margin: 0 auto;
    }

    /* Reset row margins for perfect centering */
    .keyboard-row,
    .keyboard-row:nth-child(2),
    .keyboard-row:nth-child(3),
    .keyboard-row:nth-child(4) {
        justify-content: center;
        margin-left: 0;
        gap: 2px;
    }

    .key {
        min-width: 20px;
        height: 32px;
        font-size: 0.6rem;
    }

    .key-shift-left,
    .key-shift-right {
        min-width: 35px;
    }

    .key-space {
        min-width: 80px;
    }

    .hands-section {
        gap: 0.25rem;
        transform: scale(0.9);
    }
}

/* ===== Auth Modal ===== */
.screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.screen.active {
    display: flex;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.auth-modal-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 20px;
    animation: modalSlideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.auth-card {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-tertiary);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.text-highlight {
    color: #4285F4;
    font-weight: 700;
}

.logo-area {
    margin-bottom: 24px;
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.logo-area h1 {
    font-size: 22px;
    margin-bottom: 4px;
}

.logo-area p {
    font-size: 14px;
    color: var(--text-tertiary);
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    background: #ffffff;
    color: #1f1f1f;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

[data-theme="dark"] .google-btn {
    background: #2d3748;
    color: #ffffff;
    border-color: #4a5568;
}

.google-btn:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}

[data-theme="dark"] .google-btn:hover {
    background: #374151;
}

.google-text-hint {
    margin-top: 12px;
    color: var(--text-tertiary);
    font-size: 11px;
}