/* ═══════════════════════════════════════════════════════════
   HindiTyping.online — GRAND v5.0
   Particles + Neon Glow + Glassmorphism + Animated Gradients
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg-void: #030108;
    --bg-deep: #07020f;
    --bg-primary: #030108;
    --bg-secondary: #07020f;
    --bg-card: rgba(12, 6, 28, 0.55);
    --bg-card-hover: rgba(20, 10, 45, 0.7);
    --bg-glass: rgba(255,255,255,0.025);
    --bg-hover: rgba(255,255,255,0.04);
    --border-glass: rgba(255,255,255,0.06);
    --border-glow: rgba(168, 85, 247, 0.15);
    --text-primary: #f1f0f5;
    --text-secondary: #706a85;
    --text-muted: #342f47;
    --neon-purple: #a855f7;
    --neon-blue: #3b82f6;
    --neon-cyan: #06b6d4;
    --neon-pink: #ec4899;
    --neon-green: #10b981;
    --neon-orange: #f97316;
    --neon-yellow: #eab308;
    --accent: #a855f7;
    --accent-hover: #9333ea;
    --accent-rgb: 168,85,247;
    --accent-glow: rgba(168,85,247,0.15);
    --correct: #10b981;
    --wrong: #ef4444;
    --extra: #f97316;
    --missed: #475569;
    --caret: #a855f7;
    --font-display: 'Syne', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --font-hindi: 'Noto Sans Devanagari', 'Mangal', sans-serif;
    --font-krutidev: 'Kruti Dev 010', 'Kruti Dev', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 20px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --shadow: 0 8px 40px rgba(0,0,0,0.3);
    --shadow-glow: 0 0 80px rgba(168,85,247,0.06);
    --gradient-hero: linear-gradient(135deg, #a855f7 0%, #06b6d4 40%, #ec4899 70%, #f97316 100%);
}

/* ── Themes ── */
[data-theme="ocean"] {
    --bg-void: #010817; --bg-primary: #010817; --bg-card: rgba(5,15,40,0.55);
    --text-primary: #cbd5e1; --text-secondary: #475569; --text-muted: #1e3a5f;
    --accent: #38bdf8; --accent-rgb: 56,189,248; --caret: #38bdf8;
    --neon-purple: #38bdf8; --neon-cyan: #818cf8;
    --correct: #4ade80; --wrong: #fb7185;
    --gradient-hero: linear-gradient(135deg, #38bdf8, #818cf8, #4ade80);
}
[data-theme="forest"] {
    --bg-void: #040f08; --bg-primary: #040f08; --bg-card: rgba(8,30,15,0.55);
    --text-primary: #d1e7dd; --text-secondary: #4a7a5a; --text-muted: #1c3d24;
    --accent: #4ade80; --accent-rgb: 74,222,128; --caret: #4ade80;
    --neon-purple: #4ade80; --neon-cyan: #a3e635;
    --correct: #86efac; --wrong: #fca5a5;
    --gradient-hero: linear-gradient(135deg, #4ade80, #a3e635, #34d399);
}
[data-theme="sunset"] {
    --bg-void: #100812; --bg-primary: #100812; --bg-card: rgba(30,10,35,0.55);
    --text-primary: #f5d0fe; --text-secondary: #a855f7; --text-muted: #581c87;
    --accent: #f472b6; --accent-rgb: 244,114,182; --caret: #f472b6;
    --neon-purple: #f472b6; --neon-cyan: #fb923c;
    --correct: #86efac; --wrong: #fca5a5;
    --gradient-hero: linear-gradient(135deg, #f472b6, #fb923c, #a78bfa);
}
[data-theme="serika"] {
    --bg-void: #161718; --bg-primary: #161718; --bg-card: rgba(30,32,34,0.7);
    --text-primary: #d1d0c5; --text-secondary: #646669; --text-muted: #3a3c3f;
    --accent: #e2b714; --accent-rgb: 226,183,20; --caret: #e2b714;
    --neon-purple: #e2b714; --neon-cyan: #e2b714;
    --correct: #7ec984; --wrong: #ca4754;
    --gradient-hero: linear-gradient(135deg, #e2b714, #f59e0b, #eab308);
}
[data-theme="light"] {
    --bg-void: #f8fafc; --bg-primary: #f8fafc; --bg-card: rgba(255,255,255,0.7);
    --bg-hover: rgba(0,0,0,0.04); --border-glass: rgba(0,0,0,0.08); --border-glow: rgba(124,58,237,0.15);
    --text-primary: #0f172a; --text-secondary: #64748b; --text-muted: #cbd5e1;
    --accent: #7c3aed; --accent-rgb: 124,58,237; --caret: #7c3aed;
    --neon-purple: #7c3aed; --neon-cyan: #06b6d4;
    --correct: #059669; --wrong: #dc2626;
    --shadow: 0 8px 32px rgba(0,0,0,0.06);
    --gradient-hero: linear-gradient(135deg, #7c3aed, #06b6d4, #ec4899);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.ht-typing-page {
    background: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    line-height: 1.6;
    min-height: 100vh;
}

/* Gradient Mesh BG */
body.ht-typing-page::before {
    content: '';
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 800px 600px at 15% 20%, rgba(var(--accent-rgb),0.08) 0%, transparent 60%),
        radial-gradient(ellipse 600px 500px at 85% 70%, rgba(6,182,212,0.05) 0%, transparent 60%),
        radial-gradient(ellipse 700px 400px at 50% 90%, rgba(236,72,153,0.04) 0%, transparent 60%);
    animation: meshFloat 25s ease-in-out infinite alternate;
}
@keyframes meshFloat {
    0% { transform: scale(1) translate(0,0); }
    50% { transform: scale(1.05) translate(-15px,10px); }
    100% { transform: scale(0.98) translate(10px,-8px); }
}

/* Noise overlay */
body.ht-typing-page::after {
    content: '';
    position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb),0.3); border-radius: 2px; }

/* ═══════ APP LAYOUT ═══════ */
.ht-app { position: relative; z-index: 2; display: flex; flex-direction: column; min-height: 100vh; }

/* ── Header ── */
.ht-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 40px; position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(30px) saturate(1.5); -webkit-backdrop-filter: blur(30px) saturate(1.5);
    background: rgba(3,1,8,0.6); border-bottom: 1px solid rgba(255,255,255,0.03);
}

.ht-logo {
    display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text-primary);
}
.ht-logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    box-shadow: 0 0 20px rgba(var(--accent-rgb),0.3), 0 0 60px rgba(var(--accent-rgb),0.1);
    animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
    0%,100% { box-shadow: 0 0 20px rgba(var(--accent-rgb),0.3), 0 0 60px rgba(var(--accent-rgb),0.1); }
    50% { box-shadow: 0 0 30px rgba(var(--accent-rgb),0.5), 0 0 80px rgba(var(--accent-rgb),0.2); }
}
.ht-logo span {
    font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.03em;
}

