/* Yakvia — layout and components. Colours and fonts live in brand.css. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 1.5; font-weight: var(--w-regular); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); }
h1, h2, h3 { font-weight: var(--w-bold); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
button { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.light { font-weight: var(--w-light); }
.hidden { display: none !important; }

/* ---------- page shell ---------- */
.page { max-width: 1040px; margin: 0 auto; padding: 20px 16px 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
/* logo: manuál — min. šířka 120 px na webu, kolem ochranná zóna výšky „Y“ */
.brand { display: flex; align-items: center; gap: var(--logo-clear); text-decoration: none; color: var(--ink); padding: calc(var(--logo-clear) / 2) 0; }
.brand-logo { height: var(--logo-h); width: auto; min-width: 120px; display: block; }
.brand-claim { margin: 0; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-2); font-weight: var(--w-medium); }

.player { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .9rem; white-space: nowrap; font-weight: var(--w-medium); color: var(--ink); text-decoration: none; }
.chip strong { font-weight: 700; }
.level { min-width: 190px; }
.xpbar { height: 6px; width: 90px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.xpbar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card h2, .card h3 { margin: 0 0 6px; letter-spacing: -.01em; }
.card h2 { font-size: 1.25rem; }
.card h3 { font-size: 1.05rem; }
.card p { margin: 0 0 12px; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-2); margin: 28px 0 10px; font-weight: var(--w-semibold); }

/* denní výzva: Mountain Brown + Paper White + oranžové tlačítko; čárkovaná trasa
   s bodem na mapě je motiv z manuálu (spodní okraj) */
.hero { position: relative; overflow: hidden; background: var(--hero); color: var(--hero-ink); border: 0; padding: 26px 24px; }
.hero .muted { color: color-mix(in srgb, var(--hero-ink) 82%, transparent); }
.hero .kicker { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; font-weight: var(--w-medium); opacity: .85; }
.hero h2 { color: var(--hero-ink); }
.hero-trail { position: absolute; right: -10px; bottom: -6px; width: 62%; max-width: 520px; height: auto; pointer-events: none; opacity: .95; }
.hero > *:not(.hero-trail) { position: relative; }
.hero .scoreline { font-size: 2rem; font-weight: var(--w-bold); }
.slogan { font-weight: var(--w-semibold); color: var(--accent); letter-spacing: .01em; }

