/* ══════════════════════════════════════════════════════
   map-core.css — Shared styles for all Harrison Bored
   Nether mapping tools (seed map, netherite finder, etc.)
   ══════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Zurich';
  src: url('../ZurichCondMono.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Theme variables ── */
:root {
  --bg-grad-a: #2a28c4;
  --bg-grad-b: #2424b8;
  --bg-grad-c: #2020a8;
  --bg-grad-d: #1a1890;
  --nav-bg: rgba(30,26,160,0.5);
  --border: rgba(255,255,255,0.08);
  --border-light: rgba(255,255,255,0.14);
  --orange: #d4803a;
  --orange-dim: #a06028;
  --text: #e8e6f0;
  --text-muted: rgba(255,255,255,0.55);
  --text-sub: rgba(255,255,255,0.38);
  --text-faint: rgba(255,255,255,0.22);
  --map-bg: #0a0a14;
  --map-loading-bg: #0a0a14;
  --input-bg: rgba(255,255,255,0.05);
  --font-brand: 'Zurich', 'Courier New', monospace;
  --font-data: 'IBM Plex Mono', 'Courier New', monospace;
}

/* ── Dark mode overrides ── */
body.dark-mode {
  --bg-grad-a: #1a1212;
  --bg-grad-b: #1e1414;
  --bg-grad-c: #1c1010;
  --bg-grad-d: #150c0c;
  --nav-bg: rgba(20,12,12,0.7);
  --border: rgba(255,255,255,0.07);
  --border-light: rgba(255,255,255,0.12);
  --text: #ddd8d0;
  --text-muted: rgba(220,210,200,0.55);
  --text-sub: rgba(220,210,200,0.38);
  --text-faint: rgba(220,210,200,0.20);
  --map-bg: #080608;
  --map-loading-bg: #080608;
  --input-bg: rgba(255,255,255,0.04);
}
body.dark-mode .bg-layer {
  background: linear-gradient(180deg, var(--bg-grad-a) 0%, var(--bg-grad-b) 40%, var(--bg-grad-c) 70%, var(--bg-grad-d) 100%);
}

html { font-size: 15px; }
body {
  font-family: var(--font-data);
  background: #2226b0;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg-layer {
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(180deg, var(--bg-grad-a) 0%, var(--bg-grad-b) 40%, var(--bg-grad-c) 70%, var(--bg-grad-d) 100%);
  transition: background 0.4s ease;
}
.bg-grain {
  position: fixed; inset: 0; z-index: 1; opacity: 0.10; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}
.bg-vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to right, rgba(10,8,60,0.15) 0%, transparent 12%, transparent 88%, rgba(10,8,60,0.15) 100%),
    linear-gradient(to bottom, rgba(10,8,60,0.10) 0%, transparent 10%, transparent 92%, rgba(10,8,60,0.12) 100%);
}

/* --- Consistently Styled Labels --- */
.info-heading, .dev-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--orange);
  margin-bottom: 1.2rem;
  font-weight: 600;
  display: block;
}

/* Ensure Zurich is preserved for main headers */
.tool-title, .info-title {
  font-family: 'Zurich', sans-serif;
}

/* ── Nav ── */
nav {
  position: relative; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 2.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: background 0.4s ease;
}
.nav-brand {
  display: flex; align-items: center; gap: 0.55rem;
  text-decoration: none; cursor: pointer; transition: opacity 0.2s;
}
.nav-brand:hover { opacity: 0.8; }
.nav-brand-icon { width: 32px; height: 26px; object-fit: contain; }
.nav-brand-text {
  font-family: var(--font-brand); font-size: 0.95rem;
  color: var(--text-muted); letter-spacing: 0.06em;
}
.nav-right {
  display: flex; align-items: center; gap: 2.2rem;
  position: absolute; left: 50%; transform: translateX(-50%);
}
.nav-actions { display: flex; align-items: center; gap: 0.8rem; }
.nav-links { display: flex; gap: 2.2rem; list-style: none; }
.nav-links a {
  font-family: var(--font-brand); font-size: 0.82rem;
  color: var(--text-muted); text-decoration: none; letter-spacing: 0.04em;
  transition: color 0.2s; cursor: pointer;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--orange); }