.ht-nav { display: flex; align-items: center; gap: 4px; }
.ht-nav a, .ht-nav button {
    padding: 8px 16px; color: var(--text-secondary); text-decoration: none;
    font-size: 13px; font-weight: 500; border-radius: var(--radius-xs);
    transition: var(--transition); background: none; border: none; cursor: pointer;
}
.ht-nav a:hover, .ht-nav button:hover, .ht-nav a.active { color: var(--text-primary); background: var(--bg-hover); }
.ht-nav a.active { position: relative; }
.ht-nav a.active::after {
    content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
    width: 16px; height: 2px; background: var(--accent); border-radius: 2px;
    box-shadow: 0 0 8px rgba(var(--accent-rgb),0.5);
}

.ht-user-badge {
    display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 8px !important;
    background: linear-gradient(135deg, rgba(var(--accent-rgb),0.12), rgba(6,182,212,0.08)) !important;
    border: 1px solid rgba(var(--accent-rgb),0.15) !important;
    border-radius: 28px !important; color: var(--accent) !important; font-weight: 600 !important;
}
.ht-user-badge:hover { border-color: rgba(var(--accent-rgb),0.3) !important; box-shadow: 0 0 20px rgba(var(--accent-rgb),0.1); }

/* ── Main ── */
.ht-main { flex: 1; padding: 24px 40px 40px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ═══════ CONFIG BAR ═══════ */
.ht-config {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
    padding: 14px 24px; margin-bottom: 28px;
    background: var(--bg-card); backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass); border-radius: var(--radius);
    box-shadow: 0 4px 30px rgba(0,0,0,0.25);
}
.ht-config-group { display: flex; align-items: center; gap: 4px; }
.ht-config-hindifont {
    border: 1px dashed rgba(var(--accent-rgb),0.2); border-radius: 20px;
    padding: 4px 10px; background: rgba(var(--accent-rgb),0.03);
}
.ht-config-divider { width: 1px; height: 24px; background: var(--border-glass); margin: 0 8px; }
.ht-pill-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-muted); font-weight: 700; margin-right: 6px; }

