/* BEBRUSY — The Deep Field */

:root {
  --void: #070e24;
  --void-2: #0a1430;
  --ink: #0d1838;
  --line: rgba(154, 214, 255, 0.12);
  --line-hot: rgba(154, 214, 255, 0.28);
  --text: #eef3ff;
  --muted: #9bb0d4;
  --dim: #6d82ab;
  --cyan: #9ad6ff;
  --ember: #ee7a3a;
  --moss: #7dcf6a;
  --violet: #8b9cff;
  --amber: #ffc773;
  --coral: #ff7f96;
  --glass: rgba(154, 214, 255, 0.05);
  --glass-2: rgba(154, 214, 255, 0.09);
  --display: "Fraunces", "Times New Roman", serif;
  --body: "Outfit", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --rail: 76px;
}

* {
  box-sizing: border-box;
}

/* display в правилах ниже перебивает атрибут hidden, поэтому закрепляем его здесь */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

#field-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.85;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(80, 120, 255, 0.16), transparent 60%),
    radial-gradient(90% 60% at 100% 100%, rgba(157, 139, 255, 0.12), transparent 60%),
    radial-gradient(70% 50% at 0% 70%, rgba(79, 242, 200, 0.08), transparent 60%),
    linear-gradient(180deg, rgba(4, 8, 26, 0.2), rgba(4, 8, 26, 0.78));
}

.vignette::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

main,
.top,
.foot,
.depth-rail {
  position: relative;
  z-index: 2;
}

/* ---------- header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 14px clamp(16px, 4vw, 46px);
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(4, 8, 26, 0.88), rgba(4, 8, 26, 0.5));
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--cyan);
}

.mark {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 0 10px rgba(79, 242, 200, 0.5));
  animation: spin 30s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.brand-text {
  display: flex;
  flex-direction: column;
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.16em;
  color: var(--text);
  line-height: 1;
}

.brand-text em {
  font-family: var(--mono);
  font-style: normal;
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.34em;
  color: var(--dim);
  margin-top: 4px;
}

.nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 13.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.nav a {
  position: relative;
  padding: 4px 0;
  transition: color 0.2s;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--cyan);
  transition: right 0.25s;
}

.nav a:hover,
.nav a.on {
  color: var(--text);
}

.nav a:hover::after,
.nav a.on::after {
  right: 0;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.signal {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border: 1px solid var(--line-hot);
  border-radius: 999px;
  background: rgba(79, 242, 200, 0.06);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.2s;
}

.signal:hover {
  background: rgba(79, 242, 200, 0.14);
  border-color: var(--cyan);
  transform: translateY(-1px);
}

.signal .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 10px currentColor;
  color: var(--coral);
}

.signal.live .dot {
  background: var(--cyan);
  color: var(--cyan);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 38px;
  height: 34px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.burger span {
  width: 16px;
  height: 1.5px;
  background: var(--text);
}

/* ---------- buttons ---------- */

.prime {
  position: relative;
  padding: 14px 28px;
  border: none;
  border-radius: 999px;
  background: var(--ember);
  color: #1a0b04;
  font-family: var(--body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 12px 32px -14px rgba(238, 122, 58, 0.85);
  transition:
    transform 0.18s,
    box-shadow 0.18s,
    filter 0.18s;
}

.prime:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -12px rgba(79, 242, 200, 0.85);
  filter: saturate(1.1);
}

.prime:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid var(--line-hot);
  border-radius: 12px;
  background: rgba(120, 156, 255, 0.04);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s,
    color 0.2s;
}

.ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(79, 242, 200, 0.07);
}

.ghost.big {
  padding: 14px 24px;
  font-size: 13px;
}

.ghost.tiny {
  padding: 7px 12px;
  font-size: 10.5px;
  border-radius: 9px;
}

