/* ============================================
   WORLD-CLASS TYPING TEST - PREMIUM STYLES
   ============================================ */

/* ===== CSS Variables ===== */
:root {
    --tt-font: 'Inter', 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont, sans-serif;
    --tt-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* Word Colors */
    --word-idle: rgba(0, 0, 0, 0.8);
    --word-correct: #1a1a2e;
    --word-error: #e74c3c;
    --word-extra: rgba(231, 76, 60, 0.4);
    --word-active-bg: rgba(0, 0, 0, 0.02);

    /* Accent Colors */
    --tt-accent: #0099ff;
    --tt-accent-rgb: 0, 153, 255;
    --tt-success: #27ae60;
    --tt-success-rgb: 39, 174, 96;
    --tt-warning: #f39c12;
    --tt-danger: #c0392b;

    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-hover: rgba(0, 0, 0, 0.04);

    /* Text */
    --text-primary: #1a1a2e;
    --text-secondary: rgba(0, 0, 0, 0.85);

    /* Gradients */
    --grad-wpm: linear-gradient(135deg, #00d4ff, #0099ff);
    --grad-acc: linear-gradient(135deg, #2ecc71, #00b894);
    --grad-time: linear-gradient(135deg, #a855f7, #7c3aed);
    --grad-cpm: linear-gradient(135deg, #f59e0b, #ef4444);
}

.dark-mode {
    --word-idle: rgba(255, 255, 255, 0.9);
    --word-correct: #e2e8f0;
    --word-error: #ff6b6b;
    --word-extra: rgba(255, 107, 107, 0.4);
    --word-active-bg: rgba(255, 255, 255, 0.03);
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.95);
    --tt-accent: #00d4ff;
    --tt-accent-rgb: 0, 212, 255;
    --tt-success: #2ecc71;
    --tt-success-rgb: 46, 204, 113;
}

body:not(.dark-mode) .stat-value {
    color: #1a1a2e;
}

body:not(.dark-mode) .stat-label {
    color: rgba(0, 0, 0, 0.85);
}

body:not(.dark-mode) .card-unit {
    color: #1a1a2e;
}

body:not(.dark-mode) .card-label {
    color: rgba(0, 0, 0, 0.85);
}

body:not(.dark-mode) .detail-label {
    color: rgba(0, 0, 0, 0.85);
}

body:not(.dark-mode) .result-title {
    color: #1a1a2e;
}

body:not(.dark-mode) .top-restart-btn {
    box-shadow: 0 4px 20px rgba(0, 153, 255, 0.3);
}

body:not(.dark-mode) .time-card .card-value {
    color: #7c3aed;
    text-shadow: none;
}

/* ===== Main Section ===== */
.typing-section {
    padding: 20px 20px 0;
    max-width: 1100px;
    margin: 0 auto;
}

/* ===== Hero Header ===== */
.typing-hero {
    text-align: center;
    margin-bottom: 25px;
    animation: fadeInDown 0.6s ease;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(0, 153, 255, 0.08));
    border: 1px solid rgba(0, 212, 255, 0.2);
    padding: 6px 18px;
    border-radius: 50px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--tt-accent);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 600;
}

.badge-icon {
    font-size: 1.1rem;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 8px;
    background: linear-gradient(135deg, #fff, rgba(255, 255, 255, 0.7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

body:not(.dark-mode) .hero-title {
    background: linear-gradient(135deg, #1a1a2e, #4a4a6a);
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--word-idle);
    margin: 0;
    font-weight: 400;
}

/* ===== Settings Bar ===== */
.typing-settings-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px 25px;
    padding: 14px 20px;
    border-radius: 18px;
    margin-bottom: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-label {
    font-size: 0.75rem;
    color: var(--word-idle);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    white-space: nowrap;
}

/* Language Select */
.custom-select-wrapper {
    position: relative;
}

.custom-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 7px 30px 7px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-family: var(--tt-font);
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    min-width: 140px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

body:not(.dark-mode) .custom-select {
    background-color: rgba(0, 0, 0, 0.04);
    color: #333;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.custom-select:hover,
.custom-select:focus {
    border-color: var(--tt-accent);
    background-color: rgba(0, 212, 255, 0.08);
}

.custom-select option {
    background: #1a1a2e;
    color: #fff;
    padding: 8px;
}

body:not(.dark-mode) .custom-select option {
    background: #fff;
    color: #333;
}

/* Mode Selector Pill */
.mode-selector-pill {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    padding: 3px;
    border-radius: 12px;
    gap: 2px;
    border: 1px solid var(--glass-border);
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    color: var(--word-idle);
    padding: 7px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: var(--tt-font);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.mode-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.mode-btn.active {
    color: var(--tt-accent);
    background: rgba(0, 212, 255, 0.12);
    font-weight: 600;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.1);
}

.mode-btn svg {
    flex-shrink: 0;
}

/* Config Selector */
.config-selector-pill {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    padding: 3px;
    border-radius: 10px;
    gap: 2px;
    border: 1px solid var(--glass-border);
}

.config-btn {
    background: transparent;
    border: none;
    color: var(--word-idle);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: var(--tt-font);
    transition: all 0.25s ease;
    font-weight: 500;
}

.config-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.config-btn.active {
    color: var(--tt-accent);
    background: rgba(0, 212, 255, 0.12);
    font-weight: 700;
}

/* Option Toggles */
.options-group {
    gap: 6px;
}

.option-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--word-idle);
    font-size: 0.78rem;
    border: 1px solid transparent;
    transition: all 0.25s ease;
    user-select: none;
}

.option-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.option-toggle.active {
    color: var(--tt-accent);
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.2);
}

.option-icon {
    font-size: 0.85rem;
    font-weight: 700;
}

.option-label {
    font-weight: 500;
}

/* ===== Custom Text Area ===== */
.custom-text-area {
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.custom-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px;
    color: #fff;
    font-size: 1rem;
    font-family: var(--tt-font);
    resize: vertical;
    outline: none;
    transition: border-color 0.3s;
    min-height: 80px;
}

body:not(.dark-mode) .custom-textarea {
    color: #333;
    background: rgba(0, 0, 0, 0.03);
}

.custom-textarea:focus {
    border-color: var(--tt-accent);
}

.btn-apply-custom {
    margin-top: 10px;
    padding: 8px 24px;
    background: var(--grad-wpm);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-apply-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}

/* ===== Typing Area ===== */
.typing-area-wrapper {
    position: relative;
    padding: 25px 28px;
    border-radius: 20px;
    min-height: 140px;
    max-height: 200px;
    overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: text;
    transition: all 0.3s ease;
}

.typing-area-wrapper:hover {
    border-color: rgba(0, 212, 255, 0.15);
}

.typing-area-wrapper.focused {
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.05);
}