.ht-pill {
    padding: 6px 14px; border: 1px solid transparent; border-radius: 20px;
    background: transparent; color: var(--text-secondary); font-family: var(--font-body);
    font-size: 12px; font-weight: 600; cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.ht-pill:hover { color: var(--text-primary); background: var(--bg-hover); }
.ht-pill.active {
    color: var(--accent);
    background: rgba(var(--accent-rgb),0.1);
    border-color: rgba(var(--accent-rgb),0.2);
    box-shadow: 0 0 15px rgba(var(--accent-rgb),0.08), inset 0 0 15px rgba(var(--accent-rgb),0.03);
}

.ht-select {
    padding: 6px 28px 6px 12px; border: 1px solid var(--border-glass); border-radius: 20px;
    background: rgba(var(--accent-rgb),0.04); color: var(--text-primary);
    font-family: var(--font-body); font-size: 11.5px; cursor: pointer; transition: var(--transition);
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6' fill='%23706a85'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
}
.ht-select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.12); }
.ht-select option { background: #0f0820; color: var(--text-primary); }

/* ═══════ TYPING AREA ═══════ */
.ht-typing-area {
    position: relative; padding: 36px 40px; min-height: 300px; outline: none; cursor: text;
    background: var(--bg-card); backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass); border-radius: var(--radius);
    box-shadow: var(--shadow), var(--shadow-glow); transition: var(--transition); margin-bottom: 24px;
}
.ht-typing-area:hover, .ht-typing-area:focus { border-color: var(--border-glow); box-shadow: var(--shadow), 0 0 100px rgba(var(--accent-rgb),0.06); }

.ht-live-stats { display: flex; gap: 40px; justify-content: center; margin-bottom: 24px; opacity: 0; transition: opacity 0.4s; }
.ht-live-stats.visible { opacity: 1; }
.ht-live-stat { text-align: center; }
.ht-live-stat span {
    display: block; font-family: var(--font-mono); font-size: 2.4rem; font-weight: 800; line-height: 1;
    background: var(--gradient-hero); background-size: 300% 300%; animation: gradShift 6s ease-in-out infinite;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.ht-live-stat small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-muted); font-weight: 700; margin-top: 4px; }
@keyframes gradShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.ht-timer-bar { height: 3px; background: rgba(255,255,255,0.04); border-radius: 3px; margin-bottom: 24px; overflow: hidden; }
.ht-timer-bar-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--neon-purple), var(--neon-cyan), var(--neon-pink));
    background-size: 200% 100%; border-radius: 3px;
    transition: width 0.15s linear; animation: timerGrad 3s linear infinite;
}
@keyframes timerGrad { 0% { background-position: 0 0; } 100% { background-position: 200% 0; } }

.ht-text-display {
    font-family: var(--font-mono); font-size: 1.4rem; line-height: 2.4;
    max-height: calc(2.4em * 3.5); overflow: hidden; overflow-y: auto;
    position: relative; word-break: break-word; scroll-behavior: smooth; user-select: none; padding: 8px 0;
}
.ht-text-display.hindi-text { font-family: var(--font-hindi); font-size: 1.5rem; letter-spacing: 0.01em; }
.ht-text-display.krutidev-text { font-family: var(--font-krutidev); }
.ht-text-display .char { position: relative; transition: color 0.12s; padding: 0 0.5px; }
.ht-text-display .char.correct { color: var(--correct); }
.ht-text-display .char.wrong { color: var(--wrong); background: rgba(239,68,68,0.1); border-radius: 3px; }
.ht-text-display .char.wrong-space { background: rgba(239,68,68,0.2); border-radius: 3px; min-width: 0.5ch; display: inline-block; }
.ht-text-display .char.extra { color: var(--extra); opacity: 0.7; }
.ht-text-display .char.upcoming { color: var(--text-muted); }
.ht-text-display .char.current { color: var(--text-primary); }

