/* =====================================================================
   Przystań na Marsie — styl „cozy futurystyczny”
   ===================================================================== */
@font-face { font-family: 'Baloo 2'; font-style: normal; font-display: swap; font-weight: 400 800;
  src: url('../fonts/baloo-2-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-display: swap; font-weight: 400 800;
  src: url('../fonts/baloo-2-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url('../fonts/nunito-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url('../fonts/nunito-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --sky-1: #241a38;
  --sky-2: #4b2c4f;
  --sky-3: #a24f4f;
  --horizon: #e58a62;
  --panel: #fff7ee;
  --panel-2: #fcebdc;
  --panel-3: #f6dcc8;
  --ink: #45283f;
  --ink-soft: #8b6a7c;
  --line: #ecd3c1;
  --teal: #2fa596;
  --teal-dark: #1f7f73;
  --teal-soft: #d4f0ea;
  --peach: #f08a5d;
  --peach-soft: #ffe0cf;
  --gold: #f2b84b;
  --lav: #9b7fd4;
  --lav-soft: #ebe2fb;
  --good: #3b9e6e;
  --bad: #d4544f;
  --bad-soft: #fde1de;
  --radius: 18px;
  --shadow: 0 14px 40px -12px rgba(30, 8, 30, 0.55), 0 2px 0 rgba(255, 255, 255, 0.6) inset;
  --font-head: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --emoji: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 85% 115%, rgba(255, 170, 120, 0.55), transparent 60%),
    radial-gradient(900px 400px at 10% 120%, rgba(240, 120, 90, 0.45), transparent 60%),
    linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 45%, var(--sky-3) 85%, var(--horizon) 100%);
  background-attachment: fixed;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body::before { /* gwiazdy */
  content: ''; position: fixed; inset: 0 0 40% 0; pointer-events: none; z-index: -1; opacity: .7;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 120px 80px, #ffe9d6, transparent),
    radial-gradient(1.5px 1.5px at 200px 20px, #fff, transparent),
    radial-gradient(1px 1px at 280px 110px, #fff, transparent),
    radial-gradient(1px 1px at 60px 140px, #d9d0ff, transparent);
  background-size: 320px 170px;
}
button, select, input, textarea { font: inherit; color: inherit; }
.emoji, .bicon, .deco, .res-ico, .avatar { font-family: var(--emoji); }

#app { max-width: 1680px; margin: 0 auto; padding: 14px 16px 28px; }

/* ---------- top bar ---------- */
.topbar {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  background: rgba(255, 247, 238, 0.12); border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px); border-radius: 22px; padding: 10px 14px; margin-bottom: 14px;
  color: #fff6ee;
}
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.logo { width: 46px; height: 46px; border-radius: 50%; position: relative; flex: none;
  background: radial-gradient(circle at 35% 30%, #ffb08a, #e06a48 55%, #a63f35);
  box-shadow: 0 0 0 4px rgba(255, 190, 150, .18), 0 0 24px rgba(255, 140, 100, .6); }
.logo::before, .logo::after { content: ''; position: absolute; border-radius: 50%; background: rgba(140, 40, 35, .35); }
.logo::before { width: 10px; height: 10px; left: 12px; top: 14px; }
.logo::after { width: 14px; height: 14px; right: 9px; bottom: 9px; }
.logo span { position: absolute; inset: 17px -7px; border: 2px solid rgba(255, 225, 200, .65); border-radius: 50%; transform: rotate(-18deg); }
.title { font-family: var(--font-head); font-weight: 600; font-size: 21px; letter-spacing: .3px; line-height: 1.1; }
.subtitle { font-size: 13px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.resources { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.res {
  display: grid; grid-template-columns: auto auto; column-gap: 6px; align-items: center;
  background: var(--panel); color: var(--ink); border-radius: 14px; padding: 5px 10px 6px 8px;
  min-width: 92px; position: relative; overflow: hidden; box-shadow: 0 4px 12px -6px rgba(0,0,0,.4);
}
.res-ico { grid-row: span 2; font-size: 20px; }
.res-amt { font-family: var(--font-head); font-weight: 600; font-size: 15px; line-height: 1.1; white-space: nowrap; }
.res-amt small { color: var(--ink-soft); font-weight: 400; font-size: 11px; }
.rate { font-size: 11px; color: var(--ink-soft); line-height: 1.1; white-space: nowrap; }
.rate.pos { color: var(--good); }
.rate.neg { color: var(--bad); font-weight: 700; }
.res-fill { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--peach); opacity: .7; transition: width .3s; }
.res.full .res-fill { background: var(--gold); }
.res.empty { background: var(--bad-soft); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px rgba(212, 84, 79, .45); } }

.clockbox { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.clock { font-family: var(--font-head); font-size: 15px; white-space: nowrap; }
.speed { display: flex; gap: 4px; background: rgba(0,0,0,.18); padding: 3px; border-radius: 12px; }
.speed button { border: 0; background: transparent; color: #ffeede; border-radius: 9px; padding: 3px 10px; cursor: pointer; font-family: var(--font-head); font-weight: 500; }
.speed button:hover { background: rgba(255,255,255,.12); }
.speed button.on { background: var(--panel); color: var(--ink); }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, 1fr); gap: 16px; align-items: start; }
.map-card, .side { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); }
.map-card { padding: 12px; position: sticky; top: 12px; }
.side { display: flex; flex-direction: column; min-height: 70vh; overflow: hidden; }

/* ---------- mapa ---------- */
.map-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; margin-bottom: 8px; padding: 0 4px; }
.map-head h2 { margin: 0; font-family: var(--font-head); font-weight: 600; font-size: 18px; }
.map-head .hint { font-size: 13px; color: var(--ink-soft); }
.placing-banner { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--teal-soft); border: 2px dashed var(--teal);
  border-radius: 12px; padding: 5px 6px 5px 12px; font-weight: 700; color: var(--teal-dark); }
.placing-banner span { flex: 1; }

.map-frame { position: relative; border-radius: 14px; overflow: hidden; container-type: inline-size;
  background: radial-gradient(ellipse at 50% 50%, #e39a6e 0%, #c8714f 55%, #9c4c42 100%); padding: 6px; }
.map { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; position: relative; z-index: 1; }
.tile {
  aspect-ratio: 1; border: 0; padding: 0; border-radius: 22%; position: relative; cursor: pointer;
  display: grid; place-items: center; font-size: 2.7cqw; line-height: 1;
  background: #e9a87c; box-shadow: inset 0 -2px 0 rgba(120, 50, 30, .18);
  transition: transform .12s, filter .12s, box-shadow .12s;
}
.tile:hover { transform: translateY(-1px) scale(1.06); z-index: 2; filter: brightness(1.06); box-shadow: 0 4px 10px rgba(80, 20, 20, .35); }
.tile:focus-visible { outline: 3px solid var(--teal); outline-offset: 1px; z-index: 3; }
.t-sand.v0 { background: #eaa97d; } .t-sand.v1 { background: #e5a075; } .t-sand.v2 { background: #edb18a; } .t-sand.v3 { background: #e39d71; }
.t-rock { background: #c47f61; } .t-rock.v1, .t-rock.v3 { background: #bd785b; }
.t-crater { background: radial-gradient(circle at 50% 55%, #9c573f 0 38%, #c17558 60%); }
.t-ore { background: linear-gradient(135deg, #b88a83, #9b6f73); }
.t-ice { background: linear-gradient(135deg, #e4f3f3, #b9dde4); }
.t-crystal { background: linear-gradient(135deg, #e6d5fb, #c2a3ec); }
.deco { opacity: .75; font-size: .8em; filter: saturate(.9); }
.t-sand .deco { color: rgba(120, 50, 30, .45); font-family: var(--font-body); font-size: 1.2em; }
.tile.fog { background: rgba(110, 48, 52, .32); cursor: default; box-shadow: inset 0 0 0 1px rgba(255, 220, 200, .06); filter: none; }
.tile.fog:hover { transform: none; }
.tile.has-b { background: radial-gradient(circle at 50% 40%, #fff3e2, #f6d6bb 70%); box-shadow: 0 0 0 2px rgba(255, 255, 255, .7) inset, 0 3px 6px -2px rgba(80, 20, 20, .45); }
.tile.has-b.on-ore { background: radial-gradient(circle at 50% 40%, #f4e7ea, #d6b9be 70%); }
.tile.has-b.on-ice { background: radial-gradient(circle at 50% 40%, #f4fdff, #c8e7ee 70%); }
.tile.has-b.on-crystal { background: radial-gradient(circle at 50% 40%, #faf4ff, #d8c3f4 70%); }
.tile.hq { box-shadow: 0 0 0 2px var(--gold) inset, 0 0 14px rgba(255, 210, 120, .7); }
.bicon { font-size: 1.15em; filter: drop-shadow(0 1px 1px rgba(0,0,0,.2)); }
.tile.building .bicon { opacity: .45; filter: grayscale(.6); }
.tile.building::after { content: '🏗️'; position: absolute; font-size: .6em; right: 6%; top: 4%; font-family: var(--emoji); }
.lvl { position: absolute; right: -2px; bottom: -2px; min-width: 1.45em; height: 1.45em; padding: 0 .25em; border-radius: 1em;
  background: var(--ink); color: #fff; font: 700 .48em/1.45em var(--font-head); text-align: center; box-shadow: 0 0 0 2px #fff7ee; }
.wk { position: absolute; left: 2px; top: 2px; font: 700 .42em/1 var(--font-head); color: var(--teal-dark); background: rgba(255,255,255,.85); border-radius: .6em; padding: .15em .3em; }
.tbar { position: absolute; left: 12%; right: 12%; bottom: 8%; height: 12%; min-height: 3px; background: rgba(69, 40, 63, .25); border-radius: 4px; overflow: hidden; }
.tbar i { display: block; height: 100%; width: 0; background: var(--teal); border-radius: 4px; transition: width .3s linear; }
.tile.valid { box-shadow: 0 0 0 2px var(--teal) inset; animation: glow 1.4s ease-in-out infinite; }
.tile.valid::before { content: '+'; position: absolute; color: var(--teal-dark); font: 700 1.1em var(--font-head); opacity: .8; }
.tile.valid .deco { opacity: .25; }
.tile.invalid:not(.fog) { filter: saturate(.4) brightness(.85); }
@keyframes glow { 50% { box-shadow: 0 0 0 3px var(--teal) inset, 0 0 12px rgba(47, 165, 150, .8); } }

.sky { position: absolute; inset: 0; z-index: 2; pointer-events: none; transition: background 2s linear; mix-blend-mode: multiply; }
.wx { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity 2s; }
.wx.rain { opacity: 1; background-image: repeating-linear-gradient(105deg, transparent 0 14px, rgba(190, 225, 255, .55) 14px 15px, transparent 15px 34px);
  background-size: 200px 200px; animation: rain .5s linear infinite; }
@keyframes rain { to { background-position: -40px 200px; } }
.wx.dust { opacity: 1; background: linear-gradient(100deg, rgba(220, 130, 70, .45), rgba(255, 190, 120, .25), rgba(200, 110, 60, .45));
  background-size: 300% 100%; animation: dust 6s linear infinite; }
@keyframes dust { to { background-position: 300% 0; } }
.wx.aurora { opacity: 1; background: linear-gradient(180deg, rgba(110, 255, 200, .35), rgba(170, 120, 255, .18) 35%, transparent 60%);
  background-size: 100% 200%; animation: aurora 8s ease-in-out infinite alternate; mix-blend-mode: screen; }
@keyframes aurora { to { background-position: 0 40%; filter: hue-rotate(40deg); } }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 4px 0; font-size: 12px; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }

/* ---------- zakładki ---------- */
.tabs { display: flex; gap: 1px; padding: 8px 8px 0; background: var(--panel-2); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 0; background: transparent; padding: 8px 9px 9px; border-radius: 12px 12px 0 0; cursor: pointer; white-space: nowrap;
  font-family: var(--font-head); font-weight: 500; font-size: 13.5px; color: var(--ink-soft); position: relative; }
.tab:hover { color: var(--ink); background: rgba(255,255,255,.4); }
.tab.on { background: var(--panel); color: var(--ink); }
.tab .badge { position: absolute; top: 3px; right: 2px; background: var(--peach); color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }
.panel { padding: 16px; overflow-y: auto; flex: 1; max-height: calc(100vh - 150px); }

/* ---------- elementy wspólne ---------- */
h3 { font-family: var(--font-head); font-weight: 600; font-size: 17px; margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; }
h3:first-child { margin-top: 0; }
h3 .count { font-size: 12px; font-weight: 500; background: var(--panel-2); color: var(--ink-soft); padding: 2px 8px; border-radius: 10px; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.card + .card { margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; align-items: start; }
.grid2 > .card + .card { margin-top: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 3px; background: var(--panel-2); border-radius: 9px; padding: 2px 7px; font-size: 12.5px; white-space: nowrap; font-weight: 600; }
.chip.cost.lack { background: var(--bad-soft); color: var(--bad); }
.chip.teal { background: var(--teal-soft); color: var(--teal-dark); }
.chip.lav { background: var(--lav-soft); color: #6a4fb0; }
.chip.peach { background: var(--peach-soft); color: #b2552c; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

.btn { border: 0; cursor: pointer; border-radius: 12px; padding: 8px 14px; font-family: var(--font-head); font-weight: 500; font-size: 14px;
  background: var(--teal); color: #fff; box-shadow: 0 3px 0 var(--teal-dark); transition: transform .08s, box-shadow .08s, filter .1s; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.btn:hover:not(:disabled) { filter: brightness(1.07); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--teal-dark); }
.btn:disabled, .btn.peach:disabled, .btn.danger:disabled, .btn.ghost:disabled { background: #d9c6bb; box-shadow: 0 3px 0 #c4ada0; cursor: not-allowed; color: #fff8f2; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 10px; }
.btn.ghost { background: var(--panel-2); color: var(--ink); box-shadow: 0 3px 0 var(--panel-3); }
.btn.peach { background: var(--peach); box-shadow: 0 3px 0 #c9673d; }
.btn.danger { background: var(--bad); box-shadow: 0 3px 0 #a33a36; }
.btn.block { width: 100%; }
.iconbtn { border: 0; background: transparent; cursor: pointer; border-radius: 8px; padding: 2px 6px; color: var(--ink-soft); font-size: 15px; }
.iconbtn:hover { background: var(--panel-2); color: var(--ink); }

.bar { height: 8px; background: var(--panel-3); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--teal); border-radius: 6px; transition: width .3s linear; }
.bar.lg { height: 12px; }
.bar.mood i { background: linear-gradient(90deg, #f2b84b, #f08a5d); }
.bar.health i { background: linear-gradient(90deg, #5cc39b, #2fa596); }
.bar.xp i { background: linear-gradient(90deg, #b59af0, #8f6fd8); }
.bar.gold i { background: linear-gradient(90deg, #ffd27a, #f2b84b); }
.bar.thin { height: 5px; }

select { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 5px 8px; font-size: 13px; max-width: 100%; cursor: pointer; }
input[type=text], textarea { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 10px; width: 100%; }
textarea { min-height: 90px; font-family: ui-monospace, monospace; font-size: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; }

/* ---------- przegląd ---------- */
.hero { background: linear-gradient(135deg, #ffe3cf, #fff2e6 60%, #e8f6f1); border-radius: 16px; padding: 14px 16px; border: 1px solid var(--line); }
.hero .lv { font-family: var(--font-head); font-size: 28px; font-weight: 600; line-height: 1; }
.hero .lv small { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.stat { background: rgba(255,255,255,.75); border-radius: 12px; padding: 8px; text-align: center; }
.stat b { display: block; font-family: var(--font-head); font-size: 18px; font-weight: 600; }
.stat span { font-size: 11.5px; color: var(--ink-soft); }
.alerts:empty { display: none; }
.alert { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; font-size: 13.5px; margin-top: 6px; background: var(--peach-soft); }
.alert.bad { background: var(--bad-soft); color: #8a2f2c; }
.alert.ok { background: var(--teal-soft); color: var(--teal-dark); }
.goal { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.goal + .goal { margin-top: 6px; }
.goal .check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font-size: 13px; }
.goal.done .check { background: var(--good); border-color: var(--good); color: #fff; }
.goal b { font-family: var(--font-head); font-weight: 500; }
.task { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.task:last-child { border-bottom: 0; }
.task .ico { font-size: 22px; grid-row: span 2; font-family: var(--emoji); }
.task .bar { grid-column: 2 / 4; }
.task .time { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }

/* ---------- osadnicy ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 25px; flex: none;
  box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0,0,0,.15); cursor: pointer; }
.avatar.lg { width: 76px; height: 76px; font-size: 44px; }
.settler { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
.settler .name { font-family: var(--font-head); font-weight: 600; font-size: 15.5px; cursor: pointer; }
.settler .name:hover { color: var(--teal-dark); }
.settler select { width: 100%; }
.settler .meters { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 4px 6px; align-items: center; font-size: 12px; color: var(--ink-soft); }
.settler.away { background: var(--lav-soft); }
.skillrow { display: grid; grid-template-columns: 22px 110px 28px 1fr; align-items: center; gap: 8px; font-size: 13.5px; padding: 3px 0; }
.skillrow b { font-family: var(--font-head); text-align: right; }
.pips { display: flex; gap: 2px; }
.pips i { flex: 1; height: 7px; border-radius: 3px; background: var(--panel-3); }
.pips i.on { background: var(--teal); }

/* ---------- budowle ---------- */
.bcard { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; position: relative; }
.bcard .bi { width: 46px; height: 46px; border-radius: 14px; background: var(--panel-2); display: grid; place-items: center; font-size: 26px; grid-row: span 3; font-family: var(--emoji); }
.bcard .bn { font-family: var(--font-head); font-weight: 600; font-size: 15px; }
.bcard .bd { font-size: 12.5px; color: var(--ink-soft); grid-column: 2; }
.bf, .bcard .bf { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.bcard.locked { opacity: .62; background: var(--panel); }
.bcard.locked .bi { filter: grayscale(.8); }
.lockmsg { font-size: 12.5px; font-weight: 700; color: #a2634d; }
.blist { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 10px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; }
.blist:hover { background: var(--panel-2); border-color: var(--line); }
.blist .bi { font-size: 22px; font-family: var(--emoji); }
.blist .bar { grid-column: 2 / 4; }
.segment { display: inline-flex; background: var(--panel-2); border-radius: 12px; padding: 3px; gap: 2px; }
.segment button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; cursor: pointer; font-family: var(--font-head); font-weight: 500; color: var(--ink-soft); }
.segment button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.infoline { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }

/* ---------- badania ---------- */
.tech { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; align-items: center; }
.tech .ti { font-size: 26px; grid-row: span 2; font-family: var(--emoji); }
.tech .tn { font-family: var(--font-head); font-weight: 600; }
.tech .td { font-size: 12.5px; color: var(--ink-soft); grid-column: 2; }
.tech .tb { grid-row: span 2; grid-column: 3; text-align: right; }
.tech.done { background: #f2fbf7; border-color: #cbeadb; }
.tech.locked { opacity: .55; }

/* ---------- wyprawy ---------- */
.dest { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.dest .di { font-size: 30px; grid-row: span 2; font-family: var(--emoji); }
.dest + .dest { margin-top: 10px; }
.picker { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pick { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 4px 8px 4px 4px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.pick .avatar { width: 26px; height: 26px; font-size: 15px; box-shadow: none; }
.pick.on { border-color: var(--teal); background: var(--teal-soft); }
.pick:disabled { opacity: .45; cursor: not-allowed; }
.pick small { color: var(--ink-soft); }

/* ---------- dziennik ---------- */
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 64px 26px 1fr; gap: 6px; padding: 7px 4px; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.log time { color: var(--ink-soft); font-size: 11.5px; padding-top: 2px; }
.log .li { font-family: var(--emoji); }
.log li.good, .log li.goal { background: linear-gradient(90deg, rgba(59,158,110,.08), transparent); }
.log li.bad { background: linear-gradient(90deg, rgba(212,84,79,.1), transparent); }
.log li.level { background: linear-gradient(90deg, rgba(242,184,75,.2), transparent); font-weight: 700; }

/* ---------- modal ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(36, 18, 40, .55); backdrop-filter: blur(3px); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fade .18s; }
.modal { background: var(--panel); border-radius: 22px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); animation: pop .22s cubic-bezier(.2,1.4,.5,1); }
.modal.wide { width: min(720px, 100%); }
.modal-head { display: flex; gap: 12px; align-items: center; padding: 16px 18px 12px; background: linear-gradient(135deg, var(--peach-soft), var(--panel)); border-radius: 22px 22px 0 0; position: sticky; top: 0; z-index: 1; }
.modal-head h2 { margin: 0; font-family: var(--font-head); font-weight: 600; font-size: 20px; line-height: 1.15; }
.modal-head .mi { font-size: 34px; font-family: var(--emoji); }
.modal-body { padding: 4px 18px 18px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 18px 18px; flex-wrap: wrap; }
.close { margin-left: auto; align-self: flex-start; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.94) translateY(8px); opacity: 0; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13.5px; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; font-weight: 600; }
.prod { display: flex; flex-wrap: wrap; gap: 6px; }
.prod .chip.out { background: #e3f5ec; color: #2b7a53; }
.prod .chip.in { background: #fbe7e1; color: #a5503b; }
.worker { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--panel-2); }
.worker + .worker { margin-top: 5px; }
.slot-empty { padding: 6px 10px; border: 2px dashed var(--line); border-radius: 10px; font-size: 13px; color: var(--ink-soft); margin-top: 5px; }
.intro-art { height: 120px; border-radius: 16px; margin-bottom: 12px; position: relative; overflow: hidden;
  background: radial-gradient(circle at 78% 30%, #ffd9b8 0 18px, transparent 19px), linear-gradient(180deg, #4b2c4f, #c25d4c 70%, #e58a62); }
.intro-art::after { content: '🏡 🌱 🚀 ☀️ 🌧️'; position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 30px; letter-spacing: 6px; font-family: var(--emoji); }
.intro-art::before { content: ''; position: absolute; left: -10%; right: -10%; bottom: -30px; height: 70px; border-radius: 50%; background: #d47a55; }

/* ---------- toasty ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; background: var(--panel); border-radius: 14px; padding: 10px 12px; box-shadow: 0 12px 30px -10px rgba(0,0,0,.5);
  border-left: 5px solid var(--teal); font-size: 13.5px; animation: slide .3s cubic-bezier(.2,1.2,.5,1); }
.toast .ti { font-size: 20px; font-family: var(--emoji); }
.toast.bad { border-color: var(--bad); }
.toast.level, .toast.goal { border-color: var(--gold); background: #fff8e8; }
.toast.weather { border-color: var(--lav); }
.toast.out { opacity: 0; transform: translateX(20px); transition: .3s; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }

/* ---------- responsywność ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .map-card { position: static; }
  .panel { max-height: none; }
  .side { min-height: 0; }
}
@media (max-width: 760px) {
  #app { padding: 10px 10px 24px; }
  .topbar { grid-template-columns: 1fr; gap: 10px; }
  .clockbox { flex-direction: row; justify-content: space-between; align-items: center; }
  .resources { justify-content: flex-start; }
  .map-head .hint { display: none; }
  .tabs { flex-wrap: wrap; }
  .res { min-width: 0; flex: 1 1 calc(25% - 6px); padding: 4px 6px; }
  .res-ico { font-size: 16px; }
  .res-amt small { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .map-frame { padding: 3px; }
  .map { gap: 2px; }
  .lvl, .wk { display: none; }
  .title { font-size: 17px; }
  .logo { width: 38px; height: 38px; }
  .legend { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* pierwsze ustawienie pasków po przebudowie HTML — bez animacji od zera */
.no-anim .bar i, .no-anim .tbar i, .no-anim .res-fill { transition: none !important; }
