:root {
  --bg: #07101f;
  --bg-soft: rgba(9, 17, 34, 0.84);
  --bg-panel: linear-gradient(180deg, rgba(15, 25, 46, 0.96), rgba(8, 14, 28, 0.96));
  --bg-panel-alt: linear-gradient(180deg, rgba(245, 248, 255, 0.95), rgba(223, 232, 255, 0.95));
  --text: #f8fbff;
  --text-soft: #b6c7e4;
  --line: rgba(148, 174, 227, 0.24);
  --blue: #0d5bff;
  --blue-2: #3b8dff;
  --gold: #ffc928;
  --gold-2: #ffe178;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 8px 22px rgba(3, 10, 22, 0.26);
  --pixel-font: "Press Start 2P", cursive;
  --ui-font: "Inter", system-ui, sans-serif;
}
body[data-theme="day"] {
  --bg: #cfe0ff;
  --bg-soft: rgba(236, 243, 255, 0.92);
  --bg-panel: var(--bg-panel-alt);
  --text: #0e1a31;
  --text-soft: #395277;
  --line: rgba(14, 26, 49, 0.12);
  --shadow: 0 18px 45px rgba(31, 61, 118, 0.16);
  --shadow-soft: 0 10px 24px rgba(31, 61, 118, 0.10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui-font);
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
input, button { font: inherit; }

.world, .world-grid, .world-glow { position: fixed; inset: 0; pointer-events: none; }
.world-back {
  z-index: -4;
  background:
    radial-gradient(circle at 14% 18%, rgba(13, 91, 255, 0.30), transparent 38%),
    radial-gradient(circle at 86% 12%, rgba(255, 201, 40, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(4, 9, 19, 0.96), rgba(6, 14, 30, 0.96));
}
body[data-theme="day"] .world-back {
  background:
    radial-gradient(circle at 14% 18%, rgba(13, 91, 255, 0.24), transparent 40%),
    radial-gradient(circle at 86% 12%, rgba(255, 201, 40, 0.20), transparent 30%),
    linear-gradient(180deg, rgba(224, 236, 255, 0.96), rgba(205, 222, 255, 0.96));
}
.world-front {
  z-index: -3;
  opacity: .8;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.8), rgba(0,0,0,.18));
}
.world-grid {
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(10,22,42,0), rgba(10,22,42,.28)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(180deg, rgba(255,255,255,.025) 0 1px, transparent 1px 96px);
}
.world-glow {
  z-index: -1;
  background:
    radial-gradient(circle at 50% -10%, rgba(13, 91, 255, .24), transparent 44%),
    radial-gradient(circle at 50% 110%, rgba(255, 201, 40, .10), transparent 28%);
}
.container { width: min(1280px, calc(100% - 32px)); margin: 0 auto; }
.section { position: relative; padding: 44px 0; }
.section--hero { padding-top: 24px; padding-bottom: 28px; }
.section--alt { background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.00)); }
body[data-theme="day"] .section--alt { background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,.12)); }

.header {
  position: relative;
  z-index: 50;
  background: linear-gradient(180deg, rgba(5, 11, 22, 0.92), rgba(5, 11, 22, 0.76));
  border-bottom: 3px solid rgba(13, 91, 255, 0.28);
  box-shadow: 0 12px 34px rgba(0,0,0,.20);
}
body[data-theme="day"] .header {
  background: linear-gradient(180deg, rgba(246, 249, 255, 0.94), rgba(235, 241, 255, 0.84));
  border-bottom-color: rgba(13, 91, 255, 0.18);
}
.header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 0;
}
.brand { display: inline-grid; gap: 6px; align-self: center; }
.brand__title,
.brand__subtitle,
.inventory-nav__item,
.theme-toggle,
.theme-auto,
.nav-toggle,
.pixel-pill,
.pixel-mini,
.panel__title,
.section-head__eyebrow,
.ip-panel__head,
.pixel-tag,
.btn,
.toast__label,
.guide-step__num,
.wiki-card__meta,
.wiki-row__cmd,
.wiki-side-link { font-family: var(--pixel-font); }
.brand__title { font-size: clamp(14px, 1.25vw, 18px); letter-spacing: .06em; line-height: 1.35; text-shadow: 2px 2px 0 rgba(0,0,0,.26); }
.brand__subtitle { font-size: 9px; color: var(--text-soft); line-height: 1.3; }

