:root {
  color-scheme: dark;
  --bg: #050812;
  --bg-deep: #02040a;
  --panel: rgba(12, 21, 38, 0.82);
  --panel-solid: #0c1526;
  --panel-soft: rgba(17, 29, 50, 0.7);
  --line: rgba(143, 211, 255, 0.16);
  --line-strong: rgba(125, 224, 255, 0.38);
  --text: #f3f8ff;
  --muted: #9caec2;
  --cyan: #5be7ff;
  --cyan-soft: rgba(91, 231, 255, 0.12);
  --violet: #aa88ff;
  --violet-soft: rgba(170, 136, 255, 0.13);
  --red: #ff667d;
  --red-soft: rgba(255, 102, 125, 0.12);
  --amber: #ffc86a;
  --green: #72e3b1;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 13px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --page: min(1180px, calc(100% - 32px));
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

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

.space-backdrop {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 16%, rgba(46, 118, 172, 0.19), transparent 32%),
    radial-gradient(circle at 88% 7%, rgba(94, 48, 151, 0.16), transparent 28%),
    radial-gradient(circle at 48% 110%, rgba(18, 112, 132, 0.18), transparent 38%),
    linear-gradient(155deg, #070d1a 0%, #03050c 52%, #070814 100%);
}

.star-layer,
.orbit-line {
  position: absolute;
  pointer-events: none;
}

.star-layer {
  inset: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.82) 0 1px, transparent 1.2px),
    radial-gradient(circle, rgba(91, 231, 255, 0.72) 0 1px, transparent 1.2px);
  background-position: 0 0, 41px 73px;
  background-size: 89px 89px, 137px 137px;
}

.star-layer-b {
  opacity: 0.22;
  transform: scale(1.4) rotate(7deg);
  background-size: 163px 163px, 219px 219px;
}

.orbit-line {
  width: 620px;
  height: 620px;
  border: 1px solid rgba(91, 231, 255, 0.07);
  border-radius: 50%;
}

.orbit-line-a {
  top: -370px;
  right: -220px;
}

.orbit-line-b {
  bottom: -470px;
  left: -180px;
  width: 760px;
  height: 760px;
  border-color: rgba(170, 136, 255, 0.06);
}

.site-shell {
  width: var(--page);
  min-height: 100vh;
  margin: 0 auto;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: max(12px, env(safe-area-inset-top)) 0 12px;
  border-bottom: 1px solid rgba(125, 224, 255, 0.1);
  background: linear-gradient(to bottom, rgba(5, 8, 18, 0.94), rgba(5, 8, 18, 0.77));
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid rgba(91, 231, 255, 0.66);
  border-radius: 50%;
  box-shadow: inset 0 0 14px rgba(91, 231, 255, 0.14), 0 0 18px rgba(91, 231, 255, 0.1);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.brand-mark::before {
  inset: 7px;
  border: 1px solid rgba(170, 136, 255, 0.72);
}

.brand-mark::after {
  top: 4px;
  right: 2px;
  width: 5px;
  height: 5px;
  background: var(--red);
  box-shadow: 0 0 9px var(--red);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  overflow: hidden;
  font-size: 15px;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.13em;
}

.signal-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid rgba(255, 102, 125, 0.2);
  border-radius: 999px;
  background: rgba(255, 102, 125, 0.07);
  color: #ffc0ca;
  font-size: 11px;
  font-weight: 700;
}

.signal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 9px var(--red);
  animation: signal-pulse 2.1s ease-in-out infinite;
}

main {
  min-height: calc(100vh - 170px);
}

.view {
  padding: 20px 0 56px;
  animation: view-in 0.38s ease both;
}

.view[hidden] {
  display: none;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(15, 28, 49, 0.95), rgba(7, 12, 25, 0.9));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.04);
}

.hero-panel::after {
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(91, 231, 255, 0.11);
  border-radius: 50%;
  content: "";
}

.hero-visual {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  background: #050a13;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  object-position: center 38%;
  filter: saturate(0.86) contrast(1.06) brightness(0.83);
  transform: scale(1.02);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(5, 9, 19, 0.85), transparent 46%),
    linear-gradient(115deg, rgba(0, 10, 20, 0.2), rgba(15, 5, 24, 0.1));
}

