/* Odkrywca Europy - ekrany aplikacji */
#app { min-height: 100%; display: flex; flex-direction: column; }
.screen { flex: 1; min-height: 0; }
.page { max-width: 1040px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
.page h2 { font-size: 26px; margin: 8px 0 12px; }
.card { background: var(--panel); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h3 { margin: 4px 0 10px; font-size: 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.center { justify-content: center; }
.btn-sm { padding: 8px 12px; font-size: 14px; border-radius: 12px; }
.inp { font: inherit; font-size: 17px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--chip); background: var(--panel); color: var(--ink); width: 100%; outline: none; }
.inp:focus { border-color: var(--accent); }
.inp-num { width: 110px; }
.lbl { display: block; font-weight: 800; margin: 14px 0 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; background: var(--chip); padding: 5px; border-radius: 16px; margin-bottom: 12px; }
.seg-b { flex: 1 1 auto; border: 0; background: transparent; padding: 10px 12px; border-radius: 12px; font-weight: 800; font-size: 15px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.seg-b.on { background: var(--panel); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12); color: var(--accent); }
.seg-sm .seg-b { padding: 7px 10px; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 2px solid var(--chip); background: var(--panel); color: var(--ink); padding: 7px 12px; border-radius: 99px; font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
span.chip { cursor: default; }
.pbar { height: 10px; background: var(--chip); border-radius: 99px; overflow: hidden; margin: 4px 0; }
.pbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 99px; }
.tag { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: var(--chip); color: var(--ink); border: 0; font-family: inherit; }
.tag-c { cursor: pointer; }
.tag-ws { background: #fff3bf; color: #7a5b00; }

/* Górny pasek */
#topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: var(--panel); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06); }
body[data-screen='play'] #topbar, body[data-screen='atlas'] #topbar { display: none; }
.tb-home { display: flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer; color: var(--ink); font: inherit; padding: 0; }
.tb-logo { width: 38px; height: 40px; display: block; }
.tb-logo svg { width: 100%; height: 100%; }
.tb-title { font-weight: 900; font-size: 18px; color: var(--accent); }
.tb-stats { display: flex; gap: 6px; align-items: center; }
.tb-chip { display: flex; align-items: center; gap: 2px; border: 0; background: var(--chip); color: var(--ink); padding: 7px 10px; border-radius: 99px; font: inherit; font-size: 15px; cursor: pointer; white-space: nowrap; }
.tb-streak { filter: grayscale(1); opacity: 0.7; }
.tb-streak.on { filter: none; opacity: 1; background: #fff0e0; color: #d9480f; }
.tb-xpbar { width: 44px; height: 7px; border-radius: 99px; background: rgba(0, 0, 0, 0.1); margin-left: 6px; overflow: hidden; }
.tb-xpbar i { display: block; height: 100%; background: var(--gold); }
.tb-av { font-size: 18px; }
.tb-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; margin-left: 4px; }
.bump { animation: bump 0.4s; display: inline-block; }
@keyframes bump { 40% { transform: scale(1.5); color: var(--gold-d); } }
@media (max-width: 640px) {
  .tb-title, .tb-name, .tb-xpbar { display: none; }
  .tb-chip { padding: 7px 8px; font-size: 14px; }
}

/* Maskotka */
.mascot { display: flex; align-items: flex-end; gap: 10px; }
.mascot-fig { width: 110px; flex: 0 0 auto; }
.mascot-fig svg { width: 100%; display: block; }
.mascot-fig.bounce { animation: kjBounce 0.5s; }
@keyframes kjBounce { 30% { transform: translateY(-10px) scale(1.04); } 60% { transform: translateY(0) scale(0.98); } }
.kajtek { overflow: visible; }
.kajtek .kj-wing2 { transform-origin: 86px 82px; animation: kjWave 2.4s ease-in-out infinite; }
@keyframes kjWave { 0%, 70%, 100% { transform: rotate(0); } 80% { transform: rotate(-18deg); } 90% { transform: rotate(8deg); } }
.mascot-bubble { position: relative; background: var(--panel); border: 3px solid var(--chip); padding: 12px 14px; border-radius: 18px; font-weight: 800; font-size: 17px; line-height: 1.3; margin-bottom: 30px; box-shadow: var(--shadow); animation: mgIn 0.3s; }
.mascot-bubble::before { content: ''; position: absolute; left: -12px; bottom: 16px; border: 10px solid transparent; border-right-color: var(--chip); border-left: 0; }
.mascot-xl .mascot-fig { width: 160px; }
.mascot-sm .mascot-fig { width: 62px; }

/* Powitanie i profile */
.welcome { max-width: 560px; margin: 0 auto; padding: 24px 16px 40px; }
.welcome-hero { text-align: center; }
.welcome-hero .mascot { justify-content: center; }
.welcome-hero h1 { font-size: 34px; margin: 6px 0; color: var(--accent); }
.lead { font-size: 18px; color: var(--muted); margin-top: 0; }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.av { font-size: 30px; padding: 6px; border-radius: 14px; border: 3px solid transparent; background: var(--chip); cursor: pointer; }
.av.on { border-color: var(--accent); background: var(--panel); transform: scale(1.08); }
.pform-go { width: 100%; margin-top: 18px; }
.plist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pitem { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 3px solid var(--chip); background: var(--panel); cursor: pointer; font: inherit; color: var(--ink); text-align: left; }
.pitem.on { border-color: var(--accent); }
.pitem-av { font-size: 32px; }
.pitem-n { flex: 1; font-weight: 900; font-size: 18px; }
.league { display: flex; flex-direction: column; gap: 6px; }
.lg-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--chip); }
.lg-row.me { outline: 3px solid var(--accent); }
.lg-pos { width: 28px; text-align: center; font-weight: 900; font-size: 18px; }
.lg-av { font-size: 24px; }
.lg-n { flex: 1; }
.lg-xp { font-weight: 900; color: var(--accent); }
.hats { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.hat { border: 3px solid var(--chip); border-radius: 16px; background: var(--panel); padding: 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; font: inherit; color: var(--ink); }
.hat.on { border-color: var(--accent); }
.hat.locked { opacity: 0.45; }
.hat-fig { width: 64px; }
.hat-fig svg { width: 100%; }

/* Ekran główny */
.home-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 18px; }
.mascot-home { flex: 1 1 320px; }
.mascot-home .mascot-fig { width: 130px; }
.home-cta { display: flex; flex-direction: column; gap: 10px; flex: 0 1 300px; }
.btn-play { font-size: 24px; padding: 20px 28px; animation: playPulse 2.2s ease-in-out infinite; }
@keyframes playPulse { 50% { transform: scale(1.04); } }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .home-grid { grid-template-columns: 1fr; } }
.goal { display: flex; gap: 16px; align-items: center; }
.goal h3 { margin: 0; }
.goal-ring { --p: 0; flex: 0 0 auto; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--good) calc(var(--p) * 360deg), var(--chip) 0); position: relative; }
.goal-ring::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: var(--panel); }
.goal-ring span { position: relative; font-weight: 900; font-size: 20px; }
.week { display: flex; gap: 6px; align-items: flex-end; margin-top: 6px; }
.wk { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wk-bar { width: 18px; height: 46px; background: var(--chip); border-radius: 6px; display: flex; align-items: flex-end; overflow: hidden; }
.wk-bar i { display: block; width: 100%; background: var(--accent); border-radius: 6px; }
.wk.goal .wk-bar i { background: var(--good); }
.wk small { font-size: 10px; color: var(--muted); }
.quests { display: flex; flex-direction: column; gap: 8px; }
.quest { display: flex; align-items: center; gap: 10px; }
.quest-ic { font-size: 24px; width: 32px; text-align: center; }
.quest-tx { flex: 1; min-width: 0; }
.quest-tx b { font-size: 14px; }
.quest-tx small { color: var(--muted); font-size: 12px; }
.quest-rw { font-weight: 900; color: var(--gold-d); }
.quest.done { opacity: 0.6; }
.quest.chest { border-top: 2px dashed var(--chip); padding-top: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px; border-radius: var(--radius); background: var(--panel); border: 0; box-shadow: var(--shadow); cursor: pointer; font: inherit; color: var(--ink); text-align: left; transition: transform 0.1s; }
.tile:hover { transform: translateY(-3px); }
.tile:active { transform: translateY(2px); }
.tile-ic { font-size: 34px; }
.tile b { font-size: 17px; }
.tile small { color: var(--muted); }
.tile-parent { opacity: 0.85; }

/* Konfiguracja tury */
.cats-special { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.cat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border-radius: 16px; border: 3px solid var(--chip); background: var(--panel); cursor: pointer; font: inherit; color: var(--ink); transition: transform 0.1s; }
.cat:active { transform: scale(0.96); }
.cat.on { border-color: var(--accent); background: var(--chip); box-shadow: 0 3px 0 var(--accent); }
.cat.empty { opacity: 0.4; }
.cat-ic { font-size: 30px; }
.cat b { font-size: 15px; text-align: center; }
.cat small { color: var(--muted); font-size: 12px; }
.cat-big { flex-direction: row; gap: 10px; justify-content: center; }
.cat-big .cat-ic { font-size: 36px; }
.cat-medal { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 12px; display: grid; place-items: center; }
.setup-go { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); }

