:root {
  --black: #060806;
  --black-soft: #0d100c;
  --panel-bg: #0a0c09;
  --line: rgba(201, 255, 60, 0.14);
  --lime: #c9ff3c;
  --lime-dim: #8fc21f;
  --lime-deep: #4c6e15;
  --ink-text: #e9ffcf;
  --ink-muted: #7d9169;
  --danger: #ff4d4d;
  --shadow: rgba(0, 0, 0, 0.6);

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--black);
  color: var(--ink-text);
  font-family: var(--font-body);
  overflow: hidden;
}

body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
}

button { font-family: var(--font-body); cursor: pointer; }

/* ---------------- Custom scrollbars (theme the ugly native ones) ---------- */
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--lime-deep) transparent; }
/* WebKit / Chromium */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--lime-deep);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--lime);
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner { background: transparent; }

/* ---------------- Topbar ---------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 24px;
  background: var(--black-soft);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}

.mark { color: var(--lime); flex-shrink: 0; }
.compass { width: 30px; height: 30px; filter: drop-shadow(0 0 6px rgba(201,255,60,0.55)); }

.title-block h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--ink-text);
  text-transform: uppercase;
}
.title-block h1 span { color: var(--lime); }

.title-row { display: flex; align-items: center; gap: 10px; }

/* Testnet warning badge — amber so it reads as "not the real thing". */
.network-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #0a0c09;
  background: #f5b301;
  border-radius: 3px;
  padding: 3px 7px;
  line-height: 1;
  white-space: nowrap;
}
.network-badge[hidden] { display: none; }

.subtitle {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

.topbar-stats {
  margin-left: auto;
  display: flex;
  gap: 26px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  margin-left: 8px;
}

.stat { display: flex; flex-direction: column; align-items: center; }
.stat-value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 16px;
  color: var(--lime);
}
/* sold-out: the minted counter reads N/N — make it pop */
.stat-value.is-soldout { color: var(--lime); text-shadow: 0 0 10px var(--lime); }
.stat-label {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.seal-button {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--black);
  background: var(--lime);
  border: 1px solid var(--lime);
  border-radius: 2px;
  padding: 10px 18px;
  box-shadow: 0 0 0 rgba(201,255,60,0);
  transition: box-shadow 0.15s ease, transform 0.12s ease, background 0.15s ease;
}
.seal-button:hover { box-shadow: 0 0 18px rgba(201,255,60,0.55); transform: translateY(-1px); }
.seal-button:active { transform: translateY(1px); }
.seal-button:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; transform: none; background: var(--lime-deep); border-color: var(--lime-deep); color: #cfe6ad;}
.seal-button.wide { width: 100%; padding: 12px; }

.ghost-button {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: transparent;
  border: 1px solid var(--ink-muted);
  color: var(--ink-muted);
  border-radius: 2px;
  padding: 6px 10px;
}
.ghost-button:hover { color: var(--lime); border-color: var(--lime); }
.ghost-button.small { padding: 6px 8px; font-size: 10.5px; }

/* Square icon-only link (e.g. the X social button) — matches ghost-button. */
.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  border: 1px solid var(--ink-muted);
  border-radius: 2px;
  color: var(--ink-muted);
  transition: color 0.15s, border-color 0.15s;
}
.icon-link:hover { color: var(--lime); border-color: var(--lime); }
.icon-link .btn-ico { margin: 0; }
.seal-button.small { padding: 8px 10px; font-size: 10.5px; }
.seal-button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---------------- Map stage ---------------- */

.mapstage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 40%, #0c1108 0%, #030402 78%);
}

.mapviewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none; /* let us handle wheel-zoom / drag-pan ourselves */
}
.mapviewport.is-panning { cursor: grabbing; }

.maplayer {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.maplayer canvas {
  position: absolute;
  top: 0;
  left: 0;
  image-rendering: pixelated;
}

#hoverCanvas { pointer-events: none; }

.zoom-controls {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}
.zoom-controls button {
  width: 34px;
  height: 34px;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: var(--panel-bg);
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 15px;
}
.zoom-controls button:hover { border-color: var(--lime); box-shadow: 0 0 10px rgba(201,255,60,0.3); }

/* ---------------- Bottom-left stacked cards (mint + legend) ---------------- */
.map-bottom-left {
  position: absolute;
  left: 20px;
  bottom: 20px;
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
}

/* Top-left personal nav: My Rank + My Plots. Same cards as Mint/Info, positioned
   top-left. All the card styling comes from .map-card / .map-card-toggle. */
.map-top-left {
  position: absolute;
  left: 20px;
  top: 20px;
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
}
.map-top-left .map-card-toggle[aria-pressed="true"] { color: var(--lime); }

/* Shared collapsible card used by both the mint panel and the legend. */
.map-card {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--font-mono);
  color: var(--ink-muted);
  overflow: hidden;
}
.map-card-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  color: var(--ink-text);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.map-card-toggle:hover { color: var(--lime); }
.map-card-sub {
  color: var(--lime);
  letter-spacing: 0;
  text-transform: none;
  margin-left: 6px;
}
.card-caret { width: 11px; height: 11px; transition: transform 0.18s ease; flex-shrink: 0; }
.map-card.is-collapsed .card-caret { transform: rotate(-90deg); }