.wide {
  width: 100%;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- depth rail ---------- */

.depth-rail {
  position: fixed;
  top: 50%;
  right: 22px;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.rail-line {
  width: 2px;
  height: 200px;
  background: linear-gradient(180deg, rgba(146, 176, 255, 0.28), rgba(146, 176, 255, 0.05));
  border-radius: 2px;
  overflow: hidden;
}

.rail-fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  box-shadow: 0 0 12px rgba(79, 242, 200, 0.6);
  transition: height 0.2s linear;
}

.rail-read {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.rail-read span {
  font-size: 9px;
  color: var(--dim);
}

.rail-label {
  writing-mode: vertical-rl;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- layers ---------- */

.layer {
  position: relative;
  padding: clamp(80px, 11vh, 150px) clamp(18px, 6vw, 96px);
  max-width: 1360px;
  margin: 0 auto;
}

.layer + .layer {
  border-top: 1px solid rgba(146, 176, 255, 0.08);
}

.layer-head {
  max-width: 760px;
  margin-bottom: 52px;
}

.depth-tag {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--cyan);
}

.depth-tag::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 1px;
  background: var(--cyan);
  vertical-align: middle;
  margin-right: 12px;
  opacity: 0.6;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.04;
  margin: 0;
}

h2 {
  font-size: clamp(36px, 5.6vw, 72px);
  font-style: italic;
}

h3 {
  font-size: 19px;
  letter-spacing: 0;
}

.layer-sub {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 16.5px;
  max-width: 68ch;
}

.fine {
  font-size: 13px;
  color: var(--dim);
  line-height: 1.55;
}

/* ---------- hero ---------- */

#surface {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(40px, 7vh, 90px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 22px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  font-size: clamp(46px, 8vw, 108px);
  font-weight: 500;
}

.grad {
  font-style: italic;
  color: var(--ember);
  background: none;
}

.lede {
  margin: 26px 0 34px;
  max-width: 60ch;
  color: var(--muted);
  font-size: 17px;
}