.ht-caret {
    position: absolute; width: 2.5px; background: var(--caret); border-radius: 2px;
    pointer-events: none; z-index: 10; transition: left 0.08s ease, top 0.08s ease;
    animation: caretBlink 1s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(var(--accent-rgb),0.6), 0 0 20px rgba(var(--accent-rgb),0.25);
}
.ht-caret.typing { animation: none; }
@keyframes caretBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.15; } }

.ht-hidden-input{position:absolute;left:-9999px;top:0;width:1px;height:1px;opacity:0;pointer-events:none;z-index:-1}
.ht-start-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  background:rgba(var(--bg-void-rgb,9,8,15),0.85);backdrop-filter:blur(6px);border-radius:var(--radius);z-index:15;cursor:text;transition:opacity 0.3s}
.ht-start-overlay.gone{opacity:0;pointer-events:none}

.ht-countdown {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(3,1,8,0.9); backdrop-filter: blur(8px); border-radius: var(--radius);
    z-index: 20; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.ht-countdown.visible { opacity: 1; pointer-events: auto; }
.ht-countdown span {
    font-family: var(--font-display); font-size: 5rem; font-weight: 900;
    background: var(--gradient-hero); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.ht-restart-hint { text-align: center; margin-top: 20px; font-size: 11px; color: var(--text-muted); letter-spacing: 0.03em; }
.ht-restart-hint kbd {
    display: inline-block; padding: 2px 8px; border: 1px solid var(--border-glass);
    border-radius: 4px; font-family: var(--font-mono); font-size: 10px;
    background: rgba(255,255,255,0.02); color: var(--text-secondary);
}

/* ═══════ RESULT ═══════ */
.ht-result { animation: fadeUp 0.5s var(--ease); }
.ht-result-hero { text-align: center; padding: 50px 0 30px; }
.ht-result-main-stat .value {
    font-family: var(--font-mono); font-size: 7rem; font-weight: 900; line-height: 1;
    background: var(--gradient-hero); background-size: 300% 300%; animation: gradShift 6s ease-in-out infinite;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    filter: drop-shadow(0 0 60px rgba(var(--accent-rgb),0.3));
}
.ht-result-main-stat .label {
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.25em;
    color: var(--text-muted); font-weight: 700; margin-top: 10px;
}
.ht-result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 32px; }
.ht-result-stat {
    background: var(--bg-card); backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass); border-radius: var(--radius-sm);
    padding: 20px 12px; text-align: center; transition: all 0.3s var(--ease);
}
.ht-result-stat:hover { transform: translateY(-3px); border-color: var(--border-glow); }
.ht-result-stat .val { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 700; }
.ht-result-stat .lbl { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 6px; }
.ht-chart-container { background: var(--bg-card); backdrop-filter: blur(16px); border: 1px solid var(--border-glass); border-radius: var(--radius-sm); padding: 24px; margin-bottom: 32px; }
.ht-chart-container canvas { width: 100% !important; }
.ht-result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; padding-bottom: 40px; }

/* ═══════ BUTTONS ═══════ */
.ht-btn {
    display: inline-flex; align-items: center; gap: 10px; padding: 14px 32px;
    border-radius: 28px; font-family: var(--font-body); font-size: 14px; font-weight: 700;
    cursor: pointer; border: none; text-decoration: none; transition: all 0.4s var(--ease);
    letter-spacing: 0.02em; position: relative; overflow: hidden;
}
.ht-btn-primary {
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue), var(--neon-cyan));
    background-size: 200% 200%; color: #fff;
    box-shadow: 0 4px 20px rgba(var(--accent-rgb),0.3), 0 0 60px rgba(var(--accent-rgb),0.1);
    animation: btnGrad 4s ease-in-out infinite;
}
@keyframes btnGrad { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.ht-btn-primary:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 8px 30px rgba(var(--accent-rgb),0.4), 0 0 80px rgba(var(--accent-rgb),0.15); }
.ht-btn-secondary {
    background: rgba(255,255,255,0.04); color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.08); backdrop-filter: blur(10px);
}
.ht-btn-secondary:hover { background: rgba(255,255,255,0.08); border-color: rgba(var(--accent-rgb),0.2); transform: translateY(-2px); }
.ht-btn-ghost { background: none; color: var(--text-secondary); border: none; padding: 10px 20px; }
.ht-btn-ghost:hover { color: var(--accent); }
.ht-btn-icon { padding: 10px 12px; }

