/* Nitro těles: popisky vrstev ve scéně a karta nitra (src/scene/InteriorLabels.js, src/ui/InteriorCard.js).
   Používá proměnné a třídy z ui.css a main.css (--glass, --line, --accent, .btn, .segmented, .card-section…). */

/* ---- popisky ve scéně ---- */

.nitro-labels {
    position: fixed;
    inset: 0;
    z-index: 12;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s;
}
.nitro-labels.is-on { opacity: 1; }

.nitro-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.nitro-lines line { stroke: rgba(255, 255, 255, 0.62); stroke-width: 1; stroke-linecap: round; filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.85)); }
.nitro-lines line.is-sel { stroke: #fff; stroke-width: 1.6; }
.nitro-lines circle { fill: #fff; stroke: rgba(0, 0, 0, 0.55); stroke-width: 1; }

.nitro-label {
    position: absolute;
    left: 0;
    top: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 24px;
    padding: 0 9px 0 7px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: var(--label-bg);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
    color: var(--text);
    font: 600 13px/1 var(--header-font);
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
    pointer-events: auto;
    cursor: pointer;
    visibility: hidden;
    will-change: transform;
}
.nitro-label:hover, .nitro-label.is-sel { border-color: rgba(255, 255, 255, 0.85); box-shadow: 0 0 10px rgba(124, 199, 255, 0.55); }
.nitro-label-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); flex: 0 0 auto; }

@media (max-width: 820px) {
    .nitro-labels { display: none; }
}

/* ---- karta nitra ---- */

.nitro-back { margin-bottom: 10px; padding-left: 8px; }

.nitro-jistota-sec { margin-top: 0; }
.nitro-jistota {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px 0 10px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.06);
    font-weight: 700;
    font-size: 13.5px;
    --j: var(--accent);
}
.nitro-jistota[data-jistota="mereno"] { --j: var(--good); }
.nitro-jistota[data-jistota="castecne"] { --j: var(--sun); }
.nitro-jistota[data-jistota="model"] { --j: #c9a0ff; }
.nitro-jistota { border-color: color-mix(in srgb, var(--j) 55%, transparent); background: color-mix(in srgb, var(--j) 12%, transparent); }
.nitro-jistota-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--j); box-shadow: 0 0 8px var(--j); }
.nitro-jistota-i { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font: italic 700 11px/1 serif; color: var(--text-dim); border: 1px solid var(--line-strong); }
.nitro-jistota-text { margin-top: 8px; }

.nitro-mode .small { margin-top: 8px; }

.nitro-list { list-style: none; display: grid; gap: 6px; }
.nitro-item { min-width: 0; }

.nitro-row {
    appearance: none;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    min-height: 52px;
    padding: 8px 10px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
    transition: background-color 0.15s, border-color 0.15s;
}
.nitro-row:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--line-strong); }
.nitro-row.is-open { background: rgba(124, 199, 255, 0.12); border-color: rgba(124, 199, 255, 0.5); border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; }
.nitro-sw { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 10px -2px var(--c); }
.nitro-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.nitro-row-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.nitro-row-sub { font-size: 12px; color: var(--text-dim); line-height: 1.3; overflow-wrap: anywhere; }
.nitro-row-size { flex: 0 0 auto; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); text-align: right; max-width: 40%; }
.nitro-row-chev { flex: 0 0 auto; color: var(--text-dim); display: grid; transition: transform 0.2s; }
.nitro-row.is-open .nitro-row-chev { transform: rotate(180deg); }

.nitro-detail {
    padding: 10px 12px 12px;
    border: 1px solid rgba(124, 199, 255, 0.35);
    border-top: 0;
    border-radius: 0 0 14px 14px;
    background: rgba(124, 199, 255, 0.06);
}
.nitro-detail[hidden] { display: none; }
.nitro-popis { font-size: 14.5px; line-height: 1.5; }
.nitro-fact { margin-top: 6px; font-size: 13.5px; line-height: 1.4; color: var(--text-dim); }
.nitro-fact strong { color: var(--text); font-weight: 600; }

.nitro-actions { margin-top: 16px; margin-bottom: 4px; }
.nitro-slot:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
    .nitro-labels, .nitro-row-chev { transition: none; }
}

