/* Layout: one centered column. A raised slab holds the scene title, play, a sunken "well" with a
   dot-matrix sky, and the controls. Below it a full-bleed footer prints the wordmark in halftone dots.
   Single committed dark look; the phase of day tints --glow. */
html, body { margin: 0; }
:root {
  --bg: #0c0c0b;
  --slab: #141412;
  --well: #080807;
  --ink: #e9e4da;
  --ink2: rgba(233, 228, 218, 0.56);
  --ink3: rgba(233, 228, 218, 0.34);
  --line: rgba(233, 228, 218, 0.11);
  --glow: #e8a07a;
  --display: "Inter Tight", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --pixel: "Doto", "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}
body {
  background:
    radial-gradient(110% 55% at 50% -12%, color-mix(in srgb, var(--glow) 13%, transparent), transparent 62%),
    var(--bg);
  color: var(--ink);
  font-family: var(--display);
  font-size: 15px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* jemné tlačové zrno cez celú stránku (dlaždica sa generuje v JS) */
/* pozadie stránky s počasím (canvas za obsahom) */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: -1; pointer-events: none; }
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background-image: var(--grain, none); opacity: 0.07; mix-blend-mode: overlay;
}
.cap {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink2); line-height: 1.75; font-variant-numeric: tabular-nums; margin: 0;
}
.app {
  box-sizing: border-box;
  max-width: 760px;
  margin: 0 auto;
  padding: 22px max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px));
  display: grid; gap: 22px;
}
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.logo { display: block; line-height: 0; }
.logo canvas { display: block; }
.status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.led {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: #34322d; box-shadow: inset 0 1px 1px rgba(0,0,0,.6);
  transition: background .4s, box-shadow .4s;
}
/* dýchanie LED nie je CSS animácia (tá by prekresľovala obrazovku pri každom snímku displeja), posúva ho obloha (frame) */
.led.on { background: var(--glow); box-shadow: 0 0 6px var(--glow), 0 0 14px color-mix(in srgb, var(--glow) 50%, transparent); }
.timer { color: var(--glow); }
.timer:empty { display: none; }

