/* Rozhraní: horní lišta, čipy, panel (karta, kvíz, nastavení), časový pruh, prohlídka, okna (hledání je v hledani.css).
   Jednotný vzhled: tmavé skleněné panely, jedna akcentní barva (--accent), emoji jen výjimečně. */

:root {
    --top-off: 120px;
    --bottom-off: 100px;
}

.ui {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    --gutter: 12px;
    --hit: 44px;
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-l: env(safe-area-inset-left, 0px);
    --safe-r: env(safe-area-inset-right, 0px);
}

.ui > * { pointer-events: auto; }
.ui [hidden] { display: none !important; }

/* ---- základní prvky ---- */

button, select, input { font: inherit; color: inherit; }

button { cursor: pointer; -webkit-tap-highlight-color: transparent; }

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* nadpisy a otázky, na které se fokus přesouvá jen kódem (čtečka přečte nový obsah), rámeček nepotřebují */
[tabindex="-1"]:focus-visible { outline: none; }

.btn, .icon-btn, .tool-btn, .chip, .seg, .tab {
    appearance: none;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    min-height: var(--hit);
    border-radius: 12px;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.btn:hover, .icon-btn:hover, .tool-btn:hover, .chip:hover, .seg:hover, .tab:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--line-strong);
}

.btn:active, .icon-btn:active, .tool-btn:active, .chip:active { transform: scale(0.97); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
}

.btn-primary, .icon-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.btn-primary:hover, .icon-btn.primary:hover {
    background: #a2d7ff;
    border-color: #a2d7ff;
}

.btn-small { padding: 0 14px; font-size: 14px; }

.btn:disabled { opacity: 0.45; cursor: default; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: var(--hit);
    padding: 0;
    flex: 0 0 auto;
}

.icon { display: block; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.field {
    min-height: var(--hit);
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text);
    font-size: 16px;
    color-scheme: dark;
}

.small { font-size: 13px; color: var(--text-dim); line-height: 1.45; }

/* ---- horní lišta ---- */

#topbar {
    position: absolute;
    top: calc(var(--gutter) - 2px + var(--safe-t));
    left: calc(var(--gutter) + var(--safe-l));
    right: calc(var(--gutter) + var(--safe-r));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

#topbar > * { pointer-events: auto; }

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 16px 4px 10px;
    min-height: 52px;
    background: var(--glass);
    border: 1px solid var(--line);
    border-radius: 18px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    min-width: 0;
}

.brand h1 {
    font-size: 17px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-sub { color: var(--text-dim); font-weight: 500; }
.brand-e { color: var(--accent); }
.brand h1 .brand-sub { font-size: 0.84em; margin-left: 0.25em; }
.brand-logo { flex: 0 0 auto; }

.toolbar {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: var(--glass);
    border: 1px solid var(--line);
    border-radius: 18px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    flex: 0 0 auto;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: var(--hit);
    padding: 0 12px;
    background: transparent;
    border-color: transparent;
    font-size: 14px;
    font-weight: 600;
    border-radius: 14px;
}

.tool-btn[aria-pressed="true"], .tool-btn[aria-expanded="true"] {
    background: rgba(124, 199, 255, 0.2);
    border-color: rgba(124, 199, 255, 0.55);
    color: var(--accent);
}

.menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(360px, calc(100vw - 24px));
    padding: 6px;
    background: var(--glass-strong);
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    z-index: 5;
}

.menu button {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 56px;
    padding: 8px 12px;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
}

.menu button:hover, .menu button:focus-visible { background: rgba(124, 199, 255, 0.14); }
.menu .icon { color: var(--accent); flex: 0 0 auto; }
.menu-group + .menu-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.menu-label {
    margin: 4px 12px 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.menu strong { display: block; font-size: 15px; line-height: 1.25; }
.menu small { display: block; font-size: 12.5px; color: var(--text-dim); line-height: 1.3; }

/* ---- čipy (tečka + jméno): panel hledání a filtry úkazů; řady čipů nahoře nahradilo pole hledání (hledani.css) ---- */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 0 14px 0 11px;
    min-height: 40px;
    border-radius: 999px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

@media (pointer: coarse) { .chip { min-height: var(--hit); } }

.chip-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff8, transparent 55%), var(--c, #aab4c8);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
    flex: 0 0 auto;
    display: inline-block;
}

