:root {
  --y: #f2b705; --y2: #ffd84d; --ink: #1d2433; --mut: #5d6678; --bg: #fff8e6; --card: #fff;
  --bp: #1f5592; --ok: #2fa84f; --bad: #e0453a; --line: #e8dcc0;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* hidden musí vyhrát nad vlastním display (karta, toast, menu…) */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
body { user-select: none; -webkit-user-select: none; }
#app { height: 100%; max-width: 640px; margin: 0 auto; position: relative; }
.scr { position: absolute; inset: 0; display: flex; flex-direction: column; }
.scr[hidden] { display: none; }
.scroll { flex: 1; overflow-y: auto; padding: 12px 16px 16px; -webkit-overflow-scrolling: touch; }

/* úvod */
#uvod { padding: 24px 16px; gap: 18px; justify-content: center;
  background: repeating-linear-gradient(-45deg, #fff8e6 0 22px, #fff3d1 22px 44px); }
.hero { text-align: center; display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }
.heroImg { width: 100%; flex: 1; min-height: 0; max-height: 52vh; object-fit: cover; object-position: center 35%; display: block; border-radius: 26px; box-shadow: 0 6px 0 rgba(0,0,0,.1); order: 2; }
.heroTx { order: 1; }
h1 { font-size: 34px; margin: 0; line-height: 1.05; letter-spacing: -.5px; }
.sub { color: var(--ink); margin: 6px 0 0; font-size: 17px; font-weight: 600; }
#uvod { justify-content: flex-start; padding-top: max(16px, env(safe-area-inset-top)); }
.mut { color: var(--mut); font-weight: 500; }
.menu { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border-radius: 18px; padding: 16px; box-shadow: 0 3px 0 var(--line); display: flex; flex-direction: column; gap: 10px; }
.card label { font-weight: 700; font-size: 18px; }
input { font: inherit; font-size: 20px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); width: 100%; }
input:focus { outline: none; border-color: var(--y); }
.stat { text-align: center; color: var(--mut); font-weight: 600; }

/* tlačítka */
.btn { font: inherit; font-weight: 700; font-size: 18px; border: 0; border-radius: 16px; padding: 12px 16px; background: #fff; color: var(--ink);
  box-shadow: 0 4px 0 #d9ccb0; cursor: pointer; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #d9ccb0; }
.btn.big { font-size: 22px; padding: 16px; }
.btn.y { background: var(--y); box-shadow: 0 4px 0 #b88a00; }
.btn.y:active { box-shadow: 0 1px 0 #b88a00; }
.btn.small { font-size: 15px; padding: 8px 12px; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--mut); }
.btn.red { background: var(--bad); color: #fff; box-shadow: 0 4px 0 #9b2a22; }
.btn[disabled] { opacity: .45; }
.ib { font: inherit; font-size: 22px; width: 46px; height: 46px; border-radius: 14px; border: 0; background: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.15);
  display: grid; place-items: center; cursor: pointer; color: var(--ink); flex: none; padding: 0; }
.ib:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.15); }
.ib.small { width: 36px; height: 36px; font-size: 17px; }
.ib.on { background: var(--y); }

/* lišta */
.bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--y); }
.bar h2 { margin: 0; font-size: 21px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .stat { color: var(--ink); }
.foot { padding: 10px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); display: flex; gap: 10px; }
.foot .btn { flex: 1; }

