:root,
[data-theme="light"] {
  --bg: #eef3ec;
  --panel: #fbfcf9;
  --ink: #14211a;
  --muted: #5a6b60;
  --line: #d5e0d6;
  --accent: #1f8f45;
  --accent-ink: #ffffff;
  --chip: #e7efe6;
  --shadow: 0 12px 32px rgba(20, 33, 26, 0.07);
  --grid: rgba(20, 33, 26, 0.04);
  --wash: radial-gradient(ellipse 80% 55% at 50% -10%, rgba(34, 140, 70, 0.16), transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 20%, rgba(180, 140, 60, 0.08), transparent 55%);
  --danger: #dc2626;
  --warn: #b45309;
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0b110e;
  --panel: #121a15;
  --ink: #eef4ef;
  --muted: #9aab9f;
  --line: #243028;
  --accent: #3ecf73;
  --accent-ink: #052e16;
  --chip: #182019;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
  --grid: rgba(255, 255, 255, 0.03);
  --wash: radial-gradient(ellipse 75% 50% at 50% -8%, rgba(46, 160, 90, 0.18), transparent 58%),
    radial-gradient(ellipse 45% 35% at 85% 15%, rgba(120, 90, 30, 0.1), transparent 50%);
  --danger: #fb7185;
  --warn: #fbbf24;
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  background: var(--bg);
  background-image: var(--wash);
  background-attachment: fixed;
  font-family: Outfit, "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.grid {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.55;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 12%, #000 25%, transparent 72%);
}

.top,
main,
footer {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  position: relative;
}

.top {
  position: sticky;
  top: 0;
  z-index: 8;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 10px max(16px, calc((100% - min(1080px, 100% - 32px)) / 2));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  box-sizing: border-box;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  flex-shrink: 0;
  min-height: 40px;
}

.site-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.site-nav-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.site-nav-link:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.site-nav-link.is-active {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);
  image-rendering: pixelated;
  display: block;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-word {
  display: block;
  width: 134px;
  height: 40px;
  background: var(--ink);
  image-rendering: pixelated;
  mask: url("/static/brand-wordmark.svg?v=3") no-repeat left center / contain;
  -webkit-mask: url("/static/brand-wordmark.svg?v=3") no-repeat left center / contain;
}

.top-actions {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
}

.theme-toggle,
.ghost,
.chip,
button {
  font: inherit;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.hero {
  padding: 40px 0 12px;
  text-align: center;
  animation: hero-in 0.55s var(--ease) both;
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kicker {
  display: inline-flex;
  margin: 0 0 14px;
  padding: 4px 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(40px, 7vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 800;
}

h1 span {
  color: var(--accent);
}

.lede {
  max-width: 52ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.panel {
  margin-top: 28px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

#search-form.panel {
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

#search-form.panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--ink) 10%, transparent);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.powered-by {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  font-weight: 500;
  text-align: center;
  align-self: stretch;
}

.powered-by a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.powered-by a:hover {
  color: var(--accent);
}

.query-random {
  align-self: flex-start;
  margin-top: 2px;
}

.search-mode {
  margin: -4px 0 18px;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.search-mode legend {
  padding: 0;
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.search-mode-opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--chip);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.search-mode-opt:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
}

.search-mode-opt input {
  width: auto;
  margin-top: 3px;
  accent-color: var(--accent);
}

.search-mode-opt span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-mode-opt strong {
  font-size: 14px;
  font-weight: 700;
}

.search-mode-opt small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.result-block {
  margin-top: 12px;
}

.result-block h4 {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

textarea,
select,
input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

textarea:focus,
select:focus,
input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 1px;
}

.filter-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 8px;
}

.filter-search {
  margin-bottom: 0;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px 12px;
  margin-bottom: 16px;
  max-height: min(48vh, 480px);
  overflow: auto;
  padding-right: 4px;
}

.filter-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  padding: 0;
  min-width: 0;
  transition: border-color 0.2s var(--ease);
}

.filter-group[open] {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.filter-group > summary {
  list-style: none;
  cursor: pointer;
  margin: 0;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  user-select: none;
}

.filter-group > summary::-webkit-details-marker {
  display: none;
}

.filter-group > summary::after {
  content: "▾";
  float: right;
  opacity: 0.7;
}

.filter-group:not([open]) > summary::after {
  content: "▸";
}

.filter-list {
  list-style: none;
  margin: 0;
  padding: 0 8px 8px;
  display: grid;
  gap: 1px;
  max-height: 168px;
  overflow: auto;
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.3;
}

.filter-check:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.filter-check input {
  width: auto;
  min-width: 14px;
  height: auto;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  border: none;
  background: transparent;
  border-radius: 0;
  accent-color: var(--accent);
}

.filter-check span {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-group[hidden],
.filter-list li[hidden] {
  display: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: var(--chip);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.chip:hover,
.theme-toggle:hover,
.ghost:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
}

.chip.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.contact-mail,
.footer-mail a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--muted) 45%, transparent);
}

.contact-mail:hover,
.footer-mail a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.theme-switch {
  width: 68px;
  height: 32px;
  padding: 0;
  border: 2px solid #3b2a1a;
  border-radius: 4px;
  background: #5a93d6;
  box-shadow: inset 0 -2px 0 #2f6cb0, 2px 2px 0 #1a120c;
  cursor: pointer;
  image-rendering: pixelated;
}

.theme-switch.is-night {
  border-color: #141428;
  background: #1a1a3c;
  box-shadow: inset 0 -2px 0 #0d0d22, 2px 2px 0 #07070f;
}

.theme-switch-sky {
  position: relative;
  display: block;
  height: 100%;
  overflow: hidden;
}

.mc-sun,
.mc-moon {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  image-rendering: pixelated;
}

.mc-sun {
  left: 5px;
}

.mc-moon {
  right: 5px;
}

.theme-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #c6c6c6;
  border: 2px solid #373737;
  box-shadow: inset 2px 2px 0 #ffffff, inset -2px -2px 0 #8b8b8b;
  transition: left 0.16s steps(4, end);
}

