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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #a3e635 0%, #65a30d 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

#game-container {
    width: 100%;
    max-width: 650px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #65A30D, #3F6212);
    color: white;
}

.game-title {
    font-size: 1.3rem;
    font-weight: 700;
}

.stats {
    display: flex;
    gap: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.7rem;
    opacity: 0.9;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

#game-area {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.track {
    width: 100%;
    height: 60px;
    background: #ECFCCB;
    border-radius: 30px;
    border: 3px solid #84CC16;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.snail {
    font-size: 2.5rem;
    position: absolute;
    left: 10px;
    transition: left 0.3s ease-out;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.snail .label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #3F6212;
    margin-top: -5px;
}

.finish-line {
    position: absolute;
    right: 20px;
    font-size: 2rem;
    opacity: 0.7;
}

.typing-area {
    background: #F7FEE7;
    padding: 24px;
    border-radius: 16px;
    border: 2px dashed #84CC16;
    text-align: center;
}

.target-text {
    font-size: 1.4rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
    min-height: 1.5em;
}

.target-text .correct {
    color: #16A34A;
}

.target-text .wrong {
    color: #DC2626;
    background: #FEE2E2;
}

.type-input {
    width: 100%;
    padding: 12px 20px;
    font-size: 1.2rem;
    border: 2px solid #D9F99D;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s;
}

.type-input:focus {
    border-color: #84CC16;
    box-shadow: 0 0 0 4px rgba(132, 204, 22, 0.2);
}

.hidden {
    display: none !important;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

#result-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.modal-content h2 {
    font-size: 1.8rem;
    color: #1F2937;
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-primary {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #65A30D, #4D7C0F);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(101, 163, 13, 0.4);
}

.btn-secondary {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    background: #F3F4F6;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #E5E7EB;
}