/* Focus Overlay */
.focus-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 30, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 20px;
    z-index: 20;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.focus-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.focus-message {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--word-idle);
    font-size: 0.95rem;
    animation: pulse-soft 2s ease infinite;
}

@keyframes pulse-soft {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* Timer Overlay */
.timer-overlay {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 15;
}

.timer-big {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--tt-accent);
    opacity: 0.5;
    font-family: var(--tt-mono);
    text-shadow: 0 0 20px rgba(var(--tt-accent-rgb), 0.3);
}

/* Words Display */
.words-area {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em 0.6em;
    font-size: 1.6rem;
    line-height: 2;
    color: var(--word-idle);
    user-select: none;
    font-family: var(--tt-font);
    transition: transform 0.25s ease;
    position: relative;
}

.word {
    position: relative;
    display: inline-flex;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

.word.active {
    border-bottom-color: rgba(var(--tt-accent-rgb), 0.3);
}

.word.error-word {
    border-bottom-color: rgba(255, 107, 107, 0.5);
}

.char {
    position: relative;
    transition: color 0.1s ease;
}

.char.correct {
    color: var(--word-correct);
}

.char.incorrect {
    color: var(--word-error);
    position: relative;
}

.char.incorrect::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--word-error);
    border-radius: 1px;
}

.char.extra {
    color: var(--word-extra);
    font-size: 0.85em;
    opacity: 0.6;
}

/* Hidden Input */
.hidden-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: text;
    z-index: 10;
    font-size: 16px;
    /* Prevent iOS zoom */
}

/* Caret */
.caret {
    position: absolute;
    width: 2.5px;
    height: 1.8rem;
    background: var(--tt-accent);
    border-radius: 2px;
    z-index: 11;
    pointer-events: none;
    box-shadow: 0 0 12px rgba(var(--tt-accent-rgb), 0.6),
        0 0 25px rgba(var(--tt-accent-rgb), 0.2);
}