.map-card-body { padding: 0 12px 12px; display: block; }
.map-card.is-collapsed .map-card-body { display: none; }

.map-legend-group-title {
  margin: 6px 0 5px;
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
  opacity: 0.7;
}
.map-legend-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  font-size: 9.5px;
}
.map-legend-row span { display: flex; align-items: center; gap: 5px; }

/* Status swatches mirror the map: state is shown by BORDER style, not fill,
   so nothing competes with the rarity fill colors. */
.legend-dot { width: 9px; height: 9px; display: inline-block; flex-shrink: 0; box-sizing: border-box; }
.legend-dot.free { background: rgba(16,28,8,0.85); border: 1px solid var(--line); } /* fog, available */
.legend-dot.minted { background: transparent; border: 1px solid rgba(210,225,190,0.55); } /* claimed = faint border */
.legend-dot.staked-dot { background: rgba(201,255,60,0.25); border: 1.5px solid var(--lime); box-shadow: 0 0 6px rgba(201,255,60,0.9); } /* staked = lime glow */
.legend-dot.selected { background: transparent; border: 1.5px dashed #fff; } /* selected = white dashed */
.rarity-chip { width: 9px; height: 9px; display: inline-block; flex-shrink: 0; border-radius: 1px; }

/* ---------------- Staking hub (tabbed panel) ---------------- */

.hub {
  position: absolute;
  left: 20px;
  top: 116px; /* below the My Rank/My Plots buttons, LEFT side — keeps the map
                 visible on the right so you can see the plot you select light up */
  width: min(340px, calc(100% - 40px));
  max-height: calc(100% - 136px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(10, 12, 9, 0.97);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 14;
}
.hub[hidden] { display: none; }

.hub-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line);
}
.hub-title h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--ink-text);
}

.hub-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--ink-muted);
}
.hub-close svg { width: 13px; height: 13px; }
.hub-close:hover { color: var(--lime); border-color: var(--line); }

.hub-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px;
  gap: 10px;
}

/* --- navbar live score chip --- */
.score-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(201,255,60,0.06);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--ink-text);
  font-family: var(--font-mono);
  transition: border-color 0.12s, background 0.12s;
}
.score-chip:hover { border-color: var(--lime); background: rgba(201,255,60,0.1); }
.score-chip-main { font-size: 12px; }
.score-chip-main b { color: var(--lime); font-weight: 700; }
.score-chip-rank {
  font-size: 10.5px;
  color: var(--ink-muted);
  padding-left: 8px;
  border-left: 1px solid var(--line);
}
.score-chip-pending {
  font-size: 10px;
  color: var(--black);
  background: var(--lime);
  border-radius: 999px;
  padding: 1px 6px;
  font-weight: 700;
}

/* --- points drawer (right side) --- */
.points-drawer {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%); /* centered modal — never covers the corner cards */
  width: min(360px, calc(100% - 40px));
  max-height: calc(100% - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(10, 12, 9, 0.97);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 14;
}
.points-drawer[hidden] { display: none; }
.points-drawer .hub-body { overflow-y: auto; }

/* --- rarity filter pills --- */
.hub-rarity-filter { display: flex; gap: 6px; flex-wrap: wrap; }

.rarity-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-muted);
  border-radius: 999px;
  padding: 5px 11px;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.rarity-pill:hover { color: var(--ink-text); border-color: var(--ink-muted); }
.rarity-pill.is-active {
  color: var(--black);
  background: var(--lime);
  border-color: var(--lime);
  font-weight: 600;
}

.hub-selectbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.hub-count { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-muted); }
.hub-count b { color: var(--lime); font-weight: 600; }
.hub-select-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* busy state on any button running a transaction */
.is-busy { opacity: 0.7; cursor: progress; animation: busy-pulse 1s ease-in-out infinite; }
@keyframes busy-pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 0.85; } }

.owned-plots-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 60px;
  padding-right: 6px;
}
/* slightly slimmer scrollbar for this compact list (global one is 8px) */
.owned-plots-list::-webkit-scrollbar { width: 6px; }

.owned-plots-empty {
  margin: 0;
  padding: 18px 8px;
  font-size: 11px;
  color: var(--ink-muted);
  text-align: center;
}

.hub-actions { display: flex; gap: 8px; }
.hub-actions .wide { flex: 1; }

