.tool-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.control-panel {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: center;
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-group select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.stats-panel {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
}

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

.stat-label {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
}

.typing-area {
    position: relative;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    min-height: 200px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 1.5em;
    line-height: 1.6;
    cursor: text;
    overflow: hidden;
}

.typing-area.focused {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.2em;
    z-index: 10;
    border-radius: 6px;
    backdrop-filter: blur(2px);
}

.hidden-input {
    position: absolute;
    opacity: 0;
    top: 0;
    left: 0;
    height: 0;
    width: 0;
}

.text-display {
    color: var(--text-secondary);
    word-break: break-all;
    white-space: pre-wrap;
}

.char {
    position: relative;
}

.char.correct {
    color: var(--text-primary);
}

.char.incorrect {
    color: #ff4d4f;
    text-decoration: underline;
}

.char.current {
    background-color: rgba(var(--primary-rgb), 0.2);
    border-bottom: 2px solid var(--primary-color);
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: var(--primary-color);
    vertical-align: middle;
    animation: blink 1s infinite;
}

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

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

.modal-content {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    min-width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.result-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.result-item .label {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.result-item .value {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--primary-color);
}

/* Dark mode adjustments if needed */
[data-theme="dark"] .overlay {
    background: rgba(255, 255, 255, 0.1);
}
