/* style.css */
.app {
    width: 100%;
    max-width: 1000px;
    padding: 24px 16px 40px;
}
/* Settings Bar */
.settings-bar {
    position: relative;
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}
.setting-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.setting-btn,
.option-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

.setting-btn:hover,
.option-btn:hover {
    background: #2a2b3a;
}

.option-btn.active:hover {
    background:#111217;
}
.setting-btn.active {
    background: var(--highlighttext-color);
    color: #111217;
}

.settings-bar .setting-group + .setting-group {
    margin-left: 14px;
    padding-left: 24px;
    border-left: 1px solid var(--highlighttext-color);
}
/*language */
.language-dropdown {
    margin-left: auto; /* pushes it to the right */
}

.language-dropdown select {
    background: #181924;
    color: #f5f5f5;
    border: 1px solid #2a2b3a;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: 0.2s;
}

.language-dropdown select:hover {
    border-color: var(--highlighttext-color);
}

.language-dropdown select:focus {
    border-color: var(--highlighttext-color);
    box-shadow: 0 0 0 2px rgba(249,178,51,0.3);
}

.highlight-bar {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: var(--highlighttext-color);
    width: 0;
    transition: all 0.25s ease;
    border-radius: 2px;
}

.option-highlight-bar {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: var(--highlighttext-color);
    width: 0;
    transition: all 0.25s ease;
    border-radius: 2px;
}
#time-options,
#word-options {
    position: relative;
}
.test-status {
    display: none;
    position: absolute;
    left: 25%;              /* IMPORTANT: center it */
    transform: translateX(-50%);
    font-size: 22px;
    font-weight: 600;
    color: var(--highlighttext-color);
    pointer-events: none;
}
.reset-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--highlighttext-color);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: 0.2s;
}

.reset-btn:hover {
    background: #2a2b3a;
}

/* Test Area */
.test-area {
    position: relative;
    padding:1px;
    min-height: 160px;
    cursor: text;
    overflow: visible;
    text-align: justify;
}

.words-wrapper {
    line-height: 1.6;
    font-size: 20px;
    text-align: justify;
    color: var(--text-color);
    -webkit-user-select:none;
    user-select: none;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

.word {
    margin-right: 8px;
    display: inline-block;
}

.char {
    position: relative;
    display: inline;
}

.char.correct {
    color: #f5f5f5;
}

.char.incorrect {
    color: #ff5c5c;
}

.char.current {
    border-bottom: 2px solid var(--highlighttext-color);
}

.overlay-hint {
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-size: 12px;
    color: #55576a;
}

#hiddenInput {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    margin-bottom: 16px;
    font-size: 14px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat .label {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: #6f6f80;
}

.stat .value {
    font-size: 18px;
}

/* Graph */
.graph-section {
    background: var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

#graphCanvas {
    width: 100%;
    height: 220px;
    display: block;
}

/* Result Panel */
.result-panel {
    background: var(--border-color);
    border-radius: 12px;
    padding: 16px 20px 20px;
    display: none;
    margin-bottom: 16px;
}

.result-panel h2 {
    font-size: 18px;
    margin-bottom: 12px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.result-grid .label {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--beige-color);
    display: block;
    margin-bottom: 4px;
}

.result-grid .value {
    font-size: 18px;
    color: var(--highlighttext-color);
}

#restartBtn {
    background: var(--highlighttext-color);
    color: var(--a-color);
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
}

#restartBtn:hover {
    filter: brightness(1.05);
}

/* Responsive */
@media (max-width: 700px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}