.caret.smooth {
    transition: all 0.08s ease-out;
}

.caret.blink {
    animation: caretBlink 1s ease infinite;
}

@keyframes caretBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.1;
    }
}

/* ===== Live Stats Bar ===== */
.live-stats-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 10px 20px;
    border-radius: 15px;
    margin-top: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    animation: slideUp 0.4s ease;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 20px;
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wpm-icon {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 153, 255, 0.1));
    color: var(--tt-accent);
}

.acc-icon {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.2), rgba(0, 184, 148, 0.1));
    color: var(--tt-success);
}

.time-icon {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(124, 58, 237, 0.1));
    color: #a855f7;
}

.cpm-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.1));
    color: #f59e0b;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.2;
    font-family: var(--tt-mono);
    color: var(--text-primary, #fff);
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    opacity: 0.9;
}

.stat-divider {
    width: 1px;
    height: 30px;
    background: var(--glass-border);
}

/* ===== Typing Actions ===== */
.typing-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass-bg);
    color: var(--word-idle);
    font-size: 0.9rem;
    font-family: var(--tt-font);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.action-btn:hover {
    color: #fff;
    background: var(--glass-hover);
    border-color: rgba(var(--tt-accent-rgb), 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.reset-btn:hover svg {
    animation: spin 0.5s ease;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.shortcut-hints {
    font-size: 0.75rem;
    color: var(--word-idle);
    opacity: 0.6;
    display: flex;
    align-items: center;
    gap: 6px;
}

.shortcut-hints kbd {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: var(--tt-mono);
}

.hint-divider {
    margin: 0 4px;
    opacity: 0.3;
}

/* ===== Result Screen ===== */
.result-screen {
    padding: 35px 30px;
    border-radius: 24px;
    animation: resultReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes resultReveal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.result-header {
    text-align: center;
    margin-bottom: 30px;
}

.top-restart-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--tt-accent), #7c3aed);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(var(--tt-accent-rgb), 0.4);
    animation: tryAgainPulse 2s ease-in-out infinite;
}

.top-restart-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 30px rgba(var(--tt-accent-rgb), 0.6);
}

.top-restart-btn:active {
    transform: translateY(0) scale(0.98);
}

@keyframes tryAgainPulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(var(--tt-accent-rgb), 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(var(--tt-accent-rgb), 0.7);
    }
}

.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 20px;
    border-radius: 50px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    animation: badgePulse 2s ease infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }
}

.result-badge.rank-excellent {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.2), rgba(0, 184, 148, 0.1));
    color: var(--tt-success);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.result-badge.rank-good {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 153, 255, 0.1));
    color: var(--tt-accent);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.result-badge.rank-average {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.2), rgba(243, 156, 18, 0.1));
    color: var(--tt-warning);
    border: 1px solid rgba(241, 196, 15, 0.3);
}

.result-badge.rank-beginner {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(124, 58, 237, 0.1));
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.result-emoji {
    font-size: 1.3rem;
}

.result-title {
    font-size: 1.6rem;
    margin: 0;
    font-weight: 700;
    color: var(--text-primary, #fff);
}

/* Result Main Cards */
.result-main-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.result-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 15px;
    border-radius: 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.result-card:hover {
    transform: translateY(-3px);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    border-radius: 50%;
    opacity: 0.06;
    pointer-events: none;
}

.wpm-card .card-glow {
    background: radial-gradient(circle, var(--tt-accent), transparent 70%);
}

.acc-card .card-glow {
    background: radial-gradient(circle, var(--tt-success), transparent 70%);
}

.time-card .card-glow {
    background: radial-gradient(circle, #a855f7, transparent 70%);
}

.card-value {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    font-family: var(--tt-mono);
}

.wpm-card .card-value {
    color: var(--tt-accent);
}

.acc-card .card-value {
    color: var(--tt-success);
}

.time-card .card-value {
    color: #c084fc;
    text-shadow: 0 0 15px rgba(192, 132, 252, 0.4);
}

.card-unit {
    font-size: 1rem;
    font-weight: 700;
    margin-top: 4px;
    opacity: 1;
    color: var(--text-primary);
}

.card-label {
    font-size: 0.72rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.65));
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

/* Result Chart */
.result-chart-container {
    padding: 20px;
    border-radius: 18px;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 15px;
    opacity: 0.9;
}

.chart-wrapper {
    height: 200px;
    position: relative;
}

/* Result Details Grid */
.result-details-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.detail-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border-radius: 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: transform 0.3s;
}