.lede b {
  color: var(--text);
  font-weight: 600;
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.ticker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 46px 0 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.ticker > div {
  padding: 16px 14px;
  background: rgba(7, 14, 38, 0.82);
}

.ticker dt {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}

.ticker dd {
  margin: 7px 0 0;
  font-family: var(--mono);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* ---------- hero art: looking down into the pond ---------- */

.hero-art {
  display: flex;
  justify-content: center;
}

.pond {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pond-glass {
  position: relative;
  width: min(480px, 86vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(18, 36, 78, 0.2), rgba(7, 14, 36, 0.92) 72%);
  box-shadow:
    inset 0 0 0 1px rgba(154, 214, 255, 0.18),
    inset 0 -40px 80px rgba(7, 14, 36, 0.55),
    0 0 0 14px rgba(12, 20, 48, 0.9),
    0 0 0 15px rgba(154, 214, 255, 0.16),
    0 40px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.pond-ripple {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(154, 214, 255, 0.14);
  pointer-events: none;
}

.pond-ripple.r1 {
  inset: 8%;
  animation: ripple 14s ease-out infinite;
}

.pond-ripple.r2 {
  inset: 20%;
  animation: ripple 14s ease-out 4.6s infinite;
}

.pond-ripple.r3 {
  inset: 34%;
  border-style: dashed;
  animation: spin 80s linear infinite;
}

@keyframes ripple {
  0% {
    transform: scale(0.86);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

.pond-cap {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--dim);
}

.specimen {
  position: relative;
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  z-index: 2;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}

.specimen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.specimen-tag {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(7, 14, 36, 0.78);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.specimen-tag b {
  color: var(--ember);
  font-weight: 500;
}

.drifters {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.drifters img {
  position: absolute;
  width: 18%;
  border-radius: 50%;
  image-rendering: pixelated;
  animation: floaty 9s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

@keyframes floaty {
  50% {
    transform: translateY(-10px);
  }
}

.scroll-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: clamp(30px, 6vh, 64px);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--dim);
}

.scroll-hint i {
  width: 44px;
  height: 1px;
  background: linear-gradient(90deg, var(--dim), transparent);
  animation: slide 2.4s ease-in-out infinite;
}

@keyframes slide {
  50% {
    transform: translateX(10px);
  }
}

/* ---------- panels ---------- */

.panel {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--glass-2), var(--glass));
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(146, 176, 255, 0.45), transparent);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-note {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--dim);
}

.chip {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.chip.strong {
  border-color: rgba(79, 242, 200, 0.45);
  color: var(--cyan);
  background: rgba(79, 242, 200, 0.08);
}

/* ---------- journal ---------- */

.locked {
  max-width: 560px;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--glass-2), transparent);
  text-align: center;
  margin: 0 auto;
}

.locked-art {
  width: 110px;
  margin: 0 auto 18px;
  color: var(--cyan);
  opacity: 0.55;
  animation: pulse 4s ease-in-out infinite;
}

.locked h3 {
  font-size: 26px;
  margin-bottom: 12px;
}

.locked p {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0 0 24px;
}

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

.roster {
  grid-column: 1 / -1;
}

.purse-main {
  text-align: center;
  padding: 10px 0 18px;
}

.spores {
  font-family: var(--mono);
  font-size: clamp(38px, 6vw, 56px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: linear-gradient(120deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.unit {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--dim);
}

.purse-rows {
  display: grid;
  gap: 1px;
  margin-bottom: 18px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.purse-rows > div {
  display: flex;
  justify-content: space-between;
  padding: 11px 14px;
  background: rgba(6, 12, 32, 0.7);
  font-size: 13.5px;
}

.purse-rows span {
  color: var(--dim);
}

.purse-rows b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.tide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px dashed rgba(255, 199, 115, 0.35);
  border-radius: 12px;
  background: rgba(255, 199, 115, 0.05);
}

.tide-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--amber);
}

.tide-value {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 14px;
}

.tide.done {
  opacity: 0.55;
  border-style: solid;
}

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

.brood-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(79, 242, 200, 0.04);
  font-size: 13.5px;
}

.brood-list b {
  font-family: var(--mono);
  color: var(--cyan);
}

.brood-empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  font-size: 13px;
  color: var(--dim);
  text-align: center;
}

.roster-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.roster-grid,
.showcase,
.dive-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
}

.rcard {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #060c20;
  cursor: pointer;
  transition:
    border-color 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}

.rcard:hover {
  transform: translateY(-3px);
  border-color: var(--line-hot);
}

.rcard img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  image-rendering: pixelated;
}

.rcard .rmeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.rcard.on {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan) inset, 0 14px 30px -18px rgba(79, 242, 200, 0.8);
}

.rcard.on::after {
  content: "tethered";
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--cyan);
  color: #04122a;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rcard.diving::after {
  content: "under";
  background: var(--amber);
}

.rcard.picked {
  border-color: var(--violet);
  box-shadow: 0 0 0 1px var(--violet) inset;
}

.rcard .relic-dots {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 3px;
}

.relic-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

.tier {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tier-common {
  color: var(--dim);
}

.tier-uncommon {
  color: var(--cyan);
}

.tier-rare {
  color: var(--violet);
}

.tier-epic {
  color: var(--amber);
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field span {
  display: block;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(4, 8, 26, 0.7);
  font-family: var(--mono);
  font-size: 13px;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--cyan);
}

.showcase .rcard.on::after {
  content: "showcase";
}

/* ---------- broods ---------- */

.brood-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.bcard {
  position: relative;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--glass-2), transparent 70%);
  overflow: hidden;
  transition:
    transform 0.25s,
    border-color 0.25s;
}

.bcard:hover {
  transform: translateY(-4px);
  border-color: var(--line-hot);
}

.bcard::after {
  content: "";
  position: absolute;
  inset: auto -30% -60% auto;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 242, 200, 0.14), transparent 70%);
}

.bnum {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.2em;
}

