* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    color: #e4e4e7;
    padding: 0;
    overflow-x: hidden;
    display: flex;
}

.sidebar {
    width: 280px;
    background: #18181b;
    border-right: 1px solid #27272a;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e4e4e7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 24px;
    max-width: calc(100vw - 280px);
}

.header {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px 0;
}

.header h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

.header p {
    font-size: 1rem;
    color: #71717a;
    font-weight: 400;
}

.btn {
    padding: 12px 16px;
    border: 1px solid #27272a;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #18181b;
    color: #e4e4e7;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    text-align: center;
}

.btn-primary {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

.btn-secondary {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.btn-success {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.btn-minimize {
    background: #f59e0b;
    border-color: #f59e0b;
    color: white;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    background: #0f0f0f;
    border: 1px solid #27272a;
    padding: 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.stat-item:hover {
    border-color: #3f3f46;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 0.875rem;
    color: #71717a;
    font-weight: 500;
}

.stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #6366f1;
}

.session-stats {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 16px;
    display: none;
}

.session-stats.active {
    display: block;
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #1e293b;
}

.session-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e2e8f0;
}

.session-time {
    font-size: 0.75rem;
    color: #64748b;
}

.session-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.session-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-metric-value {
    font-size: 1rem;
    font-weight: 700;
    color: #06b6d4;
}

.session-metric-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.keyboard-container {
    background: #18181b;
    border: 1px solid #27272a;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.keyboard-row {
    display: flex;
    gap: 3px;
    margin-bottom: 4px;
    justify-content: center;
}

.keyboard-row:last-child {
    margin-bottom: 0;
}

.key {
    background: #0f0f0f;
    border: 1px solid #27272a;
    border-radius: 6px;
    color: #a1a1aa;
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    min-height: 38px;
    min-width: 38px;
    flex: 0 0 38px;
    user-select: none;
}

.key:hover {
    background: #1a1a1a;
    border-color: #3f3f46;
}

.wide-key {
    flex: 0 0 58px;
    min-width: 58px;
}

.extra-wide-key {
    flex: 0 0 78px;
    min-width: 78px;
}

.spacebar {
    flex: 0 0 180px;
    min-width: 180px;
}

.function-key {
    background: #0a0a0a;
    font-size: 9px;
    color: #71717a;
}

.heat-1 {
    background: linear-gradient(135deg, #1e293b, #334155) !important;
    border-color: #475569 !important;
    color: #94a3b8 !important;
    box-shadow: 0 0 8px rgba(30, 41, 59, 0.4);
}

.heat-2 {
    background: linear-gradient(135deg, #0f172a, #1e293b) !important;
    border-color: #3730a3 !important;
    color: #a5b4fc !important;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.3);
}

.heat-3 {
    background: linear-gradient(135deg, #312e81, #4338ca) !important;
    border-color: #4f46e5 !important;
    color: #c7d2fe !important;
    box-shadow: 0 0 12px rgba(79, 70, 229, 0.4);
}

.heat-4 {
    background: linear-gradient(135deg, #3730a3, #4f46e5) !important;
    border-color: #6366f1 !important;
    color: #e0e7ff !important;
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.5);
}

.heat-5 {
    background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
    border-color: #8b5cf6 !important;
    color: #f3f4f6 !important;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.6);
}

.heat-6 {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    border-color: #a855f7 !important;
    color: #ffffff !important;
    box-shadow: 0 0 18px rgba(139, 92, 246, 0.6);
}

.heat-7 {
    background: linear-gradient(135deg, #8b5cf6, #06b6d4) !important;
    border-color: #0891b2 !important;
    color: #ffffff !important;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.6);
}

.heat-8 {
    background: linear-gradient(135deg, #06b6d4, #10b981) !important;
    border-color: #059669 !important;
    color: #ffffff !important;
    box-shadow: 0 0 22px rgba(16, 185, 129, 0.7);
}

.heat-9 {
    background: linear-gradient(135deg, #10b981, #f59e0b) !important;
    border-color: #d97706 !important;
    color: #ffffff !important;
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.7);
}

.heat-10 {
    background: linear-gradient(135deg, #f59e0b, #ef4444) !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
    box-shadow: 0 0 26px rgba(239, 68, 68, 0.8);
    transform: scale(1.02);
}

.key-pressed {
    transform: scale(0.96);
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    border-color: #a855f7 !important;
    color: #ffffff !important;
}

.typing-area {
    margin-top: 32px;
}

#typingArea {
    width: 100%;
    min-height: 120px;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 12px;
    padding: 20px;
    color: #e4e4e7;
    font-size: 16px;
    font-family: 'JetBrains Mono', 'SF Mono', Monaco, 'Cascadia Code', monospace;
    resize: vertical;
    transition: all 0.2s ease;
    line-height: 1.6;
}

#typingArea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#typingArea::placeholder {
    color: #52525b;
}

.minimize-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    min-width: 300px;
    display: none;
}

.minimized .minimize-panel {
    display: block;
}

.minimized .sidebar,
.minimized .main-content {
    display: none;
}

.minimize-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #27272a;
}

.minimize-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e4e4e7;
}

.minimize-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.minimize-stat {
    text-align: center;
}

.minimize-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #6366f1;
    display: block;
}

.minimize-stat-label {
    font-size: 0.75rem;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
        max-width: calc(100vw - 240px);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100vw;
        padding: 16px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .keyboard-container {
        padding: 16px 12px;
        overflow-x: auto;
    }
    
    .keyboard-row {
        min-width: 580px;
    }
    
    .minimize-panel {
        right: 10px;
        top: 10px;
        min-width: 280px;
    }
}

@media (max-width: 480px) {
    .key {
        min-height: 34px;
        min-width: 34px;
        flex: 0 0 34px;
        font-size: 9px;
    }
    
    .wide-key {
        flex: 0 0 48px;
        min-width: 48px;
    }
    
    .extra-wide-key {
        flex: 0 0 62px;
        min-width: 62px;
    }
    
    .spacebar {
        flex: 0 0 140px;
        min-width: 140px;
    }
    
    .keyboard-row {
        min-width: 520px;
    }
}