:root {
  --bg: #0f141c;
  --panel: #161d28;
  --panel-border: #253042;
  --text: #e6ebf2;
  --muted: #8b97a8;
  --accent: #4f8cff;
  --accent-soft: rgba(79, 140, 255, 0.15);
  --saved: #3ecf8e;
  --pending: #8b97a8;
  --partial: #f5b544;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- sidebar ---------- */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 14px;
  background: var(--panel);
  border-right: 1px solid var(--panel-border);
}

.brand {
  font-size: 18px;
  font-weight: 700;
  padding: 0 8px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.side-btn:hover { background: rgba(255, 255, 255, 0.05); }

.side-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.side-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.legend {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.legend-title {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 6px;
}

.legend ul { margin: 0; padding-left: 18px; line-height: 1.6; }

/* ---------- main ---------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
  gap: 16px;
}

.main-header h1 {
  margin: 0;
  font-size: 22px;
}

.run-info {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.map-area {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* the wrapper shrinks to the image so % marker positions line up with it */
.map-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
}

.map-wrap.placing { cursor: crosshair; }

.map-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ---------- lane switcher: our own copy of the game's side switcher, bottom right of the map ----------
   A dark bar; the current side is a light pill, the others a small dash (like the game's, no numbers). */
.lane-switch {
  position: absolute;
  right: 2.5%;
  bottom: 3.5%;
  width: 21%;
  height: 4.4%;
  min-height: 22px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0.35%;
  border-radius: 999px;
  background: rgba(22, 25, 30, 0.88);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.lane-btn {
  appearance: none;
  position: relative;
  min-width: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

/* the small dash on sides that aren't selected */
.lane-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14%;
  height: 12%;
  min-height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  transform: translate(-50%, -50%);
}

.lane-btn.active { background: #e3e5e8; cursor: default; }
.lane-btn.active::after { display: none; }
.lane-btn:not(.active):hover { background: rgba(255, 255, 255, 0.12); }
.lane-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- hut markers ---------- */
.marker {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
}

.marker-badge {
  position: relative; /* anchor for .marker-note */
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--pending);
  color: #0f141c;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* stronghold and towers stand out from the huts */
.marker.stronghold .marker-badge { width: 38px; height: 38px; border-radius: 10px; font-size: 16px; }
.marker.tower .marker-badge { border-radius: 8px; font-size: 12px; }

.marker.saved .marker-badge { background: var(--saved); }
.marker.partial .marker-badge { background: var(--partial); }

/* PP hero portrait in place of the number; the ring colour shows the saved state.
   Sized like the icon diamonds on the map: ~5.5% of the map's width (--map-w is set by app.js). */
.map-wrap {
  --pp-size: max(26px, calc(var(--map-w, 1000px) * 0.055));
  --pp-size-stronghold: max(30px, calc(var(--map-w, 1000px) * 0.06));
}

.marker .marker-badge.pp {
  position: relative;
  width: var(--pp-size);
  height: var(--pp-size);
  border: 3px solid var(--pending);
  background: var(--panel);
}
.marker.stronghold .marker-badge.pp { width: var(--pp-size-stronghold); height: var(--pp-size-stronghold); }
.marker.saved .marker-badge.pp { border-color: var(--saved); background: var(--panel); }
.marker.partial .marker-badge.pp { border-color: var(--partial); background: var(--panel); }

.marker-pp {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.marker-tag {
  position: absolute;
  right: -7px;
  bottom: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid #fff;
  background: var(--bg);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.marker.empty .marker-badge { background: transparent; color: #fff; border-style: dashed; }
.marker.open .marker-badge,
.marker:hover .marker-badge { outline: 3px solid var(--accent); }
.marker:focus-visible { outline: none; }
.marker:focus-visible .marker-badge { outline: 3px solid var(--accent); }

/* ---------- huts without a map position ---------- */
.unplaced-title {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.unplaced-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  appearance: none;
  border: 1px solid var(--panel-border);
  border-left: 4px solid var(--pending);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.chip.saved { border-left-color: var(--saved); }
.chip.open { border-color: var(--accent); }
.chip.partial { border-left-color: var(--partial); }
.chip:hover { border-color: var(--accent); }

/* ---------- hut card: a popover beside the clicked marker (positioned by app.js) ---------- */
.hut-card {
  position: absolute;
  top: 0;
  left: 0;
  width: min(300px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  z-index: 10;
}

.hut-card-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.hut-card-close:hover { color: var(--text); }

.hut-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.hut-card-pp {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--panel-border);
  object-fit: cover;
}

.hut-card-kicker {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hut-card-title {
  margin: 4px 28px 0 0;
  font-size: 17px;
}

.hut-card.multi-round { width: min(580px, calc(100vw - 32px)); }

.hut-card-heroes {
  margin: 0 0 12px;
  padding-left: 20px;
  line-height: 1.6;
}

.hut-card-img {
  display: block;
  width: 100%;
  border-radius: 8px;
}

.hut-card-empty { color: var(--muted); font-size: 14px; margin: 0; }

/* one column per round (R1, R2, ...); they stack when the card is too narrow */
.hut-card-rounds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.round {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.hut-card:not(.multi-round) .round { padding: 0; border: none; background: none; }

.round-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 15px;
}

.round-status {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.round-status.saved { color: var(--saved); }

/* ---------- shared note in the results card ---------- */
.hut-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-border);
}

.hut-note-head { display: flex; align-items: baseline; gap: 8px; }
.hut-note-meta { color: var(--muted); font-size: 12px; }

.hut-note-text {
  margin: 0 0 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.5;
}

.hut-note-text.empty { color: var(--muted); }

.hut-note-form { display: grid; gap: 8px; }

.hut-note-input {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 8px;
}

.hut-note-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.hut-note-count { margin-left: auto; align-self: center; color: var(--muted); font-size: 12px; }

.hut-note-error {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 4px solid var(--partial);
  border-radius: 6px;
  background: rgba(245, 181, 68, 0.1);
  font-size: 13px;
}

.hut-note-error blockquote {
  margin: 6px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}

/* ---------- screenshots in the results card (shots.js) ---------- */
.hut-shots {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-border);
}

.shot-group + .shot-group { margin-top: 10px; }
.shot-label { margin: 6px 0; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

.shot-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.shot-slot {
  min-height: 84px;
  border: 1px dashed var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.shot-slot.filled { border-style: solid; }
.shot-slot.target,
.shot-slot.drop { border-color: var(--accent); border-style: solid; background: var(--accent-soft); }
.shot-slot.busy { opacity: 0.6; }

.shot-empty {
  flex: 1;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  padding: 10px;
  cursor: pointer;
}

.shot-empty:hover { color: var(--text); }

.shot-view { display: block; line-height: 0; background: var(--bg); }
.shot-view img { width: 100%; max-height: 180px; object-fit: contain; }

.shot-actions {
  display: flex;
  gap: 6px;
  padding: 6px;
  border-top: 1px solid var(--panel-border);
}

.shot-actions .small-btn { flex: 1; padding: 4px 6px; font-size: 12px; }

/* Gear stats: one add box, then everyone's screenshots, newest first */
.gear-drop { min-height: 44px; }

.gear-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.gear-item {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
}

.gear-item.busy { opacity: 0.6; }

.gear-caption {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 13px;
}

.gear-when { color: var(--muted); font-size: 12px; }
.gear-caption .small-btn { margin-left: auto; padding: 3px 8px; font-size: 12px; }
.gear-item .shot-view img { max-height: 260px; }

.hut-shots-status { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.hut-shots-status.error { color: #ff8a8a; }

/* small speech bubble on markers whose place has a note */
.marker-note {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 12px;
  height: 12px;
  border-radius: 50% 50% 50% 0;
  background: var(--accent);
  border: 2px solid var(--bg);
  pointer-events: none;
}

/* ---------- placement mode ---------- */
.place-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 14px;
}

.place-panel > * { min-width: 0; }
.place-text { overflow-wrap: anywhere; }
.place-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.place-output {
  width: 100%;
  resize: vertical;
  font: 12px ui-monospace, Consolas, monospace;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 8px;
}

.place-panel code,
.map-missing code {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

.small-btn {
  appearance: none;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.small-btn:hover { border-color: var(--accent); }
.small-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

.map-missing {
  text-align: center;
  padding: 40px 24px;
  border: 2px dashed var(--panel-border);
  border-radius: 12px;
  color: var(--muted);
  max-width: 460px;
}

.missing-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

/* ---------- roster builder (roster.js) ---------- */
.roster-toggle {
  appearance: none;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.roster-toggle:hover,
.roster-toggle.active { background: var(--accent-soft); }

.roster-bar {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 14px;
}

.roster-progress {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.roster-editor { width: min(560px, calc(100vw - 32px)); }

.roster-form { display: grid; gap: 12px; margin-top: 12px; }

.roster-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: start;
  gap: 8px;
}

.roster-row-label {
  padding-top: 8px;
  font-weight: 700;
  font-size: 14px;
}

.team-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
}

.team-fields.single { grid-template-columns: minmax(0, 1fr); }

.hero-field {
  position: relative;
  min-width: 0;
}

.hero-icon {
  position: absolute;
  left: 5px;
  top: 50%;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.hero-input {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 7px 8px;
}

.hero-icon:not([hidden]) + .hero-input { padding-left: 34px; }
.hero-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.hero-input.unknown { border-color: var(--partial); }

.roster-form-error { margin: 0; color: #ff8a8a; font-size: 13px; }

/* reading R1 / R2 from a pasted screenshot (reader.js) */
.roster-read {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px dashed var(--panel-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.roster-read-status { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.roster-read-status.error { color: var(--partial); }
.roster-read .small-btn { flex-shrink: 0; }

/* a hero read from a screenshot that needs checking; clicking it shows the other likely heroes */
.hero-input.doubtful {
  border-color: var(--partial);
  box-shadow: 0 0 0 2px rgba(245, 181, 68, 0.25);
}
.roster-hero-status { margin: 0; color: var(--muted); font-size: 13px; }
.roster-form-actions { margin-top: 2px; }

.hero-suggest {
  position: absolute;
  z-index: 30;
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

.hero-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.hero-option img { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.hero-option.active,
.hero-option:hover { background: var(--accent-soft); }

/* review dialog */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 8, 12, 0.7);
}

.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-title { margin: 0 0 12px; font-size: 19px; }
.modal-actions { margin-top: 16px; justify-content: flex-end; }

.review-warnings {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-left: 4px solid var(--partial);
  border-radius: 6px;
  background: rgba(245, 181, 68, 0.1);
  font-size: 14px;
}

.review-warnings p { margin: 0; }
.review-warnings p + p { margin-top: 4px; }

.review-side + .review-side { margin-top: 14px; }
.review-side h3 { margin: 0 0 8px; font-size: 15px; }
.review-none { margin: 0; color: var(--muted); font-size: 14px; }

.review-place {
  padding: 8px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.review-place + .review-place { margin-top: 6px; }
.review-place-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }

.review-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.review-line + .review-line { margin-top: 4px; }
.review-tag { width: 26px; color: var(--muted); font-weight: 700; }

.review-hero {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.review-hero img { width: 20px; height: 20px; border-radius: 50%; }
.review-hero.unknown { padding-left: 8px; outline: 1px solid var(--partial); }

.small-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- site password box over the map (app.js) ---------- */
.lock {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 11, 16, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lock-card {
  width: min(480px, 100%);
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* the pillow, cut out as a circle */
.lock-pillow {
  display: block;
  width: 170px;
  height: 170px;
  margin: 0 auto 20px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 3px solid var(--panel-border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.lock-quote {
  margin: 0 0 24px;
  padding: 0 4px;
  text-align: center;
  font-style: italic;
  font-size: 19px;
  line-height: 1.5;
  color: var(--text);
}

.lock-quote::before { content: "\201C"; }
.lock-quote::after { content: "\201D"; }

.lock-title { margin: 0 0 4px; font-size: 19px; }
.lock-text { margin: 0 0 14px; color: var(--muted); font-size: 15px; }

.lock-input {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 16px;
}

.lock-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.lock-submit {
  width: 100%;
  margin-top: 14px;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
}

.lock-submit:disabled { opacity: 0.6; cursor: wait; }
.lock-error { margin: 12px 0 0; color: #ff8a8a; font-size: 15px; }

/* ---------- reset map (app.js): kept apart from the everyday buttons ---------- */
.danger-zone {
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
}

.reset-open {
  appearance: none;
  border: 1px solid rgba(255, 107, 107, 0.45);
  background: transparent;
  color: #ff8a8a;
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.reset-open:hover { background: rgba(255, 107, 107, 0.12); }
.reset-modal { width: min(440px, 100%); }
.reset-text { margin: 0 0 10px; font-size: 14px; line-height: 1.5; }
.reset-summary { margin: 0; color: var(--muted); font-size: 13px; }
.small-btn.danger { background: #d64545; border-color: #d64545; color: #fff; }
.small-btn.danger:hover { background: #e05555; }

[hidden] { display: none !important; }

/* ---------- narrow screens: sidebar becomes a top bar ---------- */
@media (max-width: 700px) {
  .layout { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar {
    width: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
  }
  .side-nav { flex-direction: row; }
  .roster-toggle { padding: 8px 10px; }
  .legend { display: none; }
  .main { padding: 16px; }
  .map-area { display: block; flex: none; }
  .map-wrap { display: block; }
  .map-img { width: 100%; height: auto; max-height: none; }
  .marker-badge { width: 24px; height: 24px; font-size: 12px; }
  .marker.stronghold .marker-badge { width: 30px; height: 30px; font-size: 13px; }
  .marker.tower .marker-badge { font-size: 10px; }
  .marker .marker-badge.pp { border-width: 2px; }
  .lock-card { padding: 24px; }
  .lock-pillow { width: 140px; height: 140px; }
  .lock-quote { font-size: 17px; }
  .marker-tag { min-width: 14px; height: 14px; font-size: 8px; right: -5px; bottom: -5px; }
  .hut-card { padding: 14px; max-height: 75vh; }
}