.bcard h3 {
  margin: 12px 0 10px;
  font-size: 27px;
}

.bval {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--cyan);
}

.bcard p:last-child {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.bcard.echo {
  border-color: rgba(238, 122, 58, 0.4);
}

.bcard.echo .bval {
  color: var(--ember);
}

.bcard.echo::after {
  background: radial-gradient(circle, rgba(238, 122, 58, 0.2), transparent 70%);
}

.rate-table {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(6, 12, 32, 0.5);
}

.rate-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.rate-head p {
  margin: 6px 0 0;
  color: var(--dim);
  font-size: 13.5px;
}

.rate-table ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rate-table li {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 2fr;
  gap: 14px;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(146, 176, 255, 0.07);
  font-size: 14px;
}

.rate-table li b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.rate-bar {
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
}

.rate-table > .fine {
  padding: 16px 24px;
  margin: 0;
}

/* ---------- dives ---------- */

.dive-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 18px;
}

.dive-opts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.dopt {
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(4, 8, 26, 0.6);
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.dopt:hover {
  border-color: var(--line-hot);
}

.dopt.on {
  border-color: var(--violet);
  background: rgba(157, 139, 255, 0.12);
}

.dopt b {
  display: block;
  font-family: var(--mono);
  font-size: 17px;
}

.dopt span {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--dim);
}

.dive-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.ditem {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(4, 8, 26, 0.6);
}

.ditem .drow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ditem .dtime {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--amber);
}

.dbar {
  height: 4px;
  border-radius: 3px;
  background: rgba(146, 176, 255, 0.14);
  overflow: hidden;
}

.dbar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--cyan));
}

.dive-mini {
  display: flex;
  gap: 6px;
}

.dive-mini img {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  image-rendering: pixelated;
  border: 1px solid var(--line);
}

.relic-legend {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.relic-legend h4 {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dim);
}

.relic-legend ul {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.relic-legend li {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
}

.relic-legend b {
  font-family: var(--mono);
  color: var(--amber);
}

/* ---------- draws ---------- */

.draw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-bottom: 44px;
}

.dcard {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(170deg, rgba(157, 139, 255, 0.1), var(--glass) 60%);
  overflow: hidden;
}

.dcard h3 {
  font-size: 23px;
  margin-bottom: 8px;
}

.dcard .prize {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14.5px;
}

.dmeta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 16px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.dmeta > div {
  padding: 11px;
  background: rgba(4, 8, 26, 0.72);
  text-align: center;
}

.dmeta dt {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.dmeta dd {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 15px;
}

.ticket-row {
  display: flex;
  gap: 8px;
}

.ticket-row input {
  width: 84px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(4, 8, 26, 0.7);
  font-family: var(--mono);
  text-align: center;
}

.seed {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
  word-break: break-all;
}

.past-draws h3 {
  margin-bottom: 16px;
  font-size: 20px;
}

.past-draws ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.past-draws li {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(6, 12, 32, 0.55);
  font-size: 13.5px;
}

.past-draws .mono {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 11.5px;
  word-break: break-all;
}

/* ---------- chart ---------- */

.chart-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  gap: 18px;
}

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

.crow {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(6, 12, 32, 0.55);
  transition: border-color 0.2s;
}

.crow:hover {
  border-color: var(--line-hot);
}

.crow .pos {
  font-family: var(--display);
  font-size: 19px;
  color: var(--dim);
}

.crow.top1 {
  border-color: rgba(255, 199, 115, 0.5);
  background: linear-gradient(90deg, rgba(255, 199, 115, 0.1), transparent);
}

.crow.top1 .pos {
  color: var(--amber);
}

.crow.top2 .pos,
.crow.top3 .pos {
  color: var(--cyan);
}

.crow .who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.crow .who img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  image-rendering: pixelated;
  border: 1px solid var(--line);
}

.crow .name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crow .sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}

.crow .val {
  font-family: var(--mono);
  font-size: 15px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.crow .val span {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.registry {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--glass-2), transparent 70%);
  height: fit-content;
}