.theme-switch.is-night .theme-switch-knob {
  left: 39px;
}

.donate {
  margin: 0;
}

.donate-btn {
  list-style: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.2s var(--ease), filter 0.2s var(--ease);
}

.donate-btn:hover {
  transform: translateY(-1px);
}

.donate-btn::-webkit-details-marker {
  display: none;
}

.donate-btn::marker {
  content: "";
}

.donate[open] .donate-btn {
  filter: brightness(0.92);
}

body.donate-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 7;
  background: color-mix(in srgb, #0c0f0d 48%, transparent);
}

body.donate-open .top {
  z-index: 20;
}

.donate-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 22;
  width: min(560px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: panel-pop 0.22s var(--ease) both;
}

@keyframes panel-pop {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.donate-panel p {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.donate-alerts {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin: 0 0 14px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.2s var(--ease), filter 0.2s var(--ease);
}

.donate-alerts:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.crypto-list {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
  display: grid;
  gap: 10px;
}

.crypto-list li {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.crypto-coin {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.crypto-net {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent);
}

.crypto-addr {
  min-width: 0;
  overflow: visible;
  white-space: normal;
  word-break: break-all;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}

.crypto-copy {
  border: 1px solid color-mix(in srgb, #f59e0b 55%, var(--line));
  background: #f59e0b;
  color: #1a1208;
  border-radius: 10px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.edition-row {
  margin-bottom: 4px;
}

.edition-row .field {
  margin-bottom: 12px;
}

.search-actions {
  display: grid;
  gap: 10px;
}

#submit,
#lucky {
  appearance: none;
  width: 100%;
  font-weight: 700;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
}

#submit {
  border: 0;
  background: var(--ink);
  color: var(--bg);
}

#submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--ink) 22%, transparent);
}

#lucky {
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
}

#lucky:hover {
  transform: translateY(-1px);
}

[data-theme="dark"] #submit {
  background: var(--ink);
  color: var(--bg);
}

[data-theme="dark"] #lucky {
  border-color: var(--ink);
  color: var(--ink);
}

#submit:disabled,
#lucky:disabled {
  opacity: 0.55;
  cursor: wait;
}

.lucky-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 40;
  margin: 0;
  padding: 12px 18px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-weight: 600;
  pointer-events: none;
}

.lucky-toast.show {
  animation: lucky-fade 5s linear forwards;
}

[data-theme="dark"] .lucky-toast {
  background: #f4f4f5;
  color: #111827;
}

@keyframes lucky-fade {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.hint {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0 48px;
}

.card {
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.card-aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  min-width: 2.5rem;
}

.seed {
  font-size: clamp(20px, 3vw, 28px);
  margin: 0;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
  flex: 1;
  min-width: 0;
}

.score {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.1;
  text-align: center;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--chip);
  color: var(--muted);
}

.badge.exact {
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
  color: var(--accent);
}