/* Dark mode toggle button */
.darkmode-btn {
  background: none; border: 1px solid var(--border-light); cursor: pointer;
  color: var(--text-muted); font-family: var(--font-data); font-size: 0.65rem;
  padding: 0.3rem 0.6rem; letter-spacing: 0.05em; transition: all 0.2s;
  display: flex; align-items: center; gap: 0.35rem;
}
.darkmode-btn:hover { border-color: var(--orange-dim); color: var(--orange); }
.darkmode-btn-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-faint); transition: background 0.3s;
}
body.dark-mode .darkmode-btn-dot { background: var(--orange); }

/* ── Tool page layout ── */
.tool-page { max-width: 1100px; margin: 0 auto; padding: 1.8rem 2.5rem 3rem; position: relative; z-index: 2; }

.tool-header { margin-bottom: 1.4rem; position: relative; }
.tool-title {
  font-family: var(--font-brand); font-size: 3.0rem;
  color: var(--text); letter-spacing: 0.03em;
}
.tool-subtitle {
  font-family: var(--font-data); font-size: 0.72rem;
  color: var(--text-sub); margin-top: 0.35rem; line-height: 1.5;
}

.controls-block { margin-bottom: 1.2rem; overflow: visible; }

/* Seed row */
.seed-row {
  display: flex; align-items: center; gap: 0.6rem; margin-bottom: 2rem; flex-wrap: wrap;
}
.control-group { display: flex; flex-direction: column; gap: 0.2rem; }
.control-group-horiz { display: flex; align-items: center; gap: 0.4rem; }
.live-coord-row { display: none; }
.live-coord-cell { display: none; }
.live-coord-label { display: none; }
.control-label {
  font-family: var(--font-data); font-size: 0.62rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em;
}
.seed-input {
  background: var(--input-bg); border: 1px solid var(--border-light);
  color: var(--text); font-family: var(--font-data); font-size: 0.8rem;
  padding: 0.42rem 0.7rem; width: 200px; outline: none; transition: border-color 0.2s;
}
.seed-input:focus { border-color: var(--orange-dim); }
.coord-input {
  background: var(--input-bg); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-data); font-size: 0.8rem;
  padding: 0.42rem 0.5rem; width: 80px; outline: none; text-align: center;
  transition: border-color 0.2s;
}
.coord-input:focus { border-color: var(--orange-dim); }
.edition-select {
  background: var(--input-bg); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-data); font-size: 0.72rem;
  padding: 0.38rem 0.5rem; outline: none; cursor: pointer;
  transition: border-color 0.2s; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='rgba(255,255,255,0.35)'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; padding-right: 22px;
}
.edition-select:focus { border-color: var(--orange-dim); }
.edition-select option { background: #1a1860; color: var(--text); }
.reset-btn {
  background: transparent; border: 1px solid var(--border-light);
  color: var(--text-faint); font-family: var(--font-brand); font-size: 0.78rem;
  padding: 0.42rem 1.0rem; cursor: pointer; letter-spacing: 0.05em;
  transition: all 0.2s;
}
.reset-btn:hover { border-color: var(--text-faint); color: var(--text-sub); }
.seed-input-wrap {
  position: relative; display: inline-flex;
}
.seed-input-wrap .seed-input {
  padding-right: 2.8rem;
}
.rand-btn {
  position: absolute; right: 1px; top: 1px; bottom: 1px;
  background: transparent; border: none; border-left: 1px solid var(--border-light);
  color: var(--text);
  padding: 0 0.5rem; cursor: pointer;
  transition: background 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.rand-btn:hover { background: rgba(255,255,255,0.04); }
.rand-btn:hover svg { opacity: 0.65; }

.seed-btn {
  background: rgba(212,128,58,0.08); border: 1px solid var(--orange-dim);
  color: var(--orange); font-family: var(--font-brand); font-size: 0.78rem;
  padding: 0.42rem 1.8rem; cursor: pointer; letter-spacing: 0.05em;
  transition: all 0.2s; margin-left: 0.8rem;
}
.seed-btn:hover { border-color: var(--orange); background: rgba(212,128,58,0.16); }

/* Y-level input (used for overhang on seed map, terrain level on netherite finder) */
.ylevel-input, .overhang-input {
  background: var(--input-bg); border: 1px solid var(--border-light);
  color: var(--text); font-family: var(--font-data); font-size: 0.75rem;
  padding: 0.38rem 0.45rem; width: 52px; text-align: center; outline: none;
  -moz-appearance: textfield; appearance: textfield;
  transition: border-color 0.2s;
}
.ylevel-input::-webkit-outer-spin-button,
.ylevel-input::-webkit-inner-spin-button,
.overhang-input::-webkit-outer-spin-button,
.overhang-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ylevel-input:focus, .overhang-input:focus { border-color: var(--orange-dim); }

/* Live coord readout */
.coord-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
}
.coord-group { display: flex; align-items: center; gap: 0.4rem; }
.live-coord {
  position: absolute;
  top: calc(100% + 0.3rem);
  width: 80px; right: 0; left: auto;
  text-align: center;
  font-family: var(--font-data); font-size: 0.92rem; font-weight: 600;
  color: var(--orange-dim); letter-spacing: 0.02em;
  white-space: nowrap; pointer-events: none;
  transition: color 0.15s;
}
.live-coord.active { color: var(--orange); }

/* Toggle row */
.toggle-row { display: flex; align-items: center; gap: 1.1rem; }
.toggle-item {
  font-family: var(--font-data); font-size: 0.62rem; font-weight: 500;
  color: var(--text-sub); display: flex; align-items: center; gap: 0.3rem;
  cursor: pointer; user-select: none; transition: color 0.2s;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.toggle-item:hover { color: var(--text-muted); }
.toggle-item.active { color: var(--text-muted); }
.toggle-dot { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--text-sub); transition: all 0.2s; }
.toggle-dot.on { background: var(--orange-dim); border-color: var(--orange); }

/* Structure / overlay toggle wrapper — hosts hover dropdown */
.struct-toggle-wrap {
  position: relative;
}
/* Dropdown panel — appended to body at runtime, fixed position avoids all clipping */
.struct-filter-dropdown {
  display: none;
  position: fixed;
  z-index: 9999;
  background: rgba(8,7,18,0.82);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.45rem 0.6rem;
  min-width: 150px;
}
.struct-filter-dropdown.visible {
  display: flex;
  flex-direction: column;
}
.struct-filter-row {
  display: flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-data); font-size: 0.60rem; font-weight: 500;
  color: var(--text-sub); cursor: pointer; user-select: none;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.28rem 0.1rem;
  transition: color 0.15s;
}
.struct-filter-row.has-icon { justify-content: space-between; }
.struct-filter-row.has-icon > span:not(.toggle-dot) { flex: 1; }
.struct-filter-header {
  display: flex; align-items: center; justify-content: space-between; gap: 0.35rem;
  font-family: var(--font-data); font-size: 0.60rem; font-weight: 600;
  color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.28rem 0.1rem 0.1rem;
  pointer-events: none; user-select: none;
}
.struct-filter-header > span { flex: 1; }
.struct-filter-row:hover { color: var(--text-muted); }
.struct-filter-row.active { color: var(--text-muted); }
.struct-filter-divider {
  height: 1px; background: var(--border); margin: 0.3rem 0;
}
.struct-filter-icon {
  width: 16px; height: 16px;
  image-rendering: pixelated;
  opacity: 0.75;
  flex-shrink: 0;
}