/* ---- karta nitra: horní řádek, spodní list (telefon) ---- */

.nitro-toprow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.nitro-toprow .nitro-back { margin-bottom: 0; }
.nitro-jrow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.nitro-cesta-btn.is-sheet { display: none; }
.nitro-head-back { display: none; flex: 0 0 auto; }

/* na spodním listu: šipka zpět místo „kolečka“ tělesa, bez podnadpisu a nadpisů skupin, ať je vidět přepínač a první vrstvy */
.is-sheet .nitro-head-back { display: grid; }
.is-sheet .card--nitro .card-dot, .is-sheet .card--nitro .card-sub { display: none; }
.is-sheet .card--nitro .card-head { gap: 6px; padding-left: 6px; }
.is-sheet .card--nitro .card-title { font-size: 19px; }
.is-sheet .nitro-toprow { display: none; }
.is-sheet .nitro-cesta-btn.is-sheet { display: inline-flex; flex: 1 1 auto; justify-content: center; min-height: 34px; }
.is-sheet .card--nitro[data-mode="vrstvy"] .card-info { font-size: 14px; line-height: 1.4; margin-bottom: 8px; }
.is-sheet .card--nitro .card-section { margin-top: 8px; }
.is-sheet .card--nitro .nitro-mode h3, .is-sheet .card--nitro .nitro-layers > h3 { display: none; }
.is-sheet .card--nitro .segmented { margin-top: 0; }
.is-sheet .card--nitro .seg { min-height: 38px; }
.is-sheet .card--nitro .nitro-mode .small { margin-top: 4px; font-size: 12px; line-height: 1.3; }
.is-sheet .card--nitro .nitro-list { gap: 4px; }
.is-sheet .card--nitro .nitro-row { min-height: 44px; padding: 5px 9px; }

/* ---- cesta do středu ---- */

.cesta { display: flex; flex-direction: column; gap: 10px; padding-top: 2px; }
.cesta-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cesta-play { margin-left: auto; min-width: 150px; justify-content: center; }
.cesta-play-ic { display: inline-grid; }