.chip.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.chip.is-parent {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---- panel (karta tělesa, kvíz, nastavení) ---- */

.panel {
    position: absolute;
    display: flex;
    flex-direction: column;
    background: var(--glass-strong);
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transition: height 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.panel.is-dragging { transition: none; }

.panel.is-side {
    top: var(--top-off);
    right: calc(var(--gutter) + var(--safe-r));
    width: min(390px, calc(100vw - 24px));
    max-height: calc(100vh - var(--top-off) - var(--bottom-off) - 14px);
    animation: panel-in 0.25s ease-out;
}

@keyframes panel-in {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: none; }
}

.panel.is-sheet {
    left: calc(8px + var(--safe-l));
    right: calc(8px + var(--safe-r));
    border-radius: 22px;
    animation: sheet-in 0.25s ease-out;
}

@keyframes sheet-in {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}

.panel-grip, .card-head, .quiz-head, .settings-head { touch-action: none; }

.panel-grip {
    display: none;
    flex: 0 0 auto;
    width: 100%;
    height: 26px;
    padding: 0;
    place-items: center;
    background: transparent;
    border: 0;
    color: var(--text-dim);
    touch-action: none;
    position: relative;
}

.panel-grip::before {
    content: '';
    position: absolute;
    top: 7px;
    left: 50%;
    width: 44px;
    height: 5px;
    margin-left: -22px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.3);
}

.panel-grip .icon { display: none; }
.is-sheet .panel-grip { display: block; }
/* oblast úchytu pro prst je vyšší než viditelný proužek */
.panel-grip::after { content: ''; position: absolute; inset: -8px 0 -4px; }

.panel-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.panel[data-snap="peek"] .card-scroll { overflow: hidden; }

.card, .quiz, .settings {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 10px 10px 16px;
    flex: 0 0 auto;
    touch-action: none;
}

.is-sheet .card-head { padding-top: 2px; }

.card-dot {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff9, transparent 55%), var(--c, #aab4c8);
    box-shadow: 0 0 18px -2px var(--c, #7cc7ff), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
    display: grid;
    place-items: center;
}

.card-dot--quiz, .card-dot--settings, .card-dot--ship {
    background: rgba(124, 199, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(124, 199, 255, 0.5);
    color: var(--accent);
}

.card-titles { flex: 1 1 auto; min-width: 0; }
.card-title { font-size: 22px; font-weight: 700; line-height: 1.15; outline-offset: 4px; }
.card-sub { font-size: 13px; color: var(--text-dim); margin-top: 2px; }

.card-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 16px 26px;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
}

.card-info { font-size: 15px; line-height: 1.55; color: var(--text); margin-bottom: 12px; }

.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.card-section { margin-top: 16px; }
.card-section h3 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.tile {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    border-radius: 14px;
    min-width: 0;
}

.tile-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-dim); font-weight: 600; }
.tile-value { font-size: 18px; font-weight: 700; line-height: 1.25; margin-top: 2px; overflow-wrap: anywhere; }
.tile-sub { font-size: 12px; color: var(--text-dim); line-height: 1.35; margin-top: 2px; }

.live-rows { display: grid; gap: 6px; }
.live-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 8px 12px; background: rgba(124, 199, 255, 0.07); border-radius: 12px; }
.live-label { font-size: 13px; color: var(--text-dim); }
.live-row > div:last-child { text-align: right; }
.live-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.live-sub { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.live-sub:empty { display: none; }
.live-light { margin-top: 8px; font-size: 14px; color: var(--text); }

.cmp-row { display: flex; align-items: flex-end; justify-content: center; gap: 28px; height: 112px; padding-bottom: 4px; }
.cmp-item { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.cmp-circle {
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.5), transparent 55%), var(--c);
    box-shadow: inset -6px -6px 12px rgba(0, 0, 0, 0.35);
    flex: 0 0 auto;
}
.cmp-label { font-size: 12px; color: var(--text-dim); }
.cmp-text { margin-top: 8px; font-size: 14px; }

