/* Slime Atlas — интерфейс поверх пиксельной сцены */

:root {
  --accent: #7fe08a;
  --accent-2: #d8f27a;
  --accent-soft: rgba(127, 224, 138, .35);
  --ink: #040b08;
  --text: #f1f6f0;
  --muted: #9fb0a4;
  --panel: rgba(9, 13, 12, .55);
  --panel-solid: rgba(9, 13, 12, .88);
  --line: rgba(255, 255, 255, .12);
  --line-soft: rgba(255, 255, 255, .07);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: #05070a;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#scene {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block;
  /* Сцена выше слоя фона: без этого картинка накрывает слаймов. */
  z-index: 1;
  /* Порядок важен: crisp-edges понимают не все движки, pixelated — все
     современные. Поэтому pixelated идёт последним и побеждает там, где
     поддерживаются оба ключевых слова. */
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  touch-action: none;
  cursor: crosshair;
}

/* Слой авторского фона. Геометрия повторяет #scene один в один, чтобы картинка
   легла ровно под сцену, но рисуется в натуральном разрешении экрана:
   image-rendering здесь обычный, без pixelated. */
#sky {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  /* Фон — основа кадра, поэтому лежит ПОД сценой: слаймы и земля рисуются
     поверх него, а не прячутся за картинкой. */
  z-index: 0;
  pointer-events: none;
  image-rendering: auto;
}

/* Слой слаймов-спрайтов: та же геометрия, что у сцены, но натуральное
   разрешение. z-index как у сцены, а в DOM он позже — значит рисуется поверх
   неё, но под виньеткой, сканлайнами и HUD. */
#slimes {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 1;
  pointer-events: none;
  image-rendering: auto;
}

/* Передний план: вырезки из авторского фона. Стоит после слаймов, поэтому
   слаймы проходят позади предметов. Натуральное разрешение — это фотография,
   а не пиксельная сетка. */
#fore {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 1;
  pointer-events: none;
  image-rendering: auto;
}

/* Слой мягких частиц погоды (споры, снег): та же геометрия, но идёт после
   слаймов — частицы летают и перед ними тоже, это и даёт глубину. */
#soft {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 1;
  pointer-events: none;
  image-rendering: auto;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 42%, transparent 44%, rgba(0, 0, 0, .5) 100%);
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .14;
  mix-blend-mode: multiply;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .5) 0 1px, transparent 1px 3px);
}

/* ------------------------------------------------------------------ HUD -- */

.hud {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  padding: clamp(12px, 2vw, 24px);
  /* На телефонах с вырезом и домашней полосой не залезаем под системные зоны. */
  padding-top: max(clamp(12px, 2vw, 24px), env(safe-area-inset-top, 0px));
  padding-right: max(clamp(12px, 2vw, 24px), env(safe-area-inset-right, 0px));
  padding-bottom: max(clamp(12px, 2vw, 24px), env(safe-area-inset-bottom, 0px));
  padding-left: max(clamp(12px, 2vw, 24px), env(safe-area-inset-left, 0px));
  pointer-events: none;
}

/* Сцена бывает светлой: у грибного биома авторская картинка неба, и белым
   подписям не на что опереться. Подложка затемняет верх и низ кадра, а
   середину, где живут слаймы, не трогает. ::before лежит за содержимым HUD
   (z-index -1 внутри стека самого .hud), поэтому текст и кнопки остаются
   поверх и остаются кликабельными. */
.hud::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(to bottom,
      rgba(5, 4, 8, .82) 0,
      rgba(5, 4, 8, .54) 16%,
      rgba(5, 4, 8, .22) 34%,
      rgba(5, 4, 8, 0) 52%),
    linear-gradient(to top,
      rgba(5, 4, 8, .74) 0,
      rgba(5, 4, 8, .36) 15%,
      rgba(5, 4, 8, 0) 33%);
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .74);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .55);
  padding-top: 3px;
}

.brand-mark {
  position: relative;
  width: 15px;
  height: 13px;
  background: var(--accent);
  border-radius: 52% 52% 44% 44%;
  box-shadow: 0 0 14px var(--accent-soft);
  transition: background .4s, box-shadow .4s;
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 4px;
  width: 2px;
  height: 2px;
  background: var(--ink);
  box-shadow: 4px 0 0 var(--ink);
}

.actions {
  display: flex;
  gap: 8px;
  pointer-events: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(10, 14, 13, .5);
  color: var(--text);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 9px 12px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color .2s, background .2s, transform .12s, color .2s, filter .2s;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--accent);
  background: rgba(10, 14, 13, .72);
}

.btn:active { transform: translateY(1px); }

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

.btn kbd {
  font-family: var(--mono);
  font-size: 9px;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line-soft);
  color: var(--muted);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #07120a;
  font-weight: 700;
  box-shadow: 0 6px 24px var(--accent-soft);
}

.btn-primary:hover {
  background: var(--accent);
  filter: brightness(1.08);
}