/* Rozgrywka */
.screen-play, .screen-learn { position: fixed; inset: 0; }
body[data-screen='learn'] #topbar { display: none; }
.learn-name { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; }
.learn-name b { font-size: 28px; font-weight: 900; color: var(--accent); }
.learn-flag { font-size: 40px; }
.learn-desc { line-height: 1.45; }
.qcard.learn .facts { font-size: 15px; margin-top: 8px; }
.setup-go { flex-wrap: wrap; }
.setup-go > span { flex: 1 1 100%; }
@media (min-width: 700px) { .setup-go > span { flex: 1 1 auto; } }
.play { position: absolute; inset: 0; }
.play-map, .play-map.emap, .atlas-map.emap { position: absolute; inset: 0; }
.play-hud { position: absolute; top: calc(8px + env(safe-area-inset-top)); left: 8px; right: 8px; display: flex; align-items: center; gap: 8px; z-index: 5; pointer-events: none; }
.play-hud > * { pointer-events: auto; }
.hud-x { width: 42px; height: 42px; border-radius: 14px; border: 0; background: var(--panel); color: var(--ink); font-size: 18px; font-weight: 900; box-shadow: var(--shadow); cursor: pointer; }
.dots { flex: 1; display: flex; gap: 4px; background: var(--panel); padding: 8px 10px; border-radius: 99px; box-shadow: var(--shadow); max-width: 560px; }
.dots i { flex: 1; height: 10px; border-radius: 99px; background: var(--chip); transition: background 0.2s; }
.dots i.cur { background: var(--gold); }
.dots i.ok { background: var(--good); }
.dots i.bad { background: var(--bad); }
.hud-r { display: flex; gap: 6px; margin-left: auto; }
.hud-chip { background: var(--panel); padding: 8px 12px; border-radius: 99px; font-weight: 800; box-shadow: var(--shadow); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hud-time.hurry { color: var(--bad); animation: mgPulse 0.6s infinite alternate; }
.hud-combo { font-weight: 900; color: #d9480f; background: #fff0e0; padding: 8px 12px; border-radius: 99px; display: none; }
.hud-combo.on { display: block; animation: bump 0.4s; }
.qcard { position: absolute; z-index: 6; left: 12px; top: calc(64px + env(safe-area-inset-top)); width: min(420px, calc(100% - 24px)); background: var(--panel); border-radius: 22px; padding: 14px 16px 16px; box-shadow: var(--shadow); max-height: calc(100% - 90px); overflow-y: auto; }
.q-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; color: var(--muted); }
.q-num { background: var(--chip); padding: 3px 8px; border-radius: 99px; }
.q-cat { flex: 1; }
.qring { --p: 1; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 360deg), var(--chip) 0); position: relative; }
.qring::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--panel); }
.qring span { position: relative; font-weight: 900; color: var(--ink); font-size: 14px; }
.qring.hurry { background: conic-gradient(var(--bad) calc(var(--p) * 360deg), var(--chip) 0); animation: mgPulse 0.5s infinite alternate; }
.q-prompt { font-size: 19px; font-weight: 700; margin: 10px 0 4px; line-height: 1.3; }
.q-name { font-weight: 900; color: var(--accent); font-size: 23px; display: inline-block; }
.q-big { font-size: 17px; font-weight: 700; background: var(--chip); border-radius: 14px; padding: 10px 12px; margin: 8px 0; line-height: 1.35; }
.q-big.flag { font-size: 84px; text-align: center; background: none; padding: 0; line-height: 1.1; }
.q-big.riddle::before { content: '🕵️ '; }
.q-sub { font-size: 13px; color: var(--muted); font-weight: 700; }
.q-body { margin-top: 10px; }
.q-instr { font-weight: 800; color: var(--accent2); padding: 6px 0; }
.q-hint { background: #fff3bf; color: #5c4400; padding: 8px 10px; border-radius: 12px; font-weight: 800; margin-bottom: 8px; letter-spacing: 0.04em; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { display: flex; align-items: center; gap: 8px; text-align: left; border: 3px solid var(--chip); border-bottom-width: 5px; background: var(--panel); color: var(--ink); border-radius: 16px; padding: 10px 12px; font: inherit; font-weight: 800; font-size: 16px; cursor: pointer; min-height: 56px; transition: transform 0.08s; }
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt:active:not(:disabled) { transform: translateY(2px); }
.opt:disabled { opacity: 0.45; }
.opt.right { background: #d3f9d8; border-color: var(--good); opacity: 1; }
.opt.wrong { background: #ffe3e3; border-color: var(--bad); opacity: 1; animation: shake 0.35s; }
.opt-k { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 8px; background: var(--chip); display: grid; place-items: center; font-size: 13px; color: var(--muted); }
.opts-num { grid-template-columns: repeat(4, 1fr); margin-top: 8px; }
.opt-num { justify-content: center; font-size: 22px; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.q-type { display: flex; gap: 8px; }
.q-inp { font-size: 20px; font-weight: 800; }
.q-tools { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.qcard.fb.ok { box-shadow: 0 0 0 4px var(--good), var(--shadow); }
.qcard.fb.bad { box-shadow: 0 0 0 4px var(--bad), var(--shadow); }
.fb-box { margin-top: 10px; border-top: 2px dashed var(--chip); padding-top: 10px; animation: mgIn 0.25s; }
.fb-top { display: flex; gap: 10px; align-items: center; }
.fb-head { font-weight: 900; font-size: 19px; }
.qcard.ok .fb-head { color: var(--good-d); }
.qcard.bad .fb-head { color: var(--bad-d); }
.fb-ans { font-size: 16px; margin-top: 2px; }
.fb-ans b { font-size: 19px; }
.fb-ans small { color: var(--muted); }
.fb-xp { font-weight: 900; color: var(--gold-d); margin-top: 2px; }
.fb-fact { background: var(--chip); border-radius: 14px; padding: 10px 12px; margin-top: 10px; font-size: 15px; line-height: 1.4; }
.fb-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: 13px; }
.fb-stats span { background: var(--chip); padding: 4px 8px; border-radius: 10px; }
.fb-stats .best { background: #d3f9d8; font-weight: 800; }
.fb-btns { display: flex; gap: 8px; margin-top: 12px; }
.fb-next { flex: 1; font-size: 18px; }
.emap-mk.dim { opacity: 0.3; }
@media (max-width: 700px) {
  .qcard { left: 0; right: 0; top: auto; bottom: 0; width: 100%; border-radius: 22px 22px 0 0; max-height: 58%; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .q-prompt { font-size: 17px; margin-top: 6px; }
  .q-name { font-size: 20px; }
  .q-big.flag { font-size: 64px; }
  .opt { min-height: 48px; font-size: 15px; padding: 8px 10px; }
  .play .emap-zoom { bottom: auto; top: 64px; }
  .hud-chip { padding: 7px 9px; font-size: 13px; }
  .dots { padding: 7px 8px; gap: 3px; }
  .dots i { height: 8px; }
}

/* Podsumowanie */
.sum-hero { text-align: center; }
.sum-hero .mascot { justify-content: center; }
.sum-stars { font-size: 64px; letter-spacing: 10px; color: #d0d4dc; }
.sum-stars .on { color: var(--gold); text-shadow: 0 3px 0 var(--gold-d); animation: starIn 0.5s backwards; }
.sum-stars .on:nth-child(2) { animation-delay: 0.2s; }
.sum-stars .on:nth-child(3) { animation-delay: 0.4s; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); } }
.sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 14px 0; }
.sum-grid div { background: var(--panel); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.sum-grid b { font-size: 24px; }
.sum-grid small { color: var(--muted); }
.sum-snake { width: 100%; margin: 6px 0 16px; font-size: 22px; animation: playPulse 1.6s infinite; }
.ups { display: flex; flex-wrap: wrap; gap: 10px; }
.up { display: flex; align-items: center; gap: 8px; background: var(--chip); border-radius: 14px; padding: 8px 12px; font-weight: 800; }
.up-ic { font-size: 26px; }
.mist { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mist-i { border: 0; background: #ffe3e3; color: var(--ink); border-radius: 99px; padding: 6px 12px; font: inherit; font-weight: 700; cursor: pointer; }

/* Okna modalne */
#modal-root { position: relative; z-index: 800; }
.modal-wrap { position: fixed; inset: 0; background: rgba(10, 20, 40, 0.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 800; animation: fadeIn 0.2s; }
.modal-wrap.out { opacity: 0; transition: opacity 0.2s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-box { position: relative; background: var(--panel); color: var(--ink); border-radius: 24px; padding: 20px; width: min(560px, 100%); max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow); animation: mgIn 0.25s; }
.modal-wrap.sheet { align-items: flex-end; padding: 0; }
.modal-box.sheet { width: min(720px, 100%); border-radius: 24px 24px 0 0; max-height: 88vh; padding-bottom: calc(20px + env(safe-area-inset-bottom)); animation: sheetIn 0.3s ease-out; }
@keyframes sheetIn { from { transform: translateY(100%); } }
@media (min-width: 900px) { .modal-wrap.sheet { align-items: center; } .modal-box.sheet { border-radius: 24px; } }
.modal-x { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--chip); color: var(--ink); font-size: 17px; font-weight: 900; cursor: pointer; z-index: 2; }
.modal-browser { width: min(1000px, 100%); height: 90vh; display: flex; flex-direction: column; padding: 12px; }
.br { display: flex; flex-direction: column; height: 100%; gap: 8px; }
.br-bar { display: flex; align-items: center; gap: 10px; padding-right: 44px; }
.br-title { flex: 1; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-frame { flex: 1; width: 100%; border: 0; border-radius: 14px; background: #fff; }
.br-note { text-align: center; }
.confirm { text-align: center; }
.confirm-fig { width: 100px; margin: 0 auto; }
.lvlup { text-align: center; }
.lvlup-fig { width: 150px; margin: 0 auto; animation: kjBounce 0.8s 2; }
.lvlup-n { font-size: 48px; font-weight: 900; color: var(--gold-d); }

/* Karta obiektu */
.info-head { display: flex; gap: 12px; align-items: flex-start; padding-right: 40px; }
.info-ic { font-size: 50px; line-height: 1; }
.info-tt { flex: 1; min-width: 0; }
.info-tt h2 { margin: 0 0 6px; font-size: 26px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.say { border: 0; background: var(--chip); border-radius: 10px; padding: 4px 8px; cursor: pointer; font-size: 16px; }
.info-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.info-other { margin-top: 6px; }
.mstars i { font-style: normal; color: #d0d4dc; font-size: 15px; }
.mstars i.on { color: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 14px 0; }
.st { background: var(--chip); border-radius: 14px; padding: 8px 10px; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.st span { grid-row: span 2; font-size: 22px; }
.st small { color: var(--muted); font-size: 12px; }
.st-link { cursor: pointer; }
.info-desc { font-size: 16px; line-height: 1.5; }
.info-sec h4 { margin: 14px 0 6px; }
.facts { margin: 0; padding-left: 20px; line-height: 1.5; }
.facts li { margin-bottom: 4px; }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person { background: var(--chip); border-radius: 12px; padding: 6px 10px; font-weight: 800; font-size: 14px; display: flex; flex-direction: column; }
.person small { font-weight: 600; color: var(--muted); font-size: 11px; }
.info-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Atlas */
.screen-atlas { position: fixed; inset: 0; }
.atlas { position: absolute; inset: 0; }
.atlas-map { position: absolute; inset: 0; }
.atlas-panel { position: absolute; top: calc(8px + env(safe-area-inset-top)); left: 8px; width: min(400px, calc(100% - 66px)); z-index: 5; display: flex; flex-direction: column; gap: 8px; }
.atlas-panel::before { content: ''; }
.srch-wrap { position: relative; display: flex; gap: 6px; }
.srch { box-shadow: var(--shadow); border: 0; }
.srch-res { position: absolute; top: 100%; left: 0; right: 0; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); margin-top: 6px; max-height: 50vh; overflow-y: auto; z-index: 3; }
.yted .srch-res { position: static; box-shadow: none; }
.srch-i { display: flex; gap: 8px; align-items: center; width: 100%; padding: 10px 12px; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: var(--ink); border-bottom: 1px solid var(--chip); }
.srch-i small { margin-left: auto; color: var(--muted); }
.atlas-layers { background: var(--panel); border-radius: 18px; padding: 8px; box-shadow: var(--shadow); max-height: 46vh; overflow-y: auto; }
.atlas-layers .seg { margin-bottom: 8px; }
.atlas-layers .chip { font-size: 13px; padding: 5px 10px; }
.atlas-back { position: absolute; z-index: 6; }
@media (max-width: 640px) { .atlas-layers { max-height: 30vh; } }

/* Encyklopedia */
.lib-tabs { margin: 10px 0; }
.lib-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.lib-i { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 0; background: var(--panel); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08); cursor: pointer; font: inherit; color: var(--ink); text-align: left; }
.lib-ic { font-size: 24px; width: 34px; text-align: center; font-weight: 900; color: var(--accent); }
.lib-n { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lib-n small { color: var(--muted); }

/* Ordery */
.medal { --mc: #d0d4dc; position: relative; display: inline-flex; flex-direction: column; align-items: center; width: 54px; height: 62px; flex: 0 0 auto; }
.medal-rib { width: 24px; height: 18px; background: linear-gradient(90deg, var(--accent) 50%, var(--accent2) 50%); clip-path: polygon(0 0, 100% 0, 80% 100%, 20% 100%); }
.medal-disc { width: 44px; height: 44px; margin-top: -4px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8, transparent 40%), var(--mc); border: 3px solid rgba(0, 0, 0, 0.12); display: grid; place-items: center; font-size: 20px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15); }
.medal.t0 { filter: grayscale(1); opacity: 0.5; }
.medal.t6 .medal-disc { animation: shine 2s infinite; }
@keyframes shine { 50% { box-shadow: 0 0 16px var(--mc); } }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.badge { background: var(--panel); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.badge .pbar { width: 100%; }
.badge.locked b { color: var(--muted); }
.tier-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; font-size: 13px; }
.tier-legend span { display: flex; align-items: center; gap: 4px; }
.tier-legend .medal { transform: scale(0.6); width: 34px; height: 40px; }
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.ach { background: var(--panel); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; text-align: center; opacity: 0.55; }
.ach.on { opacity: 1; }
.ach-ic { font-size: 40px; }
.ach small { color: var(--muted); font-size: 12px; }
.passport { background: #1d3c6e; border-radius: 22px; padding: 14px; box-shadow: var(--shadow); }
.pass-cover { color: #f8d66d; font-weight: 900; font-size: 18px; display: flex; justify-content: space-between; margin-bottom: 12px; letter-spacing: 0.05em; }
.stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; background: #fbf6e9; border-radius: 14px; padding: 10px; }
.stamp { border: 2px dashed #c9bfa5; border-radius: 12px; padding: 6px; display: flex; flex-direction: column; align-items: center; background: transparent; cursor: pointer; font: inherit; color: #6b5f45; filter: grayscale(1); opacity: 0.5; }
.stamp.on { filter: none; opacity: 1; border: 3px solid #c92a2a; color: #c92a2a; transform: rotate(var(--rot)); background: rgba(201, 42, 42, 0.04); }
.stamp-f { font-size: 32px; }
.stamp small { font-weight: 800; font-size: 11px; text-align: center; }
.stamp em { font-size: 10px; font-style: normal; font-weight: 900; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.sbox { background: var(--panel); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.sbox span { font-size: 24px; }
.sbox b { font-size: 20px; }
.sbox small { color: var(--muted); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--chip); }

/* Salon gier */
.glist { display: flex; flex-direction: column; gap: 10px; }
.gitem { display: flex; align-items: center; gap: 12px; background: var(--panel); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); }
.gitem.off { opacity: 0.5; }
.g-ic { font-size: 40px; width: 50px; text-align: center; }
.g-tx { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.g-tx small { font-size: 13px; }

/* Panel rodzica */
.gate { max-width: 420px; margin: 30px auto; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--chip); }
.prow > span { display: flex; flex-direction: column; font-weight: 700; }
.prow small { color: var(--muted); font-weight: 600; font-size: 12px; }
.prow select.inp { width: auto; }
.prow input[type='checkbox'] { width: 24px; height: 24px; accent-color: var(--accent); }
.yted { margin-top: 10px; }
.yt-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; align-items: center; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Efekty */
.fx-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1000; }
#toast-root { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 1001; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--panel); padding: 10px 18px; border-radius: 99px; font-weight: 800; box-shadow: var(--shadow); animation: mgIn 0.25s; transition: opacity 0.4s, transform 0.4s; }
.toast.gold { background: var(--gold); color: #3a2a00; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; transform: translateY(-10px); }

/* Pasek: brakujące pliki / nowa wersja gry (js/app/update.js) */
.upd-bar { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 1002; width: max-content; max-width: calc(100vw - 32px); display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; border-radius: 18px; background: var(--ink); color: var(--panel); font-weight: 800; box-shadow: var(--shadow); animation: mgIn 0.25s; }
.upd-bar .btn { flex: none; padding: 8px 14px; }
.upd-bar .upd-x { flex: none; background: none; border: 0; color: inherit; font-size: 20px; cursor: pointer; opacity: 0.7; }

/* Panel rodzica: stały pasek zapisu na dole */
.parent-save { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 5; display: flex; justify-content: flex-end; gap: 10px; padding: 12px; margin-top: 8px; border-radius: 20px; background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(6px); box-shadow: var(--shadow); }
