@font-face { font-family: Serif4; font-weight: 400; font-display: swap; src: url(./fonts/source-serif-4-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Serif4; font-weight: 400; font-display: swap; src: url(./fonts/source-serif-4-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: Serif4; font-weight: 600; font-display: swap; src: url(./fonts/source-serif-4-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Serif4; font-weight: 600; font-display: swap; src: url(./fonts/source-serif-4-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: Serif4; font-style: italic; font-weight: 400; font-display: swap; src: url(./fonts/source-serif-4-latin-400-italic.woff2) format('woff2'); }
@font-face { font-family: Serif4; font-style: italic; font-weight: 400; font-display: swap; src: url(./fonts/source-serif-4-latin-ext-400-italic.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF; }

/* Mapový list: tuš na papieri, dvojitý rám, pätkové písmo, voda modrou kurzívou */
:root {
  --paper: #f1ece0;
  --paper-2: #e8e1d1;
  --ink: #1d1b17;
  --ink-2: #5d574c;
  --ink-3: #8c8475;
  --blue: #2c5c86;
  --red: #b8412a;
  --ochre: #a8752c;
  --serif: Serif4, "Iowan Old Style", Georgia, serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --halo: 0 0 2px var(--paper), 0 0 5px var(--paper), 0 0 9px rgba(241, 236, 224, 0.9);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #cfd9e2; color: var(--ink); font: 16px/1.4 var(--serif);
  font-variant-numeric: lining-nums; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.tlink { font: 400 15px var(--serif); color: var(--ink); text-decoration: underline; text-decoration-thickness: 0.5px; text-underline-offset: 3px; }
.tlink:hover { color: var(--blue); }

/* ---------- rám mapového listu ---------- */
.frame { position: fixed; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); padding: 4px; box-shadow: 0 6px 22px rgba(20, 25, 30, 0.22); }
.frame > .in { border: 0.5px solid var(--ink); padding: 12px 15px 13px; }
.kick { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 600 10.5px/1.2 var(--serif); letter-spacing: 2.2px; text-transform: uppercase; color: var(--ink-2); }
.kick .kt { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; text-align: left; }
.kick .x { font: 400 24px/0.8 var(--serif); letter-spacing: 0; color: var(--ink-2); width: 30px; height: 26px; margin: -6px -8px -6px 0; }
.kick .x:hover { color: var(--ink); }
h3, .frame h2 { font: 600 24px/1.12 var(--serif); letter-spacing: -0.2px; margin: 6px 0 0; }
.lede { font-size: 15.5px; line-height: 1.45; color: var(--ink-2); margin: 6px 0 0; }
.small { font-size: 14px; line-height: 1.45; color: var(--ink-2); margin: 8px 0 0; }
.src { font: italic 400 12.5px var(--serif); color: var(--ink-3); margin: 6px 0 0; }
.fig { margin: 10px 0 0; padding: 7px 0 3px; border-top: 0.5px solid var(--ink); border-bottom: 0.5px solid var(--ink); }
.fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 10px; font: italic 400 13px var(--serif); color: var(--ink-2); }
.foot .tlink { font-style: normal; font-size: 14px; white-space: nowrap; }

/* ---------- kartuša (názov) ---------- */
#cartouche { top: calc(12px + var(--safe-t)); left: 12px; z-index: 3; pointer-events: none; box-shadow: 0 4px 16px rgba(20, 25, 30, 0.2); }
#cartouche .in { padding: 7px 14px 8px; text-align: center; }
#cartouche .c-k { display: block; font: 600 9px/1 var(--serif); letter-spacing: 2.4px; text-transform: uppercase; color: var(--ink-2); padding-bottom: 5px; border-bottom: 0.5px solid var(--ink); }
#cartouche h1 { margin: 6px 0 4px; font: 600 22px/1 var(--serif); letter-spacing: 3.2px; text-transform: uppercase; }
#cartouche .c-s { display: block; font: italic 400 12.5px/1.2 var(--serif); color: var(--ink-2); padding-top: 5px; border-top: 0.5px solid var(--ink); }

/* štvorcové tlačidlá vpravo hore */
.tbtn { position: fixed; top: calc(12px + var(--safe-t)); right: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.sq { width: 42px; height: 42px; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--ink); box-shadow: 0 2px 8px rgba(20, 25, 30, 0.2);
  font: 600 19px/1 var(--serif); color: var(--ink); }
.sq:hover { background: #fbf8f0; }
.sq[aria-expanded="true"] { background: var(--ink); color: var(--paper); }
#north { transition: transform 0.15s linear; }
#north text { font-family: var(--serif); }

/* ---------- spodný list ---------- */
#sheet { left: 12px; bottom: calc(12px + var(--safe-b)); width: min(390px, calc(100% - 24px)); z-index: 2; max-height: calc(100% - 150px - var(--safe-t) - var(--safe-b)); display: flex; }
#sheet > .in { overflow: auto; overscroll-behavior: contain; flex: 1; scrollbar-width: thin; }
.list { display: none; }
body:not(.drain):not(.flood):not(.hist):not(.mpo) #note-intro,
body.drain #drain-card, body.flood #flood-card, body.hist:not(.drain) #hist-card, body.mpo:not(.hist):not(.drain):not(.flood) #mpo-card { display: block; }
body.story .ui, body.story #labels, body.story .credits { opacity: 0; pointer-events: none; }
.ui, #labels, .credits { transition: opacity 0.5s ease; }
.more-t { display: none; }
/* zbalený list: len hlavička a ovládanie */
.list.min > :not(.kick):not(.keep) { display: none !important; }
.list.min .kick .kt::after, .list .kick .kt::after { content: " ▴"; letter-spacing: 0; }
.list.min .kick .kt::after { content: " ▾"; }

/* režimy: vytlačené „pečiatky“ – vyzerajú ako tlačidlá, pri stlačení sa zatlačia */
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 2px 3px 0; }
.modes button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 10px; text-align: center;
  font: 600 16px/1.1 var(--serif); color: var(--ink); background: #faf7f0; border: 1px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease; }
.modes button:hover { background: #fffdf8; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.modes button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.modes .mi { width: 22px; height: 22px; color: var(--blue); }
.modes #btn-flood .mi, .modes #btn-story .mi { color: var(--red); }
.modes i { display: block; font: 600 11px var(--serif); letter-spacing: 1.5px; font-style: normal; color: var(--ink-2); order: 3; }

/* hladina: veľké číslo a mierka */
.lake-ctl { margin-top: 8px; }
.num { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.num b { font: 400 42px/1 var(--serif); letter-spacing: -0.6px; font-variant-numeric: lining-nums tabular-nums; }
.num .delta { font: italic 400 16px var(--serif); color: var(--blue); }
#hist-card .num b { font-size: 34px; }
.lake-ctl #btn-drain { margin-top: 4px; }

/* posuvník ako grafická mierka */
.rwrap { position: relative; flex: 1; }
.ruler { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; margin: 4px 0 0; background: transparent; cursor: pointer; --seg: 7.6923%; }
.ruler::-webkit-slider-runnable-track { height: 6px; border: 0.75px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--ink) 0 var(--seg), var(--paper) var(--seg) calc(var(--seg) * 2)); }
.ruler::-moz-range-track { height: 5px; border: 0.75px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--ink) 0 var(--seg), var(--paper) var(--seg) calc(var(--seg) * 2)); }
.ruler::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 26px; margin-top: -11px; background: var(--blue); border: 2px solid var(--paper); outline: 0.75px solid var(--ink); }
.ruler::-moz-range-thumb { width: 8px; height: 22px; border-radius: 0; background: var(--blue); border: 2px solid var(--paper); outline: 0.75px solid var(--ink); }
.ruler.red { --seg: 4.1667%; }
.ruler.red::-webkit-slider-thumb { background: var(--red); }
.ruler.red::-moz-range-thumb { background: var(--red); }
.ticks { display: flex; justify-content: space-between; font: 400 11px var(--serif); color: var(--ink-2); margin-top: -3px; padding: 0 1px; }

/* časová os prietrže */
.timeline { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.sq.sm { width: 38px; height: 38px; font-size: 15px; flex: none; box-shadow: none; }
#time-label { min-width: 88px; text-align: right; font: 400 19px var(--serif); font-variant-numeric: tabular-nums; }

/* zatopené obce: tabuľka */
.village-list { list-style: none; margin: 6px 0 0; padding: 0; }
.village-list li { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 0.5px dotted var(--ink-2); }
.village-list .vname { font: 400 16px var(--serif); text-align: left; }
.village-list .vname:hover { color: var(--blue); }
.village-list .vst { text-align: right; font: italic 400 14.5px var(--serif); color: var(--blue); }
.village-list li.emerged .vst { color: var(--ochre); }
.village-list .vnote { grid-column: 1 / -1; font: italic 400 12.5px var(--serif); color: var(--ink-3); margin-top: 1px; }

/* ---------- legenda prietrže (počítač) ---------- */
.stats { display: none; top: calc(12px + var(--safe-t)); right: 66px; width: 290px; z-index: 2; }
@media (min-width: 900px) and (min-height: 620px) { body.flood .stats { display: block; } }
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; border-bottom: 0.5px dotted var(--ink-2); font-size: 14.5px; }
.stat:first-of-type { margin-top: 6px; }
.stat .k { color: var(--ink-2); }
.stat .v { font: 400 18px var(--serif); font-variant-numeric: tabular-nums; }
.chart { margin: 10px 0 4px; position: relative; }
.chart figcaption { font: italic 400 13px var(--serif); color: var(--ink-2); margin-bottom: 2px; }
#chart { width: 100%; height: auto; display: block; }
#chart .grid { stroke: rgba(29, 27, 23, 0.15); stroke-width: 0.5; }
#chart .axis { fill: var(--ink-2); font: 11px var(--serif); }
#chart .line { fill: none; stroke: var(--red); stroke-width: 1.4; stroke-linejoin: round; }
#chart .cursor { stroke: var(--ink); stroke-width: 0.75; }
#chart .dot { fill: var(--red); stroke: var(--paper); stroke-width: 1.5; }
#chart .hover { stroke: var(--ink-2); stroke-width: 0.75; stroke-dasharray: 2 3; }
.tip { position: absolute; top: 18px; background: var(--paper); border: 0.75px solid var(--ink); padding: 1px 6px; font-size: 13px; pointer-events: none; white-space: nowrap; }
.legend { margin-top: 8px; display: grid; gap: 3px; font-size: 13.5px; }
.legend .k { font: italic 400 13px var(--serif); color: var(--ink-2); }
.ramp { height: 8px; border: 0.75px solid var(--ink); background: linear-gradient(90deg, #cde2fb, #86b6ef, #3987e5, #1c5cab, #104281); }
.ramp-labels { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 11.5px; }
body[data-water="realna"] .legend-depth, body[data-water="hlbka"] .legend-real { display: none; }
.swatches { display: grid; gap: 3px; color: var(--ink-2); }
.swatches i { display: inline-block; width: 16px; height: 9px; margin-right: 8px; vertical-align: 0; border: 0.75px solid var(--ink); }

/* ---------- menu ---------- */
.menu { display: none; top: calc(12px + var(--safe-t)); right: 66px; width: min(310px, calc(100% - 90px)); z-index: 4; max-height: calc(100% - 40px); }
.menu > .in { max-height: calc(100vh - 70px); overflow: auto; }
.menu.open { display: block; }
.menu .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 0.5px dotted var(--ink-2); font-size: 15px; }
.menu select { font: 400 14.5px var(--serif); background: var(--paper); color: var(--ink); border: 0.75px solid var(--ink); border-radius: 0; padding: 3px 6px; max-width: 58%; }
.menu .toggle { justify-content: flex-start; }
.menu .toggle input { width: 16px; height: 16px; accent-color: var(--ink); margin: 0 4px 0 0; }
.views { display: grid; grid-template-columns: 1fr 1fr; margin: 10px 0 6px; border: 0.5px solid var(--ink); }
.views button { padding: 7px 4px; font: 400 15px var(--serif); border-right: 0.5px solid var(--ink); border-bottom: 0.5px solid var(--ink); }
.views button:nth-child(2n) { border-right: 0; }
.views button:nth-child(n + 3) { border-bottom: 0; }
.views button:hover { background: var(--ink); color: var(--paper); }
.hint { margin: 10px 0 0; color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
.credits-in { font: italic 400 11.5px var(--serif); color: var(--ink-3); margin: 10px 0 0; }
kbd { display: inline-block; min-width: 15px; padding: 0 3px; margin: 0 1px; border: 0.75px solid var(--ink-3); font: 11px/15px var(--serif); text-align: center; }
@media (pointer: coarse) { .hint { display: none; } }

/* ---------- popisky v teréne podľa kartografických pravidiel ---------- */
#labels { position: fixed; inset: 0; pointer-events: none; }
.place { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; text-align: center; font: 600 16px/1.1 var(--serif); color: var(--ink); text-shadow: var(--halo); }
.place::before { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--red); margin-right: 5px; vertical-align: 1px; box-shadow: 0 0 0 1.5px var(--paper); }
.place .t { display: block; font: italic 400 12.5px var(--serif); color: var(--ink-2); margin-top: 1px; }
.place.caps { font: 600 11px var(--serif); letter-spacing: 2.6px; text-transform: uppercase; }
.place.caps::before { display: none; }
.place.small { font-size: 14px; font-weight: 400; }
.place.reached .t { color: var(--red); }
.place.hist { font-weight: 400; font-size: 15px; }
.place.hist::before { width: 6px; height: 6px; background: none; border: 1.5px solid var(--ink); border-radius: 50%; box-shadow: none; }
.place.hist .t { color: var(--ink-2); }
.place.hist.under .t { color: var(--blue); }
.place.hist.emerged .t { color: var(--ochre); }
.place.hist.pop { animation: emerge 1.4s ease-out; }
@keyframes emerge { 0% { transform: translate(-50%, -70%); opacity: 0; } 100% { transform: translate(-50%, -100%); opacity: 1; } }
body:not(.flood) .place:not(.hist) .t { display: none; }
.place.water { font: italic 400 17px var(--serif); letter-spacing: 1.5px; color: var(--blue); }
.place.water::before { display: none; }

/* ---------- zošit ---------- */
dialog { max-width: 600px; margin: auto; }
dialog::backdrop { background: rgba(20, 25, 30, 0.45); }
dialog.frame { position: fixed; }
.book { width: min(520px, calc(100% - 20px)); }
.book .in { padding: 12px 16px 12px; }
.book h2 { font-size: 27px; margin: 8px 0 0; }
.book .fig { margin-top: 10px; }
.book p { font-size: 16.5px; line-height: 1.5; margin: 10px 0 0; min-height: 5.8em; }
#book-action { margin: 4px 0 0; }
#book-action .tlink { color: var(--blue); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 8px; border-top: 0.5px solid var(--ink); }
.pager .tlink:disabled { visibility: hidden; }
.dots i { display: inline-block; width: 7px; height: 7px; border: 0.75px solid var(--ink); transform: rotate(45deg); margin: 0 5px; cursor: pointer; }
.dots i.f { background: var(--ink); }
#about { width: min(600px, calc(100% - 20px)); }
#about .in { max-height: 84vh; overflow: auto; padding: 14px 18px; }
#about h2 { margin-bottom: 8px; }
#about p, #about li { font-size: 15px; line-height: 1.5; }
#about ul { padding-left: 18px; }
#about .warn { color: var(--red); font-style: italic; }

.loading { left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; }
.loading .in { padding: 10px 22px; font: italic 400 19px var(--serif); }
.credits { position: fixed; right: 10px; bottom: 2px; margin: 0; font: italic 400 11px var(--serif); color: var(--ink); text-shadow: var(--halo); pointer-events: none; }
body.busy { cursor: progress; }

/* ---------- mobil ---------- */
@media (max-width: 640px) {
  #cartouche { left: 10px; top: calc(10px + var(--safe-t)); }
  #cartouche .in { padding: 6px 11px 7px; }
  #cartouche h1 { font-size: 17px; letter-spacing: 2.4px; }
  #cartouche .c-s { font-size: 11.5px; }
  .tbtn { right: 10px; top: calc(10px + var(--safe-t)); }
  .sq { width: 40px; height: 40px; }
  #btn-north { display: none; }
  #sheet { left: 8px; right: 8px; width: auto; bottom: calc(8px + var(--safe-b)); max-height: 62%; }
  .frame > .in { padding: 11px 13px 12px; }
  .modes { margin: 12px 3px 3px 0; gap: 7px; }
  .num b { font-size: 38px; }
  h3 { font-size: 21px; }
  .lede { font-size: 15px; }
  #flood-card .lede { display: none; }
  .more-t { display: block; font: italic 400 14px var(--serif); color: var(--ink-2); margin-top: 8px; text-decoration: underline; text-decoration-thickness: 0.5px; text-underline-offset: 3px; }
  .more-t::after { content: " ▾"; font-style: normal; }
  .list.open .more-t::after { content: " ▴"; }
  .more { display: none; }
  .list.open .more { display: block; }
  .credits { display: none; }
  .menu { right: 58px; width: calc(100% - 76px); }
  #story .cap { left: 10px; right: 10px; max-width: none; }
}
@media (max-width: 640px) and (max-height: 700px) { #sheet .fig { display: none; } }

/* ---------- kamerový príbeh ---------- */
#story { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#story .bar { position: absolute; left: 0; right: 0; height: 9vh; background: #111; transition: transform 0.8s ease; }
#story .bar.top { top: 0; }
#story .bar.bottom { bottom: 0; }
#story .cap { position: absolute; left: max(20px, 5vw); bottom: calc(9vh + 26px); max-width: min(560px, calc(100% - 40px));
  opacity: 0; transform: translateY(8px); transition: opacity 0.9s ease, transform 0.9s ease; }
#story.cap-in .cap { opacity: 1; transform: none; }
#story .when { font: 600 10.5px var(--serif); letter-spacing: 2.2px; text-transform: uppercase; color: var(--ink-2); }
#story h2 { margin: 6px 0 0; font: 600 clamp(22px, 3vw, 30px)/1.1 var(--serif); }
#story p { margin: 6px 0 0; font-size: clamp(15px, 1.4vw, 17px); line-height: 1.45; color: var(--ink-2); }
#story .story-ui { position: absolute; left: max(20px, 5vw); right: max(20px, 5vw); bottom: calc(4.5vh - 15px); display: flex; gap: 16px; align-items: center; pointer-events: auto; }
#story .prog { flex: 1; height: 1px; background: rgba(241, 236, 224, 0.3); }
#story .prog i { display: block; height: 100%; width: 0; background: var(--paper); }
.tbtn2 { font: 400 14px var(--serif); color: var(--paper); text-decoration: underline; text-decoration-thickness: 0.5px; text-underline-offset: 3px; }
@media (max-width: 760px) { #story .bar { height: 6vh; } #story .cap { bottom: calc(6vh + 50px); } }
button:focus { outline: none; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
dialog .x:focus-visible { outline: none; }
.swatches b { font-weight: 400; }

/* prepínač jazyka: dve polia ako v legende mapy, zvolený jazyk je vytlačený tušou */
.sq.lang { display: flex; flex-direction: column; padding: 3px; gap: 0; font: 600 10.5px/1 var(--serif); letter-spacing: 1.6px; }
.sq.lang span { flex: 1; display: grid; place-items: center; width: 100%; color: var(--ink-3); padding-left: 1.6px; }
.sq.lang span + span { border-top: 0.5px solid var(--ink); }
.sq.lang span.on { background: var(--ink); color: var(--paper); }
.sq.lang:hover span:not(.on) { color: var(--ink); }
#about [data-thtml] > p:first-child { margin-top: 8px; }

/* srdiečko a okno podpory */
.sq.heart svg { transition: transform 0.15s ease; overflow: visible; }
.sq.heart:hover svg { transform: scale(1.12) rotate(-4deg); }
.support { width: min(460px, calc(100% - 20px)); }
.support .in { padding: 12px 18px 16px; }
.sup-head { display: flex; align-items: center; gap: 12px; margin: 12px 0 2px; }
.sup-head h2 { margin: 0; }
.big-heart { flex: none; overflow: visible; transform: rotate(-6deg); }
.support .lead { font-size: 17px; line-height: 1.45; margin: 10px 0 0; }
.vision-t { font: 600 10.5px var(--serif); letter-spacing: 2.2px; text-transform: uppercase; color: var(--ink-2); margin: 16px 0 4px; }
.vision { list-style: none; margin: 0; padding: 0; border-top: 0.5px solid var(--ink); }
.vision li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 0.5px dotted var(--ink-2); }
.vision .n { font: 600 13px var(--serif); letter-spacing: 1.5px; color: var(--red); text-align: center; border: 0.75px solid var(--ink); padding: 3px 0 2px; }
.vision b { display: block; font: 600 17px/1.2 var(--serif); }
.vision i { display: block; font: italic 400 14.5px/1.4 var(--serif); color: var(--ink-2); margin-top: 2px; }
.support .cta { display: block; margin: 18px 4px 4px 0; padding: 11px 14px; text-align: center; text-decoration: none; font: 600 17px var(--serif); color: var(--paper);
  background: var(--red); border: 1px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); transition: transform 0.08s ease, box-shadow 0.08s ease; }
.support .cta:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.support .cta:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.support .src { margin-top: 8px; }
.support .sign { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; margin: 14px 0 0; padding-top: 10px; border-top: 0.5px solid var(--ink); font: italic 400 15px var(--serif); }
.support .sign span + span { font-size: 12.5px; color: var(--ink-3); }

/* „Chcem podporiť“ – štítok pod kartušou */
.heart-tab { position: absolute; top: 100%; left: -1px; margin-top: 8px; pointer-events: auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px 5px 8px; background: var(--paper); border: 1px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
  font: 600 13px var(--serif); color: var(--ink); white-space: nowrap; transition: transform 0.08s ease, box-shadow 0.08s ease; }
.heart-tab:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.heart-tab:hover svg { transform: scale(1.12) rotate(-4deg); }
.heart-tab svg { overflow: visible; transition: transform 0.15s ease; }
body.story .heart-tab { display: none; }
@media (max-width: 640px) { .heart-tab { font-size: 12.5px; padding: 4px 9px 4px 7px; margin-top: 6px; } }
/* náčrty k vízii */
.sk2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.sk2 figure { margin: 0; border: 0.5px solid var(--ink); background: #f6f2e8; padding: 4px 4px 3px; }
.sk2 svg { display: block; width: 100%; height: auto; overflow: visible; }
.sk2 figcaption { font: italic 400 12px var(--serif); color: var(--ink-2); text-align: center; margin-top: 2px; }
/* podpis s portrétom */
.support .sign { display: flex; flex-direction: row; justify-content: flex-end; align-items: center; gap: 12px; }
.support .sign img { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--ink); padding: 3px; background: var(--paper); box-shadow: 2px 2px 0 rgba(29, 27, 23, 0.25); }
.support .sign div { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.support .sign div span { font: italic 400 14px var(--serif); color: var(--ink-2); }
.support .sign b { font: 600 17px var(--serif); font-style: normal; }

.toast { top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 8; width: min(360px, calc(100% - 40px)); transition: opacity 0.9s ease; }
.toast .in { padding: 14px 22px; font: 600 18px var(--serif); text-align: center; }
.toast.out { opacity: 0; }

/* ---------- dobová fotka: značka v teréne a prelínanie ---------- */
.photo-pin { position: absolute; transform: translate(-50%, calc(-100% - 16px)); pointer-events: auto; display: flex; align-items: center; gap: 6px; padding: 4px 9px 4px 7px; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); font: 600 13px/1 var(--serif); letter-spacing: .4px; cursor: pointer; }
.photo-pin::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 16px; background: var(--ink); }
.photo-pin::before { content: ""; position: absolute; left: calc(50% - 3px); top: calc(100% + 13px); width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(184, 65, 42, .55); animation: pinpulse 2.4s ease-out infinite; }
.photo-pin:hover { background: #fff; }
.photo-pin:active { transform: translate(calc(-50% + 1px), calc(-100% - 15px)); box-shadow: 1px 1px 0 var(--ink); }
@keyframes pinpulse { 0% { box-shadow: 0 0 0 0 rgba(184, 65, 42, .55); } 70%, 100% { box-shadow: 0 0 0 10px rgba(184, 65, 42, 0); } }
body.photo-on .ui, body.photo-on .place { opacity: 0; pointer-events: none; }
.photo { position: fixed; inset: 0; z-index: 30; pointer-events: none; --x: 100%; --o: 0; --a: 1; }
.photo.shown { --o: 1; }
.ph-box { position: absolute; left: var(--bx); top: var(--by); width: var(--bw); height: var(--bh); pointer-events: auto; cursor: ew-resize; touch-action: none; user-select: none; -webkit-user-select: none;
  box-shadow: 0 0 0 1px var(--ink), 0 0 0 6px var(--paper), 0 0 0 7px var(--ink), 0 0 0 100vmax rgba(29, 27, 23, .38); transition: box-shadow .6s; }
.ph-box img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; clip-path: inset(0 calc(100% - var(--x)) 0 0); filter: sepia(.22) contrast(1.04); opacity: calc(var(--o) * var(--a)); transition: opacity .9s ease; pointer-events: none; }
/* prelínanie: fotka cez celý záber, priehľadnosť --a (0 = model, 1 = fotka) */
.photo.mix .ph-box img { clip-path: none; }
.photo.mix .ph-split { display: none; }
.photo.tahaj .ph-box img { transition: none; }
.ph-mode { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; font: 400 13px var(--serif); }
.ph-mode button { font: 600 12px/1 var(--serif); letter-spacing: .5px; padding: 6px 10px; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); cursor: pointer; }
.ph-mode button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.ph-mode label { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ph-mode label[hidden] { display: none; }
.ph-mode input[type=range] { width: 130px; accent-color: var(--ink); }
.ph-mode output { min-width: 3.2em; font-variant-numeric: tabular-nums; }
.ph-split { position: absolute; top: 0; bottom: 0; left: var(--x); width: 0; border-left: 1.5px solid var(--paper); box-shadow: 0 0 0 .5px rgba(29, 27, 23, .6); opacity: var(--o); transition: opacity .9s; }
.ph-k { position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%); width: 38px; height: 38px; display: grid; place-items: center; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); border-radius: 50%; box-shadow: 2px 2px 0 var(--ink); }
.ph-tag { position: absolute; top: 10px; padding: 3px 8px; background: var(--paper); color: var(--ink); font: 600 11px/1 var(--serif); letter-spacing: 2px; text-transform: uppercase; opacity: var(--o); transition: opacity .9s; pointer-events: none; }
.ph-tag.l { left: 10px; } .ph-tag.r { right: 10px; }
.ph-cap { position: absolute; left: 50%; top: calc(var(--by) + var(--bh) + 20px); transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); padding: 12px 16px; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); outline: 1px solid var(--ink); outline-offset: 3px; pointer-events: auto; display: grid; gap: 4px; opacity: var(--o); transition: opacity .9s; font-family: var(--serif); }
.ph-cap b { font: 600 17px/1.2 var(--serif); }
.ph-cap .ph-d { font: 400 14px/1.35 var(--serif); color: var(--ink-2); }
.ph-cap .ph-s { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font: italic 400 12.5px var(--serif); color: var(--ink-3); margin-top: 2px; }
@media (max-width: 640px) { .ph-cap { padding: 10px 12px; } .ph-cap b { font-size: 16px; } .ph-cap .ph-d { font-size: 13px; } }
.heart-tab[hidden] { display: none; }
.dom-l { position: absolute; transform: translate(-50%, -110%); white-space: nowrap; font: italic 400 11.5px/1 var(--serif); color: var(--ink); text-shadow: var(--halo); pointer-events: none; }