.slab {
  /* mierne priesvitný, aby počasie v pozadí presvitalo */
  background: linear-gradient(180deg, rgba(25,25,23,.8), rgba(20,20,18,.84) 40%);
  -webkit-backdrop-filter: blur(16px) saturate(1.1); backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  display: grid; gap: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 40px 80px -40px rgba(0,0,0,.9), 0 2px 0 rgba(0,0,0,.4);
}
.slab-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 4px 4px 0; }
/* úvodná veta pre nového návštevníka: po prvom play sa stiahne (záporný okraj zruší medzeru mriežky) */
.titles { display: grid; gap: 6px; min-width: 0; }
#where { display: flex; flex-wrap: wrap; align-items: center; column-gap: 14px; }
.locate { display: inline-flex; align-items: center; gap: 6px; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--ink2); background: none; border: 0; padding: 0; min-height: 28px; cursor: pointer; }
@media (pointer: coarse) { .locate { min-height: 36px; } }
.locate svg { width: 9px; height: 9px; fill: currentColor; flex: none; }
.locate:hover { color: var(--ink); }
.locate:hover span { text-decoration: underline; text-underline-offset: 3px; }
.locate:focus-visible { outline: 1px solid var(--glow); outline-offset: 2px; }
.locate:disabled { cursor: default; }
.locate[aria-pressed="true"] { color: var(--glow); }
.locate:disabled span { text-decoration: none; }
.locate[hidden] { display: none; }
a.locate { text-decoration: none; }
/* ďalšia skladba a celá obrazovka pod oknom, kláves vedľa textu (na dotyku nie je) */
.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 0 18px; padding: 0 4px; margin-top: -8px; }
.transport:not(:has(button:not([hidden]))) { display: none; }
.transport #goFull { margin-left: auto; }
.transport .locate:disabled { opacity: .4; }
.locate kbd { font: inherit; letter-spacing: .06em; padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; }
.transport i { font-style: normal; }
@media (hover: none) { .locate kbd { display: none; } }
@media (max-width: 680px) { .transport i, .transport kbd, #goFull span { display: none; } #goFull { min-width: 44px; justify-content: flex-end; } #goFull svg { width: 16px; height: 16px; } }
h1 {
  margin: 0;
  font-size: clamp(2.1rem, 8vw, 3.5rem);
  line-height: 0.95;
  font-weight: 300;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
h1 em { font-style: normal; font-weight: 650; color: var(--glow); transition: color 2s ease; }
#scene { transition: opacity .35s ease; }
#play {
  flex: none;
  width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.18), 0 6px 18px -6px rgba(0,0,0,.8);
  transition: transform .2s ease, box-shadow 1.2s ease, background .3s, color .3s;
}
#play:hover { transform: scale(1.04); }
#play:active { transform: scale(.97); }
#play:focus-visible { outline: 2px solid var(--glow); outline-offset: 4px; }
#play.on { background: var(--well); color: var(--ink); box-shadow: inset 0 2px 6px rgba(0,0,0,.8), 0 0 40px -10px var(--glow); }
#play svg { width: 24px; height: 24px; }
/* mobil: keď veľký play zroluješ preč, dole sa vysunie malý pruh s play a scénou */
.minibar { display: none; }
@media (max-width: 680px) {
  .minibar {
    display: block;
    position: fixed; z-index: 40; right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 6px; border-radius: 50%;
    background: color-mix(in srgb, var(--slab) 88%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(1.1); backdrop-filter: blur(16px) saturate(1.1);
    border: 1px solid var(--line); box-shadow: 0 18px 40px -14px rgba(0,0,0,.9);
    transform: translateY(calc(100% + 24px)); opacity: 0; visibility: hidden;
    transition: transform .35s cubic-bezier(.2,.7,.1,1), opacity .25s ease, visibility 0s linear .35s;
  }
  .minibar.show { transform: none; opacity: 1; visibility: visible; transition: transform .35s cubic-bezier(.2,.7,.1,1), opacity .25s ease; }
}
.mini-play {
  flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--ink); color: var(--bg); display: grid; place-items: center; cursor: pointer;
  transition: background .3s, color .3s, box-shadow 1.2s ease;
}
.mini-play.on { background: var(--well); color: var(--ink); box-shadow: inset 0 2px 6px rgba(0,0,0,.8), 0 0 24px -8px var(--glow); }
.mini-play svg { width: 18px; height: 18px; }
.mini-play:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .minibar, .minibar.show { transition: none; } }