.badge.related,
.badge.unknown {
  color: var(--warn);
}

.reason,
.caveats,
.coords {
  color: var(--muted);
  font-size: 14px;
}

ul.coords {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

ul.coords li.is-requested {
  font-weight: 700;
  color: var(--ink);
}

.caveats {
  color: var(--warn);
}

.engine-note {
  margin: 0 0 16px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.tags li {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.empty,
.error {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  grid-column: 1 / -1;
}

.error {
  color: var(--danger);
}

footer {
  padding-bottom: 88px;
  color: var(--muted);
  font-size: 13px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 280px);
  gap: 24px 40px;
  align-items: start;
}

.footer-legal p {
  margin: 0 0 10px;
}

.footer-legal p:last-child {
  margin-bottom: 0;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
}

.footer-meta .legal-line,
.footer-meta .legal-links {
  margin: 0;
}

.legal-line {
  line-height: 1.5;
  max-width: 72ch;
}

.footer-legal a {
  color: var(--accent);
}


.seo-block {
  margin-top: 28px;
  padding: 22px 24px;
}

.seo-block h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.seo-block p {
  margin: 0 0 12px;
  color: var(--muted);
  max-width: 72ch;
}

.seo-block p:last-child {
  margin-bottom: 0;
}

.seo-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.seo-topics li {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}

.seo-topics a {
  color: inherit;
  text-decoration: none;
}

.seo-topics a:hover {
  color: var(--accent);
}

.seo-faq {
  display: grid;
  gap: 8px;
}

.seo-faq details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--chip);
  padding: 10px 14px;
}

.seo-faq summary {
  cursor: pointer;
  font-weight: 700;
}

.seo-faq details p {
  margin: 10px 0 0;
}

.seo-guide-link {
  margin-top: 14px;
}

.seo-guide-link a {
  color: var(--accent);
  font-weight: 700;
}

.lang-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 14px;
}

.lang-links a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.lang-links a:hover {
  text-decoration: underline;
}

.guide-main {
  padding: 24px 0 48px;
}

