:root {
  --gate-gold: #e7c16f;
  --gate-gold-soft: #b98d3f;
  --gate-cyan: #7fe8e1;
  --gate-void: #040308;
  --gate-panel: rgba(10, 7, 16, 0.9);
}

body.system-gate-pending {
  overflow-x: hidden;
  background: var(--gate-void);
}

body.system-gate-pending > .oracle-header,
body.system-gate-pending > .oracle-shell {
  display: none;
}

.system-gate[hidden] {
  display: none;
}

.system-gate {
  position: relative;
  z-index: 1000;
  min-height: 100svh;
  padding: max(22px, env(safe-area-inset-top)) 16px
    max(28px, env(safe-area-inset-bottom));
  color: #f4ead4;
  background:
    radial-gradient(circle at 75% 15%, rgba(93, 38, 120, 0.28), transparent 32%),
    radial-gradient(circle at 20% 35%, rgba(45, 104, 125, 0.16), transparent 30%),
    linear-gradient(180deg, #05040a, #020205 72%);
  isolation: isolate;
}

.system-gate::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.55;
  background-image:
    radial-gradient(circle, rgba(231, 193, 111, 0.56) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(127, 232, 225, 0.34) 0 1px, transparent 1.5px);
  background-position: 0 0, 41px 67px;
  background-size: 118px 118px, 163px 163px;
  pointer-events: none;
}

.system-gate__shell {
  width: min(1120px, 100%);
  margin-inline: auto;
}

.system-gate__header {
  margin-bottom: 24px;
  text-align: center;
}

.system-gate__eyebrow,
.system-gate__status-label,
.system-gate__ad-label {
  color: var(--gate-cyan);
  font-family: var(--font-system, ui-monospace, monospace);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.system-gate h1 {
  margin: 5px 0 8px;
  color: var(--gate-gold);
  font-family: var(--font-display, serif);
  font-size: clamp(2.1rem, 8vw, 4.2rem);
  font-weight: 500;
  line-height: 1.05;
  text-shadow: 0 0 26px rgba(231, 193, 111, 0.18);
}

.system-gate__lead {
  max-width: 680px;
  margin: 0 auto;
  color: rgba(244, 234, 212, 0.74);
  line-height: 1.75;
}

.system-gate__grid {
  display: grid;
  gap: 18px;
}

.system-entry {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(231, 193, 111, 0.32);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(31, 16, 43, 0.58), rgba(5, 4, 9, 0.94)),
    var(--gate-panel);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    0 22px 70px rgba(0, 0, 0, 0.44);
}

.system-entry--kagome {
  border-color: rgba(127, 232, 225, 0.24);
}

.system-entry__top {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 15px;
  align-items: center;
}

.system-entry__icon {
  display: grid;
  width: 86px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(231, 193, 111, 0.5);
  border-radius: 20px;
  background: #05040a;
  box-shadow: 0 0 24px rgba(231, 193, 111, 0.14);
}

.system-entry__icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.system-entry__orbit {
  width: 58px;
  aspect-ratio: 1;
  border: 1px solid rgba(127, 232, 225, 0.72);
  border-radius: 50%;
  box-shadow:
    0 0 0 9px rgba(127, 232, 225, 0.07),
    inset 0 0 20px rgba(231, 193, 111, 0.2);
}

.system-entry__orbit::before,
.system-entry__orbit::after {
  display: block;
  width: 54px;
  height: 1px;
  margin-top: 28px;
  content: "";
  background: var(--gate-gold);
  transform: rotate(60deg);
}

.system-entry__orbit::after {
  margin-top: -1px;
  transform: rotate(-60deg);
}

.system-entry__type {
  margin: 0 0 4px;
  color: var(--gate-cyan);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.system-entry h2 {
  margin: 0;
  color: var(--gate-gold);
  font-family: var(--font-display, serif);
  font-size: clamp(1.55rem, 5vw, 2.25rem);
  font-weight: 500;
}

.system-entry__copy {
  margin: 7px 0 0;
  color: rgba(244, 234, 212, 0.7);
  font-size: 0.86rem;
  line-height: 1.65;
}

.system-gate__status {
  display: grid;
  gap: 4px;
  margin: 17px 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(127, 232, 225, 0.24);
  border-radius: 12px;
  background: rgba(4, 3, 8, 0.62);
}

.system-gate__status-value {
  color: #f4ead4;
  font-weight: 700;
}

.system-gate__status-note {
  color: rgba(244, 234, 212, 0.62);
  font-size: 0.76rem;
  line-height: 1.5;
}

.system-gate__action,
.system-gate__subaction {
  width: 100%;
  min-height: 50px;
  border-radius: 12px;
  font: inherit;
  cursor: pointer;
}

.system-gate__action {
  border: 1px solid rgba(231, 193, 111, 0.72);
  color: #fff5dd;
  background: linear-gradient(180deg, #4a235e, #211027);
  box-shadow:
    inset 0 0 18px rgba(231, 193, 111, 0.1),
    0 0 24px rgba(93, 38, 120, 0.2);
}

.system-gate__subaction {
  margin-top: 8px;
  border: 1px solid rgba(231, 193, 111, 0.24);
  color: rgba(244, 234, 212, 0.78);
  background: rgba(3, 2, 5, 0.7);
}

.system-gate__action:disabled,
.system-gate__subaction:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.system-gate__ad {
  margin-top: 15px;
  padding: 14px;
  border: 1px solid rgba(231, 193, 111, 0.38);
  border-radius: 14px;
  background:
    radial-gradient(circle at 82% 28%, rgba(151, 57, 182, 0.23), transparent 34%),
    linear-gradient(135deg, rgba(35, 13, 44, 0.9), rgba(4, 3, 8, 0.95));
}

.system-gate__ad h3 {
  margin: 5px 0 7px;
  color: var(--gate-gold);
  font-family: var(--font-display, serif);
  font-size: 1.18rem;
}

.system-gate__ad p {
  margin: 0;
  color: rgba(244, 234, 212, 0.76);
  font-size: 0.8rem;
  line-height: 1.65;
}

.system-gate__features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 11px 0 0;
  padding: 0;
  list-style: none;
}

.system-gate__features li {
  padding: 5px 8px;
  border: 1px solid rgba(231, 193, 111, 0.25);
  border-radius: 999px;
  color: rgba(244, 234, 212, 0.8);
  font-size: 0.68rem;
}

.system-gate__utility {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}

.system-gate__utility button {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid rgba(231, 193, 111, 0.24);
  border-radius: 999px;
  color: rgba(244, 234, 212, 0.76);
  background: rgba(5, 4, 9, 0.82);
  font: inherit;
}

.system-gate__message {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: var(--gate-cyan);
  font-size: 0.76rem;
  text-align: center;
}

@media (min-width: 800px) {
  .system-gate {
    display: grid;
    place-items: center;
    padding-inline: 26px;
  }

  .system-gate__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-entry {
    padding: 22px;
  }
}

@media (max-width: 480px) {
  .system-gate {
    padding-inline: 12px;
  }

  .system-gate__header {
    margin-bottom: 17px;
  }

  .system-entry {
    padding: 14px;
    border-radius: 17px;
  }

  .system-entry__top {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .system-entry__icon {
    width: 70px;
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .system-gate *,
  .system-gate *::before,
  .system-gate *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