.hero-status {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 102, 125, 0.3);
  border-radius: 12px;
  background: rgba(7, 10, 20, 0.72);
  text-align: right;
  backdrop-filter: blur(10px);
}

.hero-status span,
.hero-status strong {
  display: block;
}

.hero-status span {
  color: #ffb1be;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hero-status strong {
  margin-top: 1px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0.06em;
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: 25px 22px 26px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.045em;
}

.hero-copy h1 {
  margin-bottom: 17px;
  font-size: clamp(38px, 11vw, 63px);
  line-height: 1.08;
}

.hero-description {
  max-width: 620px;
  margin-bottom: 21px;
  color: #c5d2e0;
  font-size: 15px;
}

.status-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-row span,
.tag-row span,
.record-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(150, 202, 235, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #c9d6e4;
  font-size: 12px;
  font-weight: 700;
}

.status-light {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-light.warning {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(255, 200, 106, 0.7);
}

.status-light.danger {
  background: var(--red);
  box-shadow: 0 0 8px rgba(255, 102, 125, 0.7);
}

.home-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 40px 2px 17px;
}

.home-heading h2 {
  margin: 0;
  font-size: 26px;
}

.home-heading > p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
}

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

.category-card {
  position: relative;
  display: flex;
  min-height: 185px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  overflow: hidden;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, rgba(18, 34, 58, 0.86), rgba(7, 12, 24, 0.9));
  text-align: left;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.category-card::before {
  position: absolute;
  top: -45px;
  right: -55px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--card-glow, rgba(91, 231, 255, 0.17)), transparent 67%);
  content: "";
}

.category-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.05);
  transform: translateY(-3px);
}

.category-world {
  --card-glow: rgba(91, 231, 255, 0.22);
}

.category-characters {
  --card-glow: rgba(170, 136, 255, 0.22);
}

.category-facilities {
  --card-glow: rgba(114, 227, 177, 0.2);
}

.category-creatures {
  --card-glow: rgba(255, 102, 125, 0.22);
}

.category-profiles {
  --card-glow: rgba(255, 200, 106, 0.2);
  grid-column: 1 / -1;
  min-height: 155px;
}

.category-number {
  position: absolute;
  top: 15px;
  left: 16px;
  color: rgba(220, 234, 247, 0.45);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.category-symbol {
  position: absolute;
  top: 14px;
  right: 16px;
  color: var(--cyan);
  font-size: 38px;
  font-weight: 300;
  line-height: 1;
  text-shadow: 0 0 22px rgba(91, 231, 255, 0.4);
}

.category-characters .category-symbol {
  color: var(--violet);
}

.category-facilities .category-symbol {
  color: var(--green);
}

.category-creatures .category-symbol {
  color: var(--red);
}

.category-profiles .category-symbol {
  color: var(--amber);
}

.category-copy strong,
.category-copy small {
  display: block;
}

.category-copy strong {
  margin-bottom: 4px;
  font-size: 21px;
  letter-spacing: -0.04em;
}

.category-copy small {
  color: var(--muted);
  font-size: 12px;
}

.category-arrow {
  position: absolute;
  right: 15px;
  bottom: 15px;
  color: rgba(255, 255, 255, 0.44);
  font-size: 17px;
}

.archive-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 0 28px;
}

.back-button,
.copy-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 27, 46, 0.78);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 800;
}

.back-button:hover,
.copy-button:hover {
  border-color: var(--line-strong);
  background: rgba(27, 45, 70, 0.85);
  transform: translateY(-1px);
}

.archive-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.archive-header {
  max-width: 760px;
  padding-bottom: 26px;
}

.archive-header h1 {
  margin-bottom: 12px;
  font-size: clamp(36px, 10vw, 62px);
  line-height: 1.08;
}

.archive-header > p:last-child {
  margin-bottom: 0;
  color: #adbed0;
  font-size: 15px;
}

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