.detail-card:hover {
    transform: translateY(-2px);
}

.detail-icon {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 1.3rem;
    font-weight: 800;
    font-family: var(--tt-mono);
    color: #fff;
}

[data-theme="light"] .detail-value {
    color: #1a1a2e;
}

.detail-label {
    font-size: 0.65rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
    font-weight: 600;
    opacity: 0.9;
}

/* Keyboard Heatmap */
.heatmap-container {
    padding: 20px;
    border-radius: 18px;
    margin-bottom: 20px;
}

.keyboard-heatmap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px;
}

.heatmap-row {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.heatmap-key {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--tt-mono);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s;
    cursor: default;
    text-transform: uppercase;
    position: relative;
}

.heatmap-key.speed-fast {
    background: rgba(46, 204, 113, 0.25);
    color: #2ecc71;
    border-color: rgba(46, 204, 113, 0.3);
}

.heatmap-key.speed-medium {
    background: rgba(241, 196, 15, 0.25);
    color: #f1c40f;
    border-color: rgba(241, 196, 15, 0.3);
}

.heatmap-key.speed-slow {
    background: rgba(231, 76, 60, 0.25);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.3);
}

.heatmap-key.speed-unused {
    background: rgba(255, 255, 255, 0.03);
    color: var(--word-idle);
}

.heatmap-key.wide {
    min-width: 60px;
}

.heatmap-key.space-key {
    min-width: 200px;
}

/* History Section */
.history-container {
    padding: 20px;
    border-radius: 18px;
    margin-bottom: 20px;
}

/* Result Actions */
.result-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.primary-btn {
    background: var(--grad-wpm) !important;
    color: #fff !important;
    border-color: transparent !important;
    font-weight: 700;
}

.primary-btn:hover {
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.4) !important;
}

.secondary-btn {
    background: var(--glass-bg);
}

/* ===== Glass Card ===== */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ===== SEO Content Section ===== */
.seo-content-section {
    margin-top: 50px;
    padding: 0 0 40px;
}

.ad-container {
    min-height: 90px;
    margin: 25px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--glass-border);
    border-radius: 12px;
    background: var(--glass-bg);
    opacity: 0.5;
}

.seo-article {
    padding: 35px 30px;
    border-radius: 20px;
}

.seo-heading {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 20px;
    text-align: center;
    line-height: 1.3;
}

.seo-intro p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--word-idle);
    text-align: center;
    max-width: 800px;
    margin: 0 auto 30px;
}

.seo-features h3,
.seo-faq h3,
.seo-tips h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 30px 0 20px;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.feature-item {
    padding: 20px;
    border-radius: 15px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-3px);
}

.feature-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.feature-item h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 6px;
}

.feature-item p {
    font-size: 0.85rem;
    color: var(--word-idle);
    line-height: 1.6;
    margin: 0;
}

/* FAQ */
.faq-item {
    padding: 18px 20px;
    border-radius: 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    margin-bottom: 12px;
    transition: all 0.3s;
}

.faq-item:hover {
    border-color: rgba(var(--tt-accent-rgb), 0.2);
}

.faq-item h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 8px;
    cursor: pointer;
}

.faq-item p {
    font-size: 0.9rem;
    color: var(--word-idle);
    line-height: 1.7;
    margin: 0;
}

/* Tips */
.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list li {
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--word-idle);
    transition: transform 0.2s;
}

.tips-list li:hover {
    transform: translateX(5px);
}

.tips-list li strong {
    color: #fff;
}

[data-theme="light"] .tips-list li strong {
    color: #1a1a2e;
}