.btn-primary kbd {
  background: rgba(0, 0, 0, .16);
  border-color: rgba(0, 0, 0, .18);
  color: rgba(0, 0, 0, .62);
}

.btn.icon {
  padding: 9px 11px;
  font-size: 14px;
  letter-spacing: 0;
  min-width: 38px;
  justify-content: center;
}

.btn.icon[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------------------------------------------------------- biome card -- */

.hud-mid {
  display: flex;
  align-items: flex-start;
}

.biome-card {
  max-width: min(640px, 74vw);
  padding-top: clamp(2px, 1.6vh, 16px);
  text-shadow: 0 2px 18px rgba(0, 0, 0, .6);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
}

.kicker .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 9px var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5.2vw, 62px);
  line-height: .94;
  letter-spacing: -.03em;
  font-weight: 800;
  color: #f7fbf6;
  text-shadow: 0 0 34px var(--accent-soft), 0 3px 22px rgba(0, 0, 0, .55);
}

.tagline {
  margin: 12px 0 0;
  max-width: 46ch;
  font-size: clamp(12px, 1.1vw, 14px);
  line-height: 1.5;
  color: rgba(240, 246, 240, .8);
}

.climate {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.climate li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(8, 12, 11, .44);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.climate b {
  color: var(--text);
  font-weight: 600;
  letter-spacing: .04em;
}

/* ---------------------------------------------------------- lore card -- */

.hud-bottom {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.lore-card {
  max-width: min(430px, 80vw);
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--accent);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .28);
}

.lore-title {
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
}

.lore-card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(238, 246, 238, .84);
}

.roster {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .05em;
  color: rgba(240, 246, 240, .88);
}

.chip i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: 0 0 7px currentColor;
}

.chip.rare {
  border-color: var(--accent);
  color: var(--accent);
}

/* -------------------------------------------------------------- footer -- */

.hint {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .45);
  white-space: nowrap;
}

.hint kbd {
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, .28);
  font-family: var(--mono);
  font-size: 9px;
  color: rgba(255, 255, 255, .6);
}

.progress {
  text-align: right;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.9;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
}

.progress b {
  color: var(--accent);
  font-weight: 600;
}

/* --------------------------------------------------------------- toast -- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  z-index: 15;
  transform: translate(-50%, 10px);
  padding: 10px 15px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--panel-solid);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .45), 0 0 22px var(--accent-soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  max-width: min(90vw, 460px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast b { color: var(--accent); }

/* -------------------------------------------------------------- curtain -- */

.curtain {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: #040706;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}

.curtain.on { opacity: 1; }

/* ---------------------------------------------------------------- atlas -- */

.atlas {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  background: rgba(3, 5, 6, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity .2s;
}

.atlas.open { opacity: 1; }
.atlas[hidden] { display: none; }

.atlas-panel {
  width: min(1020px, 100%);
  max-height: 90vh;
  /* dvh учитывает динамические панели браузера на телефонах. */
  max-height: 90dvh;
  overflow: auto;
  padding: clamp(16px, 3vw, 28px);
  background: rgba(9, 13, 12, .92);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .2) transparent;
}

.atlas-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.atlas-head h2 {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 30px);
  letter-spacing: -.02em;
}

.atlas-sub {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.atlas-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.atlas-stats b {
  color: var(--accent);
  font-weight: 600;
}

.atlas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.atlas-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font);
  transition: transform .15s, border-color .15s, background .15s;
}

.atlas-tile:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(255, 255, 255, .06);
}

.atlas-tile:disabled {
  cursor: default;
  opacity: .5;
}

.atlas-tile.current {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

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

.tile-art {
  position: relative;
  display: block;
  height: 74px;
  border-radius: 8px;
  overflow: hidden;
}

.tile-art::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 24px;
  height: 18px;
  transform: translateX(-50%);
  background: var(--tile-accent, #7fe08a);
  border-radius: 52% 52% 42% 42%;
  box-shadow: 0 0 16px var(--tile-accent, #7fe08a);
  opacity: .92;
}

.tile-art::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 15px;
  z-index: 2;
  width: 3px;
  height: 3px;
  transform: translateX(-72%);
  background: #0b0f0d;
  border-radius: 50%;
  box-shadow: 7px 0 0 #0b0f0d;
}

.atlas-tile.locked .tile-art { filter: grayscale(.85) brightness(.6); }
.atlas-tile.locked .tile-art::after { opacity: .4; box-shadow: none; }
.atlas-tile.locked .tile-art::before { display: none; }

.tile-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.tile-meta {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.tile-species {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 8px;
}

.tile-species i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .45);
}