.fact { padding: 10px 12px; border-radius: 14px; margin-bottom: 8px; border: 1px solid var(--line); }
.fact strong { font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; }
.fact p { margin-top: 4px; font-size: 14.5px; line-height: 1.5; }
.fact--fun { background: rgba(255, 211, 92, 0.09); border-color: rgba(255, 211, 92, 0.3); }
.fact--fun strong { color: var(--sun); }
.fact--real { background: rgba(94, 224, 160, 0.08); border-color: rgba(94, 224, 160, 0.28); }
.fact--real strong { color: var(--good); }

.weight-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.weight-row .field { width: 96px; text-align: right; }
.weight-result { margin-top: 10px; font-size: 16px; }
.weight-result strong { color: var(--sun); font-size: 20px; }
.weight .small { margin-top: 6px; }

/* ---- nastavení ---- */

.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 56px; padding: 6px 0; border-top: 1px solid var(--line); }
.card-section h3 + .setting-row { border-top: 0; }
.setting-text { min-width: 0; }
.setting-label { font-weight: 600; font-size: 15px; }
.setting-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.4; }
.setting-block { margin-bottom: 8px; }
.seg-desc { margin-top: 8px; }
.seg-desc:empty { display: none; }

.switch {
    position: relative;
    flex: 0 0 auto;
    width: 54px;
    height: 32px;
    min-height: 0;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s;
}

/* oblast pro prst má 44 px, i když je přepínač menší */
.switch::after { content: ''; position: absolute; inset: -8px -4px; }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(22px); background: var(--accent-ink); }

.segmented { display: flex; gap: 4px; padding: 4px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); border-radius: 14px; margin-top: 6px; }
.seg { flex: 1 1 0; border: 0; background: transparent; font-weight: 600; font-size: 14px; border-radius: 10px; }
.seg[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
/* čtyři volby (Kvalita grafiky: Automaticky | Nízká | Střední | Vysoká) se musí vejít i na telefon 360 px */
.segmented--4 .seg { font-size: 13px; padding: 0 5px; }
@media (max-width: 380px) { .segmented--4 .seg { font-size: 12px; padding: 0 3px; } }

.action-list { display: grid; gap: 8px; }
.action-list .btn { justify-content: flex-start; }

/* ---- kvíz ---- */

.quiz-q { font-size: 18px; font-weight: 600; line-height: 1.35; margin: 4px 0 14px; outline: none; }
.quiz-options { display: grid; gap: 8px; }

.quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 8px 12px;
    text-align: left;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
}

.quiz-option:hover:not(:disabled) { background: rgba(124, 199, 255, 0.16); border-color: var(--accent); }
.quiz-option:disabled { cursor: default; color: var(--text); }
.quiz-letter { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: rgba(255, 255, 255, 0.1); font-size: 13px; font-weight: 700; }
.quiz-text { flex: 1 1 auto; }
.quiz-mark { flex: 0 0 auto; display: grid; }
.quiz-option.is-correct { background: rgba(94, 224, 160, 0.16); border-color: var(--good); }
.quiz-option.is-correct .quiz-mark { color: var(--good); }
.quiz-option.is-wrong { background: rgba(255, 135, 148, 0.14); border-color: var(--bad); }
.quiz-option.is-wrong .quiz-mark { color: var(--bad); }
.quiz-feedback { margin-top: 12px; font-size: 14.5px; line-height: 1.5; }
.quiz-verdict { display: block; font-size: 16px; margin-bottom: 4px; }
.quiz-next { margin-top: 12px; width: 100%; }

