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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    animation: fadeInDown 0.8s ease;
}

.header-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.language-selector {
    display: flex;
    gap: 10px;
}

.lang-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: white;
    color: #4facfe;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.4);
}

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

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 0.8s ease 0.2s both;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    animation: fadeInDown 0.8s ease 0.4s both;
}

.quick-tips {
    margin-top: 15px;
    animation: fadeInDown 0.8s ease 0.6s both;
}

.tip {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.tip:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.show-guide-btn {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.show-guide-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.show-guide-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .header-top {
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .language-selector {
        gap: 8px;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .quick-tips {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .show-guide-btn {
        margin-left: 0;
    }
}

/* Mode Tabs */
.mode-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    animation: fadeInDown 0.8s ease 0.8s both;
}

.mode-tab {
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.mode-tab:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.mode-tab.active {
    background: white;
    color: #4facfe;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.5);
}

.mode-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mode-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.instruction-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.instruction-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.instruction-content h2 {
    margin-bottom: 15px;
    color: #4facfe;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instruction-content h2::before {
    content: '📝';
    font-size: 1.5rem;
}

#instruction-text {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #555;
}

.finger-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 10px;
    font-size: 1.2rem;
}

.finger-label {
    font-weight: bold;
    color: #667eea;
}

.finger-name {
    font-weight: bold;
    color: #764ba2;
    text-transform: capitalize;
}

.practice-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    padding: 14px 28px;
    background: linear-gradient(135deg, #00d4aa 0%, #00b4d8 50%, #48cae4 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.practice-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.5);
    background: linear-gradient(135deg, #00e4b8 0%, #00c4e8 50%, #58daf4 100%);
}

.practice-btn:active {
    transform: translateY(0);
}

.practice-btn.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.practice-btn.active:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

/* Typing Test Styles */
.test-panel {
    min-height: 400px;
}

.test-setup h2 {
    text-align: center;
    color: #4facfe;
    margin-bottom: 30px;
    font-size: 2rem;
}

.level-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.level-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.level-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #4facfe;
}

.level-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.level-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.level-card p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.level-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.level-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.5);
}