.registry h3 {
  margin-bottom: 10px;
}

.registry ul {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 7px;
  max-height: 340px;
  overflow-y: auto;
}

.registry li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(146, 176, 255, 0.07);
}

.registry li b {
  color: var(--cyan);
}

.feed-head {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 17px;
}

#feed-rows {
  max-height: 260px;
}

#feed-rows li {
  color: var(--dim);
}

#feed-rows li b {
  color: var(--amber);
}

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

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
  align-items: center;
}

.filters input,
.filters select {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(4, 8, 26, 0.7);
  font-family: var(--mono);
  font-size: 12.5px;
}

.filters input {
  min-width: 210px;
}

.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: var(--cyan);
}

.beast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.beast {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  background: #060c20;
  cursor: pointer;
  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}

.beast:hover {
  transform: translateY(-4px);
  border-color: var(--line-hot);
  box-shadow: 0 20px 40px -22px rgba(0, 0, 0, 0.9);
}

.beast img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  image-rendering: pixelated;
  background: #050a18;
}

.beast .bmeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
}

.beast .bid {
  color: var(--text);
}

.beast .brank {
  color: var(--dim);
}

.beast .flag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(4, 8, 26, 0.82);
  border: 1px solid var(--line-hot);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}

.beast .flag.unsighted {
  left: auto;
  right: 8px;
  color: var(--ember);
  border-color: rgba(238, 122, 58, 0.45);
}

/* ---------- descent ---------- */

.descent {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.descent::before {
  content: "";
  position: absolute;
  left: 78px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--violet) 45%, rgba(146, 176, 255, 0.1));
}

.stage {
  position: relative;
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr);
  gap: 28px;
  padding: 0 0 42px;
}

.stage-depth {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 3px;
  padding-right: 34px;
  font-family: var(--mono);
  color: var(--dim);
}

.stage-depth b {
  font-family: var(--display);
  font-size: 30px;
  color: var(--muted);
}

.stage-depth span {
  font-size: 11px;
}

.stage-depth::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 12px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--dim);
  background: var(--void);
}

.stage.live .stage-depth::after {
  border-color: var(--cyan);
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan);
}

.stage.next .stage-depth::after {
  border-color: var(--violet);
}

.stage-body {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--glass-2), transparent 75%);
}

.stage.live .stage-body {
  border-color: rgba(79, 242, 200, 0.4);
  box-shadow: 0 24px 60px -34px rgba(79, 242, 200, 0.6);
}

.stage-state {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--dim);
}

.stage.live .stage-state {
  color: var(--cyan);
}

.stage.next .stage-state {
  color: var(--violet);
}

.stage-body h3 {
  font-size: 25px;
  margin-bottom: 12px;
}

.stage-body p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 15px;
}

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

.stage-list li {
  position: relative;
  padding-left: 20px;
  font-size: 13.5px;
  color: var(--dim);
}

.stage-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 7px;
  height: 1px;
  background: var(--cyan);
}

/* ---------- codex ---------- */

.codex {
  display: grid;
  gap: 10px;
  max-width: 900px;
}

.codex details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(6, 12, 32, 0.5);
  overflow: hidden;
}

.codex summary {
  padding: 18px 22px;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.codex summary::-webkit-details-marker {
  display: none;
}

.codex summary::after {
  content: "+";
  font-family: var(--mono);
  color: var(--cyan);
  font-size: 18px;
}

.codex details[open] summary::after {
  content: "–";
}

.codex p {
  margin: 0;
  padding: 0 22px 20px;
  color: var(--muted);
  font-size: 14.5px;
}

/* ---------- admin ---------- */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 16px;
}

.admin-draws {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 13px;
}

.admin-draws li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

/* ---------- foot ---------- */