/* --- points tab --- */
.claim-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201,255,60,0.12), transparent 70%),
    rgba(255,255,255,0.02);
}
.claim-hero-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.claim-hero-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 34px;
  line-height: 1;
  color: var(--lime);
  text-shadow: 0 0 22px rgba(201,255,60,0.35);
  /* Fixed-width digits so the live counter doesn't jitter as it ticks. */
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.claim-hero-rate {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--lime);
  opacity: 0.75;
  min-height: 12px;
}
.claim-hero .seal-button { margin-top: 4px; min-width: 160px; }
.claim-hint { font-size: 10px; color: var(--ink-muted); text-align: center; }
.claim-countdown {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-align: center;
}
.staking-copy.small { font-size: 9.5px; opacity: 0.7; margin-top: 6px; }

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

.points-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.points-card-value {
  font-family: var(--font-mono);
  color: var(--lime);
  font-size: 16px;
  font-weight: 700;
}
.points-card label {
  font-size: 9px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.plot-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 11px;
  color: var(--ink-text);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.12s, background 0.12s;
}
.plot-choice:hover { border-color: var(--ink-muted); }
/* Selecting a plot lights up the whole row (no checkbox needed). */
.plot-choice:has(input:checked) {
  border-color: var(--lime);
  background: rgba(201,255,60,0.1);
  box-shadow: inset 0 0 0 1px var(--lime);
}
/* the checkbox drives state but is not shown — the row glow IS the selection */
.plot-choice input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}

.plot-choice.is-staked {
  border-color: rgba(201,255,60,0.5);
  background: rgba(201,255,60,0.08);
}

.plot-choice-main {
  font-family: var(--font-mono);
  color: var(--lime);
  font-weight: 600;
  flex-shrink: 0;
}

/* rarity sits in the middle and truncates before it can push anything */
.plot-choice-meta {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink-muted);
  font-size: 9.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* state pill pinned to the right */
.plot-choice-state {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--ink-muted);
  border: 1px solid var(--line);
}
.plot-choice.is-staked .plot-choice-state {
  color: var(--black);
  background: var(--lime);
  border-color: var(--lime);
}

/* Plot in unstake-cooldown: dimmed + amber label, checkbox disabled. */
.plot-choice.is-cooldown {
  border-color: rgba(255,210,74,0.35);
  background: rgba(255,210,74,0.05);
  opacity: 0.75;
  cursor: default;
}
.plot-choice.is-cooldown .plot-choice-state {
  color: #ffd24a;
  border-color: rgba(255,210,74,0.5);
}
.plot-choice.is-cooldown input { cursor: not-allowed; }

/* "Show more" pagination button in the staking hub plot list */
.plots-show-more {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--line);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.plots-show-more:hover {
  color: var(--ink-text);
  border-color: var(--lime);
  background: rgba(255,255,255,0.05);
}

/* navbar button icon */
.btn-ico { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; fill: currentColor; }
.ghost-button[aria-pressed="true"] { color: var(--lime); border-color: var(--lime); }

.tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--panel-bg);
  border: 1px solid var(--lime);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-text);
  z-index: 50;
  box-shadow: 0 0 14px rgba(201,255,60,0.25);
  line-height: 1.5;
}
.tooltip b { color: var(--lime); }

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  max-width: min(92vw, 460px);
  background: var(--panel-bg);
  border: 1px solid var(--lime);
  padding: 12px 20px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 0 16px rgba(201,255,60,0.3), 0 8px 24px var(--shadow);
  /* Sit above the parcel side panel (z-index 40) so a mint/stake toast is
     never hidden behind the drawer that opens on the same action. */
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(.4,0,.2,1);
}
/* .show is toggled by showToast(); [hidden] still fully removes it. */
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* Status variants — accent the border/glow, keep the dark panel look. */
.toast-success { border-color: var(--lime); box-shadow: 0 0 16px rgba(201,255,60,0.35), 0 8px 24px var(--shadow); }
.toast-error   { border-color: #ff5c5c; box-shadow: 0 0 16px rgba(255,92,92,0.35), 0 8px 24px var(--shadow); }
.toast-warning { border-color: #ffcc4d; box-shadow: 0 0 16px rgba(255,204,77,0.30), 0 8px 24px var(--shadow); }

/* ---------------- Side panel ---------------- */

.panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 340px;
  background: var(--panel-bg);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 30px var(--shadow);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  z-index: 40;
  padding: 26px 22px;
  overflow-y: auto;
}
.panel.open { transform: translateX(0); }

.panel-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 16px;
  color: var(--ink-muted);
}
.panel-close:hover { color: var(--lime); }

.panel-empty {
  margin-top: 60px;
  text-align: center;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 0 10px;
}

.panel-preview canvas {
  width: 100%;
  border: 1px solid var(--line);
  image-rendering: pixelated;
}

