:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #eef2f7;
  background: #0b1220;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { background: #0b1220; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 50% -20%, #1a2941 0, #0b1220 42%); }
button { font: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 16px 22px;
  border-bottom: 1px solid #334155;
  background: rgba(18, 29, 47, 0.96);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand-block strong { font-size: 1.03rem; letter-spacing: .02em; }
.resources { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.resource-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #344258;
  background: #121c2d;
  border-radius: 999px;
  padding: 6px 9px;
  color: #f8fafc;
  white-space: nowrap;
}
.subtle { color: #9eacc0; font-size: .9rem; }

.progress-wrap { max-width: 1240px; margin: 0 auto; padding: 14px 18px 0; }
.phase-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid #2c3a50;
  background: rgba(17, 28, 45, .75);
  border-radius: 14px;
}
.phase-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  color: #718096;
  font-size: .88rem;
  border-radius: 10px;
}
.phase-step.active { background: #1d2b43; color: #fff; font-weight: 700; }
.phase-step.done { color: #a8d6be; }
.phase-dot {
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: .72rem;
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .75fr);
  gap: 18px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px;
}
.left-column, .right-column { display: flex; flex-direction: column; gap: 18px; }
.panel, .map-card {
  background: linear-gradient(180deg, #182437 0%, #162132 100%);
  border: 1px solid #334155;
  border-radius: 18px;
  padding: 19px;
  box-shadow: 0 14px 34px rgba(0,0,0,.22);
}

.map-header, .village-heading, .event-meta, .status-row, .end-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.map-header h2 { margin-bottom: 8px; }
.map-legend { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; color: #9eacc0; font-size: .78rem; }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend-dot.stable { background: #5bb98c; }
.legend-dot.warning { background: #d7a74b; }
.legend-dot.critical { background: #df6a6a; }

.map-area { aspect-ratio: 16/9; min-height: 340px; }
.map-svg { width: 100%; height: 100%; background: linear-gradient(180deg, #101a2b, #111c2f); border-radius: 13px; overflow: hidden; }
.grid-line { fill: none; stroke: #223149; stroke-width: .22; opacity: .45; }
.gmina-boundary { fill: rgba(56, 83, 120, .16); stroke: #52637c; stroke-width: .7; stroke-dasharray: 2 1.5; }
.road { stroke: #66768d; stroke-width: 1.05; stroke-linecap: round; opacity: .74; }
.village-marker { cursor: pointer; outline: none; }
.village-marker text { fill: #f3f7fb; font-size: 3.7px; font-weight: 700; paint-order: stroke; stroke: #0d1625; stroke-width: .7px; }
.marker-core { stroke: #0b1220; stroke-width: .9; }
.village-marker.stable .marker-core { fill: #69c398; }
.village-marker.warning .marker-core { fill: #e1b559; }
.village-marker.critical .marker-core { fill: #e46f6f; }
.selection-ring { fill: none; stroke: #eef6ff; stroke-width: .8; opacity: .9; }
.map-caption-svg { fill: #73849c; font-size: 2.2px; letter-spacing: .04em; }
.map-note { margin-top: 10px; color: #8ea0b8; font-size: .84rem; }

h1, h2, h3 { margin-top: 0; color: #f8fafc; }
h2 { font-size: 1.52rem; }
h3 { font-size: 1.05rem; }
p { line-height: 1.58; }
.eyebrow { font-size: .74rem; letter-spacing: .12em; color: #91a5bd; text-transform: uppercase; margin-bottom: 7px; }

.village-heading { align-items: center; }
.village-heading h2 { margin-bottom: 0; }
.village-population { margin: 2px 0 10px; }
.status-badge, .severity-chip {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: .74rem;
  font-weight: 750;
  border: 1px solid transparent;
}
.status-badge.stable, .severity-chip.low { color: #a9e5c8; background: rgba(47, 126, 91, .2); border-color: rgba(81, 175, 132, .35); }
.status-badge.warning, .severity-chip.medium { color: #f2d18b; background: rgba(147, 101, 25, .2); border-color: rgba(210, 154, 60, .35); }
.status-badge.critical, .severity-chip.high, .severity-chip.critical { color: #ffb3b3; background: rgba(144, 50, 50, .2); border-color: rgba(218, 89, 89, .38); }

.metric { margin: 14px 0; }
.metric-row { display: flex; justify-content: space-between; margin-bottom: 6px; color: #dce4ef; }
.bar { height: 8px; background: #2d3a4d; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width .25s ease; }
.bar-fill.stable { background: #73c69e; }
.bar-fill.warning { background: #d9ad58; }
.bar-fill.critical { background: #dc6d6d; }
.site-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.site-tags span { border: 1px solid #39485c; border-radius: 999px; padding: 5px 9px; font-size: .82rem; color: #c4cfdd; background: #111b2c; }

.event-panel { position: relative; overflow: hidden; }
.event-panel::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #74859d; }
.event-panel.severity-low::before { background: #5bb98c; }
.event-panel.severity-medium::before { background: #d7a74b; }
.event-panel.severity-high::before, .event-panel.severity-critical::before { background: #df6a6a; }
.event-meta { align-items: center; }
.event-meta .eyebrow { margin: 0; }
.event-text { font-size: 1.04rem; line-height: 1.62; color: #edf2f7; }
.decision-label { margin-top: 21px; color: #91a5bd; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.event-type-label { margin: 18px 0 6px; color: #a8bad0; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.info-consequence .event-type-label { color: #9ed9bc; }
.info-message .event-type-label { color: #adc3dd; }
.consequence-box { margin: 14px 0 18px; padding: 12px 14px; border: 1px solid #3d536c; border-radius: 11px; background: #101b2c; color: #c5d2df; line-height: 1.5; }
.info-event .primary { margin-top: 10px; }
.choices { display: grid; gap: 10px; margin-top: 9px; }
.choice {
  text-align: left;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #41516a;
  background: #0e1828;
  color: #f9fafb;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.choice:hover:not(:disabled) { border-color: #8394aa; transform: translateY(-1px); background: #122036; }
.choice:disabled { opacity: .42; cursor: not-allowed; }
.choice small { display: block; margin-top: 7px; color: #91a5bd; }
.choice-warning { color: #e99b9b !important; }
.outcome-panel { border-color: #526783; }
.outcome-choice { background: #101a2a; border: 1px solid #33445b; border-radius: 10px; padding: 11px 12px; color: #b8c6d8; }
.phase-complete { text-align: left; }
.full { width: 100%; }

.primary, .secondary {
  border-radius: 10px;
  padding: 11px 16px;
  cursor: pointer;
  border: 1px solid #687b95;
  transition: transform .14s ease, opacity .14s ease;
}
.primary:hover, .secondary:hover { transform: translateY(-1px); }
.primary { background: #edf3fa; color: #0d1725; font-weight: 800; }
.secondary { background: transparent; color: #cdd7e4; }

.status-row { align-items: center; }
.status-row h3 { margin-bottom: 0; }
.score-small { font-size: 2.25rem; font-weight: 900; letter-spacing: -.04em; }
.score-small span { font-size: 1rem; color: #8090a5; letter-spacing: 0; }
.stability-bar { height: 10px; border-radius: 999px; background: #29374b; overflow: hidden; margin: 3px 0 9px; }
.stability-bar > div { height: 100%; background: linear-gradient(90deg, #557a95, #9bc4b0); border-radius: inherit; }

.history-panel h3 { margin-bottom: 12px; }
.history-mini { display: grid; gap: 8px; }
.history-mini-item { border-left: 2px solid #44566f; padding: 3px 0 3px 10px; }
.history-mini-item span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #7f91a8; margin-bottom: 2px; }
.history-mini-item strong { font-size: .88rem; color: #d9e2ed; font-weight: 600; }

.start-screen, .end-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.start-card, .end-card {
  width: min(940px, 100%);
  background: linear-gradient(160deg, #17243a, #111b2b 72%);
  border: 1px solid #3a4b63;
  border-radius: 24px;
  padding: clamp(24px, 4vw, 44px);
  box-shadow: 0 28px 70px rgba(0,0,0,.34);
}
.start-kicker { color: #91a5bd; letter-spacing: .14em; font-size: .76rem; font-weight: 800; }
.start-card h1 { font-size: clamp(2.3rem, 7vw, 4.6rem); letter-spacing: -.055em; margin: 12px 0 14px; line-height: .96; max-width: 760px; }
.start-lead { font-size: 1.1rem; color: #d4deea; max-width: 780px; }
.mission-card { margin: 28px 0; padding: 20px; border: 1px solid #465a75; border-radius: 16px; background: #0f1a2b; }
.mission-time { color: #a9bdd3; font-size: .76rem; letter-spacing: .12em; font-weight: 800; }
.mission-card h2 { margin: 7px 0 6px; }
.mission-card p { margin-bottom: 0; color: #bcc9d8; }
.start-rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.start-rules > div { border: 1px solid #33445a; border-radius: 13px; padding: 14px; background: rgba(9, 16, 28, .44); }
.start-rules strong, .start-rules span { display: block; }
.start-rules span { color: #91a5bd; font-size: .86rem; margin-top: 5px; line-height: 1.4; }
.start-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.start-button { min-width: 220px; }
.fiction-note { margin: 20px 0 0; color: #6f829a; font-size: .78rem; }

.end-header { align-items: center; border-bottom: 1px solid #33445a; padding-bottom: 22px; }
.end-header > div:first-child { max-width: 620px; }
.end-header p { color: #b7c4d4; }
.end-score-block { min-width: 180px; text-align: center; border: 1px solid #455873; border-radius: 16px; padding: 15px; background: #0d1828; }
.end-score-block span { display: block; color: #8da0b8; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.score { font-size: 4rem; font-weight: 950; line-height: 1; margin: 8px 0; letter-spacing: -.06em; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 22px 0 12px; }
.summary-metric { border: 1px solid #33445a; border-radius: 12px; padding: 13px; background: #101a2a; }
.summary-metric span, .summary-metric strong { display: block; }
.summary-metric span { color: #91a5bd; font-size: .8rem; }
.summary-metric strong { margin-top: 3px; font-size: 1.15rem; }
.resource-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.resource-summary span { background: #0f1929; border: 1px solid #33445a; border-radius: 999px; padding: 7px 10px; color: #b9c6d5; }
.full-history { max-height: 390px; overflow: auto; padding-right: 4px; }
.history-row { display: grid; grid-template-columns: 130px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid #29384d; }
.history-row > span { color: #8194ac; font-size: .78rem; text-transform: uppercase; }
.history-row strong { color: #edf3fa; }
.history-row p { margin: 3px 0 0; color: #aab8c9; font-size: .9rem; }
.prototype-note { margin: 20px 0; border: 1px solid #3f536e; background: #101b2e; color: #aebed0; border-radius: 12px; padding: 12px; font-size: .88rem; }

@media (max-width: 920px) {
  .topbar { align-items: flex-start; }
  .game-grid { grid-template-columns: 1fr; }
  .right-column { order: -1; }
  .map-area { min-height: 300px; }
}

@media (max-width: 680px) {
  .topbar { position: static; flex-direction: column; gap: 10px; padding: 14px; }
  .resources { justify-content: flex-start; gap: 6px; }
  .resource-item { font-size: .86rem; padding: 5px 7px; }
  .progress-wrap { padding: 10px 10px 0; overflow-x: auto; }
  .phase-strip { min-width: 480px; }
  .game-grid { padding: 10px; gap: 12px; }
  .panel, .map-card { border-radius: 14px; padding: 15px; }
  .right-column, .left-column { gap: 12px; }
  .map-header { flex-direction: column; }
  .map-legend { justify-content: flex-start; }
  .map-area { min-height: 245px; }
  .event-text { font-size: 1rem; }
  .start-screen, .end-screen { padding: 12px; }
  .start-card, .end-card { border-radius: 17px; padding: 20px; }
  .start-rules, .summary-grid { grid-template-columns: 1fr; }
  .start-actions { flex-direction: column; }
  .start-button { width: 100%; }
  .end-header { flex-direction: column; align-items: stretch; }
  .end-score-block { width: 100%; }
  .history-row { grid-template-columns: 1fr; gap: 4px; }
}

/* Nawigacja do portalu gier */
.portal-link, .back-link {
  color: #8fa5bc;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.portal-link { display: block; margin-bottom: 5px; }
.back-link { display: inline-block; margin-bottom: 18px; }
.portal-link:hover, .back-link:hover { color: #eef5fc; }

/* =========================================================
   v0.2.2 — UX, status operacyjny i nowa mapa
   ========================================================= */

/* Bardziej zwarty nagłówek */
.topbar {
  padding: 11px 18px;
  gap: 16px;
}
.brand-block strong { font-size: .94rem; }
.brand-block .subtle { font-size: .78rem; }
.portal-link { margin-bottom: 3px; font-size: .7rem; }
.resources { gap: 6px; }
.resource-item { padding: 4px 7px; font-size: .82rem; }

.progress-wrap { padding-top: 10px; }
.phase-strip { padding: 7px; gap: 6px; }
.phase-step { min-height: 32px; font-size: .8rem; }
.phase-dot { width: 20px; height: 20px; font-size: .66rem; }

/* Pasek operacyjny widoczny przed mapą i wydarzeniami */
.overview-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 18px 0;
}
.overview-strip {
  display: grid;
  grid-template-columns: minmax(180px, 1.15fr) minmax(110px, .45fr) minmax(0, 2.4fr);
  align-items: stretch;
  gap: 8px;
  padding: 9px;
  border: 1px solid #33465f;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(24, 37, 57, .95), rgba(17, 28, 44, .95));
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}
.overview-main,
.overview-trust,
.overview-metric {
  border: 1px solid #33465e;
  background: #101a2a;
  border-radius: 10px;
  min-height: 55px;
}
.overview-main { padding: 7px 10px; }
.overview-main > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.overview-main span,
.overview-trust span,
.overview-metric span {
  color: #91a5bc;
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.overview-main strong { font-size: 1.45rem; line-height: 1; letter-spacing: -.04em; }
.overview-main strong small { font-size: .72rem; color: #7f92aa; margin-left: 2px; letter-spacing: 0; }
.overview-progress { margin-top: 6px; height: 5px; border-radius: 99px; background: #2a394d; overflow: hidden; }
.overview-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #5d88a4, #9fcab5); }
.overview-trust { display: flex; flex-direction: column; justify-content: center; padding: 7px 10px; }
.overview-trust strong { margin-top: 2px; font-size: 1rem; }
.overview-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.overview-metric { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 7px 8px; min-width: 0; }
.overview-metric span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overview-metric strong { font-size: .93rem; }
.overview-metric.stable strong { color: #a9e5c8; }
.overview-metric.warning strong { color: #f2d18b; }
.overview-metric.critical strong { color: #ffb3b3; }

.game-grid { padding-top: 12px; }

/* Mapa operacyjna */
.map-card { padding: 15px; }
.map-header { align-items: flex-start; margin-bottom: 9px; }
.map-header h2 { margin: 2px 0 2px; font-size: 1.3rem; }
.map-subtitle { color: #7f92aa; font-size: .76rem; line-height: 1.35; }
.map-area { aspect-ratio: 16 / 9.4; min-height: 360px; }
.map-svg {
  background: #0c1726;
  border: 1px solid #2b3e56;
  box-shadow: inset 0 0 40px rgba(0,0,0,.26);
}
.map-background { fill: #0c1726; }
.grid-line { stroke: #2a3c52; stroke-width: .18; opacity: .28; }
.field { stroke: rgba(104, 132, 104, .22); stroke-width: .28; }
.field-a, .field-d { fill: rgba(55, 89, 66, .16); }
.field-b, .field-e { fill: rgba(98, 91, 59, .10); }
.field-c { fill: rgba(62, 90, 80, .12); }
.gmina-boundary {
  fill: rgba(40, 66, 91, .10);
  stroke: #6a7e94;
  stroke-width: .55;
  stroke-dasharray: 1.8 1.25;
  opacity: .88;
}
.terrain-line { fill: none; stroke: rgba(116, 142, 157, .16); stroke-width: .35; stroke-dasharray: 1.2 1.5; }
.road { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.road-primary { stroke: #77879a; stroke-width: 1.05; opacity: .72; }
.road-secondary { stroke: #52657c; stroke-width: .58; opacity: .52; stroke-dasharray: 1.1 .7; }
.context-village circle { fill: #718198; opacity: .62; }
.context-village text { fill: #6f8298; font-size: 2.05px; font-weight: 600; opacity: .78; paint-order: stroke; stroke: #0b1421; stroke-width: .42px; }
.village-marker { cursor: pointer; outline: none; }
.village-marker .village-name { fill: #f3f7fb; font-size: 3.1px; font-weight: 760; paint-order: stroke; stroke: #08111d; stroke-width: .7px; }
.marker-halo { fill: #0b1522; stroke: rgba(235,244,252,.25); stroke-width: .5; }
.marker-core { stroke: #07111c; stroke-width: .45; filter: url(#softGlow); }
.village-marker.stable .marker-core { fill: #6dcca0; }
.village-marker.warning .marker-core { fill: #e0b24f; }
.village-marker.critical .marker-core { fill: #eb6d70; }
.selection-ring { fill: none; stroke: #eaf4ff; stroke-width: .65; opacity: .96; }
.event-ring { fill: none; stroke: #f3c96c; stroke-width: .5; opacity: .95; transform-box: fill-box; transform-origin: center; animation: eventPulse 1.55s ease-out infinite; }
@keyframes eventPulse { 0% { transform: scale(.82); opacity: .95; } 75%,100% { transform: scale(1.55); opacity: 0; } }
.alert-badge circle { fill: #d96767; stroke: #0a1421; stroke-width: .35; }
.alert-badge text { fill: #fff; font-size: 2.2px; font-weight: 900; stroke: none; }
.north-arrow path { fill: #91a6bc; }
.north-arrow text { fill: #91a6bc; font-size: 2.4px; font-weight: 800; }
.map-caption-svg { fill: #667b92; font-size: 1.75px; }
.map-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: #7f92a8;
  font-size: .74rem;
}
.map-footer strong { color: #b9c8d8; font-weight: 650; }

/* Kompaktowy stan wybranej miejscowości */
.compact-village-panel { padding: 14px 15px; }
.compact-village-panel .village-heading { align-items: flex-start; }
.compact-village-panel h2 { font-size: 1.22rem; margin: 1px 0 0; }
.compact-village-panel .village-population { margin: 3px 0 0; font-size: .76rem; }
.village-metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.village-metric { min-width: 0; padding: 8px 9px; border: 1px solid #35475e; border-radius: 10px; background: #101a2a; }
.village-metric > span { display: block; color: #91a5bc; font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.village-metric > strong { display: block; margin-top: 2px; font-size: 1rem; }
.village-metric.stable > strong { color: #a9e5c8; }
.village-metric.warning > strong { color: #f2d18b; }
.village-metric.critical > strong { color: #ffb3b3; }
.mini-bar { height: 4px; margin-top: 5px; border-radius: 99px; background: #2a394d; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: #7ea3b9; border-radius: inherit; }
.village-metric.stable .mini-bar i { background: #6cbf96; }
.village-metric.warning .mini-bar i { background: #d5a64b; }
.village-metric.critical .mini-bar i { background: #d86668; }
.village-sites-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px solid #2c3d52; }
.village-sites-row > span { flex: 0 0 auto; color: #7f92a8; font-size: .7rem; }
.compact-village-panel .site-tags { gap: 5px; }
.compact-village-panel .site-tags span { padding: 3px 7px; font-size: .71rem; }

/* Drobne odchudzenie kart */
.panel { padding: 16px; }
.event-panel h2 { font-size: 1.38rem; margin-bottom: 8px; }
.event-text { font-size: .97rem; line-height: 1.55; }
.choice { padding: 11px 12px; }
.choice small { margin-top: 5px; }
.history-panel { padding: 13px 15px; }
.history-panel h3 { margin-bottom: 8px; }
.history-mini { gap: 6px; }
.history-mini-item strong { font-size: .82rem; }

@media (max-width: 1040px) {
  .overview-strip { grid-template-columns: minmax(180px, .9fr) minmax(110px, .45fr) minmax(0, 1.9fr); }
  .overview-metric { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; }
}

@media (max-width: 920px) {
  .overview-strip { grid-template-columns: 1.2fr .7fr; }
  .overview-metrics { grid-column: 1 / -1; }
  .map-area { min-height: 330px; }
}

@media (max-width: 680px) {
  .topbar { position: sticky; top: 0; flex-direction: column; gap: 7px; padding: 9px 10px; }
  .brand-block { width: 100%; }
  .brand-block strong { font-size: .82rem; }
  .brand-block .subtle { font-size: .7rem; }
  .portal-link { display: none; }
  .resources { width: 100%; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 2px; scrollbar-width: none; }
  .resources::-webkit-scrollbar { display: none; }
  .resource-item { flex: 0 0 auto; font-size: .74rem; padding: 3px 6px; }

  .progress-wrap { padding: 7px 8px 0; }
  .phase-strip { min-width: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 5px; gap: 4px; }
  .phase-step { min-height: 29px; font-size: .68rem; gap: 4px; }
  .phase-dot { width: 17px; height: 17px; font-size: .58rem; }

  .overview-wrap { padding: 7px 8px 0; }
  .overview-strip { grid-template-columns: 1.25fr .75fr; gap: 5px; padding: 6px; border-radius: 11px; }
  .overview-main, .overview-trust, .overview-metric { min-height: 47px; border-radius: 8px; }
  .overview-main { padding: 6px 8px; }
  .overview-main strong { font-size: 1.18rem; }
  .overview-main span, .overview-trust span, .overview-metric span { font-size: .61rem; }
  .overview-trust { padding: 6px 8px; }
  .overview-trust strong { font-size: .86rem; }
  .overview-metrics { gap: 4px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .overview-metric { padding: 5px 6px; flex-direction: column; align-items: flex-start; }
  .overview-metric span { max-width: 100%; }
  .overview-metric strong { font-size: .8rem; }

  .game-grid { padding: 8px; gap: 9px; }
  .right-column, .left-column { gap: 9px; }
  .panel, .map-card { padding: 12px; border-radius: 12px; }
  .right-column { order: -1; }
  .event-panel { order: 0; }
  .history-panel { order: 2; }
  .map-header { gap: 7px; margin-bottom: 7px; }
  .map-header h2 { font-size: 1.12rem; }
  .map-subtitle { font-size: .67rem; }
  .map-legend { gap: 7px; font-size: .66rem; }
  .map-area { min-height: 245px; aspect-ratio: 1.25 / 1; }
  .village-marker .village-name { font-size: 3.7px; }
  .context-village text { font-size: 2.35px; }
  .map-footer { font-size: .67rem; gap: 4px; }
  .map-footer strong { width: 100%; }

  .compact-village-panel { padding: 11px 12px; }
  .compact-village-panel h2 { font-size: 1.08rem; }
  .village-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
  .village-metric { padding: 6px 7px; }
  .village-sites-row { align-items: flex-start; flex-direction: column; gap: 5px; margin-top: 8px; padding-top: 7px; }
  .event-panel h2 { font-size: 1.2rem; }
  .event-text { font-size: .91rem; }
  .decision-label { margin-top: 15px; }
  .choice { padding: 10px; }
  .history-panel { display: none; }
}

@media (max-width: 390px) {
  .overview-metric span { font-size: .56rem; }
  .overview-metric strong { font-size: .74rem; }
  .phase-step { font-size: .62rem; }
  .phase-dot { display: none; }
}

/* v0.3 — mapa: czytelniejsze miejscowości i aktywne zdarzenia */
.village-marker .village-name { font-size: 3.55px; stroke-width: .8px; }
.event-label {
  fill: #f3c96c;
  font-size: 1.85px;
  font-weight: 900;
  letter-spacing: .11em;
  paint-order: stroke;
  stroke: #08111d;
  stroke-width: .6px;
}
.alert-badge text { font-size: 2.45px; font-weight: 900; }
.village-marker.event-active .marker-core { filter: url(#softGlow); }
.crisis-end { border-color: rgba(217, 103, 103, .55); }
.inline-score { margin: 22px 0; max-width: 220px; }

@media (max-width: 680px) {
  .village-marker .village-name { font-size: 4.1px; }
  .event-label { font-size: 2.15px; }
  .alert-badge text { font-size: 2.7px; }
}