.quiz-result { text-align: center; padding: 12px 0; }
.quiz-score { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.quiz-score-num { font-size: 64px; font-weight: 800; line-height: 1; color: var(--sun); font-family: var(--header-font); }
.quiz-score-of { font-size: 20px; color: var(--text-dim); }
.quiz-msg { font-size: 17px; margin: 10px 0 6px; }
.quiz-result-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* ---- prohlídka ---- */

.tour {
    position: absolute;
    left: 50%;
    bottom: calc(var(--bottom-off) + 10px);
    transform: translateX(-50%);
    width: min(680px, calc(100% - 24px));
    background: var(--glass-strong);
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: sheet-in 0.25s ease-out;
}

.tour-progress { height: 4px; background: rgba(255, 255, 255, 0.1); }
.tour-progress-fill { height: 100%; width: 0; background: var(--accent); transition: width 0.25s linear; }
.tour.is-paused .tour-progress-fill { background: var(--text-dim); }
.tour-main { display: flex; gap: 14px; align-items: center; padding: 12px 14px 4px 16px; }
.tour-texts { flex: 1 1 auto; min-width: 0; }
.tour-count { font-size: 12px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.tour-title { font-size: 19px; margin: 2px 0 4px; outline-offset: 3px; }
.tour-text { font-size: 14.5px; line-height: 1.5; color: var(--text); }
.tour-controls { display: flex; gap: 6px; flex: 0 0 auto; align-items: center; }
.tour-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 14px 12px; }

/* ---- nápověda při startu a upozornění ---- */

.hint {
    position: absolute;
    left: 50%;
    bottom: calc(var(--bottom-off) + 12px);
    transform: translateX(-50%);
    width: min(580px, calc(100% - 24px));
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 10px 16px;
    background: var(--glass-strong);
    border: 1px solid rgba(124, 199, 255, 0.45);
    border-radius: 18px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
    animation: sheet-in 0.4s ease-out;
}

.hint-text { flex: 1 1 auto; font-size: 14.5px; line-height: 1.45; }
.hint-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.hint-close { background: transparent; border-color: transparent; }

.toast {
    position: absolute;
    left: 50%;
    bottom: calc(var(--bottom-off) + 16px);
    transform: translate(-50%, 12px);
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    background: var(--glass-strong);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: 14.5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    text-align: center;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---- časový pruh ---- */

#timebar {
    position: absolute;
    left: 50%;
    bottom: calc(var(--gutter) - 2px + var(--safe-b));
    transform: translateX(-50%);
    width: min(1000px, calc(100% - 24px - var(--safe-l) - var(--safe-r)));
    display: grid;
    grid-template-columns: auto auto auto auto minmax(190px, 1fr);
    grid-template-areas: "play speed date today slider";
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--glass);
    border: 1px solid var(--line);
    border-radius: 22px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.tb-row { display: contents; }
#tb-play { grid-area: play; width: 48px; min-height: 48px; border-radius: 16px; }
.tb-select { grid-area: speed; position: relative; min-width: 0; }
.tb-date { grid-area: date; position: relative; }
#tb-today { grid-area: today; }
.tb-slider { grid-area: slider; min-width: 0; }
#timebar.is-paused #tb-play { box-shadow: 0 0 0 4px rgba(124, 199, 255, 0.28); }

#tb-date { width: 100%; font-variant-numeric: tabular-nums; }

#tb-date-input {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    border: 0;
    padding: 0;
}

#tb-date-input.is-open {
    opacity: 1;
    height: var(--hit);
    pointer-events: auto;
    bottom: calc(100% + 6px);
    z-index: 2;
}

#tb-today.is-off { opacity: 0.62; }
#tb-today.is-off:hover { opacity: 1; }

#tb-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 32px;
    background: transparent;
    cursor: pointer;
    display: block;
}

#tb-range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(255,255,255,.14), rgba(124,199,255,.4), rgba(255,255,255,.14)); }
#tb-range::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(255,255,255,.14), rgba(124,199,255,.4), rgba(255,255,255,.14)); }
#tb-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: var(--accent); border: 3px solid #0b1022; box-shadow: 0 0 0 1px var(--accent); }
#tb-range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 3px solid #0b1022; box-shadow: 0 0 0 1px var(--accent); }