/* ═══════ DASHBOARD ═══════ */
.ht-dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.ht-dash-card {
    position: relative; background: var(--bg-card); backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass); border-radius: var(--radius);
    padding: 28px 20px; text-align: center; overflow: hidden; transition: all 0.4s var(--ease);
}
.ht-dash-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; opacity: 0; transition: opacity 0.3s;
}
.ht-dash-card:nth-child(1)::before { background: linear-gradient(90deg, var(--neon-purple), var(--neon-blue)); }
.ht-dash-card:nth-child(2)::before { background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green)); }
.ht-dash-card:nth-child(3)::before { background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple)); }
.ht-dash-card:nth-child(4)::before { background: linear-gradient(90deg, var(--neon-pink), var(--neon-orange)); }
.ht-dash-card:nth-child(5)::before { background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan)); }
.ht-dash-card:nth-child(6)::before { background: linear-gradient(90deg, var(--neon-orange), var(--neon-yellow)); }
.ht-dash-card:nth-child(7)::before { background: linear-gradient(90deg, var(--neon-orange), var(--neon-pink)); }
.ht-dash-card:nth-child(8)::before { background: linear-gradient(90deg, var(--neon-yellow), var(--neon-green)); }
.ht-dash-card:hover { transform: translateY(-6px); border-color: var(--border-glow); }
.ht-dash-card:hover::before { opacity: 1; }
.ht-dash-card .icon { font-size: 1.6rem; margin-bottom: 12px; }
.ht-dash-card .value { font-family: var(--font-mono); font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.ht-dash-card .label { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 6px; font-weight: 600; }

/* ═══════ LEADERBOARD ═══════ */
.ht-leaderboard {
    background: var(--bg-card); backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass); border-radius: var(--radius);
    padding: 32px; box-shadow: var(--shadow);
}
.ht-lb-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.ht-lb-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ht-lb-table { width: 100%; border-collapse: collapse; }
.ht-lb-table th, .ht-lb-table td { padding: 14px 16px; text-align: left; font-size: 13px; }
.ht-lb-table th { color: var(--text-muted); text-transform: uppercase; font-size: 10px; letter-spacing: 0.12em; font-weight: 700; border-bottom: 1px solid var(--border-glass); }
.ht-lb-table tr { border-bottom: 1px solid rgba(255,255,255,0.015); transition: all 0.3s; }
.ht-lb-table tr:last-child { border: none; }
.ht-lb-table tr:hover { background: rgba(var(--accent-rgb),0.03); }
.ht-lb-rank {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%; font-weight: 800; font-size: 13px; background: rgba(255,255,255,0.05); color: var(--text-secondary);
}
.ht-lb-rank.gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1a0a00; box-shadow: 0 0 15px rgba(251,191,36,0.3); }
.ht-lb-rank.silver { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.ht-lb-rank.bronze { background: linear-gradient(135deg, #cd7f32, #b45309); color: #fff; }
.ht-lb-wpm {
    font-family: var(--font-mono); font-weight: 800; font-size: 1.1rem;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.ht-lb-username { font-weight: 700; color: var(--text-primary); }

/* ═══════ HERO / HOME ═══════ */
.ht-hero { text-align: center; padding: 100px 20px 60px; position: relative; }
.ht-hero::before {
    content: ''; position: absolute; top: -50px; left: 50%; transform: translateX(-50%);
    width: 800px; height: 400px;
    background: radial-gradient(ellipse, rgba(var(--accent-rgb),0.12) 0%, rgba(6,182,212,0.06) 40%, transparent 70%);
    filter: blur(60px); animation: heroBreath 8s ease-in-out infinite alternate; pointer-events: none;
}
@keyframes heroBreath { 0% { opacity: 0.6; transform: translateX(-50%) scale(1); } 100% { opacity: 1; transform: translateX(-50%) scale(1.15); } }
.ht-hero-badge {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 18px;
    background: rgba(var(--accent-rgb),0.08); border: 1px solid rgba(var(--accent-rgb),0.15);
    border-radius: 24px; font-size: 12px; font-weight: 600; color: var(--accent);
    margin-bottom: 32px; letter-spacing: 0.06em; text-transform: uppercase;
}
.ht-hero h1 {
    font-family: var(--font-display); font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 900; line-height: 1.05; letter-spacing: -0.04em; margin-bottom: 24px;
}
.ht-gradient {
    background: var(--gradient-hero); background-size: 300% 300%; animation: gradShift 6s ease-in-out infinite;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.ht-hero p { font-size: 1.1rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto 40px; line-height: 1.8; }
.ht-hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* Stats Counter */
.ht-stats-counter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; max-width: 900px; margin: 0 auto 80px; }
.ht-counter-item {
    position: relative; background: var(--bg-card); backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass); border-radius: var(--radius);
    padding: 32px 16px; text-align: center; overflow: hidden; transition: all 0.4s var(--ease);
}
.ht-counter-item::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--neon-cyan), transparent);
    opacity: 0; transition: opacity 0.4s;
}
.ht-counter-item:hover { transform: translateY(-6px); border-color: var(--border-glow); }
.ht-counter-item:hover::before { opacity: 1; }
.ht-counter-item .num {
    font-family: var(--font-mono); font-size: 2.8rem; font-weight: 800; line-height: 1;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; letter-spacing: -0.04em;
}
.ht-counter-item .txt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-secondary); margin-top: 8px; font-weight: 600; }