.parcel-id {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin: 14px 0 2px;
  color: var(--ink-text);
}
.parcel-coords {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
  margin: 0 0 14px;
}

.badges { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }

.panel-status, .rarity-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border: 1px solid var(--line);
}
.panel-status.free { color: var(--ink-muted); }
.panel-status.mine { color: var(--black); background: var(--lime); border-color: var(--lime); }
.panel-status.branded { color: var(--black); background: linear-gradient(135deg, #ffffff, var(--lime)); border-color: #fff; }

/* Rarity badge colors — slugs are r-<rarity-lowercased> (see raritySlug()).
   5 tiers: Common, Rare, Epic, Legendary, Mythic. */
.rarity-badge.r-common { color: var(--ink-muted); }
.rarity-badge.r-rare { color: #4db6e5; border-color: #4db6e544; }
.rarity-badge.r-epic { color: #b96cf0; border-color: #b96cf0; }
.rarity-badge.r-legendary {
  color: #201700;
  background: #ffcc4d;
  border-color: #ffcc4d;
  box-shadow: 0 0 10px rgba(255,204,77,0.7);
}
.rarity-badge.r-mythic {
  color: #fff;
  background: #ff5c5c;
  border-color: #ff5c5c;
  box-shadow: 0 0 12px rgba(255,92,92,0.85);
}

.panel-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-text);
}
.panel-row span:first-child { color: var(--ink-muted); }

/* --- Mint panel contents (inside a .map-card) --- */
.mint-panel-copy {
  margin: 8px 0 12px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-muted);
}
.mint-panel-actions {
  display: flex;
  gap: 8px;
}
.mint-panel-actions .seal-button { flex: 1; }

.panel-available-hint {
  margin: 12px 0 0;
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-muted);
  background: rgba(201,255,60,0.05);
  border: 1px dashed var(--line);
  border-radius: 3px;
}

.text-input {
  width: 100%;
  background: var(--black);
  border: 1px solid var(--line);
  color: var(--ink-text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 9px 10px;
  border-radius: 2px;
  margin-bottom: 8px;
}
.text-input:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 8px rgba(201,255,60,0.35);
}
.text-input::placeholder { color: var(--ink-muted); }

.seal-button.danger {
  background: transparent;
  color: var(--lime);
  border: 1px solid var(--lime);
  box-shadow: none;
}
.seal-button.danger:hover {
  background: var(--lime);
  color: var(--black);
}


.hint {
  margin-top: 18px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

/* ---------------- Footer ---------------- */

.foot {
  display: flex;
  justify-content: space-between;
  padding: 8px 24px;
  background: var(--black-soft);
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
}
.foot code { color: var(--lime-dim); }
.foot-links a { color: var(--ink-muted); text-decoration: none; }
.foot-links a:hover { color: var(--lime); }

/* ---------------- "How it works" modal ---------------- */
.how-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(2px);
  z-index: 70;
}
.how-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 440px);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--panel-bg);
  border: 1px solid var(--lime);
  border-radius: 3px;
  box-shadow: 0 0 30px rgba(201, 255, 60, 0.18), 0 20px 60px var(--shadow);
  z-index: 71;
}
.how-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.how-head h3 { font-size: 17px; color: var(--ink-text); margin-top: 2px; }
.how-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 14px; }

.how-steps { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.how-steps li { display: flex; gap: 11px; align-items: flex-start; }
.how-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 1px solid var(--lime);
  border-radius: 50%;
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.how-steps b { color: var(--ink-text); font-size: 13px; letter-spacing: 0.02em; }
.how-steps p { color: var(--ink-muted); font-size: 11.5px; line-height: 1.4; margin-top: 2px; }

.how-rarity {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.how-rarity-head {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 2px;
}
.how-rarity-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-text);
}
/* Same rarity colours as the map Legend (index.html .rarity-chip) so the two
   never disagree. Common #7d9169 · Rare #4db6e5 · Epic #b96cf0 · Legendary #ffcc4d
   · Mythic #ff5c5c. */
.how-rarity-row .dot { width: 9px; height: 9px; border-radius: 1px; flex-shrink: 0; }
/* Match the rarity tier colors used in the map legend + badges. */
.how-rarity-row .dot.common { background: #7d9169; }
.how-rarity-row .dot.rare { background: #4db6e5; }
.how-rarity-row .dot.epic { background: #b96cf0; }
.how-rarity-row .dot.legendary { background: #ffcc4d; }
.how-rarity-row .dot.mythic { background: #ff5c5c; }
.how-rate {
  margin-left: auto;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--lime);
}
.how-foot { font-size: 11.5px; color: var(--ink-muted); line-height: 1.45; }
.how-foot b { color: var(--ink-text); }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  .topbar-stats { order: 3; margin-left: 0; width: 100%; justify-content: space-around; }
  .panel { width: 100%; }
  .rarity-legend { display: none; }
}
