/* Politická karikatúra: čierny tuš na bielom papieri s novinovým rastrom, jediná farba je červená. Jeden stĺpec, obrazovky sa striedajú. */
:root {
  --paper: #FFFFFF;
  --ink: #111111;
  --red: #E10600;
  --dot: rgba(0,0,0,.10);
  --muted: #4B4B4B;
  --hand: "Caveat Brush", "Comic Sans MS", cursive;
  --text: "Patrick Hand", "Comic Sans MS", "Segoe Print", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
html { overflow: hidden; }
body {
  margin: 0;
  background-color: var(--paper); color: var(--ink); font-family: var(--text); font-size: 18px; line-height: 1.2;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 7px 7px;
  padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px));
  padding-block: max(14px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px dashed var(--red); outline-offset: 3px; }
.wrap {
  --fit-scale: 1;
  max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; min-height: 100%;
  transform: scale(var(--fit-scale)); transform-origin: top center;
}
.screen { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.hand { font-family: var(--hand); font-weight: 400; }
.caption { align-self: flex-start; background: var(--ink); color: #FFF; padding: 2px 10px; font-size: 17px; transform: rotate(-1.2deg); max-width: 100%; }
.caption.red { background: var(--red); }
.panel { border: 4px solid var(--ink); background: var(--paper); box-shadow: 6px 6px 0 var(--ink); position: relative; }
.btn { min-height: 56px; border: 4px solid var(--ink); background: var(--paper); box-shadow: 4px 4px 0 var(--ink); font-family: var(--hand); font-size: 24px; line-height: 1; padding: 6px 10px; border-radius: 10px 6px 12px 8px; }
.btn.red { background: var(--red); color: #FFF; }
.btn.black { background: var(--ink); color: #FFF; box-shadow: 4px 4px 0 var(--red); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.small-btn { min-height: 44px; border: 3px solid var(--ink); background: var(--paper); font-size: 17px; border-radius: 10px 6px 12px 8px; padding: 4px 10px; }
.small-btn[aria-pressed="true"] { background: var(--ink); color: #FFF; }

/* Úvod */
.title { margin: 0; font-family: var(--hand); font-weight: 400; font-size: clamp(58px, 18vw, 78px); line-height: .82; }
.lens { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.toggles { display: flex; flex-direction: column; gap: 4px; font-size: 19px; }
.toggles label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.toggles input { width: 20px; height: 20px; accent-color: var(--red); margin: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.settings-dialog { width: min(400px, calc(100% - 28px)); padding: 0; border: 0; background: transparent; overflow: visible; color: var(--ink); }
.settings-dialog::backdrop { background: rgba(17, 17, 17, .45); }
.settings-panel { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.settings-panel h2 { margin: 0; font-family: var(--hand); font-weight: 400; font-size: 40px; line-height: .9; }
.settings-meta { margin: 0; display: grid; gap: 0; }
.settings-meta div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 2px dashed #9A9A9A; font-size: 14px; }
.settings-meta dt { color: var(--muted); }
.settings-meta dd { margin: 0; max-width: 58%; text-align: right; overflow-wrap: anywhere; }
.analytics-dialog { width: min(420px, calc(100% - 28px)); padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible; }
.analytics-dialog::backdrop { background: rgba(17, 17, 17, .45); }
.analytics-panel { padding: 14px; display: grid; gap: 10px; }
.analytics-panel strong { font-family: var(--hand); font-size: 27px; font-weight: 400; }
.analytics-panel p { margin: 0; font-size: 17px; line-height: 1.15; }
.analytics-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: stretch; }
.analytics-actions .btn { min-height: 44px; font-size: 19px; }
.install-btn { min-height: 48px; font-size: 21px; }

/* HUD */
.hud { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
.meter { display: flex; align-items: flex-end; gap: 6px; min-width: 0; }
.col { width: 22px; height: 54px; border: 3px solid var(--ink); position: relative; overflow: hidden; background: #FFF; flex: none; transition: border-width .2s; }
.col i { position: absolute; left: 0; right: 0; bottom: 0; transition: height .7s steps(7); }
.col.danger { border-color: var(--red); }
.col.edge { border-width: 5px; }
.mval { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.mval b { font-family: var(--hand); font-weight: 400; font-size: 26px; }
.mval b.danger { color: var(--red); }
.mval span { font-size: 15px; }
.mval em { font-style: normal; font-size: 15px; color: var(--ink); min-height: 15px; }
.mval em.bad { color: var(--red); }
#v-geo { font-size: 23px; }
.kronika-btn { min-height: 44px; min-width: 44px; border: 3px solid var(--ink); background: #FFF; border-radius: 50% 45% 55% 48%; display: flex; align-items: center; justify-content: center; padding: 0; }

/* Karta */
.stage { flex: 1; display: flex; flex-direction: column; }
.card { flex: 1; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; transform: rotate(-.8deg); }
.card.dragging { cursor: grabbing; }
.card.settle { transition: transform .22s ease, opacity .22s ease; }
.card.crisis { border-color: var(--red); box-shadow: 6px 6px 0 var(--red); }
.card h2 { margin: 0; font-family: var(--hand); font-weight: 400; font-size: 36px; line-height: .9; text-wrap: balance; }
.scene { width: 100%; height: auto; display: block; }
.question { margin: 0; border: 3px solid var(--ink); border-radius: 50% 46% 52% 48% / 30% 34% 28% 32%; padding: 12px 18px; font-family: var(--hand); font-size: 24px; line-height: 1; text-align: center; position: relative; }
.question::before { content: ""; position: absolute; left: 22%; top: -14px; width: 18px; height: 18px; background: #FFF; border-left: 3px solid var(--ink); border-top: 3px solid var(--ink); transform: skewY(-30deg) rotate(20deg); }
.whispers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.whisper { overflow-wrap: anywhere; border: 3px dashed var(--ink); border-radius: 16px 12px 18px 10px; padding: 6px 8px; font-size: 16px; line-height: 1.08; min-width: 0; }
.whisper b { color: var(--red); font-weight: 400; font-family: var(--hand); font-size: 19px; }
.whisper ul { margin: 2px 0 0; padding-left: 14px; }
.whisper li + li { margin-top: 3px; }
.stamp { position: absolute; top: 46px; font-family: var(--hand); font-size: 30px; line-height: 1; padding: 4px 10px; border: 4px solid; border-radius: 6px; background: #FFF; opacity: 0; pointer-events: none; z-index: 3; }
.stamp.l { right: 12px; color: var(--ink); transform: rotate(10deg); }
.stamp.r { left: 12px; color: var(--red); transform: rotate(-10deg); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choices .btn { font-size: 21px; }
.warn { margin: 0; font-size: 16px; color: var(--red); text-align: center; }
.hint { margin: 0; font-size: 15px; color: var(--muted); text-align: center; }

/* Dopad a koniec */
.result { padding: 14px; display: flex; flex-direction: column; gap: 10px; transform: rotate(.6deg); }
.result .kicker { font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.result h2 { margin: 0; font-family: var(--hand); font-weight: 400; font-size: 40px; line-height: .9; overflow-wrap: anywhere; }
.big-stamp { position: static; align-self: flex-start; margin: 10px 0 4px 6px; border: 5px solid var(--red); color: var(--red); font-family: var(--hand); font-size: 32px; line-height: 1; padding: 4px 10px; transform: rotate(-5deg); background: #FFF; border-radius: 6px; }
.big-stamp.no { border-color: var(--ink); color: var(--ink); }
.reactions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: end; }
.react { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.react p { overflow-wrap: anywhere; margin: 0; border: 3px solid var(--ink); border-radius: 50% 45% 52% 48% / 40% 46% 42% 48%; padding: 10px 10px; font-family: var(--hand); font-size: 19px; line-height: 1; text-align: center; width: 100%; }
.deltas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; border: 3px solid var(--ink); border-radius: 10px 6px 12px 8px; padding: 8px; }
.deltas div { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.deltas b { font-family: var(--hand); font-weight: 400; font-size: 28px; }
.deltas b.bad { color: var(--red); }
.deltas span { font-size: 15px; }
.fact { margin: 0; border: 3px dashed var(--ink); padding: 8px 10px; font-size: 16.5px; line-height: 1.2; }
.fact strong { display: block; font-family: var(--hand); font-weight: 400; font-size: 21px; }
.fact a { color: var(--red); }
.cause { margin: 0; background: var(--red); color: #FFF; padding: 6px 10px; font-size: 16px; line-height: 1.15; transform: rotate(-.8deg); }
.cause strong { display: block; font-family: var(--hand); font-weight: 400; font-size: 20px; }
.eval { margin: 0; display: grid; gap: 0; }
.eval div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 2px dashed #9A9A9A; font-size: 17px; }
.eval dd { margin: 0; text-align: right; font-family: var(--hand); font-size: 22px; }

/* Kronika */
.kronika { height: calc(100dvh - 28px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.kronika-header { padding: 12px; border-bottom: 3px solid var(--ink); background: var(--paper); position: sticky; top: 0; z-index: 2; }
.kronika h2 { margin: 0; font-family: var(--hand); font-weight: 400; font-size: 40px; line-height: .9; }
.kronika-header p { margin: 5px 0 0; color: var(--muted); font-size: 16px; line-height: 1.2; }
.kronika-header #log-count { margin: 4px 0 0; color: var(--red); font-family: var(--hand); font-size: 18px; line-height: 1; }
.kronika-intro { max-width: 34ch; }
.log-filter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.log-filter .small-btn { min-height: 40px; padding: 4px 6px; }
.log { list-style: none; margin: 0; padding: 12px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.log-entry { border: 3px solid var(--ink); border-radius: 8px 5px 10px 6px; padding: 10px; background: var(--paper); font-size: 17px; line-height: 1.28; box-shadow: 3px 3px 0 var(--ink); }
.log-entry.crisis-entry { border-color: var(--red); box-shadow: 3px 3px 0 var(--red); }
.log-entry-head { display: flex; align-items: flex-start; gap: 8px; }
.log-entry h3 { margin: 0; font-family: var(--hand); font-size: 25px; font-weight: 400; line-height: .95; overflow-wrap: anywhere; }
.log .y { flex: none; font-family: var(--hand); font-size: 21px; line-height: 1; }
.log-choice { margin: 8px 0 0; font-size: 17px; }
.log-choice b { font-weight: 400; font-family: var(--hand); font-size: 22px; }
.log-impact { display: flex; flex-wrap: wrap; gap: 4px 7px; margin-top: 7px; padding-top: 7px; border-top: 2px dashed #9A9A9A; font-size: 16px; color: var(--muted); }
.log-impact strong { color: var(--ink); font-weight: 400; }
.log-fact { margin-top: 8px; border-top: 2px dashed #9A9A9A; padding-top: 7px; }
.log-fact summary { min-height: 32px; cursor: pointer; color: var(--red); font-family: var(--hand); font-size: 19px; line-height: 1.1; }
.log-fact p { margin: 5px 0 0; font-size: 16px; line-height: 1.3; }
.log .gov-entry { border-left: 5px solid var(--ink); padding: 8px 10px; font-size: 17px; line-height: 1.2; background: #F4F4F4; }
.log .gov { background: var(--ink); color: #FFF; padding: 2px 8px; display: inline-block; font-family: var(--hand); font-size: 20px; }
.log .crisis { color: var(--red); }
.log .d { font-size: 15px; color: var(--muted); }
.log a { color: var(--red); }
.empty { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .card.settle, .col i { transition: none; } }
@media (max-height: 700px) {
  body { padding-block: max(8px, env(safe-area-inset-top, 0px)); }
  .wrap, .screen { gap: 6px; }
  .title { font-size: clamp(48px, 16vw, 64px); }
  #s-intro > .panel .scene { max-height: 170px; }
  .lens { gap: 6px; }
  .small-btn { min-height: 38px; padding: 2px 7px; font-size: 15px; }
  .btn { min-height: 48px; padding: 4px 8px; }
  .hud { gap: 5px; }
  .meter { gap: 4px; }
  .col { width: 18px; height: 40px; border-width: 2px; }
  .mval b { font-size: 20px; }
  .mval span, .mval em { font-size: 11px; min-height: 11px; }
  #v-geo { font-size: 18px; }
  .hud .meter > svg { width: 38px; height: 40px; }
  .caption { padding: 2px 8px; font-size: 14px; }
  .kronika-btn { min-height: 38px; min-width: 38px; }
  .top-actions { gap: 6px; }
  .stage { min-height: 0; }
  .card { padding: 6px 7px 7px; gap: 4px; }
  .card h2 { font-size: 27px; }
  .card > .scene { height: 108px; }
  .question { padding: 6px 10px; font-size: 18px; }
  .question::before { top: -10px; width: 14px; height: 14px; }
  .whispers { gap: 5px; }
  .whisper { border-width: 2px; padding: 4px 5px; font-size: 12.5px; line-height: 1.02; }
  .whisper b { font-size: 15px; }
  .whisper ul { padding-left: 12px; }
  .whisper li + li { margin-top: 2px; }
  .stamp { top: 32px; font-size: 20px; padding: 2px 6px; border-width: 3px; }
  .choices { gap: 8px; }
  .choices .btn { min-height: 44px; border-width: 3px; font-size: 16px; }
  .hint { font-size: 11px; }
  .result { padding: 8px; gap: 6px; }
  .result h2 { font-size: 30px; }
  .big-stamp { margin: 4px 0 2px; font-size: 24px; border-width: 4px; }
  .react p { padding: 6px; font-size: 15px; }
  .react svg { width: 60px; height: 68px; }
  .deltas { padding: 5px; gap: 5px; }
  .deltas b { font-size: 22px; }
  .deltas span, .fact { font-size: 13px; }
  .eval div { padding: 3px 0; font-size: 14px; }
  .eval dd { font-size: 18px; }
  .kronika { height: calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
  .kronika-header { padding: 9px; }
  .kronika h2 { font-size: 34px; }
  .kronika-header p, .kronika-intro { font-size: 14px; }
  .log { padding: 9px; gap: 9px; }
  .log-entry { padding: 9px; font-size: 16px; }
  .log-entry h3 { font-size: 23px; }
  .log-choice { font-size: 16px; }
  .log-choice b { font-size: 20px; }
  .log-impact, .log-fact p { font-size: 15px; }
  .log-filter .small-btn { min-height: 36px; font-size: 14px; }
  .analytics-panel { padding: 10px; gap: 7px; }
  .analytics-panel strong { font-size: 21px; }
  .analytics-panel p { font-size: 14px; }
  .analytics-actions .btn, .analytics-actions .small-btn { min-height: 36px; font-size: 14px; }
  .install-btn { min-height: 42px; font-size: 18px; }
}