/* Features */
.ht-section-title { font-family: var(--font-display); font-size: 2rem; font-weight: 800; text-align: center; letter-spacing: -0.03em; margin-bottom: 12px; }
.ht-features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.ht-feature-card {
    position: relative; background: var(--bg-card); backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass); border-radius: var(--radius);
    padding: 36px 28px; transition: all 0.4s var(--ease); overflow: hidden; cursor: default;
}
.ht-feature-card::before {
    content: ''; position: absolute; inset: -1px; border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(var(--accent-rgb),0.15), transparent, rgba(6,182,212,0.1));
    opacity: 0; z-index: -1; transition: opacity 0.4s;
}
.ht-feature-card:hover { transform: translateY(-8px); border-color: var(--border-glow); box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 40px rgba(var(--accent-rgb),0.06); }
.ht-feature-card:hover::before { opacity: 1; }
.ht-feature-card .icon { font-size: 2.2rem; margin-bottom: 16px; filter: drop-shadow(0 4px 12px rgba(var(--accent-rgb),0.2)); }
.ht-feature-card h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.02em; }
.ht-feature-card p { font-size: 13px; line-height: 1.7; color: var(--text-secondary); }
.ht-home-lb { background: var(--bg-card); backdrop-filter: blur(16px); border: 1px solid var(--border-glass); border-radius: var(--radius); padding: 28px; }

/* ═══════ AUTH ═══════ */
.ht-auth-container { display: flex; align-items: center; justify-content: center; min-height: 60vh; padding: 40px 20px; }
.ht-auth-card {
    width: 100%; max-width: 440px; position: relative;
    background: var(--bg-card); backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass); border-radius: var(--radius);
    padding: 44px 36px; box-shadow: var(--shadow), var(--shadow-glow); overflow: hidden;
}
.ht-auth-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--neon-purple), var(--neon-cyan), var(--neon-pink));
}
.ht-auth-card h2 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; margin-bottom: 4px; letter-spacing: -0.02em; }
.ht-auth-card .subtitle { color: var(--text-secondary); font-size: 13px; margin-bottom: 28px; }
.ht-form-group { margin-bottom: 20px; }
.ht-form-group label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); margin-bottom: 8px; }
.ht-input {
    width: 100%; padding: 12px 16px; background: rgba(var(--accent-rgb),0.03);
    border: 1px solid var(--border-glass); border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: 14px; font-family: var(--font-body); transition: var(--transition);
}
.ht-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.1), 0 0 30px rgba(var(--accent-rgb),0.04); outline: none; }
.ht-input::placeholder { color: var(--text-muted); }
.ht-input-hint { font-size: 11px; margin-top: 6px; color: var(--text-muted); }
.ht-input-hint.success { color: var(--neon-green); }
.ht-input-hint.error { color: var(--wrong); }
.ht-checkbox-group { margin-bottom: 16px; }
.ht-checkbox-group label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.ht-auth-footer { margin-top: 24px; text-align: center; font-size: 13px; color: var(--text-secondary); }
.ht-auth-footer a { color: var(--accent); text-decoration: none; font-weight: 700; }
.ht-auth-footer a:hover { text-decoration: underline; }
.ht-error-msg { display: none; padding: 12px 16px; background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: var(--wrong); border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.ht-error-msg.visible { display: block; animation: fadeUp 0.3s var(--ease); }
.ht-success-msg { padding: 12px 16px; background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); color: var(--neon-green); border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }

