/* PixelCity 7.0 — interfejs wielostronicowy */
:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --glass: rgba(255, 255, 255, 0.88);
  --ink: #1f2430;
  --ink-2: #5b6272;
  --line: rgba(31, 36, 48, 0.12);
  --accent: #f26b2a;
  --accent-2: #e2561a;
  --accent-soft: #fde7da;
  --teal: #12a594;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(40, 32, 20, 0.16), 0 2px 6px rgba(40, 32, 20, 0.08);
  --topbar-h: 56px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--ink-2); }
.small { font-size: 12px; }
.mt { margin-top: 16px; }

/* ---------- pasek górny ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 50;
  display: flex; align-items: center; gap: 20px; padding: 0 20px;
  background: rgba(255, 255, 255, 0.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, #ff8a47, #e2561a); box-shadow: 0 3px 8px rgba(226, 86, 26, 0.35); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { padding: 8px 14px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 600; transition: background 0.15s, color 0.15s; }
.nav a:hover { background: rgba(31, 36, 48, 0.06); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent-2); }
.topbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; background: rgba(31, 36, 48, 0.06); font-size: 12px; font-weight: 600; color: var(--ink-2); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- widoki ---------- */
.views { position: fixed; inset: var(--topbar-h) 0 0 0; }
.view { position: absolute; inset: 0; overflow: auto; }
.view-studio { overflow: hidden; background: #dbe6f0; }
.studio-stage, .screen-3d, .catalog-stage { position: absolute; inset: 0; overflow: hidden; }
.city-stage { position: absolute; inset: 0; overflow: hidden; }
.city-canvas { display: block; cursor: grab; outline: none; }
.city-canvas:active { cursor: grabbing; }

/* ---------- karty / HUD ---------- */
.card { background: var(--glass); backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, 0.7); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 4px 16px; }
.card-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-2); }
.card-body { padding: 8px 16px 16px; }
.hud { position: absolute; z-index: 5; }
.hud-left { left: 16px; top: 16px; width: 300px; }
.hud-right { right: 16px; top: 16px; width: 312px; max-height: calc(100% - 140px); overflow: auto; }
.hud-top { left: 50%; top: 16px; transform: translateX(-50%); width: max-content; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 700px); pointer-events: none; }
.stat { background: var(--glass); backdrop-filter: blur(10px); padding: 6px 12px; border-radius: 999px; box-shadow: 0 4px 12px rgba(40, 32, 20, 0.12); font-size: 12px; color: var(--ink-2); }
.stat b { color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-hint { display: none; }
.hud-dock { left: 50%; bottom: 16px; transform: translateX(-50%); width: max-content; display: flex; gap: 6px 18px; padding: 10px 16px; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 32px); }
.hud-legend { left: 16px; bottom: 112px; padding: 12px 14px; display: grid; gap: 6px; font-size: 12px; max-width: 220px; }
.legend-row { display: flex; align-items: center; gap: 8px; }
.legend-sw { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.hud-walk { left: 50%; top: 16px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 10px 14px; display: flex; gap: 12px; align-items: center; font-size: 13px; z-index: 8; }

.dock-group { display: flex; align-items: center; gap: 8px; }
.dock-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); font-weight: 700; }
.seg { display: inline-flex; background: rgba(31, 36, 48, 0.07); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-btn { border: 0; background: transparent; padding: 6px 11px; border-radius: 8px; font-weight: 600; font-size: 12.5px; color: var(--ink-2); transition: all 0.15s; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { background: #fff; color: var(--accent-2); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }
.tgl { border: 1px solid var(--line); background: #fff; padding: 6px 11px; border-radius: 9px; font-weight: 600; font-size: 12.5px; color: var(--ink-2); }
.tgl.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- formularze ---------- */
.field-label { display: block; margin: 14px 0 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field-label strong { color: var(--ink); }
.text-input, .select { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.text-input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 107, 42, 0.18); }
.text-input-lg { padding: 14px 16px; font-size: 16px; border-radius: 12px; }
.input-row { display: flex; gap: 8px; align-items: center; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.range { width: 100%; accent-color: var(--accent); }
.range-mini { width: 90px; }
.btn { border: 1px solid transparent; border-radius: 10px; padding: 9px 14px; font-weight: 700; font-size: 13px; transition: transform 0.08s, background 0.15s, box-shadow 0.15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-primary { background: linear-gradient(180deg, #ff8346, var(--accent-2)); color: #fff; box-shadow: 0 4px 12px rgba(226, 86, 26, 0.32); }
.btn-primary:hover { box-shadow: 0 6px 16px rgba(226, 86, 26, 0.42); }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-2); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { color: var(--accent-2); }
.btn-block { width: 100%; margin-top: 10px; }
.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: 12px; }
.icon-btn { width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(31, 36, 48, 0.06); font-size: 18px; line-height: 1; color: var(--ink-2); }
.icon-btn:hover { background: rgba(31, 36, 48, 0.12); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-chip { border: 1px solid var(--line); background: #fff; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.preset-chip:hover { border-color: var(--accent); color: var(--accent-2); }

/* ---------- inspektor ---------- */
.insp-kind { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.kind-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.insp-name { font-size: 18px; font-weight: 700; margin: 6px 0 10px; letter-spacing: -0.01em; }
.insp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.insp-grid div { background: rgba(31, 36, 48, 0.04); border-radius: 10px; padding: 8px 10px; }
.insp-grid dt { font-size: 11px; color: var(--ink-2); }
.insp-grid dd { margin: 2px 0 0; font-weight: 700; }
.conf { margin-top: 12px; }
.conf-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
.conf-label b { color: var(--ink); }
.conf-track { height: 6px; border-radius: 99px; background: rgba(31, 36, 48, 0.08); overflow: hidden; }
.conf-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--teal), #7bd88f); transition: width 0.3s; }
.fold { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.fold summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.fold-body { padding-top: 10px; }

.tooltip { position: absolute; z-index: 9; pointer-events: none; background: rgba(25, 29, 40, 0.92); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12px; transform: translate(14px, 14px); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); max-width: 260px; }
.tooltip b { display: block; }
.tooltip span { opacity: 0.75; }

/* ---------- loader ---------- */
.loader { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(238, 243, 248, 0.72); backdrop-filter: blur(6px); transition: opacity 0.35s; }
.loader.done { opacity: 0; pointer-events: none; }
.loader-card { background: #fff; padding: 22px 28px; border-radius: 16px; box-shadow: var(--shadow); text-align: center; min-width: 280px; }
.loader-text { margin: 12px 0 10px; font-weight: 600; }
.progress { height: 6px; background: rgba(31, 36, 48, 0.08); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 5%; background: linear-gradient(90deg, #ff8a47, #e2561a); transition: width 0.25s; }
.spinner { width: 34px; height: 34px; margin: 0 auto; border-radius: 50%; border: 3px solid rgba(242, 107, 42, 0.2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- podstrony ---------- */
.view-page { background: radial-gradient(1200px 500px at 80% -10%, #fde7da 0%, transparent 60%), var(--bg); }
.page { max-width: 1080px; margin: 0 auto; padding: 36px 24px 64px; }
.page-wide { max-width: 1280px; }
.page-head h1 { font-size: 34px; letter-spacing: -0.02em; }
.page-head p { margin: 8px 0 0; color: var(--ink-2); max-width: 680px; font-size: 15px; }
.page-head-row { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; flex-wrap: wrap; }
.search-bar { display: flex; gap: 10px; margin: 24px 0 8px; }
.section-title { margin: 32px 0 14px; font-size: 18px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card-grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.city-card { background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(40, 32, 20, 0.07); cursor: pointer; text-align: left; padding: 0; transition: transform 0.15s, box-shadow 0.15s; }
.city-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.city-thumb { height: 150px; background-size: cover; background-position: center; display: grid; place-items: end start; padding: 10px; position: relative; }
.city-thumb .tag { background: rgba(255, 255, 255, 0.9); border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 700; }
.city-meta { padding: 12px 14px 14px; }
.city-meta h3 { font-size: 15px; }
.city-meta p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { color: var(--ink-2); font-style: italic; }
.export-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.export-card p { margin: 0; color: var(--ink-2); flex: 1; }
.export-card h3 { font-size: 16px; }
.export-hero { display: flex; gap: 20px; padding: 16px; margin: 24px 0; align-items: center; flex-wrap: wrap; }
.export-preview { width: 360px; max-width: 100%; border-radius: 12px; display: block; }
.export-hero-empty { width: 360px; max-width: 100%; height: 200px; border-radius: 12px; background: rgba(31, 36, 48, 0.05); display: grid; place-items: center; color: var(--ink-2); }
.export-preview:not([hidden]) ~ .export-hero-empty { display: none; }
.export-hero-meta { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.export-place { font-size: 20px; font-weight: 700; }

/* ---------- katalog obiektów ---------- */
.view-catalog { display: grid; grid-template-columns: 250px 1fr 300px; overflow: hidden; background: #dbe6f0; }
.catalog-list { background: rgba(255, 255, 255, 0.9); border-right: 1px solid var(--line); overflow: auto; padding: 14px 10px 24px; }
.cat-group { margin: 10px 6px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 800; color: var(--ink-2); }
.cat-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left; padding: 9px 10px; border-radius: 10px; font-weight: 600; color: var(--ink); }
.cat-item:hover { background: rgba(31, 36, 48, 0.06); }
.cat-item.active { background: var(--accent-soft); color: var(--accent-2); }
.cat-dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.catalog-main { position: relative; min-width: 0; }
.catalog-bar { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: max-content; padding: 10px 14px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 24px); z-index: 4; }
.catalog-info { margin: 16px 16px 16px 0; padding: 20px; align-self: start; }
.catalog-info h2 { font-size: 22px; letter-spacing: -0.01em; }
.catalog-info p { margin: 8px 0 12px; }
.bullets { padding-left: 18px; margin: 0 0 14px; display: grid; gap: 4px; }

/* ---------- akademia ---------- */
.kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; min-width: 96px; }
.kpi span { display: block; font-size: 11px; color: var(--ink-2); }
.kpi b { font-size: 20px; letter-spacing: -0.01em; }
.tabs { display: flex; gap: 4px; margin: 24px 0 16px; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: transparent; padding: 10px 16px; font-weight: 700; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--accent-2); border-bottom-color: var(--accent); }
.dual { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.screen { margin: 0; background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(40, 32, 20, 0.07); }
.screen figcaption { padding: 10px 14px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.screen canvas { display: block; width: 100%; height: auto; aspect-ratio: 640 / 420; cursor: crosshair; }
.screen-3d { position: relative; inset: auto; width: 100%; aspect-ratio: 640 / 420; background: #dbe6f0; }
.verify-bar { display: flex; gap: 20px; padding: 14px 18px; margin-top: 16px; align-items: center; flex-wrap: wrap; }
.verify-info { flex: 1 1 260px; min-width: 0; }
.verify-name { font-size: 18px; font-weight: 700; }
.verify-metrics { display: flex; gap: 18px; }
.verify-metrics span { display: block; font-size: 11px; color: var(--ink-2); }
.verify-metrics b { font-size: 18px; }
.verify-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.verify-actions .select { width: auto; }
.prob-bars { display: grid; gap: 6px; margin-top: 14px; max-width: 520px; }
.prob-row { display: grid; grid-template-columns: 150px 1fr 48px; gap: 10px; align-items: center; font-size: 12.5px; }
.prob-track { height: 8px; border-radius: 99px; background: rgba(31, 36, 48, 0.08); overflow: hidden; }
.prob-fill { height: 100%; border-radius: 99px; }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card h3 { font-size: 15px; margin-bottom: 12px; }
.stages-list { display: grid; gap: 10px; margin-bottom: 16px; }
.stage-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.stage-item.active { border-color: var(--accent); background: var(--accent-soft); }
.stage-title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; }
.stage-item p { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-2); }
.feature-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.feature-pill { display: inline-flex; gap: 6px; background: rgba(31, 36, 48, 0.06); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.metrics-table { display: grid; gap: 4px; }
.metric-row-full { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 8px; padding: 7px 8px; border-radius: 8px; font-size: 13px; }
.metric-row-full:nth-child(odd) { background: rgba(31, 36, 48, 0.035); }
#nn-loss-canvas, #confusion-matrix-canvas { width: 100%; height: auto; border-radius: 10px; background: #fbfaf7; border: 1px solid var(--line); }

/* ---------- toasty ---------- */
.toast-container { position: fixed; right: 20px; bottom: 24px; z-index: 100; display: grid; gap: 8px; }
.toast { background: rgba(25, 29, 40, 0.94); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); max-width: 360px; animation: toast-in 0.25s ease-out; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- responsywność ---------- */
@media (min-width: 1500px) { .stat-hint { display: inline-block; } }
@media (max-width: 1700px) { .hud-dock .dock-label { display: none; } .hud-dock { gap: 6px 12px; } }
@media (max-width: 1100px) {
  .hud-top { display: none; }
  .view-catalog { grid-template-columns: 200px 1fr; }
  .catalog-info { position: absolute; right: 12px; top: 12px; width: 250px; margin: 0; z-index: 4; }
}
@media (max-width: 800px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .brand-name, .chip-place { display: none; }
  .nav a { padding: 8px 9px; font-size: 13px; }
  .hud-left { width: calc(100% - 32px); max-width: 340px; }
  .hud-right { width: calc(100% - 32px); max-width: 340px; top: auto; bottom: 150px; max-height: 40%; }
  .hud-dock { overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; }
  .dock-group { flex: none; }
  .dual, .grid-2col { grid-template-columns: 1fr; }
  .view-catalog { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .catalog-list { display: flex; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .cat-group { display: none; }
  .cat-item { width: auto; white-space: nowrap; }
  .catalog-info { display: none; }
  .search-bar { flex-direction: column; }
}

.check { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.check input { margin-top: 2px; accent-color: var(--accent); }

.badge { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: linear-gradient(135deg, #ff8a47, #e2561a); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; vertical-align: 1px; }
.nav-hd.active .badge { box-shadow: 0 0 0 2px #fff; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.hud-game { width: 316px; max-height: calc(100% - 32px); overflow: auto; }
.hud-game .seg { display: flex; }
.hud-game .seg-btn { flex: 1; }
.hud-game .range { margin-top: 8px; }
.hud-game .btn-block + .btn-block { margin-top: 8px; }
.loader-note { margin-top: 12px; max-width: 280px; }
.export-card-game { border: 2px solid var(--accent); }

.editor { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.editor-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.editor-head h3 { font-size: 14px; margin: 0; }
.editor .field-label { margin: 10px 0 5px; }
.ed-row { margin-bottom: 0; align-items: end; }
.stepper { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.stepper button { width: 34px; border: 0; background: rgba(31, 36, 48, 0.05); font-size: 18px; color: var(--ink-2); }
.stepper button:hover { background: var(--accent-soft); color: var(--accent-2); }
.stepper input { width: 100%; min-width: 0; border: 0; text-align: center; font-weight: 700; padding: 8px 2px; outline: none; background: transparent; }
.btn-block-sm { width: 100%; padding: 8px 10px; }
.color-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.color-field input[type=color] { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: #fff; cursor: pointer; }
.editor .btn-row .btn { padding: 8px 10px; }
.hud-right { width: 336px; }

.hud-left-col { left: 16px; top: 16px; width: 300px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100% - 120px); overflow-y: auto; scrollbar-width: thin; }
.hud-left-col > .card { flex: none; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.grid-3 .select { padding: 8px 6px; }
.obj-tabs { display: flex; margin: 6px 0 10px; }
.obj-tabs .seg-btn { flex: 1; padding: 6px 4px; font-size: 12px; }
.obj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 210px; overflow-y: auto; padding-right: 2px; }
.obj-item { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 8px; font-size: 12px; font-weight: 600; text-align: left; display: flex; gap: 7px; align-items: center; color: var(--ink); }
.obj-item:hover { border-color: var(--accent); }
.obj-item.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }
.obj-item i { width: 11px; height: 11px; border-radius: 4px; flex: none; }
.btn-row .btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }

.file-btn { display: block; text-align: center; cursor: pointer; margin-bottom: 8px; }
.model-list { display: grid; gap: 6px; margin: 8px 0; max-height: 170px; overflow-y: auto; }
.model-item { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 8px; }
.model-item.active { border-color: var(--accent); background: var(--accent-soft); }
.model-item .mi-main { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; font-weight: 600; font-size: 12px; color: var(--ink); }
.model-item .mi-main span { display: block; font-weight: 500; color: var(--ink-2); font-size: 11px; }
.model-item .mi-del { border: 0; background: rgba(31,36,48,0.06); border-radius: 8px; width: 26px; height: 26px; color: var(--ink-2); }
.model-item .mi-del:hover { background: #fde2e2; color: #b42318; }
.obj-tabs .seg-btn { padding: 6px 2px; font-size: 11.5px; }

.model-item { flex-wrap: wrap; }
.model-item .mi-main { flex: 1 1 100%; }
.model-item .mi-role { flex: 1; min-width: 0; padding: 5px 6px; font-size: 11.5px; }
.model-item .mi-rot { width: 62px; padding: 5px 4px; font-size: 11.5px; }
.model-use { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 4px; }

.hud-hp { left: 16px; bottom: 16px; width: 260px; padding: 12px 14px; z-index: 8; }
.hp-top { display: flex; justify-content: space-between; margin-bottom: 6px; }
.hp-track { height: 10px; border-radius: 99px; background: rgba(31, 36, 48, 0.12); overflow: hidden; }
.hp-fill { height: 100%; width: 100%; border-radius: 99px; background: linear-gradient(90deg, #12a594, #7bd88f); transition: width 0.2s, background 0.2s; }
.hp-msg { min-height: 18px; margin: 6px 0 2px; font-weight: 700; color: #b42318; font-size: 12.5px; }

/* ---- postacie NPC */
.cast-layout { display: grid; grid-template-columns: 300px minmax(320px, 1fr) 360px; gap: 16px; margin-top: 22px; align-items: start; }
@media (max-width: 1100px) { .cast-layout { grid-template-columns: 1fr; } }
.cast-side .card-body, .cast-mid .card-body, .cast-form-card .card-body { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.cast-list { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; }
.cast-card { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 9px; }
.cast-card.active { border-color: var(--accent); background: var(--accent-soft); }
.cast-card.off { opacity: 0.55; }
.cast-card .cc-main { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; color: var(--ink); display: flex; flex-direction: column; gap: 1px; cursor: pointer; }
.cast-card .cc-main b { font-size: 13px; }
.cast-card .cc-main span { font-size: 11px; color: var(--ink-2); }
.cast-preview { width: 100%; height: 380px; border-radius: 14px; background: linear-gradient(180deg, #eef2f6, #d9e0e8); overflow: hidden; touch-action: none; }
.cast-preview canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.cast-clips { display: flex; flex-wrap: wrap; gap: 6px; }
.clip-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--ink); }
.clip-chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn-danger { background: #fff; color: #b3261e; border: 1px solid #e3b4b0; }
.btn-danger:hover { background: #fdecea; }

/* ---- minimapa */
.minimap { position: absolute; right: 16px; bottom: 16px; z-index: 6; width: 216px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.minimap .mm-canvas { display: block; width: 200px; height: 200px; border-radius: 10px; cursor: crosshair; background: #9fb0bf; }
.minimap .mm-bar { display: flex; justify-content: space-between; gap: 6px; }
.minimap .mm-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 3px 10px; font-size: 11px; font-weight: 600; color: var(--ink); cursor: pointer; }
.minimap .mm-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.minimap.mm-collapsed .mm-canvas { display: none; }
.minimap.mm-collapsed { width: auto; }
.hud-right { max-height: calc(100% - 330px); }
#view-studio > .hud-right { top: 16px; max-height: calc(100% - 340px); }
@media (max-width: 760px) { .minimap { bottom: 96px; width: 156px; } .minimap .mm-canvas { width: 140px; height: 140px; } }
#view-studio > .minimap { bottom: 110px; width: 178px; padding: 6px; }
#view-studio > .minimap .mm-canvas { width: 162px; height: 162px; }

/* ---- gra: celownik, cel, obsada */
.hud-target { left: 50%; top: calc(50% + 34px); transform: translateX(-50%); width: 190px; padding: 8px 12px; pointer-events: none; }
.hud-target .tg-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; gap: 8px; }
.hud-target.hostile .tg-top b { color: #c0392b; }
.link-mini { font-size: 11px; font-weight: 600; margin-left: 8px; color: var(--accent); text-decoration: none; text-transform: none; letter-spacing: 0; }
.gc-list { display: flex; flex-direction: column; gap: 4px; font-size: 12px; margin-bottom: 8px; }
.gc-row { display: flex; justify-content: space-between; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 8px; }
.gc-row span { color: var(--ink-2); }
.model-lib { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; }
.ml-row { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 8px; }
.ml-row .ml-name { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; text-align: left; border: 0; background: transparent; cursor: pointer; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-row .ml-name small { display: block; font-weight: 400; color: var(--ink-2); font-size: 11px; }
.ml-row .mini { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 3px 8px; font-size: 11px; font-weight: 600; cursor: pointer; color: var(--ink); }
.ml-row .mini:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---- gra: broń, poszukiwany, znacznik trafienia */
.hud-weapon { left: 50%; transform: translateX(-50%); bottom: 18px; width: 230px; padding: 10px 12px; pointer-events: none; }
.hud-weapon .wp-name { font-weight: 800; font-size: 14px; }
.hud-weapon .wp-ammo { font-size: 26px; font-weight: 800; letter-spacing: 0.02em; line-height: 1.15; }
.hud-weapon .wp-ammo small { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.hud-weapon .wp-ammo.low { color: #c0392b; }
.hud-weapon .wp-slots { display: flex; gap: 4px; margin-top: 6px; }
.hud-weapon .wp-slots i { flex: 1; text-align: center; font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 0; border-radius: 6px; background: rgba(31, 36, 48, 0.08); color: var(--ink-2); }
.hud-weapon .wp-slots i.on { background: var(--accent); color: #fff; }
.hud-wanted { left: 50%; top: 150px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; background: rgba(20, 24, 36, 0.78); border-radius: 999px; padding: 6px 14px; color: #fff; font-weight: 700; font-size: 13px; z-index: 6; pointer-events: none; }
.hud-wanted .star { font-size: 20px; color: rgba(255, 255, 255, 0.28); }
.hud-wanted .star.on { color: #ffd23a; text-shadow: 0 0 10px rgba(255, 190, 40, 0.8); animation: wanted-blink 0.6s infinite alternate; }
@keyframes wanted-blink { from { opacity: 1; } to { opacity: 0.55; } }
.hud-wanted .wl-txt { margin-left: 8px; }

/* ---- celownik dynamiczny, wignetka obrażeń */
.game-cross { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 5; --gap: 8px; }
.game-cross .ct { position: absolute; background: #fff; box-shadow: 0 0 0 1px rgba(15, 18, 24, 0.55); transition: opacity 0.12s; }
.game-cross .t { width: 2px; height: 9px; left: -1px; top: calc(-1 * (var(--gap) + 9px)); }
.game-cross .b { width: 2px; height: 9px; left: -1px; top: var(--gap); }
.game-cross .l { height: 2px; width: 9px; top: -1px; left: calc(-1 * (var(--gap) + 9px)); }
.game-cross .r { height: 2px; width: 9px; top: -1px; left: var(--gap); }
.game-cross .cd { position: absolute; width: 4px; height: 4px; left: -2px; top: -2px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(15, 18, 24, 0.6); }
.game-cross.melee .ct { opacity: 0; }
.game-cross.ads .ct { opacity: 0.3; }
.game-cross::before, .game-cross::after { content: ""; position: absolute; left: -1px; top: -13px; width: 2px; height: 26px; background: #fff; opacity: 0; transform: rotate(45deg) scaleY(0.6); box-shadow: 0 0 0 1px rgba(15, 18, 24, 0.5); }
.game-cross::after { transform: rotate(-45deg) scaleY(0.6); }
.game-cross.hit::before, .game-cross.hit::after { opacity: 1; transform: rotate(45deg) scaleY(1); transition: transform 0.07s; }
.game-cross.hit::after { transform: rotate(-45deg) scaleY(1); }
.game-cross.kill::before, .game-cross.kill::after { opacity: 1; background: #ff2a2a; transform: rotate(45deg) scaleY(1.3); }
.game-cross.kill::after { transform: rotate(-45deg) scaleY(1.3); }
.game-cross.head::before, .game-cross.head::after { background: #ffd23a; }
.game-vignette { position: absolute; inset: 0; pointer-events: none; z-index: 4; opacity: 0; background: radial-gradient(ellipse at center, rgba(160, 0, 0, 0) 45%, rgba(170, 10, 10, 0.75) 100%); transition: opacity 0.35s ease-out; }
.game-vignette.flash { opacity: 1; transition: none; }
.game-vignette.low { opacity: 0.55; animation: vig-pulse 1.1s infinite alternate; }
@keyframes vig-pulse { from { opacity: 0.35; } to { opacity: 0.7; } }

.ml-card { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 8px; }
.ml-card .ml-row { border: 0; padding: 0; background: transparent; }
.ml-row2 { display: flex; gap: 6px; }
.ml-row2 .mini-sel { flex: 1; min-width: 0; padding: 4px 6px; font-size: 11px; }
.ml-row2 .mini-sel:last-child { flex: 0 0 64px; }

/* ---- katalog modeli: zakładki kategorii */
.mdl-tabs { margin-top: 20px; display: inline-flex; flex-wrap: wrap; }
.mdl-tabs .tab-n { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: rgba(31, 36, 48, 0.1); font-size: 11px; line-height: 17px; }
.mdl-tabs .seg-btn.active .tab-n { background: rgba(255, 255, 255, 0.35); }
#tab-npc, #tab-cars, #tab-weapons, #tab-world, #tab-other { margin-top: 16px; }
.cat-layout { display: grid; grid-template-columns: minmax(300px, 440px) minmax(320px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .cat-layout { grid-template-columns: 1fr; } }
.cat-layout .card-body { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.cat-group { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.cat-group.active { border-color: var(--accent); background: var(--accent-soft); }
.cat-group h3 { margin: 0; font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cat-group .cat-sub { font-size: 11px; color: var(--ink-2); font-weight: 500; }
.cat-empty { font-size: 12px; color: var(--ink-2); }
.cat-row { display: flex; align-items: center; gap: 6px; }
.cat-row .ml-name { flex: 1; min-width: 0; }
.cat-row select { padding: 4px 6px; font-size: 11px; }
.cat-row .rot-sel { flex: 0 0 64px; }
.cat-add { display: flex; gap: 6px; align-items: center; }
.cat-add select { flex: 1; min-width: 0; padding: 5px 6px; font-size: 12px; }
.model-lib-wide { max-height: none; }
.file-mini { cursor: pointer; }
.cat-row .ml-name { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; cursor: pointer; color: var(--ink); font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 0; }
.cat-row .ml-name small { display: block; font-weight: 400; color: var(--ink-2); font-size: 11px; }
.cat-group .cat-empty, .cat-group .cat-sub { text-transform: none; letter-spacing: 0; font-weight: 500; }

.hud-street { left: 16px; top: 148px; padding: 8px 14px; display: flex; flex-direction: column; gap: 1px; pointer-events: none; z-index: 5; max-width: 300px; }
.hud-street b { font-size: 15px; }
.hud-street span { font-size: 12px; color: var(--ink-2); }
.hud-street span:empty { display: none; }

/* ---- luneta snajperki */
.game-scope { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(circle at 50% 50%, transparent 0, transparent 33.6vmin, #000 34vmin); }
.game-scope .sc-ring { position: absolute; left: 50%; top: 50%; width: 67.2vmin; height: 67.2vmin; margin: -33.6vmin 0 0 -33.6vmin; border-radius: 50%; border: 3px solid #000; box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.55); }
.game-scope .sc-h { position: absolute; left: calc(50% - 33.6vmin); width: 67.2vmin; top: 50%; height: 1px; background: rgba(0, 0, 0, 0.85); }
.game-scope .sc-v { position: absolute; top: calc(50% - 33.6vmin); height: 67.2vmin; left: 50%; width: 1px; background: rgba(0, 0, 0, 0.85); }
.game-cross.scoped { opacity: 0; }

/* ---- zakładka „Świat”: projektowanie wyglądu miasta własnymi modelami */
.world-layout { display: grid; grid-template-columns: minmax(230px, 290px) minmax(340px, 1fr) minmax(300px, 400px); gap: 16px; align-items: start; }
@media (max-width: 1180px) { .world-layout { grid-template-columns: minmax(220px, 280px) 1fr; } .world-form-card { grid-column: 1 / -1; } }
@media (max-width: 760px) { .world-layout { grid-template-columns: 1fr; } }
.world-side .card-body, .world-mid .card-body, .world-form-card .card-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.world-slots { display: flex; flex-direction: column; gap: 4px; max-height: 64vh; overflow: auto; padding-right: 2px; }
.world-group { margin: 10px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.world-slot { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 10px; cursor: pointer; color: var(--ink); font: inherit; }
.world-slot:hover { border-color: var(--accent); }
.world-slot.active { border-color: var(--accent); background: var(--accent-soft); }
.world-slot .ws-name { font-weight: 700; font-size: 13px; }
.world-slot .ws-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 11px; color: var(--ink-2); }
.world-slot .ws-meta b { color: var(--teal); }
.world-slot .ws-meta i { font-style: normal; }
.world-slot.has { box-shadow: inset 3px 0 0 var(--teal); }
.world-preview { min-height: 340px; height: 46vh; }
.ws-models { display: flex; flex-direction: column; gap: 8px; }
.ws-model { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.ws-mtop { display: flex; gap: 6px; align-items: center; }
.ws-mname { flex: 1; min-width: 0; font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-mname small { display: block; font-weight: 400; color: var(--ink-2); font-size: 11px; }
.ws-mname small.bad { color: #c62828; font-weight: 700; }
.ws-warn { font-size: 11px; color: #b3541e; background: #fff1e6; border-radius: 8px; padding: 6px 8px; }
.ws-add { display: flex; gap: 6px; align-items: center; }
.ws-add select { flex: 1; min-width: 0; padding: 5px 6px; font-size: 12px; }
.ws-fit { display: flex; flex-direction: column; gap: 8px; }
.ws-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.ws-fh { display: flex; justify-content: space-between; gap: 8px; }
.ws-field input[type="range"] { width: 100%; accent-color: var(--accent); }
.ws-mtop .rot-sel { flex: 0 0 72px; width: 72px; padding: 4px 6px; font-size: 11px; }
.ws-add .file-mini, .cat-group .file-mini { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ws-add .file-mini:hover { border-color: var(--accent); color: var(--accent-2); }
.ws-mtop .mini { flex: 0 0 auto; }

/* ---- źródła i licencje */
.chip-btn { border: 0; cursor: pointer; font: inherit; color: var(--ink-2); }
.chip-btn:hover { color: var(--accent-2); }
.credits-line { position: fixed; left: 10px; bottom: 6px; z-index: 3; font-size: 11px; color: var(--ink-2); background: rgba(255, 255, 255, 0.72); padding: 2px 8px; border-radius: 8px; backdrop-filter: blur(4px); pointer-events: auto; }
.credits-line a, .link-btn { color: inherit; text-decoration: underline; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
body:has(#view-gra:not([hidden])) .credits-line { display: none; }
.credits-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(20, 24, 32, 0.5); padding: 16px; }
.credits-card { max-width: 560px; background: #fff; border-radius: 16px; padding: 22px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; max-height: 90vh; overflow: auto; }
.credits-card ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.credits-card a { color: var(--accent-2); }

/* ---- publikacja (admin) */
.pub-form { display: flex; flex-direction: column; gap: 8px; max-width: 640px; padding: 18px; }
.pub-form .input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.pub-h2 { margin: 22px 0 10px; font-size: 16px; }
.pub-list { display: flex; flex-direction: column; gap: 10px; }
.pub-row { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; flex-wrap: wrap; }
.pub-row img { border-radius: 8px; object-fit: cover; background: #ddd; }
.pub-info { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--ink-2); }
.pub-info b { color: var(--ink); font-size: 14px; }
.pub-btns { display: flex; gap: 6px; }
.pub-bad { color: #c62828; }

/* przebudowa makiety w bieżącym widoku: mały wskaźnik zamiast zasłaniającego ekranu */
.loader.mini { inset: auto 16px 150px auto; width: 270px; height: auto; background: transparent; backdrop-filter: none; display: block; pointer-events: none; z-index: 30; }
.loader.mini .loader-card { min-width: 0; padding: 10px 14px; border-radius: 12px; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.loader.mini .spinner, .loader.mini .loader-note { display: none; }
.loader.mini .loader-text { margin: 0; font-size: 12px; }

/* ---- edytor mapy 2D */
.mapedit { position: absolute; top: 16px; right: 16px; bottom: 112px; width: min(58vw, 920px); z-index: 12; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.mapedit.me-wide { left: 336px; width: auto; }
.me-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.me-head h2 { font-size: 14px; }
.me-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.me-actions .btn { padding: 5px 10px; font-size: 12px; }
.me-body { flex: 1; display: grid; grid-template-columns: 46px minmax(0, 1fr) 250px; min-height: 0; }
.me-tools { display: flex; flex-direction: column; gap: 4px; padding: 6px; overflow-y: auto; border-right: 1px solid var(--line); }
.me-tool { width: 34px; height: 34px; font-size: 16px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; line-height: 1; }
.me-tool.active { background: var(--accent-soft); border-color: var(--accent); }
.me-stage { position: relative; min-width: 0; background: #26303d; }
#me-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.me-coords { position: absolute; left: 8px; bottom: 6px; font-size: 11px; color: #fff; text-shadow: 0 1px 2px #000; pointer-events: none; }
.me-side { padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; font-size: 12px; border-left: 1px solid var(--line); }
.me-field { display: flex; flex-direction: column; gap: 3px; font-weight: 700; }
.me-count { margin-top: auto; color: var(--ink-2); font-size: 11px; }
.me-sel { display: flex; flex-direction: column; gap: 2px; }
body.me-open #panel-inspector, body.me-open #view-studio > .minimap { display: none !important; }
@media (max-width: 900px) { .mapedit { left: 16px; width: auto; } .me-body { grid-template-columns: 46px minmax(0, 1fr); } .me-side { grid-column: 1 / -1; max-height: 40%; border-left: 0; border-top: 1px solid var(--line); } }