/* Test Area */
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.test-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.test-level-badge {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.back-btn {
    padding: 8px 16px;
    background: #e9ecef;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #dee2e6;
    transform: translateX(-3px);
}

.test-stats-live {
    display: flex;
    gap: 20px;
}

.stat-live {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 10px;
    font-weight: bold;
    color: #333;
}

.stat-icon {
    font-size: 1.2rem;
}

/* Typing Container */
.typing-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.text-display {
    font-size: 1.3rem;
    line-height: 1.8;
    color: #333;
    padding: 30px;
    background: white;
    border-radius: 10px;
    min-height: 150px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    border: 3px solid #dee2e6;
    transition: all 0.3s ease;
}

.test-area.active .text-display {
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.text-display .char {
    position: relative;
}

.text-display .char.correct {
    color: #adb5bd;
}

.text-display .char.incorrect {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.2);
    border-radius: 3px;
}

.text-display .char.current {
    background: #4facfe;
    color: white;
    border-radius: 3px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}


/* Test Controls */
.test-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.control-btn {
    padding: 14px 35px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-btn {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: white;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.restart-btn {
    background: linear-gradient(135deg, #ff9800 0%, #ffa726 100%);
    color: white;
}

.restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

/* Test Results */
.test-results {
    text-align: center;
    padding: 40px 20px;
}

.results-content {
    animation: bounceIn 0.6s ease;
}

.results-emoji {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: rotate-scale 1s ease infinite;
}

.results-content h2 {
    color: #4facfe;
    margin-bottom: 30px;
    font-size: 2.5rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.result-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.result-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #4facfe;
    margin-bottom: 5px;
}

.result-label {
    font-size: 0.9rem;
    color: #666;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.result-btn {
    padding: 14px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 50%, #ffb74d 100%);
    color: white;
}

.retry-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
    background: linear-gradient(135deg, #ff5252 0%, #ff7b43 50%, #ffa726 100%);
}

.new-level-btn {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 50%, #9b59b6 100%);
    color: white;
}

.new-level-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.5);
    background: linear-gradient(135deg, #ff5a8d 0%, #b43459 50%, #8e44ad 100%);
}

/* Responsive for test */
@media (max-width: 768px) {
    .level-cards {
        grid-template-columns: 1fr;
    }
    
    .test-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .test-stats-live {
        width: 100%;
        justify-content: space-between;
    }
    
    .stat-live {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    .text-display {
        font-size: 1.1rem;
    }
    
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.practice-info {
    margin-top: 15px;
}

.target-key-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.target-label {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

.target-key {
    font-size: 3rem;
    font-weight: bold;
    color: #764ba2;
    min-width: 60px;
    text-align: center;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    border-radius: 12px 12px 0 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 12px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    position: relative;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.4);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    text-align: center;
    font-size: 1rem;
    font-weight: bold;
    color: #555;
}

.key.highlight-target {
    animation: highlight-pulse 1s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
}

@keyframes highlight-pulse {
    0%, 100% {
        border-color: #667eea;
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
    }
    50% {
        border-color: #764ba2;
        box-shadow: 0 0 30px rgba(118, 75, 162, 0.8);
    }
}

.key.correct-press {
    animation: correct-flash 0.5s ease;
}

@keyframes correct-flash {
    0%, 100% {
        background: #f5f5f5;
    }
    50% {
        background: #4caf50;
        color: white;
        transform: scale(1.1);
    }
}

.key.wrong-press {
    animation: wrong-shake 0.5s ease;
}

@keyframes wrong-shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* Celebration animations */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.celebration-content {
    background: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: bounceIn 0.6s ease;
    position: relative;
    overflow: hidden;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.celebration-emoji {
    font-size: 5rem;
    animation: rotate-scale 1s ease infinite;
    display: inline-block;
}

@keyframes rotate-scale {
    0%, 100% {
        transform: rotate(-10deg) scale(1);
    }
    50% {
        transform: rotate(10deg) scale(1.2);
    }
}

.celebration-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #4facfe;
    margin: 20px 0 10px;
    animation: slideInUp 0.6s ease 0.3s both;
}

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.celebration-message {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 20px;
    animation: slideInUp 0.6s ease 0.5s both;
}

.celebration-stats {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin: 30px 0;
    animation: slideInUp 0.6s ease 0.7s both;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #4facfe;
}

.stat-label {
    font-size: 0.9rem;
    color: #999;
    margin-top: 5px;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #4facfe;
    animation: confetti-fall 3s linear infinite;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti:nth-child(1) { left: 10%; animation-delay: 0s; background: #4facfe; }
.confetti:nth-child(2) { left: 20%; animation-delay: 0.2s; background: #00f2fe; }
.confetti:nth-child(3) { left: 30%; animation-delay: 0.4s; background: #ffd700; }
.confetti:nth-child(4) { left: 40%; animation-delay: 0.6s; background: #ff6b9d; }
.confetti:nth-child(5) { left: 50%; animation-delay: 0.8s; background: #4facfe; }
.confetti:nth-child(6) { left: 60%; animation-delay: 1s; background: #00f2fe; }
.confetti:nth-child(7) { left: 70%; animation-delay: 1.2s; background: #ffd700; }
.confetti:nth-child(8) { left: 80%; animation-delay: 1.4s; background: #ff6b9d; }
.confetti:nth-child(9) { left: 90%; animation-delay: 1.6s; background: #4facfe; }
.confetti:nth-child(10) { left: 95%; animation-delay: 1.8s; background: #00f2fe; }

/* Finger Guide Overlay */
.finger-guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.95) 0%, rgba(0, 242, 254, 0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.5s ease;
}

.finger-guide-overlay.hidden {
    display: none;
}

.finger-guide-content {
    background: white;
    padding: 40px 50px;
    border-radius: 24px;
    max-width: 900px;
    width: 95%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.guide-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.guide-close-btn:hover {
    background: #e9ecef;
    color: #333;
    transform: scale(1.1);
}

.guide-close-btn:active {
    transform: scale(0.95);
}

@keyframes slideUp {
    0% {
        transform: translateY(100px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.guide-header h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 10px;
    animation: fadeInDown 0.6s ease 0.3s both;
}

.guide-header p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease 0.5s both;
}

.animated-hands {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.hand-container {
    flex: 1;
    min-width: 250px;
}

.hand-label {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4facfe;
    margin-bottom: 20px;
    animation: fadeIn 0.6s ease 0.7s both;
}

.animated-fingers {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.finger-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: fingerDrop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: var(--delay, 0s);
}

@keyframes fingerDrop {
    0% {
        transform: translateY(-50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.animated-finger {
    width: 38px;
    height: 55px;
    border-radius: 50% 50% 45% 45%;
    position: relative;
    animation: fingerPress 2s ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    transform-style: preserve-3d;
    perspective: 200px;
}

/* Finger nail */
.animated-finger::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 220, 220, 0.8) 100%);
    border-radius: 50% 50% 40% 40%;
    box-shadow: 
        inset 0 -2px 4px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(255, 255, 255, 0.5);
}

/* Finger highlight/shine */
.animated-finger::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 12px;
    height: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, transparent 60%);
    border-radius: 50%;
}

@keyframes fingerPress {
    0%, 100% {
        transform: translateY(0) rotateX(0deg);
    }
    50% {
        transform: translateY(10px) rotateX(-5deg);
    }
}

.animated-finger.pinky {
    background: linear-gradient(180deg, #ff6b9d 0%, #e84a7a 50%, #d43a6a 100%);
    box-shadow: 
        0 8px 20px rgba(255, 107, 157, 0.5),
        inset 0 -8px 15px rgba(0, 0, 0, 0.15),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.animated-finger.ring {
    background: linear-gradient(180deg, #ffb74d 0%, #ffa726 50%, #f59300 100%);
    box-shadow: 
        0 8px 20px rgba(255, 167, 38, 0.5),
        inset 0 -8px 15px rgba(0, 0, 0, 0.15),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.animated-finger.middle {
    background: linear-gradient(180deg, #81c784 0%, #66bb6a 50%, #4caf50 100%);
    box-shadow: 
        0 8px 20px rgba(102, 187, 106, 0.5),
        inset 0 -8px 15px rgba(0, 0, 0, 0.15),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.animated-finger.index {
    background: linear-gradient(180deg, #64b5f6 0%, #42a5f5 50%, #1e88e5 100%);
    box-shadow: 
        0 8px 20px rgba(66, 165, 245, 0.5),
        inset 0 -8px 15px rgba(0, 0, 0, 0.15),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.finger-key {
    width: 50px;
    height: 50px;
    background: #f0f0f0;
    border: 3px solid #ddd;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    position: relative;
    animation: keyGlow 2s ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes keyGlow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(79, 172, 254, 0.5);
        border-color: #4facfe;
    }
}

.finger-key.has-bump::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 3px;
    background: #999;
    border-radius: 2px;
}

.finger-name {
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
}

.thumbs-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 30px;
    animation: fadeIn 0.6s ease 1s both;
}

.thumb-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.animated-thumb {
    width: 65px;
    height: 38px;
    background: linear-gradient(180deg, #ce93d8 0%, #ab47bc 50%, #8e24aa 100%);
    border-radius: 45% 45% 50% 50%;
    box-shadow: 
        0 8px 20px rgba(171, 71, 188, 0.5),
        inset 0 -6px 12px rgba(0, 0, 0, 0.15),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: thumbPress 2s ease-in-out infinite;
    position: relative;
}

/* Thumb nail */
.animated-thumb::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 220, 240, 0.8) 100%);
    border-radius: 50% 50% 40% 40%;
    box-shadow: 
        inset 0 -2px 4px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(255, 255, 255, 0.5);
}

/* Thumb highlight */
.animated-thumb::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 12px;
    width: 15px;
    height: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 60%);
    border-radius: 50%;
}

@keyframes thumbPress {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateY(5px) rotate(-5deg);
    }
}

.thumb-key {
    padding: 12px 30px;
    background: #f0f0f0;
    border: 3px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    animation: keyGlow 2s ease-in-out infinite;
}

.color-legend {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0 15px;
    animation: fadeIn 0.6s ease 1.1s both;
}

.legend-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #555;
    margin-bottom: 20px;
}

.hand-graphic-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.hand-graphic {
    position: relative;
    width: 200px;
}

.hand-graphic-label {
    font-size: 1rem;
    font-weight: bold;
    color: #4facfe;
    margin-bottom: 10px;
    text-align: center;
}

.hand-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.finger-svg {
    transition: all 0.3s ease;
    cursor: pointer;
}

.finger-svg:hover {
    filter: brightness(1.1);
    transform: translateY(-3px);
}

.finger-label-svg {
    font-size: 10px;
    font-weight: bold;
    fill: #555;
}

/* Right hand labels positioned outside SVG */
.right-hand-graphic {
    position: relative;
}

.right-hand-labels {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
}

.rh-label {
    font-size: 10px;
    font-weight: bold;
    color: #555;
}

.thumb-label { margin-left: 5px; }
.pinky-label { margin-right: 5px; }

/* Finger hover animations */
.pinky-svg:hover rect,
.pinky-svg:hover ellipse:first-of-type {
    filter: drop-shadow(0 0 8px #ff6b9d);
}

.ring-svg:hover rect,
.ring-svg:hover ellipse:first-of-type {
    filter: drop-shadow(0 0 8px #ffa726);
}

.middle-svg:hover rect,
.middle-svg:hover ellipse:first-of-type {
    filter: drop-shadow(0 0 8px #66bb6a);
}

.index-svg:hover rect,
.index-svg:hover ellipse:first-of-type {
    filter: drop-shadow(0 0 8px #42a5f5);
}

.thumb-svg:hover ellipse:first-of-type {
    filter: drop-shadow(0 0 8px #ab47bc);
}

@media (max-width: 500px) {
    .hand-graphic-container {
        gap: 20px;
    }
    
    .hand-graphic {
        width: 160px;
    }
}

.guide-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 25px;
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border-radius: 12px;
    margin: 15px 0 25px;
    font-size: 1rem;
    color: #666;
    animation: fadeIn 0.6s ease 1.2s both;
    border: 1px solid #ffe082;
}

.tip-icon {
    font-size: 1.5rem;
}

.guide-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 45px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 25px rgba(79, 172, 254, 0.5);
    animation: fadeIn 0.6s ease 1.4s both, btnPulse 2s ease-in-out 2s infinite;
}

@keyframes btnPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 6px 25px rgba(79, 172, 254, 0.5);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 8px 35px rgba(79, 172, 254, 0.7);
    }
}

.guide-start-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 40px rgba(79, 172, 254, 0.6);
}

.guide-start-btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-arrow {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.guide-start-btn:hover .btn-arrow {
    transform: translateX(5px);
}

/* Responsive for finger guide */
@media (max-width: 768px) {
    .finger-guide-content {
        padding: 30px 20px;
    }
    
    .guide-header h2 {
        font-size: 1.5rem;
    }
    
    .animated-hands {
        flex-direction: column;
        align-items: center;
    }
    
    .hand-container {
        min-width: 100%;
    }
    
    .animated-finger {
        width: 28px;
        height: 40px;
    }
    
    .finger-key {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .guide-start-btn {
        padding: 15px 35px;
        font-size: 1.1rem;
    }
}

.keyboard-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow-x: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.keyboard-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    min-width: fit-content;
    margin: 0 auto;
}

.keyboard-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.key {
    min-width: 50px;
    height: 50px;
    padding: 0 15px;
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    user-select: none;
    position: relative;
}

.key-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: visible;
    padding: 6px 0;
}

/* When key has shift symbol, use space-between */
.key-content:has(.shift-symbol) {
    justify-content: space-between;
}

.base-key {
    font-size: 1.1rem;
    font-weight: bold;
    line-height: 1;
    z-index: 1;
    position: relative;
    flex-shrink: 0;
}

/* Only add margin when shift symbol exists */
.key-content:has(.shift-symbol) .base-key {
    margin-top: auto;
    margin-bottom: 0;
}

.shift-symbol {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    position: relative;
    cursor: pointer;
    line-height: 1;
    opacity: 1;
    transition: all 0.2s ease;
    z-index: 2;
    flex-shrink: 0;
}

/* Position shift symbol at top when it exists */
.key-content .shift-symbol {
    margin-top: 0;
    margin-bottom: auto;
}

.shift-symbol:hover {
    color: #667eea;
}

.key.wide-key {
    min-width: 80px;
    font-size: 0.9rem;
}

.key.spacebar {
    min-width: 300px;
    font-size: 1rem;
}

.key[data-key="tab"] {
    min-width: 70px;
}

.key[data-key="capslock"] {
    min-width: 90px;
}

.key[data-key="enter"] {
    min-width: 100px;
}

.key[data-key="backspace"] {
    min-width: 100px;
}

.key[data-key="shift"] {
    min-width: 120px;
}

.key[data-key="control"],
.key[data-key="alt"],
.key[data-key="meta"] {
    min-width: 60px;
    font-size: 0.85rem;
}

/* Bumps on F and J keys for home row positioning */
.key[data-key="f"]::after,
.key[data-key="j"]::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 3px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 2px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.key:hover {
    background: #e0e0e0;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

.key:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.1s ease;
}

.key.active {
    background: #667eea;
    color: white;
    border-color: #764ba2;
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.key.active .shift-symbol {
    color: rgba(255, 255, 255, 1);
    opacity: 1;
    font-weight: bold;
}

.key.pinky {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8fab 100%);
    border-color: #ff6b9d;
}

.key.pinky.active {
    background: linear-gradient(135deg, #ff4081 0%, #ff6b9d 100%);
    color: white;
}

.key.ring {
    background: linear-gradient(135deg, #ffa726 0%, #ffb74d 100%);
    border-color: #ffa726;
}

.key.ring.active {
    background: linear-gradient(135deg, #ff9800 0%, #ffa726 100%);
    color: white;
}

.key.middle {
    background: linear-gradient(135deg, #66bb6a 0%, #81c784 100%);
    border-color: #66bb6a;
}

.key.middle.active {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: white;
}

.key.index {
    background: linear-gradient(135deg, #42a5f5 0%, #64b5f6 100%);
    border-color: #42a5f5;
}

.key.index.active {
    background: linear-gradient(135deg, #2196f3 0%, #42a5f5 100%);
    color: white;
}

.key.thumb {
    background: linear-gradient(135deg, #ab47bc 0%, #ba68c8 100%);
    border-color: #ab47bc;
}

.key.thumb.active {
    background: linear-gradient(135deg, #9c27b0 0%, #ab47bc 100%);
    color: white;
}

.info-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.hand-guide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.hand h3 {
    margin-bottom: 15px;
    color: #667eea;
    text-align: center;
}

.finger-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.finger-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    cursor: default;
}

.finger-item:hover {
    background: #e8f4ff;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.2);
}

.finger-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid #333;
}

.finger-color.pinky {
    background: #ff6b9d;
}

.finger-color.ring {
    background: #ffa726;
}

.finger-color.middle {
    background: #66bb6a;
}

.finger-color.index {
    background: #42a5f5;
}

.finger-color.thumb {
    background: #ab47bc;
}


/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .key {
        min-width: 35px;
        height: 40px;
        padding: 0 8px;
        font-size: 0.85rem;
    }

    .key .key-content {
        padding: 5px 0;
    }

    .key .base-key {
        font-size: 0.85rem;
        margin-bottom: 0;
    }

    .key .shift-symbol {
        font-size: 0.85rem;
        margin-top: 0;
        opacity: 1;
    }

    .key.wide-key {
        min-width: 60px;
        font-size: 0.75rem;
    }

    .key.spacebar {
        min-width: 200px;
    }

    .key[data-key="tab"],
    .key[data-key="capslock"],
    .key[data-key="enter"],
    .key[data-key="backspace"] {
        min-width: 70px;
        font-size: 0.7rem;
    }

    .key[data-key="shift"] {
        min-width: 80px;
        font-size: 0.7rem;
    }

    .key[data-key="control"],
    .key[data-key="alt"],
    .key[data-key="meta"] {
        min-width: 45px;
        font-size: 0.7rem;
    }

    .keyboard-row {
        gap: 4px;
    }

    .hand-guide {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .instruction-panel,
    .keyboard-container,
    .info-panel {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .key {
        min-width: 30px;
        height: 35px;
        padding: 0 6px;
        font-size: 0.75rem;
    }

    .key .key-content {
        padding: 4px 0;
    }

    .key .base-key {
        font-size: 0.75rem;
        margin-bottom: 0;
    }

    .key .shift-symbol {
        font-size: 0.75rem;
        margin-top: 0;
        opacity: 1;
    }

    .key.wide-key {
        min-width: 50px;
        font-size: 0.65rem;
    }

    .key.spacebar {
        min-width: 150px;
    }

    .key[data-key="tab"],
    .key[data-key="capslock"],
    .key[data-key="enter"],
    .key[data-key="backspace"] {
        min-width: 55px;
        font-size: 0.65rem;
    }

    .key[data-key="shift"] {
        min-width: 60px;
        font-size: 0.65rem;
    }

    .key[data-key="control"],
    .key[data-key="alt"],
    .key[data-key="meta"] {
        min-width: 40px;
        font-size: 0.65rem;
    }

    .keyboard-row {
        gap: 3px;
    }

    .finger-indicator {
        font-size: 1rem;
        padding: 10px;
    }
}