.guide-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.guide-nav a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.guide-article h1 {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.guide-body p {
  margin: 0 0 14px;
  color: var(--muted);
  max-width: 72ch;
}

.guide-body a {
  color: var(--accent);
  font-weight: 700;
}

.guide-cta {
  margin: 24px 0 0;
}

.guide-page .donate-btn {
  display: inline-flex;
  text-decoration: none;
}

.footer-meta .legal-line {
  max-width: none;
}

.legal-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.linkish {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 12px 40px color-mix(in srgb, #000 25%, transparent);
}

.cookie-bar[hidden] {
  display: none;
}

.cookie-bar p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.cookie-bar button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.legal-dialog {
  width: min(640px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  color: var(--text);
  padding: 0;
}

.legal-dialog::backdrop {
  background: color-mix(in srgb, #000 45%, transparent);
}

.legal-dialog article {
  padding: 22px;
}

.legal-dialog h2 {
  margin: 0 0 12px;
}

.legal-dialog p,
.legal-dialog li {
  color: var(--muted);
  line-height: 1.55;
}

.legal-dialog ul {
  padding-left: 18px;
}

.source-link {
  color: var(--accent);
  font-size: 13px;
}

.seed-map {
  margin: 12px 0 8px;
}

.map-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.map-hint {
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.8;
}

.mc-map {
  width: min(100%, 384px);
  padding: 8px;
  border-radius: 6px;
  background:
    linear-gradient(#c4a574, #c4a574) padding-box,
    linear-gradient(#6b4423, #3d2613) border-box;
  border: 8px solid transparent;
  box-shadow: inset 0 0 0 2px #8a5a2b, 0 8px 0 #3d2613;
  image-rendering: pixelated;
  position: relative;
}

.mc-map.detailed {
  padding: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.mc-map.detailed.grabbing {
  cursor: grabbing;
}

.mc-map.detailed.busy {
  opacity: 0.72;
}

.map-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}

.mc-raster {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.seed-map svg {
  width: 100%;
  height: auto;
  display: block;
  background: #2a5aaa;
}

.mc-map.detailed .mc-raster,
.mc-map.detailed .map-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mc-map.detailed svg {
  background: transparent;
  pointer-events: none;
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 8px;
}

.map-nav {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 2px solid #6b4423;
  background: #f4e3b4;
  color: #1a1208;
  font-weight: 800;
  cursor: pointer;
}

.map-nav.reset {
  font-size: 12px;
}

.map-pos,
.map-help,
.map-pins {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.map-pos {
  margin: 0;
  font-weight: 700;
}

.map-pins {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 6px;
}

.map-pin-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.map-pin-row input[type="color"] {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.map-pin-row input[type="text"] {
  width: 100%;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--panel) 80%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  padding: 6px 8px;
}

.map-pin-coords {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.map-pin-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
}

.map-pin-remove:hover {
  color: var(--text);
  background: color-mix(in srgb, #c43c3c 18%, transparent);
}

.map-cross {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid #fff7d6;
  box-shadow: 0 0 0 1px #1a1208;
  pointer-events: none;
}

.map-pin circle {
  stroke: #fff4c8;
  stroke-width: 1.2;
}

.map-pin text {
  fill: #fff7d6;
  font-size: 9px;
  font-weight: 800;
  text-anchor: middle;
}

.fav-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 34px;
  line-height: 1;
  padding: 0;
  border-radius: 8px;
  flex-shrink: 0;
  width: 1.15em;
  height: 1.15em;
  display: grid;
  place-items: center;
}

.fav-toggle.is-on,
.fav-toggle:hover {
  color: #e2b00f;
}

.favorites-filters {
  margin-bottom: 16px;
}

.favorites-head {
  margin-bottom: 16px;
}

.favorites-head h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.favorites-empty {
  margin: 0;
  color: var(--muted);
}

.map-biomes {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.map-credit {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.map-credit a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.map-frame {
  fill: #8a6a3a;
}

.compass {
  fill: #1a1208;
  font-size: 14px;
  font-weight: 800;
  text-anchor: end;
}

.map-mark circle,
.map-mark rect {
  stroke: #fff4c8;
  stroke-width: 1.6;
}

.map-mark text,
.map-pin text {
  font-size: 11px;
  font-weight: 800;
  text-anchor: middle;
  pointer-events: none;
}

.map-tip {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
  min-width: 8em;
  max-width: calc(100% - 16px);
  padding: 7px 10px;
  border: 1px solid #fff4c8;
  border-radius: 8px;
  background: #1a1208;
  color: #fff7d6;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  line-height: 1.25;
}

.map-tip strong {
  display: block;
  font-weight: 800;
}

.map-tip small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.8;
}

.spawn {
  fill: #fff7d6;
  stroke: #1a1208;
  stroke-width: 1.5;
}

.hidden {
  display: none;
}

@media (max-width: 720px) {
  .row,
  .results,
  .search-mode {
    display: block;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-meta {
    align-items: flex-start;
    text-align: left;
  }

  .legal-links {
    justify-content: flex-start;
  }

  .search-mode-opt + .search-mode-opt {
    margin-top: 8px;
  }

  .top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "nav nav";
    gap: 8px 10px;
    padding: 8px 12px;
    align-items: center;
  }

  .brand {
    grid-area: brand;
    gap: 8px;
    min-height: 0;
  }

  .site-nav {
    grid-area: nav;
    order: unset;
    flex: none;
    width: 100%;
    gap: 6px;
  }

  .site-nav-link {
    flex: 1;
    text-align: center;
    padding: 7px 10px;
    font-size: 13px;
  }

  .top-actions {
    grid-area: actions;
    flex: none;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .contact-mail {
    display: none;
  }

  .donate-btn {
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  .theme-toggle {
    padding: 6px 10px;
    font-size: 12px;
    min-width: 2.5em;
  }

  .theme-switch {
    width: 52px;
    height: 26px;
    flex-shrink: 0;
  }

  .theme-switch-knob {
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
  }

  .theme-switch.is-night .theme-switch-knob {
    left: 28px;
  }

  .mc-sun,
  .mc-moon {
    width: 12px;
    height: 12px;
  }

  .mc-sun {
    left: 4px;
  }

  .mc-moon {
    right: 4px;
  }

  .donate-panel {
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
  }

  .crypto-list li {
    grid-template-columns: 64px 1fr;
  }

  .crypto-copy {
    grid-column: 1 / -1;
  }

  .brand-word {
    width: 96px;
    height: 28px;
  }

  .logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .card + .card {
    margin-top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .donate-panel,
  #search-form.panel,
  #submit,
  #lucky,
  .donate-btn,
  .filter-group {
    animation: none !important;
    transition: none !important;
  }

  #search-form.panel:hover,
  #submit:hover,
  #lucky:hover,
  .donate-btn:hover {
    transform: none;
  }
}