/* ===== Animations ===== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Large Tablets / Small Laptops */
@media (max-width: 1024px) {
    .result-details-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets */
@media (max-width: 768px) {
    .typing-section {
        padding: 15px 12px 0;
    }

    .typing-hero {
        margin-bottom: 18px;
    }

    .hero-title {
        font-size: 1.7rem;
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }

    .typing-settings-bar {
        padding: 12px 14px;
        gap: 10px 15px;
    }

    .words-area {
        font-size: 1.35rem;
        gap: 0.3em 0.5em;
    }

    .typing-area-wrapper {
        padding: 20px;
        min-height: 120px;
    }

    .stat-item {
        padding: 5px 12px;
    }

    .stat-icon {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .stat-icon svg {
        width: 14px;
        height: 14px;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .result-main-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .card-value {
        font-size: 2.2rem;
    }

    .result-details-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .heatmap-key {
        min-width: 28px;
        height: 28px;
        font-size: 0.6rem;
    }

    .heatmap-key.wide {
        min-width: 45px;
    }

    .heatmap-key.space-key {
        min-width: 140px;
    }

    .feature-grid {
        grid-template-columns: 1fr 1fr;
    }

    .seo-article {
        padding: 25px 18px;
    }
}

/* Large Phones */
@media (max-width: 600px) {
    .typing-settings-bar {
        flex-direction: column;
        gap: 8px;
    }

    .setting-group {
        width: 100%;
        justify-content: center;
    }

    .lang-group {
        flex-direction: column;
        align-items: center;
    }

    .mode-selector-pill {
        width: 100%;
        justify-content: center;
    }

    .options-group {
        justify-content: center;
        flex-wrap: wrap;
    }

    .live-stats-bar {
        flex-wrap: wrap;
        gap: 5px;
        padding: 8px 12px;
    }

    .stat-divider {
        display: none;
    }

    .stat-item {
        flex: 1;
        min-width: 70px;
        justify-content: center;
    }

    .result-main-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .result-card {
        padding: 20px;
        flex-direction: row;
        gap: 15px;
    }

    .card-glow {
        display: none;
    }

    .card-value {
        font-size: 2.5rem;
    }

    .result-details-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .detail-card {
        padding: 12px 8px;
    }

    .detail-value {
        font-size: 1.1rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* Standard Phones */
@media (max-width: 480px) {
    .typing-section {
        padding: 10px 8px 0;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 5px 14px;
    }

    .hero-title {
        font-size: 1.4rem;
    }

    .words-area {
        font-size: 1.2rem;
        line-height: 1.8;
    }

    .typing-area-wrapper {
        padding: 15px;
        min-height: 110px;
        border-radius: 14px;
    }

    .caret {
        height: 1.5rem;
    }

    .mode-btn {
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    .mode-btn svg {
        width: 12px;
        height: 12px;
    }

    .config-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .result-screen {
        padding: 25px 18px;
    }

    .result-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .heatmap-key {
        min-width: 22px;
        height: 24px;
        font-size: 0.55rem;
        border-radius: 4px;
    }

    .heatmap-key.wide {
        min-width: 36px;
    }

    .heatmap-key.space-key {
        min-width: 100px;
    }

    .heatmap-row {
        gap: 2px;
    }

    .result-actions {
        flex-direction: column;
        gap: 8px;
    }

    .result-actions .action-btn {
        width: 100%;
        justify-content: center;
    }

    .seo-heading {
        font-size: 1.2rem;
    }

    .seo-article {
        padding: 20px 14px;
    }
}

/* Ultra-Narrow Devices (Galaxy Fold, etc.) */
@media (max-width: 320px) {
    .typing-section {
        padding: 5px 4px 0;
    }

    .hero-title {
        font-size: 1.2rem;
    }

    .hero-subtitle {
        font-size: 0.75rem;
    }

    .words-area {
        font-size: 1.05rem;
    }

    .typing-area-wrapper {
        padding: 12px 10px;
    }

    .mode-btn span,
    .option-label {
        display: none;
    }

    .stat-label {
        display: none;
    }

    .result-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   LARGE DESKTOP RESPONSIVE - Match Header Width
   ============================================ */

/* Standard Laptop (1366-1919px) */
@media (min-width: 1366px) and (max-width: 1919px) {
    .typing-section {
        max-width: 1250px;
        padding: 25px 30px 0;
    }
}

/* Full HD Desktop (1920-2047px) */
@media (min-width: 1920px) and (max-width: 2047px) {
    .typing-section {
        max-width: 1500px;
        padding: 30px 40px 0;
    }

    .hero-title {
        font-size: 2.6rem;
    }

    .words-area {
        font-size: 1.75rem;
    }
}

/* iMac Retina 4k 21.5" (2048x1152) */
@media (min-width: 2048px) and (max-width: 2239px) {
    .typing-section {
        max-width: 1650px;
        padding: 30px 40px 0;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .hero-subtitle {
        font-size: 1.15rem;
    }

    .words-area {
        font-size: 1.85rem;
    }

    .typing-area-wrapper {
        padding: 30px 35px;
        min-height: 160px;
        max-height: 240px;
    }

    .typing-settings-bar {
        padding: 18px 28px;
        gap: 18px 30px;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

/* iMac Retina 4.5k 24" (2240x1800) */
@media (min-width: 2240px) and (max-width: 2559px) {
    .typing-section {
        max-width: 1800px;
        padding: 35px 50px 0;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .words-area {
        font-size: 1.95rem;
    }

    .typing-area-wrapper {
        padding: 35px 40px;
        min-height: 170px;
        max-height: 260px;
    }

    .typing-settings-bar {
        padding: 20px 32px;
        gap: 20px 35px;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .setting-label {
        font-size: 0.85rem;
    }

    .config-btn,
    .mode-btn {
        font-size: 0.9rem;
        padding: 9px 16px;
    }
}

/* QHD Desktop / Desktop hidpi XL (2560x1440) */
@media (min-width: 2560px) and (max-width: 3199px) {
    .typing-section {
        max-width: 2000px;
        padding: 40px 60px 0;
    }

    .hero-title {
        font-size: 3.2rem;
    }

    .hero-subtitle {
        font-size: 1.3rem;
    }

    .words-area {
        font-size: 2.1rem;
        line-height: 2.2;
    }

    .typing-area-wrapper {
        padding: 38px 45px;
        min-height: 180px;
        max-height: 280px;
        border-radius: 24px;
    }

    .typing-settings-bar {
        padding: 22px 36px;
        gap: 22px 40px;
        border-radius: 22px;
    }

    .stat-value {
        font-size: 1.7rem;
    }

    .setting-label {
        font-size: 0.9rem;
    }

    .config-btn,
    .mode-btn {
        font-size: 0.95rem;
        padding: 10px 18px;
    }

    .custom-select {
        font-size: 0.95rem;
        padding: 9px 35px 9px 15px;
    }
}

/* iMac pro Retina 5k 27" (3200x1800) */
@media (min-width: 3200px) and (max-width: 3839px) {
    .typing-section {
        max-width: 2400px;
        padding: 45px 70px 0;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .hero-subtitle {
        font-size: 1.4rem;
    }

    .words-area {
        font-size: 2.3rem;
        line-height: 2.3;
    }

    .typing-area-wrapper {
        padding: 42px 50px;
        min-height: 200px;
        max-height: 320px;
        border-radius: 28px;
    }

    .typing-settings-bar {
        padding: 24px 40px;
        gap: 24px 45px;
        border-radius: 24px;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .config-btn,
    .mode-btn {
        font-size: 1rem;
        padding: 11px 20px;
    }

    .custom-select {
        font-size: 1rem;
        padding: 10px 38px 10px 16px;
    }

    .live-stats-bar {
        padding: 14px 28px;
        border-radius: 18px;
    }
}

/* Desktop 4K (3840x2160+) */
@media (min-width: 3840px) {
    .typing-section {
        max-width: 2800px;
        padding: 50px 80px 0;
    }

    .hero-title {
        font-size: 4rem;
    }

    .hero-subtitle {
        font-size: 1.6rem;
    }

    .words-area {
        font-size: 2.6rem;
        line-height: 2.4;
    }

    .typing-area-wrapper {
        padding: 50px 60px;
        min-height: 240px;
        max-height: 380px;
        border-radius: 32px;
    }

    .typing-settings-bar {
        padding: 28px 48px;
        gap: 28px 50px;
        border-radius: 28px;
    }

    .stat-value {
        font-size: 2rem;
    }

    .config-btn,
    .mode-btn {
        font-size: 1.1rem;
        padding: 12px 22px;
    }

    .custom-select {
        font-size: 1.1rem;
        padding: 12px 40px 12px 18px;
    }

    .live-stats-bar {
        padding: 16px 32px;
        border-radius: 20px;
    }

    .action-btn {
        font-size: 1.1rem;
        padding: 14px 32px;
    }
}