/* zapustená "studňa" s bodkovou oblohou */
.well {
  position: relative; overflow: hidden;
  height: 336px;
  border-radius: 14px;
  background: var(--well);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.85), inset 0 0 0 1px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.05);
}
.well canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; touch-action: manipulation; }
/* teplota a popis skladby sú hore, parapet dole patrí parťákovi */
.ground {
  position: absolute; left: 18px; right: 18px; top: 14px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  pointer-events: none; transition: opacity .4s;
}
.sigil-name { position: absolute; left: 0; right: 0; text-align: center; font-weight: 700; font-size: 24px; letter-spacing: -0.01em; color: var(--glow); opacity: 0; transition: opacity .4s; pointer-events: none; }
.well.sigil .ground, .well.sigil .route { opacity: 0; }
/* cesta vlakom: trať so stanicami dole v okne */
.route { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); z-index: 2; display: flex; align-items: center; max-width: calc(100% - 16px); padding: 3px 9px; border: 0; border-radius: 999px; background: rgba(8, 8, 7, .68); color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; transition: opacity .3s; }
.route:hover span { text-decoration: underline; text-underline-offset: 3px; }
.route:focus-visible { outline: 1px solid var(--glow); outline-offset: 2px; }
.route[hidden] { display: none; }
.route i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink3); flex: none; }
.route i.goal { width: 8px; height: 8px; border-radius: 2px; }
.route i.on { background: var(--glow); }
.route b { position: relative; width: 22px; min-width: 6px; height: 2px; background: var(--ink3); flex: 0 1 22px; }
.route u { position: absolute; left: 0; top: 0; bottom: 0; background: var(--glow); }
.route span { margin-left: 8px; font-size: 10px; color: var(--ink); white-space: nowrap; }
.route span.solo { margin-left: 0; }
@media (max-width: 520px) { .route b { flex-basis: 12px; } }
.well.full .route { bottom: 2vh; }
.trip-l { margin: 18px 0 8px; color: var(--ink2); }
.trip-time { margin-top: 16px; }
/* cestovný pas: pečiatky miest */
.stamps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; max-height: min(430px, 58dvh); overflow-y: auto; padding: 3px; }
.stamp { display: grid; align-content: center; gap: 3px; min-height: 54px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; color: var(--ink3); }
.stamp b { font-weight: 600; font-size: 14px; line-height: 1.15; }
.stamp span { font-size: 9px; }
.stamp.on { border: 1.5px solid var(--glow); color: var(--ink); background: rgba(233, 228, 218, .04); transform: rotate(-1.1deg); }
.stamp.on:nth-child(2n) { transform: rotate(.9deg); }
.stamp.on:nth-child(3n) { transform: rotate(-.4deg); }
.stamp.on span { color: var(--glow); }
@media (max-width: 520px) { .stamps { grid-template-columns: 1fr 1fr; } }
.trip-list { margin-top: 10px; max-height: min(232px, 34dvh); overflow-y: auto; padding-right: 2px; }
.trip-list:empty::after { content: attr(data-empty); grid-column: 1 / -1; color: var(--ink2); padding: 8px 2px; }
.sheet-go:disabled { opacity: .4; cursor: default; }
.trip-sum { margin: 18px 0 14px; color: var(--ink2); min-height: 1.3em; }
.trip-free { display: flex; margin: 12px auto 0; }
.well.sigil .sigil-name { opacity: 1; }
.pixel { font-family: var(--pixel); font-weight: 800; font-size: 56px; line-height: 0.9; letter-spacing: 0.02em; color: var(--ink); text-shadow: 0 0 18px rgba(0,0,0,.6); }
.ground-r { display: grid; justify-items: end; gap: 2px; padding-bottom: 6px; text-align: right; min-width: 0; }
/* meno novej skladby sa na chvíľu rozsvieti (jeden prechod, nie nekonečná animácia) */
#key { transition: color 1.6s ease; }
#key.fresh { color: var(--glow); }
/* celá obrazovka (F, dvojklik): studňa bez okrajov ako živý obraz, popisy väčšie na čítanie z diaľky, kurzor sa po chvíli skryje */
.well.full { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
.well.full .ground { left: 4vw; right: 4vw; top: 4vh; }
.well.full .pixel { font-size: clamp(56px, 6.5vw, 120px); }
.well.full #key { font-size: clamp(11px, 1vw, 17px); }
/* iPhone: okno vyplní stránku (position: fixed by v .slab držal backdrop-filter vo vnútri) */
.fs-close { display: none; }
html.pagefull, html.pagefull body { overflow: hidden; }
html.pagefull .slab { -webkit-backdrop-filter: none; backdrop-filter: none; }
html.pagefull .well { position: fixed; inset: 0; z-index: 60; height: auto; border-radius: 0; }
html.pagefull .fs-close { display: inline-flex; position: absolute; z-index: 2; top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink); background: color-mix(in srgb, var(--well) 70%, transparent); border-radius: 8px; padding: 4px 12px; }
html.pagefull .well.full .ground { top: calc(46px + env(safe-area-inset-top, 0px)); }
/* pomodoro na celej obrazovke: vpravo hore pod menom skladby, rovnako veľké ako teplota vľavo; v bežnom okne je panel pod oknom */
.fs-pomo { display: none; }
.well.full .fs-pomo:not([hidden]) { display: grid; justify-items: end; gap: 1vh; margin-top: 2vh; }
.fs-pomo.brk .pixel { color: var(--ink2); }
.fs-pomo .locate { pointer-events: auto; color: var(--glow); border: 1px solid currentColor; border-radius: 8px; padding: 4px 12px; }
.well.full .fs-pomo .cap { font-size: clamp(11px, 1vw, 17px); }
.well.full .sigil-name { font-size: clamp(24px, 3vw, 52px); }
.well.full.idle canvas { cursor: none; }
.well:fullscreen::backdrop { background: var(--well); }
/* ponuka „Pridať do doku“: raz po dlhšom počúvaní, tichá ako úvodná veta */
.dock { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 12px 14px 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(233,228,218,.02); }
.dock[hidden] { display: none; }
.dock p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink2); text-wrap: pretty; flex: 1 1 260px; }
.dock #dockAdd { background: var(--glow); color: var(--bg); border-color: var(--glow); }
/* pomodoro: panel pod studňou, len keď beží pomodoro */
.pomo { display: grid; gap: 12px; padding: 14px 16px 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(233,228,218,.02); }
.pomo[hidden] { display: none; }
.pomo-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pomo-main > div { display: grid; gap: 7px; min-width: 0; }
.pomo-time { font-size: 64px; text-shadow: none; font-variant-numeric: tabular-nums; }
.pomo.brk .pomo-time { color: var(--ink2); }
.pomo-r { justify-items: end; text-align: right; padding-bottom: 4px; }
.pomo-bar { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.pomo-bar i { display: block; height: 100%; width: 0; background: var(--glow); }
.pomo.brk .pomo-bar i { background: var(--ink2); }
.pomo-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.pomo-today { color: var(--ink2); flex: 1; }
.pomo .chips button { min-height: 30px; padding: 4px 11px; font-size: 13px; }
.pomo .chips button[hidden] { display: none; }
.pomo .chips #pomoGo { background: var(--glow); color: var(--bg); border-color: var(--glow); }
@media (max-width: 600px) { .pomo-time { font-size: 52px; } .pomo { padding: 12px; } }
.rule { height: 0; border-top: 0.5px solid color-mix(in srgb, var(--ink) 16%, transparent); margin: 2px 4px; }

.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 26px; padding: 0 4px 4px; }
.group { display: grid; gap: 9px; align-content: start; min-width: 0; }
.group[hidden] { display: none; }
.group.wide { grid-column: 1 / -1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  font-family: var(--display); font-size: 13.5px; font-weight: 500; letter-spacing: -0.005em;
  color: var(--ink); background: rgba(233,228,218,.025);
  border: 1px solid var(--line); border-radius: 10px;
  min-height: 36px; padding: 7px 13px; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.chips button:hover { border-color: var(--ink3); }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips button:focus-visible { outline: 1px solid var(--glow); outline-offset: 2px; }
.status { font-size: 0.8rem; color: var(--ink2); margin: 0; line-height: 1.5; }
/* žánre ako karty */
.genres { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.genres button {
  display: grid; gap: 3px; align-content: start; text-align: left;
  font: inherit; color: var(--ink); background: rgba(233,228,218,.025);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 12px 13px; cursor: pointer; min-width: 0;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.genres button:hover { border-color: var(--ink3); }
.genres button:active { transform: scale(.98); }
.genres button:focus-visible { outline: 1px solid var(--glow); outline-offset: 2px; }
.genres b { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; display: flex; align-items: center; gap: 7px; }
.genres b::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: var(--ink3); flex: none; transition: background .3s, box-shadow .3s; }
.genres small { font-size: 12px; line-height: 1.35; color: var(--ink2); }
.genres button[aria-pressed="true"] { background: color-mix(in srgb, var(--glow) 9%, transparent); border-color: var(--glow); }
.genres button[aria-pressed="true"] b::before { background: var(--glow); box-shadow: 0 0 6px var(--glow); }

/* posuvníky */
.slider { display: grid; gap: 8px; }
.slider .cap { display: flex; justify-content: space-between; }
.slider output { color: var(--ink); }
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0;
  background: transparent; cursor: pointer; --fill: 50%;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 3px; border-radius: 3px;
  background: linear-gradient(var(--ink), var(--ink)) 0 / var(--fill) 100% no-repeat, rgba(233,228,218,.14);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7.5px; border-radius: 50%;
  background: var(--ink); border: 0; box-shadow: 0 0 0 5px rgba(233,228,218,.07), 0 2px 6px rgba(0,0,0,.6);
  transition: box-shadow .2s;
}
input[type=range]::-moz-range-track { height: 3px; border-radius: 3px; background: rgba(233,228,218,.14); }
input[type=range]::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--ink); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--ink); }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px color-mix(in srgb, var(--glow) 45%, transparent); }
input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 5px color-mix(in srgb, var(--glow) 45%, transparent); }