.atlas-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.link-btn {
  padding: 6px 0;
  background: none;
  border: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:hover { color: var(--text); }

/* ---------------------------------------------------------- bestiary -- */

.bestiary {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  background: rgba(3, 5, 6, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity .2s;
}

.bestiary.open { opacity: 1; }
.bestiary[hidden] { display: none; }

.bestiary-panel {
  width: min(1180px, 100%);
  max-height: 90vh;
  max-height: 90dvh;
  overflow: auto;
  padding: clamp(16px, 3vw, 28px);
  background: rgba(9, 13, 12, .92);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .2) transparent;
}

.bestiary-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.bestiary-head h2 {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 30px);
  letter-spacing: -.02em;
}

.bestiary-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.bestiary-toolbar select {
  min-width: 220px;
  padding: 8px 30px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  font: 10px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color-scheme: dark;
}

.bestiary-toolbar select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.bestiary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 18px;
  align-items: start;
}

.bestiary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.bestiary-card {
  min-height: 84px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font);
  transition: transform .15s, border-color .15s, background .15s, opacity .15s;
}

.bestiary-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(255, 255, 255, .06);
}

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

.bestiary-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.bestiary-card.locked {
  cursor: default;
  opacity: .48;
}

.bestiary-swatch {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(0,0,0,.18));
}

.bestiary-swatch::before,
.detail-art::before {
  content: "";
  position: absolute;
  width: 34px;
  height: 26px;
  background: linear-gradient(180deg, var(--slime-light), var(--slime-body) 58%, var(--slime-dark));
  border-radius: 54% 54% 44% 44%;
  box-shadow: 0 0 16px var(--slime-body);
}

.bestiary-swatch::after,
.detail-art::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 5px;
  background: var(--slime-dark);
  border-radius: 50%;
  transform: translateX(-6px);
  box-shadow: 12px 0 0 var(--slime-dark);
}

.bestiary-swatch i,
.detail-art i {
  position: absolute;
  z-index: 1;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--slime-light);
  transform: translate(-7px, -8px);
  opacity: .9;
}

.bestiary-card-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.bestiary-card-copy strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bestiary-card-copy small {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .08em;
  line-height: 1.25;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.bestiary-detail {
  position: sticky;
  top: 0;
  min-height: 330px;
  padding: 16px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--accent);
  border-radius: 12px;
}

.detail-art {
  position: relative;
  display: grid;
  place-items: center;
  height: 126px;
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: 9px;
  background: radial-gradient(circle at 50% 55%, var(--slime-body), transparent 24%), linear-gradient(145deg, rgba(255,255,255,.08), rgba(0,0,0,.22));
}

.detail-art::before {
  width: 92px;
  height: 70px;
}

.detail-art::after {
  width: 8px;
  height: 11px;
  transform: translateX(-17px);
  box-shadow: 30px 0 0 var(--slime-dark);
}

.detail-art i {
  width: 9px;
  height: 9px;
  transform: translate(-25px, -20px);
}

.detail-kicker {
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.bestiary-detail h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1;
}

.detail-description {
  margin: 12px 0 0;
  color: rgba(238, 246, 238, .82);
  font-size: 12px;
  line-height: 1.55;
}

.detail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0 0;
}

.detail-stats div {
  padding: 8px;
  background: rgba(0, 0, 0, .16);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

.detail-stats dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.detail-stats dd {
  margin: 0;
  color: var(--text);
  font-size: 11px;
  line-height: 1.25;
}

.bestiary-empty {
  display: grid;
  place-items: center;
  min-height: 296px;
  text-align: center;
  color: var(--muted);
}

.bestiary-empty strong {
  margin-top: 12px;
  color: var(--text);
  font-size: 14px;
}

.bestiary-empty p {
  max-width: 28ch;
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.5;
}

.detail-lock {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  font: 20px var(--mono);
}

/* ---------------------------------------------------------- animations -- */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.biome-card.in > * {
  animation: rise .68s cubic-bezier(.2, .7, .2, 1) both;
}

.biome-card.in > *:nth-child(1) { animation-delay: .02s; }
.biome-card.in > *:nth-child(2) { animation-delay: .07s; }
.biome-card.in > *:nth-child(3) { animation-delay: .13s; }
.biome-card.in > *:nth-child(4) { animation-delay: .19s; }

.lore-card {
  animation: rise .8s .16s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}

#scene { animation: fadein .8s ease both; }

/* -------------------------------------------------------------- mobile -- */

@media (max-width: 760px) {
  .lore-card { display: none; }
  .hint { display: none; }
  .biome-card { max-width: 92vw; }
  .climate li { font-size: 8px; padding: 4px 7px; }
  .progress { font-size: 8px; }
  .brand span:last-child { display: none; }
  .actions .btn kbd { display: none; }
  .atlas-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .bestiary-layout { grid-template-columns: 1fr; }
  .bestiary-detail { position: static; order: -1; min-height: 0; }
  .bestiary-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
  .bestiary-toolbar select { min-width: 0; flex: 1; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 430px) {
  .btn { padding: 8px 10px; font-size: 9px; }
  .btn.icon { padding: 8px 9px; }
  h1 { font-size: clamp(26px, 9vw, 40px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-delay: 0s !important;
    transition-duration: .001s !important;
  }
}