.inventory-nav {
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  gap: 8px;
  width: min(100%, 900px);
}
.inventory-nav__item,
.theme-toggle,
.theme-auto,
.btn,
.nav-toggle,
.search-panel__box,
.search-panel__clear,
.wiki-side-link,
.guide-step,
.wiki-card,
.wiki-row,
.wiki-note,
.wiki-callout,
.faq-item {
  position: relative;
  border: 3px solid #0b1322;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.12), inset 0 -3px 0 rgba(0,0,0,.24), 0 6px 0 rgba(5, 12, 24, .42), 0 12px 26px rgba(0,0,0,.16);
}
.inventory-nav__item {
  display: grid;
  place-items: center;
  min-height: 52px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(23, 41, 78, 0.96), rgba(12, 22, 42, 0.96));
  color: #f4f8ff;
  font-size: 10px;
  text-align: center;
  letter-spacing: .02em;
  transition: transform .15s ease, filter .15s ease, border-color .15s ease;
}
.inventory-nav__item:hover, .inventory-nav__item.active { transform: translateY(-2px); filter: brightness(1.05); border-color: rgba(255, 201, 40, 0.62); }
.inventory-nav__item.active::after, .btn::after, .theme-toggle::after, .theme-auto::after, .nav-toggle::after, .wiki-side-link::after, .wiki-card::after, .wiki-row::after, .wiki-note::after, .wiki-callout::after, .faq-item::after {
  content: ""; position: absolute; inset: 5px; border: 1px solid rgba(255,255,255,.08); pointer-events: none;
}
.theme-controls { display: flex; gap: 8px; align-items: center; }
.theme-toggle, .theme-auto, .nav-toggle {
  min-height: 52px; padding: 0 14px; cursor: pointer; font-size: 10px;
  background: linear-gradient(180deg, rgba(12, 99, 255, .98), rgba(7, 56, 168, .98)); color: #f7faff;
}
.theme-toggle { min-width: 120px; color: #0e1a31; background: linear-gradient(180deg, rgba(255, 201, 40, 0.98), rgba(227, 168, 20, 0.98)); }
.theme-auto { min-width: 88px; }
.theme-auto.is-auto { box-shadow: inset 0 0 0 2px rgba(255, 201, 40, .22), inset 0 2px 0 rgba(255,255,255,.12), inset 0 -3px 0 rgba(0,0,0,.24), 0 6px 0 rgba(5, 12, 24, .42), 0 12px 26px rgba(0,0,0,.16); }
.nav-toggle { display: none; width: 56px; padding: 0; place-items: center; }
.nav-toggle span { display: block; width: 22px; height: 3px; margin: 3px auto; background: #fff; }

.hero__grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr); gap: 20px; }
.hero__side { display: grid; gap: 20px; }
.panel {
  position: relative;
  overflow: hidden;
  border: 4px solid rgba(9, 17, 31, 0.88);
  background: var(--bg-panel);
  box-shadow: var(--shadow);
  padding: 24px;
}
.panel::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--line); pointer-events: none; }
.panel__topline, .panel__title-row, .ip-panel__head, .footer__inner, .hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.panel__title-row { align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel__title { margin: 0; font-size: clamp(12px, 1.15vw, 16px); line-height: 1.45; }
.pixel-pill, .pixel-mini, .pixel-tag {
  display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 8px 10px;
  background: linear-gradient(180deg, rgba(16, 98, 255, .98), rgba(8, 56, 164, .98)); border: 2px solid rgba(7, 17, 33, .86);
  color: #f5f8ff; font-size: 9px; line-height: 1.45; text-transform: uppercase;
}
.pixel-pill--gold { background: linear-gradient(180deg, rgba(255, 201, 40, .98), rgba(219, 162, 18, .98)); color: #1d1300; }
.hero__logo { width: min(760px, 100%); margin: 18px 0 16px; filter: drop-shadow(0 18px 26px rgba(0,0,0,.30)); }
.hero__title { margin: 0 0 10px; font-size: clamp(30px, 4.2vw, 56px); line-height: 1.04; font-weight: 900; letter-spacing: -.03em; }
.hero__subtitle, .section-head__text, .wiki-card__text, .wiki-row__desc, .wiki-note, .wiki-callout p, .guide-step p, .footer p, .faq-item p { margin: 0; color: var(--text-soft); font-size: 15px; }
.search-panel { margin: 20px 0; }
.search-panel__box {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: linear-gradient(180deg, rgba(10, 18, 35, 0.88), rgba(5, 10, 22, 0.88));
}
body[data-theme="day"] .search-panel__box { background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(229,238,255,.86)); }
.search-panel__icon { font-family: var(--pixel-font); font-size: 11px; }
.search-panel__input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--text); font-size: 15px; }
.search-panel__input::placeholder { color: var(--text-soft); }
.search-panel__clear {
  width: 42px; min-width: 42px; height: 42px; padding: 0; cursor: pointer;
  display: inline-grid; place-items: center; font-family: var(--pixel-font); font-size: 10px;
  background: linear-gradient(180deg, rgba(23, 41, 78, 0.96), rgba(12, 22, 42, 0.96)); color: #f4f8ff;
}
.search-panel__meta { margin-top: 10px; color: var(--text-soft); font-size: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 18px; font-size: 10px; color: #f7faff;
  text-transform: uppercase; cursor: pointer; background: linear-gradient(180deg, rgba(12, 99, 255, .98), rgba(7, 56, 168, .98)); transition: transform .15s ease, filter .15s ease;
}
.btn:hover, .theme-toggle:hover, .theme-auto:hover, .nav-toggle:hover, .search-panel__clear:hover, .wiki-side-link:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn--ghost { background: linear-gradient(180deg, rgba(26, 44, 81, .98), rgba(10, 18, 34, .98)); }
.btn--primary { background: linear-gradient(180deg, rgba(18, 110, 255, .98), rgba(7, 58, 176, .98)); }
.hero__actions--mini { margin-top: 14px; }
.ip-panel { margin-top: 20px; padding: 20px; border: 3px solid rgba(13, 91, 255, 0.24); background: linear-gradient(180deg, rgba(7, 15, 31, 0.88), rgba(7, 14, 28, 0.70)); }
body[data-theme="day"] .ip-panel { background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(229,238,255,.74)); }
.ip-panel__head { justify-content: space-between; margin-bottom: 16px; font-size: 9px; }
.ip-panel__value { font-size: clamp(22px, 3vw, 36px); font-weight: 900; letter-spacing: -.03em; margin-bottom: 16px; }
.guide-stack, .wiki-side-links, .faq-stack, .wiki-list { display: grid; gap: 12px; }
.wiki-side-link {
  display: block; min-height: 58px; padding: 14px 16px; font-size: 10px;
  background: linear-gradient(180deg, rgba(23, 41, 78, 0.96), rgba(12, 22, 42, 0.96)); color: #f4f8ff;
  transition: transform .15s ease, filter .15s ease, border-color .15s ease;
}
.wiki-side-link.is-active, .wiki-side-link:hover { border-color: rgba(255, 201, 40, 0.62); }
.guide-step {
  display: grid; grid-template-columns: 56px 1fr; gap: 14px; padding: 16px;
  background: linear-gradient(180deg, rgba(10, 19, 36, .78), rgba(8, 14, 25, .60));
}
body[data-theme="day"] .guide-step { background: linear-gradient(180deg, rgba(255,255,255,.76), rgba(235,242,255,.66)); }
.guide-step__num {
  display: inline-grid; place-items: center; width: 56px; height: 56px; font-size: 10px;
  background: linear-gradient(180deg, rgba(255, 201, 40, .98), rgba(219, 162, 18, .98)); color: #1d1300; border: 2px solid rgba(7, 17, 33, .86);
}
.guide-step strong, .wiki-card__title, .wiki-callout h3 { display: block; margin: 0 0 8px; font-size: 22px; line-height: 1.12; }
.guide-step p { margin-top: 4px; }
.section-head { display: grid; gap: 12px; margin-bottom: 18px; }
.section-head__eyebrow { font-size: 10px; color: var(--gold); }
.section-head__title { margin: 0; font-size: clamp(26px, 3vw, 42px); line-height: 1.08; }
.wiki-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.wiki-card-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wiki-card {
  padding: 20px;
  background: linear-gradient(180deg, rgba(12, 22, 42, .84), rgba(7, 14, 25, .70)); box-shadow: var(--shadow-soft);
}
body[data-theme="day"] .wiki-card { background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(232,240,255,.76)); }
.wiki-card__meta { color: var(--gold); font-size: 9px; margin-bottom: 12px; }
.wiki-callout {
  margin-bottom: 14px; padding: 20px; background: linear-gradient(180deg, rgba(10, 18, 35, 0.88), rgba(5, 10, 22, 0.88));
}
body[data-theme="day"] .wiki-callout { background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(229,238,255,.86)); }
.wiki-list { margin-bottom: 14px; }
.wiki-row {
  display: grid; grid-template-columns: 180px 1fr; gap: 14px; padding: 16px;
  background: linear-gradient(180deg, rgba(12, 22, 42, .84), rgba(7, 14, 25, .70));
}
body[data-theme="day"] .wiki-row { background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(232,240,255,.76)); }
.wiki-row__cmd { font-size: 9px; color: var(--gold); }
.wiki-note {
  padding: 16px; background: linear-gradient(180deg, rgba(255, 201, 40, .18), rgba(219, 162, 18, .12));
  color: var(--text); font-size: 15px;
}
.faq-item { background: linear-gradient(180deg, rgba(12, 22, 42, .84), rgba(7, 14, 25, .70)); }
body[data-theme="day"] .faq-item { background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(232,240,255,.76)); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 18px 20px; font-family: var(--pixel-font); font-size: 10px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item div { padding: 0 20px 18px; }
.section-actions { display: flex; justify-content: center; margin-top: 18px; }
.footer { padding: 26px 0 34px; border-top: 3px solid rgba(13, 91, 255, 0.20); background: linear-gradient(180deg, rgba(8, 14, 28, 0.82), rgba(7, 12, 23, 0.94)); }
body[data-theme="day"] .footer { background: linear-gradient(180deg, rgba(246, 249, 255, 0.8), rgba(231, 239, 255, 0.92)); }
.footer__inner { align-items: center; justify-content: space-between; }
.footer__meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--text-soft); }
.toast { position: fixed; left: 18px; top: 18px; z-index: 70; min-width: 240px; max-width: min(420px, calc(100vw - 36px)); padding: 16px 18px; border: 3px solid rgba(7, 17, 33, .88); background: linear-gradient(180deg, rgba(14, 24, 43, .97), rgba(8, 14, 24, .97)); box-shadow: var(--shadow); transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .18s ease; }
.toast.is-visible { transform: translateY(0); opacity: 1; }
.toast__label { display: block; margin-bottom: 8px; color: var(--gold-2); font-size: 9px; }
.toast__title { font-size: 14px; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .45s ease, transform .45s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
body.theme-transitioning, body.theme-transitioning * { transition: background-color .28s ease, color .28s ease, border-color .28s ease, box-shadow .28s ease, filter .28s ease !important; }
.click-burst { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; background: radial-gradient(circle, rgba(255, 201, 40, .96), rgba(13, 91, 255, .0)); box-shadow: 0 0 18px rgba(13, 91, 255, .55); animation: burst .55s ease forwards; pointer-events: none; }
mark.hl { background: rgba(255, 201, 40, .35); color: inherit; padding: 0 .2em; border-radius: 3px; }
@keyframes burst { 0% { transform: scale(.4); opacity: .92; } 100% { transform: scale(5.4); opacity: 0; } }

@media (max-width: 1180px) {
  .header__inner { grid-template-columns: auto 1fr auto; }
  .inventory-nav { width: 100%; max-width: none; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hero__grid { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .header__inner { grid-template-columns: auto auto auto; }
  .nav-toggle { display: grid; justify-self: center; }
  .inventory-nav {
    display: none;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin-top: 8px;
  }
  .inventory-nav.is-open { display: grid; }
  .theme-controls { justify-self: end; }
  .wiki-card-grid, .wiki-card-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .container { width: min(100% - 20px, 1280px); }
  .header__inner { grid-template-columns: 1fr auto auto; gap: 10px; }
  .brand__title { font-size: 14px; }
  .brand__subtitle { font-size: 8px; }
  .theme-controls { width: auto; }
  .theme-toggle, .theme-auto { min-width: 0; padding: 0 10px; }
  .section { padding: 30px 0; }
  .inventory-nav { grid-template-columns: 1fr; gap: 6px; }
  .inventory-nav__item, .theme-toggle, .theme-auto, .btn { min-height: 48px; font-size: 9px; }
  .hero__title { font-size: 30px; }
  .hero__subtitle, .search-panel__input, .search-panel__meta, .wiki-card__text, .wiki-row__desc, .wiki-note, .wiki-callout p, .guide-step p, .faq-item p { font-size: 15px; }
  .panel, .wiki-card, .wiki-row, .wiki-callout, .wiki-note { padding: 16px; }
  .hero__actions, .footer__inner { flex-direction: column; }
  .btn { width: 100%; }
  .wiki-card-grid, .wiki-card-grid--2, .wiki-row, .guide-step { grid-template-columns: 1fr; }
  .ip-panel__value { font-size: 22px; }
  .footer__inner { align-items: flex-start; }
  .toast { left: 10px; right: 10px; top: 10px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