/* ═══════ UTILITIES ═══════ */
.ht-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--text-muted); font-size: 13px; }
.ht-spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border-glass); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
.ht-empty { text-align: center; padding: 40px; color: var(--text-muted); font-size: 14px; }
.ht-toast {
    position: fixed; bottom: 24px; right: 24px; padding: 14px 24px;
    border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; z-index: 9999;
    transform: translateY(100px); opacity: 0; transition: all 0.4s var(--ease); backdrop-filter: blur(12px);
}
.ht-toast.visible { transform: translateY(0); opacity: 1; }
.ht-toast.success { background: rgba(16,185,129,0.95); color: #064e3b; }
.ht-toast.error { background: rgba(239,68,68,0.95); color: #7f1d1d; }
.ht-toast.info { background: rgba(var(--accent-rgb),0.95); color: #fff; }

.ht-footer {
    padding: 24px 40px; display: flex; align-items: center; justify-content: space-between;
    font-size: 11px; color: var(--text-muted); border-top: 1px solid rgba(255,255,255,0.02); flex-wrap: wrap; gap: 8px;
}
.ht-footer a { color: var(--text-secondary); text-decoration: none; transition: var(--transition); }
.ht-footer a:hover { color: var(--accent); }

.ht-streak-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
    background: linear-gradient(135deg, rgba(249,115,22,0.15), rgba(234,179,8,0.15));
    border: 1px solid rgba(249,115,22,0.2); border-radius: 20px;
    font-size: 12px; font-weight: 600; color: var(--neon-orange);
}

.ht-history-table { width: 100%; border-collapse: collapse; }
.ht-history-table th, .ht-history-table td { padding: 12px 14px; text-align: left; font-size: 13px; }
.ht-history-table th { color: var(--text-muted); text-transform: uppercase; font-size: 10px; letter-spacing: 0.12em; font-weight: 700; border-bottom: 1px solid var(--border-glass); }
.ht-history-table tr { border-bottom: 1px solid rgba(255,255,255,0.015); transition: all 0.3s; }
.ht-history-table tr:hover { background: rgba(var(--accent-rgb),0.03); }

.ht-pagination { display: flex; gap: 4px; justify-content: center; margin-top: 20px; }
.ht-pagination button {
    padding: 8px 14px; border: 1px solid var(--border-glass); border-radius: var(--radius-xs);
    background: var(--bg-card); color: var(--text-secondary); cursor: pointer; font-size: 12px; transition: var(--transition);
}
.ht-pagination button:hover { background: var(--bg-hover); color: var(--text-primary); }
.ht-pagination button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.ht-pagination button:disabled { opacity: 0.3; cursor: not-allowed; }

/* ═══════ ANIMATIONS ═══════ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

.ht-feature-card, .ht-counter-item, .ht-dash-card { opacity: 0; transform: translateY(20px); transition: all 0.6s var(--ease); }
.ht-visible { opacity: 1 !important; transform: translateY(0) !important; }

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 768px) {
    .ht-header { padding: 12px 16px; }
    .ht-main { padding: 16px; }
    .ht-hero h1 { font-size: 2.5rem; }
    .ht-hero p { font-size: 0.95rem; }
    .ht-stats-counter { grid-template-columns: repeat(2, 1fr); }
    .ht-features-grid { grid-template-columns: 1fr; }
    .ht-config { padding: 10px 12px; }
    .ht-config-divider { display: none; }
    .ht-typing-area { padding: 24px 20px; min-height: 220px; }
    .ht-text-display { font-size: 1.15rem; }
    .ht-text-display.hindi-text { font-size: 1.2rem; }
    .ht-live-stat span { font-size: 1.6rem; }
    .ht-result-main-stat .value { font-size: 4.5rem; }
    .ht-result-grid { grid-template-columns: repeat(3, 1fr); }
    .ht-dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .ht-auth-card { padding: 28px 20px; }
    .ht-lb-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
    .ht-nav a:not(.active):not(.ht-user-badge):not(.ht-btn) { display: none; }
    .ht-stats-counter { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .ht-features-grid { grid-template-columns: 1fr; }
    .ht-dashboard-grid { grid-template-columns: 1fr; }
    .ht-result-grid { grid-template-columns: repeat(2, 1fr); }
}
@media print {
    .ht-header, .ht-config, .ht-footer, .ht-result-actions { display: none !important; }
    body.ht-typing-page { background: #fff; color: #000; }
}