.cesta-counter { display: flex; flex-direction: column; gap: 2px; }
.cesta-km { display: flex; align-items: baseline; gap: 8px; }
.cesta-num { font-size: 44px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.cesta-unit { font-size: 18px; font-weight: 700; color: var(--text-dim); }
.cesta-sub { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 15px; font-weight: 700; }
.cesta-dot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 4px; background: var(--c, #aab4c8); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 8px -1px var(--c, #aab4c8); }
.cesta-layer { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cesta-left { margin-left: auto; flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

.cesta-slider { position: relative; height: 44px; margin: 0 8px; touch-action: none; cursor: pointer; border-radius: 12px; user-select: none; -webkit-user-select: none; }
.cesta-slider:focus { outline: none; }
.cesta-slider:focus-visible .cesta-thumb { box-shadow: 0 0 0 3px var(--accent), 0 0 12px rgba(255, 255, 255, 0.55); }
.cesta-track { position: absolute; left: 0; right: 0; top: 13px; height: 18px; }
.cesta-segs { position: absolute; inset: 0; border-radius: 9px; overflow: hidden; border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.35); }
.cesta-seg { position: absolute; top: 0; bottom: 0; background: var(--c); box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.4); }
.cesta-marks { position: absolute; inset: 0; pointer-events: none; }
.cesta-mark { position: absolute; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.7); }
.cesta-mark.is-on { width: 10px; height: 10px; margin: -5px 0 0 -5px; background: var(--sun); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.75), 0 0 10px var(--sun); }
.cesta-thumb { position: absolute; top: 5px; width: 14px; height: 34px; margin-left: -7px; border-radius: 8px; background: #fff; border: 2px solid rgba(0, 0, 0, 0.6); box-shadow: 0 0 12px rgba(255, 255, 255, 0.55); pointer-events: none; }
.cesta-ends { display: flex; justify-content: space-between; margin: -8px 8px 0; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }

.cesta-stop { display: flex; align-items: center; gap: 6px; }
.cesta-nav { flex: 0 0 auto; min-width: 44px; min-height: 44px; }
.cesta-nav:disabled { opacity: 0.35; }
.cesta-stop-box { flex: 1 1 auto; min-width: 0; text-align: center; display: flex; flex-direction: column; gap: 1px; }
.cesta-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.cesta-stop-name { font-size: 17px; font-weight: 700; line-height: 1.2; }
.cesta-stop-text { font-size: 14.5px; line-height: 1.5; }

.cesta-tiles { display: grid; grid-template-columns: 1fr; gap: 6px; }
.cesta-tiles[data-n="3"] { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) minmax(0, 0.72fr); }
.cesta-tile { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 6px 9px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); }
.cesta-tile-l { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.cesta-tile-v { font-size: 13.5px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: break-word; }
.cesta-tiha-veta { margin-top: -2px; }

.is-sheet .cesta { gap: 6px; }
.is-sheet .cesta-back { display: none; }
.is-sheet .cesta-top { justify-content: stretch; }
.is-sheet .cesta-play { width: 100%; min-height: 36px; }
.is-sheet .cesta-num { font-size: 36px; }
.is-sheet .cesta-unit { font-size: 16px; }
.is-sheet .cesta-sub { font-size: 14px; }
.is-sheet .cesta-slider { height: 40px; }
.is-sheet .cesta-track { top: 11px; }
.is-sheet .cesta-thumb { top: 3px; height: 34px; }
.is-sheet .cesta-ends { display: none; }
.is-sheet .cesta-nav { min-width: 40px; min-height: 40px; }
.is-sheet .cesta-stop-name { font-size: 16px; }
.is-sheet .cesta-tile { padding: 4px 7px; }
.is-sheet .cesta-tile-v { font-size: 13px; }
.is-sheet .cesta-stop-text { font-size: 14px; line-height: 1.45; }

/* telefon na šířku (karta vpravo, málo výšky): počitadlo a tlačítko cesty v jednom řádku, dlaždice až pod ohybem */
@media (max-height: 520px) {
    .nitro-head-back { display: grid; }
    .card--nitro .card-dot { display: none; }
    .card--nitro .card-head { gap: 6px; padding: 8px 8px 4px 6px; }
    .card--nitro .card-title { font-size: 18px; }
    .card--nitro .card-sub { display: none; }
    .cesta { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 4px; }
    .cesta > * { grid-column: 1 / -1; }
    .cesta > .cesta-top { grid-column: 2; grid-row: 1; align-self: start; }
    .cesta > .cesta-counter { grid-column: 1; grid-row: 1; }
    .cesta-back { display: none; }
    .cesta-play { min-width: 0; min-height: 34px; }
    .cesta-num { font-size: 32px; }
    .cesta-unit { font-size: 15px; }
    .cesta-sub { font-size: 13px; }
    .cesta-left { display: none; }
    .cesta-slider { height: 36px; }
    .cesta-track { top: 9px; }
    .cesta-thumb { top: 1px; height: 34px; }
    .cesta-ends { display: none; }
    .cesta-nav { min-width: 36px; min-height: 36px; }
    .cesta-stop-name { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    .cesta-thumb { transition: none; }
}
@media (max-height: 520px) {
    .nitro-toprow .nitro-back { display: none; }
    .nitro-toprow { justify-content: flex-end; margin-bottom: 6px; }
}

/* telefon (spodní list) s menší výškou: úvod zkrácený na dva řádky (klepnutím se rozbalí), bez věty pod přepínačem */
@media (max-height: 860px) {
    .is-sheet .card--nitro[data-mode="vrstvy"] .nitro-uvod:not(.is-open) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
    .is-sheet .card--nitro .nitro-mode .small { display: none; }
}
.is-sheet .nitro-jrow { flex-wrap: nowrap; }
.is-sheet .nitro-cesta-btn.is-sheet { padding: 0 10px; gap: 6px; font-size: 13.5px; min-width: 0; white-space: nowrap; }
.is-sheet .card--nitro .nitro-jistota { padding: 0 9px 0 8px; gap: 6px; flex: 0 0 auto; }
@media (max-height: 860px) {
    .is-sheet .card--nitro .seg { min-height: 34px; }
}