.record-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(155deg, rgba(15, 27, 47, 0.91), rgba(8, 13, 25, 0.9));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

.record-card[data-record-type="facility"] {
  border-color: rgba(114, 227, 177, 0.17);
}

.record-card[data-record-type="creature"] {
  border-color: rgba(255, 102, 125, 0.18);
}

button.record-card {
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

button.record-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 15px 46px rgba(0, 0, 0, 0.23);
  transform: translateY(-3px);
}

.record-image {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #09111e;
}

.record-image::after {
  position: absolute;
  inset: 0;
  border-bottom: 1px solid rgba(131, 212, 255, 0.12);
  background: linear-gradient(to top, rgba(5, 9, 18, 0.64), transparent 47%);
  content: "";
}

.record-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.35s ease;
}

button.record-card:hover .record-image img {
  transform: scale(1.035);
}

.record-index {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 10px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(4, 9, 18, 0.67);
  color: #dceaf7;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  backdrop-filter: blur(8px);
}

.record-card[data-record-type="facility"] .record-index {
  border-color: rgba(114, 227, 177, 0.24);
  color: #bdf4d8;
}

.record-card[data-record-type="creature"] .record-index {
  border-color: rgba(255, 102, 125, 0.27);
  color: #ffc0ca;
}

.record-body {
  padding: 14px;
}

.record-body h3 {
  overflow: hidden;
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-card[data-record-type="facility"] .record-body h3,
.record-card[data-record-type="creature"] .record-body h3 {
  min-height: 2.7em;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.record-body p {
  overflow: hidden;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-layout {
  display: grid;
  gap: 14px;
}

.world-lead,
.world-card,
.facility-card,
.creature-record,
.placeholder-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(15, 28, 48, 0.88), rgba(8, 13, 25, 0.88));
}

.world-lead {
  position: relative;
  overflow: hidden;
  padding: 25px 21px;
}

.world-lead::after {
  position: absolute;
  top: -72px;
  right: -42px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(91, 231, 255, 0.16);
  border-radius: 50%;
  box-shadow: inset 0 0 45px rgba(91, 231, 255, 0.04);
  content: "";
}

.world-lead h2 {
  position: relative;
  z-index: 1;
  max-width: 650px;
  margin-bottom: 13px;
  font-size: 26px;
  line-height: 1.25;
}

.world-lead p {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin-bottom: 0;
  color: #bdcbda;
}

.world-card-grid,
.facility-grid {
  display: grid;
  gap: 12px;
}

.world-card {
  padding: 20px;
}

.world-card .world-icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 24px;
  place-items: center;
  border: 1px solid rgba(91, 231, 255, 0.24);
  border-radius: 12px;
  background: var(--cyan-soft);
  color: var(--cyan);
  font-size: 18px;
}

.world-card h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.world-card p,
.world-card li {
  color: var(--muted);
  font-size: 14px;
}

.world-card p:last-child {
  margin-bottom: 0;
}

.world-card ul,
.facility-card ul,
.creature-details {
  margin: 0;
  padding-left: 19px;
}

.facility-card {
  position: relative;
  overflow: hidden;
  padding: 19px;
}

.facility-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 13px;
  margin-bottom: 21px;
}

.facility-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(114, 227, 177, 0.22);
  border-radius: 14px;
  background: rgba(114, 227, 177, 0.08);
  color: var(--green);
  font-size: 23px;
}

.facility-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: #b8c7d7;
  font-size: 10px;
  font-weight: 800;
}

.facility-status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 7px currentColor;
  content: "";
}

.facility-status.is-warning {
  color: var(--amber);
}

.facility-status.is-danger {
  color: var(--red);
}

.facility-status.is-stable {
  color: var(--green);
}

.facility-card h3 {
  margin-bottom: 7px;
  font-size: 19px;
}

.facility-card > p,
.facility-card li {
  color: var(--muted);
  font-size: 13px;
}

.facility-card > p {
  margin-bottom: 15px;
}

.facility-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 13px;
  border-top: 1px solid rgba(143, 211, 255, 0.09);
  color: #aebed0;
  font-size: 11px;
}