/* menej používané nastavenia */
.more { border: 1px solid var(--line); border-radius: 14px; background: rgba(0,0,0,.18); }
.more summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 14px; font-size: 14px; font-weight: 500; border-radius: 14px;
}
.more summary::-webkit-details-marker { display: none; }
.more summary:focus-visible { outline: 1px solid var(--glow); outline-offset: 2px; }
.more summary .chev { width: 12px; height: 12px; flex: none; transition: transform .25s; opacity: .6; }
.more[open] summary .chev { transform: rotate(180deg); }
.more summary .cap { margin-left: auto; text-align: right; }
.more-body { display: grid; gap: 18px; padding: 4px 14px 16px; }
/* štyri karty v riadku (12 stĺpcov po 3); posledný neúplný riadok sa roztiahne: jedna karta na celú šírku, dve na pol, tri na tretinu (Spánok, House, Grind) */
@media (min-width: 681px) {
  .genres { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .genres button { grid-column: span 3; }
  .genres button:last-child:nth-child(4n+1) { grid-column: 1 / -1; }
  .genres button:nth-child(4n+1):nth-last-child(2), .genres button:nth-child(4n+2):last-child { grid-column: span 6; }
  .genres button:nth-child(4n+1):nth-last-child(3), .genres button:nth-child(4n+2):nth-last-child(2), .genres button:nth-child(4n+3):last-child { grid-column: span 4; }
}
@media (max-width: 680px) {
  .genres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .genres button:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .genres button { gap: 1px; padding: 8px 10px 9px; }
  .genres b { font-size: 14px; }
  .genres small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .matrix .genres small { white-space: normal; }   /* mono písmo je širšie, na riadok by sa nezmestilo */
}
/* Matrix: zelený fosfor, všetko mono, jemné riadky ako na CRT */
:root.matrix {
  --bg: #010302; --slab: #030805; --well: #000201;
  --ink: #b9f7c9; --ink2: rgba(185, 247, 201, 0.58); --ink3: rgba(185, 247, 201, 0.34);
  --line: rgba(80, 255, 140, 0.16);
  --display: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
.matrix .slab { background: linear-gradient(180deg, rgba(2,10,5,.82), rgba(1,6,3,.88) 40%); }
.matrix h1 { font-weight: 400; letter-spacing: -0.02em; }
.matrix h1 em { font-weight: 500; text-shadow: 0 0 18px color-mix(in srgb, var(--glow) 60%, transparent); }
.matrix .ground-r { text-shadow: 0 0 6px #000, 0 0 14px #000, 0 0 2px #000; }
html.matrix body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 49;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 1px, transparent 1px 3px);
}
@media (max-width: 600px) {
  .controls { grid-template-columns: 1fr; }
  .well { height: 296px; }
  .ground-r .cap { white-space: nowrap; font-size: 9.5px; letter-spacing: .1em; }
  .pixel { font-size: 46px; }
  .slab { padding: 12px; border-radius: 20px; }
}

/* pätička: slovo "okno" vytlačené halftone bodkami */
.hwf {
  position: relative; width: 100%; overflow: hidden; isolation: isolate;
  height: clamp(340px, 26vw + 200px, 720px);
  background: transparent; color: var(--ink);   /* presvitá pozadie s počasím */
  border-top: 0.5px solid var(--line);
}
.hwf canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.hwf-top {
  position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr));
  gap: 24px; padding: clamp(22px, 3.4vw, 40px) clamp(20px, 3.4vw, 44px) 0;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; line-height: 1.75;
  pointer-events: none;
}
.hwf-top a, .hwf-top button { pointer-events: auto; }
.hwf-brand strong { display: block; font-weight: 500; }
.hwf-brand a { display: inline-block; margin-top: 6px; opacity: .78; }
.hwf-brand span, .hwf-col h3 { opacity: .45; }
.hwf-col h3 { margin: 0; font: inherit; font-weight: 500; }
.hwf-col ul { list-style: none; margin: 0; padding: 0; }
.hwf-col li { opacity: .78; }
.hwf a, .hwf-up, .hwf-link {
  display: inline-block;
  color: inherit; text-decoration: none; background: none; border: 0; padding: 7px 0;
  font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer;
  background-image: linear-gradient(currentColor, currentColor); background-size: 0% 1px;
  background-repeat: no-repeat; background-position: 0 100%;
  transition: opacity .25s ease, background-size .35s cubic-bezier(.2,.7,.1,1);
}
.hwf a:hover, .hwf-up:hover, .hwf-link:hover { background-size: 100% 1px; }
.hwf a:focus-visible, .hwf-up:focus-visible, .hwf-link:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }
.hwf-rule {
  position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center;
  margin: clamp(18px, 2.6vw, 30px) clamp(20px, 3.4vw, 44px) 0; padding-top: 12px;
  border-top: 0.5px solid color-mix(in srgb, var(--ink) 16%, transparent);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
}
.hwf-up, .hwf-rule a { opacity: .78; }
.hwf-links { display: flex; gap: 18px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 720px) {
  .hwf { height: 448px; }
  .hwf-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 18px; }
  .hwf-brand { grid-column: 1 / -1; }
  .hwf-rule { justify-content: flex-start; gap: 18px; }   /* vpravo dole je na mobile bublina s play */
}
@media (prefers-reduced-motion: reduce) {
  .hwf a, .hwf-up, .hwf-link { transition: none; }
  .sheet[open], .sheet[open]::backdrop { animation: none; }
}