/* Share button — top-right of map */
.share-btn {
  position: absolute; top: 30px; right: 10px; z-index: 10;
  background: rgba(7,6,15,0.78); border: 1px solid var(--border-light);
  color: var(--text-muted); font-family: var(--font-data); font-size: 0.58rem;
  padding: 0.32rem 0.65rem; cursor: pointer; letter-spacing: 0.06em;
  text-transform: uppercase; transition: all 0.2s;
  backdrop-filter: blur(4px); white-space: nowrap;
}
.share-btn:hover { border-color: var(--orange-dim); color: var(--orange); background: rgba(212,128,58,0.08); }
.share-btn.copied { border-color: var(--orange); color: var(--orange); }
.share-btn.hidden { opacity: 0; pointer-events: none; }

/* Map area */
.map-wrap { width: 100%; position: relative; margin-bottom: 0.5rem; }
.map-container {
  width: 100%; aspect-ratio: 16/10; max-height: 560px;
  background: var(--map-bg); border: 1px solid var(--border-light);
  position: relative; overflow: hidden; cursor: crosshair;
  transition: background 0.3s;
}
.map-container.cursor-pointer { cursor: pointer; }
.map-container canvas { display: block; width: 100%; height: 100%; }

/* Coordinate rulers */
.ruler-x {
  position: absolute; top: 0; left: 22px; right: 0; height: 20px;
  display: block; width: calc(100% - 22px);
  pointer-events: none; z-index: 5;
}
.ruler-z {
  position: absolute; top: 20px; left: 0; bottom: 0; width: 22px;
  display: block; height: calc(100% - 20px);
  pointer-events: none; z-index: 5;
}
.ruler-corner {
  position: absolute; top: 0; left: 0; width: 22px; height: 20px;
  z-index: 6; pointer-events: none;
  background: rgba(0,0,0,0.42);
  border-right: 1px solid rgba(255,255,255,0.14);
  border-bottom: 1px solid rgba(255,255,255,0.14);
}