.creature-record {
  overflow: hidden;
}

.archive-stack {
  display: grid;
  gap: 18px;
}

.creature-scan {
  position: relative;
  display: grid;
  min-height: 330px;
  overflow: hidden;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(255, 102, 125, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 102, 125, 0.04) 1px, transparent 1px),
    radial-gradient(circle, rgba(255, 102, 125, 0.12), rgba(4, 8, 16, 0.95) 65%);
  background-size: 28px 28px, 28px 28px, auto;
}

.radar-ring {
  position: relative;
  width: min(230px, 66vw);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 102, 125, 0.35);
  border-radius: 50%;
  box-shadow: inset 0 0 45px rgba(255, 102, 125, 0.07), 0 0 45px rgba(255, 102, 125, 0.08);
}

.radar-ring::before,
.radar-ring::after {
  position: absolute;
  content: "";
}

.radar-ring::before {
  inset: 23%;
  border: 1px solid rgba(255, 102, 125, 0.25);
  border-radius: 50%;
}

.radar-ring::after {
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 37px -62px 0 0 rgba(255, 102, 125, 0.78), -72px 42px 0 -1px rgba(255, 102, 125, 0.62), 0 0 14px var(--red);
  transform: translate(-50%, -50%);
}

.radar-sweep {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 50%;
  border-left: 1px solid rgba(255, 102, 125, 0.6);
  background: linear-gradient(135deg, rgba(255, 102, 125, 0.2), transparent 72%);
  transform-origin: 0 0;
  animation: radar 4.5s linear infinite;
}

.scan-label {
  position: absolute;
  right: 18px;
  bottom: 14px;
  color: rgba(255, 178, 190, 0.75);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.creature-body {
  padding: 23px 20px 26px;
}

.creature-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}

.creature-heading h2 {
  margin-bottom: 3px;
  font-size: 25px;
}

.creature-heading p,
.creature-body > p,
.creature-details li {
  color: var(--muted);
}

.creature-heading p {
  margin: 0;
  font-size: 12px;
}

.creature-state {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(255, 102, 125, 0.2);
  border-radius: 999px;
  background: var(--red-soft);
  color: #ffafbc;
  font-size: 10px;
  font-weight: 800;
}

.creature-body > p,
.creature-details li {
  font-size: 14px;
}

.placeholder-note {
  margin-top: 18px;
  padding: 13px 14px;
  border-left: 2px solid rgba(255, 102, 125, 0.6);
  border-radius: 0 10px 10px 0;
  background: rgba(255, 102, 125, 0.055);
  color: #cbbbc2;
  font-size: 12px;
}

.detail-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.detail-dialog::backdrop {
  background: rgba(1, 3, 8, 0.82);
  backdrop-filter: blur(12px);
}

.dialog-shell {
  position: relative;
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  background: #08101e;
  animation: dialog-in 0.27s ease both;
}

.dialog-close {
  position: fixed;
  z-index: 3;
  top: max(15px, env(safe-area-inset-top));
  right: 16px;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(4, 8, 17, 0.72);
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.dialog-media {
  position: relative;
  min-height: 310px;
  background: #050a13;
}

.dialog-media::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #08101e 0%, transparent 47%);
  content: "";
}

.dialog-media img {
  width: 100%;
  height: 42vh;
  min-height: 310px;
  max-height: 500px;
  object-fit: cover;
}

.dialog-content {
  position: relative;
  z-index: 1;
  margin-top: -35px;
  padding: 0 20px calc(38px + env(safe-area-inset-bottom));
}

.dialog-content h2 {
  margin-bottom: 12px;
  font-size: 31px;
  line-height: 1.17;
}

.tag-row {
  margin-bottom: 19px;
}

.tag-row span {
  border-color: rgba(170, 136, 255, 0.18);
  background: var(--violet-soft);
  color: #d8caff;
  font-size: 11px;
}

.dialog-description {
  color: #c5d2df;
  font-size: 15px;
}

.dialog-description p:last-child {
  margin-bottom: 0;
}