.foot {
  padding: 60px clamp(18px, 6vw, 96px) 70px;
  border-top: 1px solid var(--line);
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.foot-mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(42px, 12vw, 128px);
  letter-spacing: 0.04em;
  line-height: 0.9;
  background: linear-gradient(180deg, rgba(146, 176, 255, 0.3), transparent 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.foot p {
  margin: 0;
  max-width: 62ch;
  color: var(--dim);
  font-size: 13px;
}

.foot-links {
  display: flex;
  gap: 18px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.foot-links a:hover {
  color: var(--cyan);
}

/* ---------- toasts & sheet ---------- */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: grid;
  gap: 10px;
  max-width: min(360px, 88vw);
}

.toast {
  padding: 14px 16px;
  border: 1px solid var(--line-hot);
  border-radius: 13px;
  background: rgba(7, 14, 38, 0.95);
  backdrop-filter: blur(12px);
  font-size: 13.5px;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9);
  animation: rise 0.25s ease-out;
}

.toast.good {
  border-color: rgba(79, 242, 200, 0.5);
}

.toast.bad {
  border-color: rgba(255, 127, 150, 0.5);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 5, 14, 0.82);
  backdrop-filter: blur(10px);
}

.sheet-card {
  position: relative;
  width: min(620px, 96vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 30px;
  border: 1px solid var(--line-hot);
  border-radius: 22px;
  background: linear-gradient(180deg, #0a1233, #050a1c);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.95);
}

.sheet-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: none;
  cursor: pointer;
  color: var(--muted);
}

.sheet-close:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

.sheet-hero {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 22px;
}

.sheet-hero img {
  width: 150px;
  border-radius: 16px;
  image-rendering: pixelated;
  border: 1px solid var(--line-hot);
}

.sheet-hero h3 {
  font-size: 30px;
  margin-bottom: 8px;
}

.traits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.traits > div {
  padding: 12px 14px;
  background: rgba(5, 10, 28, 0.85);
}

.traits dt {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

.traits dd {
  margin: 5px 0 0;
  font-size: 14px;
}

.sheet-rows {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  font-size: 13.5px;
}

.sheet-rows div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(146, 176, 255, 0.08);
}

.sheet-rows span {
  color: var(--dim);
}

.sheet-rows b {
  font-family: var(--mono);
  font-weight: 500;
}

/* ---------- reveal ---------- */

.layer > * {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.layer.in > * {
  opacity: 1;
  transform: none;
}

.layer.in > *:nth-child(2) {
  transition-delay: 0.08s;
}

.layer.in > *:nth-child(3) {
  transition-delay: 0.14s;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  .layer > * {
    opacity: 1;
    transform: none;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .depth-rail {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-art {
    order: -1;
  }

  .dive-wrap,
  .chart-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 880px) {
  .nav {
    position: fixed;
    inset: 66px 12px auto;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--line-hot);
    border-radius: 16px;
    background: rgba(5, 10, 28, 0.97);
    backdrop-filter: blur(16px);
    display: none;
    z-index: 50;
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 11px 6px;
    border-bottom: 1px solid rgba(146, 176, 255, 0.08);
  }

  .burger {
    display: flex;
    order: 3;
  }

  .top-right {
    margin-left: auto;
  }

  .market-link {
    display: none;
  }

  .journal-grid {
    grid-template-columns: 1fr;
  }

  .ticker {
    grid-template-columns: repeat(2, 1fr);
  }

  .stage {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 16px;
  }

  .descent::before {
    left: 31px;
  }

  .stage-depth {
    flex-direction: column;
    align-items: flex-start;
    padding-right: 18px;
  }

  .stage-depth b {
    font-size: 19px;
  }

  .stage-depth::after {
    right: -7px;
    width: 12px;
    height: 12px;
  }

  .rate-table li {
    grid-template-columns: 1fr 1fr;
  }

  .rate-bar {
    display: none;
  }

  .sheet-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .layer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .spores {
    font-size: 40px;
  }

  .dive-opts {
    grid-template-columns: 1fr;
  }
}