.tb-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); margin-top: -4px; padding: 0 2px; font-variant-numeric: tabular-nums; }
.tb-ticks span:nth-child(2) { color: var(--accent); font-weight: 700; }

/* ---- zaměřovač a ladicí lišta (HUD) ---- */

#hud-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }

#hud-reticle { position: fixed; left: 0; top: 0; width: 64px; height: 64px; pointer-events: none; will-change: transform; }
#hud-reticle[hidden] { display: none; }
#hud-reticle svg { display: block; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; opacity: 0.9; animation: reticle 2.4s ease-in-out infinite; transform-origin: center; }

@keyframes reticle {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.12); opacity: 0.55; }
}

#hud-debug {
    position: fixed;
    top: 70px;
    left: 8px;
    max-width: calc(100vw - 16px);
    padding: 2px 10px;
    font: 12px/1.5 var(--mono-font);
    white-space: pre;
    color: var(--accent);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
}

/* ---- modální okna ---- */

.dialog-backdrop {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(3, 5, 14, 0.62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.14s;
    z-index: 20;
}

.dialog-backdrop.is-open { opacity: 1; }
.dialog-backdrop.is-closing { opacity: 0; }

.dialog {
    width: min(560px, 100%);
    max-height: min(88vh, 780px);
    display: flex;
    flex-direction: column;
    background: #0d1330;
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    outline: none;
}

.dialog--wide { width: min(740px, 100%); }
.dialog--help { height: min(88vh, 700px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 10px 6px 20px; }
.dialog-head h2 { font-size: 20px; }
.dialog-body { overflow-y: auto; padding: 8px 20px 20px; overscroll-behavior: contain; }
.dialog-body p { margin-bottom: 10px; line-height: 1.55; }
.dialog-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin: 18px 0 8px; }
.dialog-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.field-error { color: var(--bad); min-height: 1.4em; font-size: 14px; }
.birth-row { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; flex-wrap: wrap; }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { padding: 0 16px; font-weight: 600; font-size: 14px; border-radius: 999px; background: transparent; }
.tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.help-list { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 6px 14px; align-items: baseline; }
.help-list dt { font-weight: 700; color: var(--accent); }
.help-list dd { color: var(--text); }
.help-list--keys dt { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

kbd {
    display: inline-block;
    min-width: 28px;
    padding: 2px 8px;
    text-align: center;
    font: 600 13px var(--mono-font);
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 7px;
}

.credits { list-style: none; display: grid; gap: 12px; margin-top: 10px; }
.credits li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.04); }
.credits strong { font-size: 14px; display: block; line-height: 1.35; }
.credit-meta { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.credit-note { font-size: 12.5px; color: var(--text-dim); font-style: italic; margin-top: 2px; }
.credits a, .about a { color: var(--accent); font-size: 13px; overflow-wrap: anywhere; }

/* Podpora projektu QR platbou (O aplikaci) */
.podpora { display: flex; align-items: center; gap: 16px; margin: 18px 0 6px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.04); }
.podpora[hidden] { display: none; }
.podpora-qr { flex: none; width: 132px; height: 132px; padding: 8px; box-sizing: border-box; background: #fff; border-radius: 10px; }
.podpora-qr svg { width: 100%; height: 100%; display: block; }
.podpora-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.podpora-text strong { color: var(--accent); font-size: 15px; }
.podpora-text p { margin: 0; font-size: 14px; line-height: 1.45; }
.podpora-text small { font-size: 12.5px; line-height: 1.4; color: var(--text-dim); overflow-wrap: anywhere; }
.podpora-text small b { color: var(--text); font-weight: 600; }
@media (max-width: 480px) {
    .podpora { flex-direction: column; align-items: flex-start; }
}

.weight-list, .orbit-list { list-style: none; display: grid; gap: 2px; margin: 12px 0; }
.weight-row-btn {
    display: grid;
    grid-template-columns: 124px 1fr 84px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    text-align: left;
}

.weight-row-btn:hover { background: rgba(124, 199, 255, 0.1); }
.weight-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; }
.weight-bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.weight-bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #a8e0ff); border-radius: 4px; }
.weight-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.orbit-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); }

