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

body {
    font-family: sans-serif;
    background: #1a1a1a;
    color: #f0f0f0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    text-align: center;
    padding: 2rem;
    max-width: 920px;
    width: 100%;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
    letter-spacing: 0.1em;
}

#help-btn {
    font-size: 0.8rem;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    margin-bottom: 1.2rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 0;
}

#help-btn:hover {
    color: #999;
}

/* ---------- help modal ---------- */

#help-modal {
    background: #242424;
    color: #f0f0f0;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 2rem;
    max-width: 480px;
    width: 90%;
}

#help-modal::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

#help-modal h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #f0c040;
    letter-spacing: 0.05em;
}

#help-modal ul {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

#help-modal li {
    padding-left: 1.2rem;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #ccc;
    text-align: left;
}

#help-modal li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #f0c040;
}

#help-close {
    padding: 0.45rem 1.4rem;
    background: #f0c040;
    color: #111;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
}

.subtitle {
    color: #888;
    margin-bottom: 1.5rem;
}

/* ---------- start/stop control ---------- */

#controls {
    margin-bottom: 1.5rem;
}

#start-stop {
    padding: 0.6rem 2.5rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 6px;
    border: 2px solid #4caf50;
    background: transparent;
    color: #4caf50;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: background 0.15s, color 0.15s;
}

#start-stop:hover {
    background: #4caf50;
    color: #111;
}

#start-stop.running {
    border-color: #f44336;
    color: #f44336;
}

#start-stop.running:hover {
    background: #f44336;
    color: #fff;
}

/* ---------- question + timer ---------- */

#question-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    min-height: 2rem;
}

#question {
    font-size: 1.4rem;
}

#timer {
    font-size: 1.1rem;
    color: #f0c040;
    font-variant-numeric: tabular-nums;
    min-width: 4ch;
}

/* ---------- fretboard ---------- */

#fretboard {
    display: inline-block;
    position: relative;
    margin-bottom: 0.5rem;
}

#fretboard svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Checkbox overlay aligned to each string */
#string-checkboxes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#string-checkboxes label {
    position: absolute;
    left: 4px;
    transform: translateY(-50%);
    pointer-events: auto;
    cursor: pointer;
    line-height: 0;
}

#string-checkboxes input[type="checkbox"] {
    accent-color: #f0c040;
    width: 13px;
    height: 13px;
    cursor: pointer;
    margin: 0;
    display: block;
}

/* ---------- note buttons ---------- */

#note-choices {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.note-btn {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    background: #2a2a2a;
    color: #f0f0f0;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    min-width: 52px;
    transition: background 0.1s, border-color 0.1s;
}

.note-btn:hover:not(:disabled) {
    background: #3a3a3a;
    border-color: #888;
}

.note-btn:disabled {
    cursor: default;
    opacity: 0.5;
}

.note-btn.correct {
    background: #2e7d32;
    border-color: #4caf50;
    color: #fff;
    opacity: 1;
}

.note-btn.wrong {
    background: #4a1010;
    border-color: #f44336;
    color: #f44336;
    opacity: 1;
}

/* ---------- feedback + score ---------- */

#feedback {
    font-size: 1.2rem;
    min-height: 1.8rem;
    margin-bottom: 0.4rem;
}

#feedback.correct { color: #4caf50; }
#feedback.wrong   { color: #f44336; }

#score {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* ---------- stats ---------- */

#stats {
    margin-top: 2rem;
}

#stats h2 {
    font-size: 1rem;
    color: #888;
    margin-bottom: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#stats-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

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

.stat-val {
    font-size: 2.2rem;
    font-weight: bold;
}

.stat-val.correct { color: #4caf50; }
.stat-val.wrong   { color: #f44336; }

.stat-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
