:root {
    --accent: #2563eb;
    --ok: #15803d;
    --ok-bg: #ecfdf3;
    --bad: #b91c1c;
    --bad-bg: #fef2f2;
    --line: #cbd5e1;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #1f2937;
    background: #f1f5f9;
}

body {
    margin: 0;
    font-size: 22px;
    -webkit-text-size-adjust: 100%;
}

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

h1 {
    font-size: 2.2rem;
    margin: 0.3em 0 0.8em;
}

/* Home */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.tile {
    display: grid;
    gap: 12px;
    justify-items: center;
    padding: 36px 24px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    color: inherit;
    text-decoration: none;
}

.tile-sample {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--accent);
}

.tile-gap {
    text-decoration: underline;
}

.tile-name {
    font-size: 1.5rem;
    font-weight: 700;
}

.back {
    display: inline-block;
    padding: 8px 0;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

/* Settings */

.settings {
    display: grid;
    gap: 28px;
    max-width: 520px;
    padding: 28px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.settings > label {
    display: grid;
    gap: 10px;
    font-weight: 600;
}

.settings input[type=number] {
    font: inherit;
    font-size: 1.5rem;
    width: 4.5ch;
    padding: 8px 12px;
    border: 2px solid var(--line);
    border-radius: 12px;
}

.nowrap {
    white-space: nowrap;
}

.options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 36px;
}

.check {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.check input {
    width: 34px;
    height: 34px;
    accent-color: var(--accent);
}

/* Buttons */

button, .button {
    display: inline-block;
    font: inherit;
    font-weight: 700;
    min-height: 60px;
    padding: 14px 36px;
    border: 0;
    border-radius: 16px;
    background: #e2e8f0;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
}

.primary {
    background: var(--accent);
    color: #fff;
}

/* Test */

.problems {
    list-style: none;
    margin: 0 0 32px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.problems li, .problems li > label {
    display: flex;
    align-items: center;
    gap: 12px;
}

.problems li {
    padding: 12px 18px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    font-size: 1.7rem;
    font-variant-numeric: tabular-nums;
}

.question {
    white-space: nowrap;
}

.answer {
    font: inherit;
    width: 3.4ch;
    padding: 6px 10px;
    border: 2px solid var(--line);
    border-radius: 12px;
    text-align: center;
}

.answer:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

#test > button {
    width: 100%;
    max-width: 520px;
}

/* Vybrané slová */

.words {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.words li {
    justify-content: space-between;
}

.word {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 10px;
}

.gap {
    display: inline-block;
    min-width: 0.9em;
    border-bottom: 3px solid var(--accent);
    color: var(--accent);
    font-weight: 800;
    text-align: center;
    line-height: 1.1;
}

.letters {
    white-space: nowrap;
}

.hint {
    flex-basis: 100%;
    font-size: 1rem;
    color: #64748b;
}

.choices {
    display: flex;
    gap: 10px;
}

.choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border: 2px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}

.choice input:checked + span {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.choice input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.results.words .given {
    margin-right: 6px;
}

.results.words .fix {
    font-weight: 400;
}

.results.words .fix b {
    color: var(--ok);
    font-weight: 800;
}

/* Result */

.score {
    margin-bottom: 24px;
    padding: 24px;
    background: #fff;
    border-radius: 18px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.score .points {
    font-size: 4rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.score.perfect .points {
    color: var(--ok);
}

.score .praise {
    font-size: 1.6rem;
    font-weight: 700;
}

.score .details {
    margin-top: 8px;
    color: #64748b;
}

.results li.ok {
    background: var(--ok-bg);
}

.results li.wrong {
    background: var(--bad-bg);
}

.results .wrong .given {
    color: var(--bad);
    text-decoration: line-through;
}

.results .fix {
    color: var(--ok);
    font-weight: 800;
}

.results .mark {
    margin-left: auto;
    font-weight: 800;
}

.results .ok .mark {
    color: var(--ok);
}

.results .wrong .mark {
    color: var(--bad);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