/* zakázky */
.list { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; }
.scroll .list { padding: 12px 0; }
.zak { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 18px; padding: 12px 14px; box-shadow: 0 3px 0 var(--line); border: 0; font: inherit; text-align: left; width: 100%; cursor: pointer; color: var(--ink); }
.zak .em { font-size: 40px; width: 52px; text-align: center; flex: none; }
.zak .tx { flex: 1; min-width: 0; }
.zak b { font-size: 18px; display: block; }
.zak small { color: var(--mut); font-size: 14px; }
.zak .hv { font-size: 18px; letter-spacing: 1px; flex: none; }
.zak.zam { opacity: .55; }
.zak.zam .porImg { filter: grayscale(.8); }
.sekce { position: relative; margin: 14px 0 2px; border-radius: 18px; overflow: hidden; height: 120px; box-shadow: 0 3px 0 var(--line); }
.sekce:first-child { margin-top: 0; }
.sekce .banner { width: 100%; height: 100%; object-fit: cover; display: block; }
.sekce.zam .banner { filter: grayscale(.7) brightness(.85); }
.sekceTx { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 22px 12px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,.62)); color: #fff; font-weight: 800; font-size: 21px; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.sekceTx small { font-size: 14px; font-weight: 700; }
.por { position: relative; width: 58px; height: 58px; flex: none; }
.porImg { width: 58px; height: 58px; object-fit: contain; display: block; }
.porImg.emo, span.porImg { font-size: 42px; display: grid; place-items: center; }
.zamekIk { position: absolute; right: -4px; bottom: -4px; font-style: normal; font-size: 20px; }
.bytBtn { display: inline-block; margin-left: 6px; font-size: 22px; background: #fff4c7; border-radius: 10px; padding: 2px 6px; }
.bubble .who .porImg { width: 72px; height: 72px; }
.rozpocet { margin: -4px 2px 12px; font-size: 16px; color: var(--mut); }
.mi { width: 38px; height: 38px; object-fit: contain; display: block; }
.mat .mi { width: 40px; height: 40px; }
.obj .mi { width: 46px; height: 46px; }
.tim { width: 54px; height: 54px; object-fit: contain; flex: none; }
.inspImg { width: 84px; height: 84px; object-fit: contain; flex: none; }
.slavaIlu { width: 110px; height: 110px; object-fit: contain; display: block; margin: 0 auto; }
span.slavaIlu { font-size: 64px; display: block; }
.kamImg { width: 120px; height: auto; display: block; }
.ucet { background: #fff; border-radius: 16px; padding: 10px 14px; box-shadow: 0 3px 0 var(--line); font-size: 16px; display: flex; flex-direction: column; gap: 4px; }
.ucet > div { display: flex; justify-content: space-between; gap: 8px; }
.ucet small { color: var(--mut); }
.ucet .cerv { color: var(--bad); }
.slavaUcet { text-align: left; margin: 0 0 12px; background: #fff8e6; box-shadow: none; font-size: 15px; }
.slavaUcet .zisk { border-top: 2px solid var(--line); padding-top: 4px; font-size: 17px; font-weight: 800; }
.obchod { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.zbozi { font: inherit; border: 0; background: #fff; border-radius: 16px; padding: 8px 4px; box-shadow: 0 3px 0 var(--line); display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink); cursor: pointer; }
.zbozi img { width: 64px; height: 64px; object-fit: contain; }
.zbozi b { font-size: 14px; } .zbozi small { color: var(--mut); font-weight: 700; }
.zbozi.drahe { opacity: .5; }
.zamek { position: fixed; inset: 0; z-index: 18; background: rgba(20,25,35,.85); display: flex; align-items: center; justify-content: center; padding: 16px; }
.zamek[hidden] { display: none; }
.zamekIn { background: #fff; border-radius: 26px; padding: 22px 18px; text-align: center; max-width: 380px; }
.zamekIlu { width: 140px; height: 140px; object-fit: contain; }
.rodPrehled { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.rodPrehled div { background: #fff; border-radius: 14px; padding: 8px 10px; box-shadow: 0 2px 0 var(--line); }
.rodPrehled b { display: block; font-size: 19px; } .rodPrehled small { color: var(--mut); }
.graf { display: flex; gap: 6px; align-items: flex-end; height: 100px; margin: 4px 0 10px; }
.graf .sl { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; font-size: 12px; }
.graf i { width: 100%; background: var(--y); border-radius: 6px 6px 0 0; }
.graf b { font-size: 12px; color: var(--mut); }
select { font: inherit; font-size: 16px; padding: 8px; border-radius: 10px; border: 2px solid var(--line); background: #fff; max-width: 55%; }
.set small { font-size: 13px; }
.zak.rozd { outline: 3px dashed var(--y); }

/* brief */
.bubble { display: flex; gap: 12px; align-items: flex-start; background: #fff; border-radius: 18px; padding: 12px; box-shadow: 0 3px 0 var(--line); margin-bottom: 14px; }
.bubble .who { font-size: 46px; line-height: 1; }
.bubble p { margin: 4px 0 6px; font-size: 17px; line-height: 1.35; }
.vk { background: var(--bp); border-radius: 14px; padding: 8px; color: #eaf3ff; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.tabs button { font: inherit; font-size: 14px; font-weight: 700; padding: 7px 10px; border-radius: 10px; border: 1.5px solid rgba(234,243,255,.4); background: transparent; color: #eaf3ff; white-space: nowrap; cursor: pointer; }
.tabs button.on { background: #eaf3ff; color: var(--bp); }
.vkPlocha svg, .vkMini svg { width: 100%; height: auto; max-height: 52vh; display: block; }
.vkMini { background: var(--bp); border-radius: 12px; padding: 6px; margin-bottom: 12px; }
.razitko { display: grid; grid-template-columns: auto 1fr; gap: 0; border: 1.5px solid rgba(234,243,255,.7); margin-top: 8px; font-size: 12px; }
.razitko span { padding: 4px 6px; border-bottom: 1px solid rgba(234,243,255,.35); }
.razitko span:nth-child(odd) { opacity: .75; border-right: 1px solid rgba(234,243,255,.35); }
.razitko span:nth-last-child(-n+2) { border-bottom: 0; }
.legenda { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-top: 12px; font-size: 14px; color: var(--mut); }
.legenda div { display: flex; align-items: center; gap: 8px; }
.legenda svg { width: 26px; height: 26px; flex: none; border-radius: 4px; }
.hint { color: var(--mut); font-size: 16px; line-height: 1.4; margin: 0 0 12px; }

/* objednávka */
.obj { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 16px; padding: 10px 12px; box-shadow: 0 3px 0 var(--line); margin-bottom: 10px; }
.obj .em { font-size: 32px; }
.obj .tx { flex: 1; font-weight: 700; font-size: 17px; }
.obj .num { font-size: 28px; font-weight: 800; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }

/* stavba */
.full { background: #bfe3ff; }
#scena, #scenaMesto { position: absolute; inset: 0; }
#scena canvas, #scenaMesto canvas { display: block; }
.hud { position: absolute; z-index: 2; }
.hud.top { top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: 10px; padding-top: max(10px, env(safe-area-inset-top)); pointer-events: none; }
.hud.top > * { pointer-events: auto; }
.ttl { flex: 1; background: rgba(255,255,255,.92); border-radius: 14px; padding: 5px 10px; min-width: 0; box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.ttl b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttl span { font-size: 13px; color: var(--mut); font-weight: 600; }
.mini { position: absolute; z-index: 2; left: 10px; top: calc(max(10px, env(safe-area-inset-top)) + 58px); width: 112px; background: var(--bp); border-radius: 10px; padding: 3px; box-shadow: 0 3px 0 rgba(0,0,0,.2); cursor: pointer; }
.mini svg { width: 100%; height: auto; display: block; }
.mini[hidden] { display: none; }
.hud.side { right: 10px; top: 50%; transform: translateY(-60%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vr { background: rgba(255,255,255,.92); border-radius: 10px; padding: 4px 6px; font-size: 12px; font-weight: 700; text-align: center; max-width: 76px; line-height: 1.15; }
.hud.cam { left: 10px; top: 50%; transform: translateY(-20%); display: flex; flex-direction: column; gap: 6px; }
.hud.cam .ib { width: 40px; height: 40px; font-size: 19px; }
.hud.bottom { left: 0; right: 0; bottom: 0; padding: 8px 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.18)); }
.paleta { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.mat { flex: none; width: 64px; height: 70px; border-radius: 14px; border: 3px solid transparent; background: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.18); font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; padding: 0; color: var(--ink); position: relative; }
.mat .em { font-size: 26px; line-height: 1; }
.mat small { font-size: 11px; font-weight: 700; }
.mat .cnt { position: absolute; top: -6px; right: -6px; background: var(--ink); color: #fff; border-radius: 10px; font-size: 12px; font-weight: 800; padding: 1px 6px; }
.mat.on { border-color: var(--y); background: #fff4c7; transform: translateY(-3px); }
.mat.off { opacity: .35; }
.akce { display: flex; gap: 8px; }
.akce .btn { flex: 1; font-size: 17px; padding: 12px 8px; }
.pulse { animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.12); background: var(--y2); } }
.toast { position: fixed; z-index: 25; left: 50%; top: 22%; transform: translateX(-50%); width: min(88%, 420px); background: #fff; border-radius: 18px; padding: 12px 14px; font-size: 17px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.25); display: flex; gap: 10px; align-items: center; line-height: 1.3; }
.toast[hidden] { display: none; }
.toast .em { font-size: 34px; }
.kamion { position: absolute; z-index: 6; top: 40%; left: 0; font-size: 64px; animation: jede 2.4s linear forwards; transform: scaleX(-1); }
.kamion[hidden] { display: none; }
@keyframes jede { from { left: -30%; } to { left: 110%; } }

/* město */
.mestoList { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; overflow-x: auto; padding: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); scrollbar-width: none; }
.mestoList .chip { flex: none; background: rgba(255,255,255,.94); border-radius: 14px; padding: 8px 12px; font-weight: 700; font-size: 14px; box-shadow: 0 3px 0 rgba(0,0,0,.15); border: 0; font-family: inherit; color: var(--ink); }

/* sheet */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(20,25,35,.5); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheetIn { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheetIn h3 { margin: 0 0 10px; font-size: 21px; }
.sheetIn p { font-size: 17px; line-height: 1.4; margin: 0 0 12px; }
.sheetIn .row { display: flex; gap: 10px; margin-top: 12px; }
.sheetIn .row .btn { flex: 1; }
.insp { display: flex; gap: 12px; align-items: flex-start; }
.insp .em { font-size: 52px; line-height: 1; }
.set { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 600; }

/* oslava */
.slava { position: fixed; inset: 0; z-index: 30; background: rgba(20,25,35,.6); display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 16px; }
.slava[hidden] { display: none; }
.slavaIn { background: #fff; border-radius: 26px; padding: 22px 18px; text-align: center; width: min(100%, 400px); position: relative; animation: pop .35s cubic-bezier(.3,1.6,.6,1); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.slavaIn h2 { margin: 6px 0; font-size: 26px; }
.hvezdy { font-size: 46px; letter-spacing: 4px; margin: 6px 0; }
.hvezdy span { display: inline-block; animation: pop .4s backwards; }
.hvezdy .ne { filter: grayscale(1); opacity: .3; }
.duvody { text-align: left; font-size: 15px; color: var(--mut); margin: 8px 0 14px; line-height: 1.6; }
.stamp { position: absolute; top: 14px; right: -6px; transform: rotate(14deg); border: 4px solid var(--bad); color: var(--bad); font-weight: 900; font-size: 15px; padding: 4px 8px; border-radius: 8px; animation: stamp .5s .3s backwards; background: rgba(255,255,255,.85); }
@keyframes stamp { from { transform: rotate(14deg) scale(3); opacity: 0; } }
.konf { position: absolute; top: -20px; width: 10px; height: 16px; animation: pad linear forwards; }
@keyframes pad { to { transform: translateY(110vh) rotate(720deg); } }
.slavaIn .btn { width: 100%; margin-top: 8px; }