/* Icon overlay — HTML layer on top of canvas (structures, debris, etc.) */
.struct-overlay, .icon-overlay {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.struct-icon, .map-icon {
  position: absolute; transform: translate(-50%, -50%);
  pointer-events: all; cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.struct-icon img, .map-icon img {
  display: block; width: 48px; height: 48px;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.85));
}
.struct-icon:hover img, .map-icon:hover img { filter: drop-shadow(0 0 6px rgba(255,200,100,0.7)) drop-shadow(0 1px 3px rgba(0,0,0,0.8)); }
.struct-icon.selected img, .map-icon.selected img { filter: drop-shadow(0 0 8px rgba(255,255,255,0.9)) drop-shadow(0 1px 3px rgba(0,0,0,0.8)); }
.struct-icon .struct-label, .map-icon .icon-label {
  position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  font-family: var(--font-data); font-size: 8px; font-weight: 600;
  color: var(--text-muted); white-space: nowrap;
  background: rgba(7,6,15,0.82); padding: 1px 4px;
  pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
.struct-icon:hover .struct-label, .map-icon:hover .icon-label { opacity: 1; }

/* Popup */
.struct-popup, .icon-popup {
  position: absolute; z-index: 20;
  background: rgba(12,10,22,0.94); border: 1px solid var(--border-light);
  padding: 0.55rem 0.75rem; pointer-events: none; min-width: 130px;
}
.struct-popup-name, .icon-popup-name {
  font-family: var(--font-data); font-size: 0.72rem; font-weight: 600;
  color: var(--orange); margin-bottom: 0.2rem;
}
.struct-popup-coords, .icon-popup-coords {
  font-family: var(--font-data); font-size: 0.65rem;
  color: var(--text-muted);
}

/* Biome legend */
.biome-legend {
  position: absolute; bottom: 10px; left: 32px; z-index: 10;
  background: rgba(7,6,15,0.78); border: 1px solid rgba(255,255,255,0.08);
  padding: 0.45rem 0.6rem; pointer-events: none;
  backdrop-filter: blur(4px);
  transition: opacity 0.2s;
}
.biome-legend.hidden { opacity: 0; pointer-events: none; }
.biome-legend-title {
  font-family: var(--font-data); font-size: 0.52rem; font-weight: 600;
  color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}
.biome-row {
  display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.22rem;
}
.biome-row:last-child { margin-bottom: 0; }
.biome-swatch { width: 8px; height: 8px; flex-shrink: 0; }
.biome-name {
  font-family: var(--font-data); font-size: 0.55rem;
  color: var(--text-sub); white-space: nowrap;
}

.map-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--map-loading-bg); z-index: 5; transition: opacity 0.5s;
}
.map-loading.hidden { opacity: 0; pointer-events: none; }
.map-loading-text {
  font-family: var(--font-data); font-size: 0.72rem;
  color: rgba(255,255,255,0.18); letter-spacing: 0.05em;
}

/* Status bar */
.map-status-row {
  display: flex; align-items: center; justify-content: flex-end;
  margin-bottom: 1.6rem; padding: 0 0.1rem;
}
.map-status { font-family: var(--font-data); font-size: 0.56rem; color: var(--text-faint); }

/* Info section */
.tool-info {
  display: flex; gap: 2.5rem; padding-top: 1.4rem;
  border-top: 1px solid var(--border);
}
.info-col { flex: 1; }
.info-text {
  font-family: var(--font-data); font-size: 0.65rem;
  color: var(--text-muted); line-height: 1.7;
}
.info-text a { color: var(--orange-dim); text-decoration: none; transition: color 0.2s; }
.info-text a:hover { color: var(--orange); }