.detail-list {
  display: grid;
  gap: 0;
  margin: 25px 0 0;
  border-top: 1px solid var(--line);
}

.detail-list > div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(143, 211, 255, 0.1);
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  color: #dae4ef;
  font-size: 13px;
}

.copy-button {
  width: 100%;
  margin-top: 23px;
  padding: 13px 18px;
  border-color: rgba(91, 231, 255, 0.3);
  background: var(--cyan-soft);
  color: #c9f7ff;
  font-weight: 800;
}

.toast {
  position: fixed;
  z-index: 60;
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
  left: 50%;
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border: 1px solid rgba(91, 231, 255, 0.25);
  border-radius: 999px;
  background: rgba(8, 18, 31, 0.94);
  color: #d7faff;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(12px);
}

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

footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 21px 0 max(25px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(143, 211, 255, 0.1);
  color: rgba(167, 186, 205, 0.62);
  font-size: 10px;
  letter-spacing: 0.07em;
}

@keyframes signal-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.78); }
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@media (min-width: 640px) {
  :root {
    --page: min(1180px, calc(100% - 56px));
  }

  .brand strong {
    font-size: 17px;
  }

  .brand small {
    font-size: 10px;
  }

  .signal-chip {
    padding: 8px 12px;
    font-size: 12px;
  }

  .view {
    padding-top: 30px;
  }

  .hero-visual,
  .hero-visual img {
    min-height: 440px;
  }

  .hero-copy {
    padding: 32px;
  }

  .hero-description {
    font-size: 16px;
  }

  .category-grid {
    gap: 15px;
  }

  .category-card {
    min-height: 220px;
    padding: 22px;
  }

  .category-profiles {
    min-height: 165px;
  }

  .category-copy strong {
    font-size: 25px;
  }

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

  .record-body {
    padding: 17px;
  }

  .record-body h3 {
    font-size: 18px;
  }

  .world-card-grid,
  .facility-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .world-lead {
    padding: 31px;
  }

  .world-lead h2 {
    font-size: 31px;
  }

  .creature-record {
    display: grid;
    grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
  }

  .creature-scan {
    min-height: 500px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .creature-body {
    align-self: center;
    padding: 38px;
  }

  .detail-dialog {
    width: min(900px, calc(100% - 48px));
    height: auto;
    max-height: calc(100% - 48px);
    margin: auto;
  }

  .dialog-shell {
    display: grid;
    grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1.15fr);
    min-height: 0;
    max-height: calc(100vh - 48px);
    overflow: auto;
    border: 1px solid rgba(143, 211, 255, 0.18);
    border-radius: 25px;
    box-shadow: 0 30px 110px rgba(0, 0, 0, 0.64);
  }

  .dialog-close {
    position: absolute;
    top: 16px;
  }

  .dialog-media {
    position: sticky;
    top: 0;
    height: 100%;
    min-height: 620px;
  }

  .dialog-media::after {
    background: linear-gradient(to right, transparent 62%, #08101e 100%);
  }

  .dialog-media img {
    height: 100%;
    min-height: 620px;
    max-height: none;
  }

  .dialog-content {
    align-self: center;
    margin: 0;
    padding: 56px 38px 42px;
  }

  .dialog-content h2 {
    font-size: 38px;
  }

  footer {
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (min-width: 920px) {
  .topbar {
    min-height: 86px;
  }

  .view {
    padding-top: 40px;
    padding-bottom: 74px;
  }

  .hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(370px, 0.88fr);
    min-height: 610px;
  }

  .hero-visual {
    min-height: 610px;
  }

  .hero-visual img {
    min-height: 610px;
  }

  .hero-shade {
    background: linear-gradient(to right, transparent 58%, rgba(8, 14, 27, 0.93) 100%);
  }

  .hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 43px 48px 35px;
  }

  .hero-copy h1 {
    font-size: 60px;
  }

  .category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .category-card {
    min-height: 255px;
  }

  .category-profiles {
    grid-column: 1 / -1;
    min-height: 170px;
  }

  .record-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .record-body h3 {
    font-size: 17px;
  }

  .world-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .facility-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