/* ---------- Cesta kvapky: štítok pri kliknutí na hrádzu ---------- */
.modes #btn-kvapka .mi { color: var(--blue); }
#dam-chip { position: fixed; z-index: 30; transform: translate(-50%, calc(-100% - 14px)); padding: 3px; min-width: 210px; }
#dam-chip .in { padding: 9px 12px 11px; }
#dam-chip .kick { margin-bottom: 4px; }
#dam-chip p { margin: 0 0 8px; font-size: 14.5px; color: var(--ink-2); }
#dam-chip a { display: inline-block; font: 600 15px var(--serif); color: var(--ink); text-decoration: none; border: 1px solid var(--ink); padding: 5px 11px 6px; background: var(--paper); box-shadow: 3px 3px 0 var(--ink); }
#dam-chip a:hover { background: #fffdf8; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
#dam-chip::after { content: ''; position: absolute; left: 50%; bottom: -8px; width: 12px; height: 12px; background: var(--paper); border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); transform: translateX(-50%) rotate(45deg); }

/* ---------- Ako vznikol model: kroky výpočtu priamo na fotke ---------- */
.ph-tv { justify-self: start; margin-top: 6px; font: 600 13px/1 var(--serif); letter-spacing: .4px; padding: 8px 12px; background: var(--red); color: #fff; border: 1px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); cursor: pointer; }
.ph-tv:hover { filter: brightness(1.08); } .ph-tv[hidden] { display: none; }
.ph-box img.ph-full { clip-path: none; filter: none; object-fit: cover; opacity: 0; transition: opacity .7s ease; }
.ph-box img.ph-full.on { opacity: 1; }
.ph-box img.ph-full[hidden] { display: none; }
.ph-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
.ph-tvorba[hidden] { display: none; }
.photo.tvorba .ph-cap > :not(.ph-tvorba) { display: none; }
.photo.tvorba .ph-tag, .photo.tvorba .ph-split { display: none; }
.photo.tvorba .ph-box { cursor: default; }
.ph-tvorba { display: grid; gap: 6px; }
.tv-k { font: 600 11px/1 var(--serif); letter-spacing: 2px; text-transform: uppercase; color: var(--red); }
.tv-n { font: 600 19px/1.2 var(--serif); }
.tv-t { margin: 0; font: 400 14px/1.4 var(--serif); color: var(--ink-2); }
.tv-c { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 2px; }
.tv-c div { display: grid; gap: 2px; }
.tv-c b { font: 600 26px/1 var(--serif); font-variant-numeric: tabular-nums; color: var(--ink); }
.tv-c span { font: italic 400 12px var(--serif); color: var(--ink-3); }
.tv-nav { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.tv-nav button:not(.tlink) { font: 600 13px/1 var(--serif); padding: 7px 12px; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); cursor: pointer; }
.tv-nav #tv-next { background: var(--ink); color: var(--paper); }
.tv-nav #tv-end { margin-left: auto; }
.tv-dots { display: flex; gap: 5px; }
.tv-dots i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--ink); }
.tv-dots i.on { background: var(--ink); }
/* kreslenie v SVG */
.ph-svg .bod path { stroke: #ff3b1f; stroke-width: 1.6; fill: none; }
.ph-svg .bod circle { fill: none; stroke: #fff; stroke-width: .8; opacity: .9; }
.ph-svg .bod { transform-box: fill-box; transform-origin: center; animation: tvPop .45s cubic-bezier(.2,1.6,.4,1) both; animation-delay: var(--d); }
.ph-svg .sach { fill: rgba(255, 59, 31, .26); stroke: rgba(255, 255, 255, .55); stroke-width: .5; animation: tvFade .5s ease both; animation-delay: var(--d); }
.ph-svg .zem { stroke: rgba(255, 210, 60, .85); stroke-width: .9; fill: none; }
.ph-svg .hor { stroke: #ffd23c; stroke-width: 1.2; stroke-dasharray: 6 4; fill: none; }
.ph-svg .drot { stroke: #2bff88; stroke-width: 1.6; fill: none; stroke-linejoin: round; filter: drop-shadow(0 0 2px rgba(0, 0, 0, .7)); }
.ph-svg .kresli { stroke-dasharray: 1; stroke-dashoffset: 1; animation: tvDraw 1.1s ease forwards; animation-delay: var(--d); }
.ph-svg text { font: 600 13px var(--serif); fill: #fff; paint-order: stroke; stroke: rgba(29, 27, 23, .85); stroke-width: 3px; }
.ph-svg .kota { stroke: #fff; stroke-width: 1.2; fill: none; filter: drop-shadow(0 0 2px rgba(0, 0, 0, .8)); }
@keyframes tvPop { from { opacity: 0; transform: scale(3); } to { opacity: 1; transform: scale(1); } }
@keyframes tvFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tvDraw { to { stroke-dashoffset: 0; } }
@media (max-width: 640px) { .tv-c b { font-size: 21px; } .tv-n { font-size: 17px; } }

.photo.side .ph-cap { left: var(--capL); top: var(--capT); width: var(--capW); transform: none; max-height: calc(100vh - var(--capT) - 16px); overflow: auto; }
.photo.side .tv-n { font-size: 22px; }
.photo.side .tv-t { font-size: 15px; }
.photo.side .tv-c { flex-direction: column; gap: 12px; margin: 6px 0; }
.photo.side .tv-c b { font-size: 34px; }

/* web bez simulácie prietrže (PRIETRZ_ZAPNUTA v texty.js): skryté hneď od načítania, nič nepreblikne */
body.bez-prietrze .jen-prietrz { display: none !important; }
/* režimy: toľko stĺpcov, koľko je viditeľných tlačidiel (skryté sa nerátajú) */
.modes { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
.modes button[hidden] { display: none; }
.support .cta[hidden] { display: none; }
body.bez-svp .jen-svp { display: none !important; }
/* čas príchodu vody pri mestách len počas vlny a príbehu */
body:not(.flood):not(.story) .place .t.prichod { display: none; }

/* tlačidlá: mäkký tieň ako kartuša a štvorcové tlačidlá (namiesto tvrdého čierneho) */
.modes button, .heart-tab, .support .cta, .photo-pin, .ph-tv, .tv-nav button:not(.tlink), #dam-chip a, .ph-k { box-shadow: 0 2px 8px rgba(20, 25, 30, 0.2); }
.modes button:hover, .heart-tab:hover, .support .cta:hover, #dam-chip a:hover { box-shadow: 0 4px 12px rgba(20, 25, 30, 0.26); }
.modes button:active, .support .cta:active, .photo-pin:active { box-shadow: 0 1px 3px rgba(20, 25, 30, 0.25); }

/* „Chcem podporiť“ vpravo hore vedľa štvorcových tlačidiel; na mobile len srdce */
.heart-tab { position: fixed; top: calc(12px + var(--safe-t)); right: 64px; left: auto; margin-top: 0; height: 42px; box-sizing: border-box; padding: 0 12px 0 9px; z-index: 3; }
@media (max-width: 640px) {
  .heart-tab { top: calc(10px + var(--safe-t)); right: 58px; width: 40px; height: 40px; padding: 0; justify-content: center; margin-top: 0; }
  .heart-tab span { display: none; }
}