/* Footer */
footer {
  position: relative; z-index: 2; border-top: 1px solid var(--border);
  padding: 1rem 2.5rem; display: flex; justify-content: space-between; align-items: center;
}
.footer-left { font-family: var(--font-data); font-size: 0.6rem; color: var(--text-faint); }
.footer-center { font-family: var(--font-data); font-size: 0.6rem; color: var(--text-faint); }
.footer-contact { color: var(--text-faint); text-decoration: none; transition: color 0.2s; }
.footer-contact:hover { color: var(--text-muted); }
.footer-right { display: flex; gap: 1.5rem; }
.footer-right a {
  font-family: var(--font-data); font-size: 0.6rem;
  color: var(--text-faint); text-decoration: none; transition: color 0.2s;
}
.footer-right a:hover { color: var(--text-muted); }

/* Waypoint markers */
.waypoint-marker {
  position: absolute; transform: translate(-50%, -100%);
  pointer-events: all; cursor: default; z-index: 15;
}
.waypoint-pin { display: flex; flex-direction: column; align-items: center; }
.waypoint-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #e8c060; border: 2px solid rgba(255,255,255,0.8);
  box-shadow: 0 0 6px rgba(232,192,96,0.6), 0 1px 3px rgba(0,0,0,0.8);
}
.waypoint-label {
  background: rgba(10,8,20,0.88); border: 1px solid rgba(232,192,96,0.4);
  padding: 2px 5px; margin-bottom: 3px;
  font-family: var(--font-data); font-size: 0.58rem; font-weight: 600;
  color: #e8c060; white-space: nowrap; pointer-events: none;
  text-align: center; line-height: 1.4;
}
.waypoint-label span { display: block; font-size: 0.5rem; color: rgba(232,192,96,0.65); font-weight: 400; }

/* Animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.anim { animation: fadeUp 0.5s ease-out both; }
.d1{animation-delay:.04s}.d2{animation-delay:.10s}.d3{animation-delay:.18s}.d4{animation-delay:.27s}.d5{animation-delay:.36s}

/* Dev log / changelog */
.dev-footer {
  max-width: 900px;
  margin: 6rem auto 2rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  border-top: 1px solid var(--border);
  padding-top: 3rem;
}
.dev-entry {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
  line-height: 1.4;
}
.dev-date {
  color: var(--text-muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.support p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.support-link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--orange);
  transition: color 0.2s;
}
.support-link:hover {
  color: var(--orange);
}

/* ── Cross-promo banner — frontier broadside ── */
.promo-banner {
  position: absolute;
  top: 0; right: 0;
  z-index: 10;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s ease, filter 0.25s ease;
}
.promo-banner:hover { transform: translateY(-1px) scale(1.02); filter: brightness(1.1); }
.promo-banner:active { transform: translateY(1px) scale(0.99); }

.promo-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(145deg, rgba(50,32,16,0.94) 0%, rgba(38,24,12,0.96) 100%);
  border: 2px solid #7a5535;
  border-radius: 5px;
  padding: 0.45rem 0.65rem;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(180,130,70,0.12),
    inset 0 1px 0 rgba(255,200,100,0.06),
    0 3px 16px rgba(0,0,0,0.45);
}
.promo-card::before {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px; opacity: 0.05; pointer-events: none;
}
.promo-card::after {
  content: ''; position: absolute; inset: 3px;
  border: 1px solid rgba(180,130,70,0.18); border-radius: 3px; pointer-events: none;
}

.promo-img {
  flex-shrink: 0;
  width: 44px; height: 44px;
  image-rendering: pixelated;
  border: 1px solid rgba(180,130,70,0.3);
  border-radius: 2px;
  position: relative; z-index: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}

.promo-text { position: relative; z-index: 1; }

.promo-headline {
  font-family: var(--font-brand);
  font-size: 0.82rem;
  color: #e8c060;
  line-height: 1.2;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.promo-headline em {
  font-style: normal;
  color: #d4803a;
}

.promo-cta {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-data);
  font-size: 0.5rem;
  letter-spacing: 0.04em;
  color: rgba(210,170,110,0.55);
  white-space: nowrap;
  transition: color 0.2s;
}
.promo-cta .promo-cta-arrow {
  display: inline-block;
  transition: transform 0.2s;
}
.promo-banner:hover .promo-cta { color: rgba(210,170,110,0.8); }
.promo-banner:hover .promo-cta-arrow { transform: translateX(3px); }