/* Okienká: úvod pri prvom otvorení a výber okna */
html:has(dialog[open]) { overflow: hidden; }
.sheet { width: min(460px, calc(100vw - 32px)); max-height: min(640px, calc(100dvh - 32px)); padding: 0; color: var(--ink); background: var(--slab); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.55); }
#windows { width: min(600px, calc(100vw - 32px)); }
.sheet:focus { outline: none; }
.sheet::backdrop { background: rgba(6,6,5,.62); }
.sheet[open] { animation: sheet-in .28s ease both; }
.sheet[open]::backdrop { animation: sheet-fade .28s ease both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes sheet-fade { from { opacity: 0; } }
.sheet-in { padding: 24px; }
.sheet h2 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sheet-sub { margin: 6px 0 0; color: var(--ink2); line-height: 1.5; }
.hints { list-style: none; margin: 16px 0 22px; padding: 0; display: grid; gap: 10px; color: var(--ink2); line-height: 1.45; }
.hint-keys { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 4px; }
.hint-keys span + kbd { margin-left: 10px; }
.hint-keys kbd { font: inherit; padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; }
@media (hover: none) { .hint-keys { display: none; } }
.sheet-go { width: 100%; min-height: 46px; font: inherit; font-weight: 600; color: var(--bg); background: var(--glow); border: 0; border-radius: 12px; cursor: pointer; }
.sheet-go:focus-visible, .win:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
#windowList h3 { margin: 20px 0 8px; font-weight: 500; }
#windowList > .win { margin-top: 16px; width: 100%; }
.win-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.win { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; align-items: baseline; text-align: left; font: inherit; color: var(--ink); background: rgba(233,228,218,.03); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; }
.win:hover { border-color: var(--ink3); }
.win[aria-current] { border-color: var(--glow); }
.win-t { color: var(--ink2); }
.win-s { grid-column: 1 / -1; color: var(--ink3); min-height: 1em; }
.win-s:empty { display: none; }
@media (max-width: 520px) { .win-grid { grid-template-columns: 1fr; } .sheet-in { padding: 20px; } }