/* ---- kompaktní rozvržení ---- */

/* popisek tlačítka Celá obrazovka je dlouhý: pod 1100 px zůstane jen ikona, ať se vejde značka */
@media (max-width: 980px) {
    .brand-sub { display: none; }
}
@media (max-width: 1100px) {
    #btn-fullscreen .tool-label { display: none; }
    #btn-fullscreen { padding: 0; width: var(--hit); }
}

/* na nejužších telefonech (≤ 389 px) se pět tlačítek vedle značky nevejde: celá obrazovka je jen v Nastavení */
@media (max-width: 389px) {
    #btn-fullscreen { display: none; }
}

/* telefon a tablet na výšku: spodní list, úspornější horní lišta a časový pruh */
@media (max-width: 820px) {
    .brand h1 { font-size: 15px; }
    .brand-sub { display: none; }
    .tool-label { display: none; }
    .tool-btn { padding: 0; width: var(--hit); }
    .toolbar { gap: 2px; }
    .menu { right: -2px; }

    #timebar {
        grid-template-columns: 48px minmax(0, 1.35fr) minmax(0, 1fr) auto;
        grid-template-areas: "play date date today" "speed speed slider slider";
        gap: 6px 8px;
        padding: 8px 10px;
        border-radius: 20px;
    }

    #tb-today { justify-self: end; padding: 0 14px; }
    #tb-date { padding: 0 10px; font-size: 14px; }
    .tb-slider { padding: 0 6px; }
    .tb-ticks span:first-child, .tb-ticks span:last-child { display: none; }
    .tb-ticks { justify-content: center; }

    .tour-main { flex-direction: column; align-items: stretch; gap: 8px; }
    .tour-controls { justify-content: space-between; }
    .tour-text { font-size: 14px; }
    .hint { flex-wrap: wrap; }
    .hint-actions { width: 100%; justify-content: space-between; }
    .tiles { gap: 6px; }
    .tile-value { font-size: 17px; }
    .weight-row-btn { grid-template-columns: 104px 1fr 76px; }
}

@media (max-width: 460px) {
    .brand { padding: 4px 12px 4px 8px; gap: 8px; }
    .brand h1 { font-size: 13px; line-height: 1.1; white-space: normal; max-width: 84px; }
    .help-list { grid-template-columns: 1fr; gap: 0; }
    .help-list dd { margin-bottom: 8px; }
    .dialog-body { padding: 4px 16px 16px; }
    .dialog-head { padding-left: 16px; }
}

/* nízká obrazovka (telefon na šířku) */
@media (max-height: 520px) {
    .brand-sub { display: none; }
    .tool-label { display: none; }
    .tool-btn { padding: 0; width: var(--hit); }
    .tb-ticks { display: none; }
    .tb-slider { align-self: center; }
    #timebar {
        padding: 4px 10px;
        grid-template-columns: 44px minmax(0, 1.1fr) minmax(0, 1.3fr) auto minmax(80px, 1fr);
        grid-template-areas: "play speed date today slider";
        gap: 6px;
    }
    #tb-play { width: 44px; min-height: 44px; }
    /* prohlídka na nízké obrazovce: kompaktní, ať zbyde místo na model */
    .tour { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: min(760px, calc(100% - 24px)); }
    .tour-progress { grid-column: 1 / -1; }
    .tour-main { flex-direction: row; align-items: center; gap: 10px; padding: 6px 8px 8px 14px; }
    .tour-foot { flex-direction: column; justify-content: center; padding: 4px 12px 4px 0; }
    .tour-count { display: none; }
    .tour-title { font-size: 16px; margin: 0 0 2px; }
    .tour-text { font-size: 13px; line-height: 1.4; }
    .tour-controls { gap: 4px; }
    .tour-controls .icon-btn { min-height: 38px; min-width: 38px; }
    .tour-foot .btn { min-height: 34px; }
    .hint { padding: 6px 8px 6px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    #hud-reticle svg { animation: none; }
    .panel, .tour, .hint { animation: none; }
}