/* ── Floating ad banner ── */
.ad-banner {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  z-index: 200;
  cursor: pointer;
  border-radius: 10px;
  border: 2px solid rgba(180,130,70,0.55);
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0,0,0,0.6);
  transition: box-shadow 0.3s ease, transform 0.25s ease, border-color 0.3s ease;
  display: block;
  text-decoration: none;
}
.ad-banner:hover {
  border-color: rgba(212,128,58,0.9);
  box-shadow: 0 4px 32px rgba(0,0,0,0.7), 0 0 18px 4px rgba(212,128,58,0.35);
  transform: translateY(-2px);
}
.ad-banner img {
  display: block;
  height: 162px;
  width: auto;
  max-width: 90vw;
  object-fit: cover;
}
.ad-close {
  position: absolute;
  top: 5px; right: 6px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(180,130,70,0.4);
  color: rgba(210,170,110,0.7);
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
  z-index: 201;
  font-family: var(--font-data);
  user-select: none;
}
.ad-close:hover {
  color: #fff;
  border-color: rgba(212,128,58,0.9);
  background: rgba(30,15,5,0.85);
  box-shadow: 0 0 8px 2px rgba(212,128,58,0.45);
}
@media (max-width: 700px) {
  .ad-banner img { height: 108px; }
}

/* ── Fullscreen button — glass style matching legend / share ── */
.fullscreen-btn {
  position: absolute;
  bottom: 8px; right: 8px;
  top: auto; left: auto;
  z-index: 15;
  background: rgba(7,6,15,0.78);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-family: var(--font-data);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.32rem 0.65rem;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  user-select: none;
  white-space: nowrap;
}
.fullscreen-btn:hover {
  border-color: var(--orange-dim);
  color: var(--orange);
  background: rgba(212,128,58,0.08);
}
.map-container:-webkit-full-screen { width: 100vw !important; height: 100vh !important; }
.map-container:-moz-full-screen    { width: 100vw !important; height: 100vh !important; }
.map-container:fullscreen          { width: 100vw !important; height: 100vh !important; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .dev-footer { grid-template-columns: 1fr; gap: 2rem; }
}

/* ── Hamburger menu (mobile only) ── */
.nav-hamburger {
  display: none;
  background: none; border: none; cursor: pointer; padding: 4px;
  flex-direction: column; gap: 4px; justify-content: center;
  z-index: 102;
}
.nav-hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text-muted);
  transition: transform 0.25s, opacity 0.25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 700px) {
  nav { padding: 0.7rem 1.2rem; }
  .nav-brand-text { display: none; }

  .nav-hamburger { display: flex; }

  .nav-right {
    position: fixed; top: 0; right: 0;
    width: 220px; height: 100vh;
    background: rgba(12,10,22,0.97);
    border-left: 1px solid var(--border);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    flex-direction: column; align-items: flex-start;
    padding: 4rem 1.4rem 2rem;
    gap: 0.6rem;
    transform: translateX(100%);
    transition: transform 0.3s ease, visibility 0.3s;
    visibility: hidden;
    z-index: 101;
  }
  .nav-right.open { transform: translateX(0); visibility: visible; }
  .nav-links { flex-direction: column; gap: 1.2rem; }
  .nav-links a { font-size: 0.92rem; }

  /* Dark mode + hamburger stay visible in ribbon */
  .nav-actions { display: flex; align-items: center; gap: 0.8rem; }
  .darkmode-btn { font-size: 0.55rem; padding: 0.22rem 0.5rem; }

  .tool-page { padding: 1.2rem 1rem 2rem; }
  .seed-input { width: 140px; }
  .coord-input { width: 64px; }
  .seed-row { gap: 0.4rem; }
  .tool-info { flex-direction: column; gap: 1rem; }
  footer { padding: 0.8rem 1.2rem; flex-wrap: wrap; gap: 0.4rem; }
  .struct-icon img, .map-icon img { width: 36px; height: 36px; }
  .biome-legend { bottom: 6px; left: 6px; padding: 0.28rem 0.38rem; }
  .biome-legend-title { font-size: 0.38rem; margin-bottom: 0.2rem; }
  .biome-swatch { width: 5px; height: 5px; }
  .biome-name { font-size: 0.38rem; }
  .biome-row { gap: 0.25rem; margin-bottom: 0.14rem; }
  .promo-banner { position: relative; top: auto; right: auto; margin-top: 0.6rem; margin-bottom: 0.4rem; }

  /* Fullscreen button — hidden on mobile (no reliable API support) */
  .fullscreen-btn { display: none; }
}

/* Overlay to close menu when tapping outside */
.nav-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}
.nav-overlay.open { display: block; }