.game-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; transition: transform .12s ease, border-color .12s ease; }
.game-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.game-card .icon { font-size: 30px; }
.game-card .meta { margin-top: auto; display: flex; justify-content: space-between; font-size: .85rem; color: var(--ink-2); }
.tag { display: inline-block; font-size: .72rem; font-weight: var(--w-semibold); padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.tag.warn { background: color-mix(in srgb, var(--mid) 18%, transparent); color: var(--mid); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 18px; background: var(--accent); color: var(--accent-ink); font-weight: var(--w-semibold); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.ghost:hover { background: var(--line); }
.btn.warm { background: var(--accent); color: var(--accent-ink); }
.btn.big { padding: 14px 24px; font-size: 1.05rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px; background: var(--surface-2); font-size: .85rem; }
.badge.locked { opacity: .45; filter: grayscale(1); }

/* ---------- passport ---------- */
.stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 3px double var(--stamp); color: var(--stamp); display: grid; place-items: center; text-align: center; padding: 10px; transform: rotate(-6deg); font-weight: var(--w-bold); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
.stamp small { display: block; font-weight: 600; font-size: .68rem; text-transform: none; letter-spacing: 0; opacity: .8; }
.stamp.empty { border: 2px dashed var(--line); color: var(--ink-2); transform: none; font-weight: 600; text-transform: none; }
.stamp:nth-child(3n) { transform: rotate(5deg); }
.stamp:nth-child(4n) { transform: rotate(-2deg); }

/* ---------- game: Kde jsem? ---------- */
.stage { position: fixed; inset: 0; background: #000; }
.stage .psv-container { position: absolute; inset: 0; }
.hud { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; justify-content: space-between; gap: 10px; pointer-events: none; z-index: 20; }
.hud > * { pointer-events: auto; }
.hud .chip { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(6px); }
.guess-panel { position: absolute; right: 14px; bottom: 14px; width: 340px; height: 250px; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 30px rgba(0,0,0,.45); z-index: 20; transition: width .18s ease, height .18s ease; background: var(--surface); display: flex; flex-direction: column; }
.guess-panel:hover, .guess-panel.pinned { width: min(620px, calc(100vw - 28px)); height: min(440px, calc(100vh - 110px)); }
.guess-panel .map { flex: 1; min-height: 0; }
.guess-panel .actions { display: flex; gap: 8px; padding: 8px; background: var(--surface); }
.guess-panel .actions .btn { flex: 1; }
.map-toggle { display: none; }
@media (max-width: 720px) {
  .guess-panel { left: 8px; right: 8px; width: auto; bottom: 8px; height: 46vh; transform: translateY(calc(100% + 20px)); transition: transform .2s ease; }
  .guess-panel:hover { width: auto; height: 46vh; }
  .guess-panel.open { transform: none; }
  .map-toggle { display: inline-flex; position: absolute; right: 12px; bottom: 16px; z-index: 21; transition: bottom .2s ease; }
  .guess-panel.open ~ .map-toggle { bottom: calc(46vh + 18px); }
}

.result { position: absolute; inset: 0; z-index: 30; display: grid; grid-template-columns: 1fr 380px; background: var(--bg); }
.result .map { position: relative; min-height: 0; }
.result aside { padding: 18px; overflow: auto; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.result .points { font-size: 2.2rem; font-weight: var(--w-bold); letter-spacing: -.02em; }
.result .dist { font-size: 1.05rem; }
.meter { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--bad), var(--mid), var(--good)); }
.reveal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.reveal .place { font-weight: var(--w-bold); font-size: 1.15rem; }
.reveal ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.attrib { font-size: .78rem; color: var(--ink-2); }
.new-stamp { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 2px dashed var(--stamp); color: var(--stamp); font-weight: 700; animation: pop .35s ease; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 860px) {
  .result { grid-template-columns: 1fr; grid-template-rows: 44vh 1fr; }
  .result aside { border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- summary ---------- */
.summary { max-width: 760px; margin: 0 auto; }
.summary table { width: 100%; border-collapse: collapse; }
.summary td, .summary th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.summary td.num, .summary th.num { text-align: right; }
.bigscore { font-size: 3rem; font-weight: var(--w-bold); letter-spacing: -.03em; line-height: 1; }

/* ---------- quiz games ---------- */
.quiz { max-width: 820px; margin: 0 auto; }
.question { font-size: 1.5rem; font-weight: var(--w-bold); letter-spacing: -.01em; margin: 6px 0 4px; }
.slider { width: 100%; accent-color: var(--accent); }
.km-input { width: 150px; font: inherit; font-size: 1.4rem; font-weight: var(--w-bold); padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-align: right; }
.mini-map { height: 280px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); margin-top: 14px; }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .vs { grid-template-columns: 1fr; } }
.city { text-align: center; padding: 26px 16px; }
.city .name { font-size: 1.5rem; font-weight: var(--w-bold); }
.city .val { font-size: 2.4rem; font-weight: var(--w-bold); margin-top: 8px; }
.city .val.unknown { color: var(--ink-2); }
.city.correct { border-color: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 30%, transparent); }
.city.wrong { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 30%, transparent); }
.choice { display: grid; gap: 10px; margin-top: 14px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 100; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%); }

.dev-banner { background: color-mix(in srgb, var(--mid) 16%, transparent); color: var(--ink); border: 1px solid color-mix(in srgb, var(--mid) 45%, transparent); padding: 8px 12px; border-radius: 10px; font-size: .85rem; }
.footer { margin-top: 36px; font-size: .82rem; color: var(--ink-2); display: flex; gap: 14px; flex-wrap: wrap; }
.maplibregl-ctrl-attrib { font-size: 10px; }
