:root {
  color-scheme: dark;
  --canvas: #0c0b11;
  --ink: #f7efe7;
  --muted: #c9bfc7;
  --accent: #e6b08b;
  --line: #e6b08b54;
  font-family: system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, #0c0b11fc, #0c0b11c9 44%, #0c0b115c),
    url("https://orbicade.com/assets/eclipse.jpg") 72% center / cover fixed,
    var(--canvas);
  color: var(--ink);
}

.shell {
  width: min(100% - 2.5rem, 72rem);
  margin-inline: auto;
  padding-block: clamp(1.25rem, 4vh, 3rem) 2rem;
}

.brand {
  display: inline-block;
  margin-bottom: clamp(1.25rem, 4vh, 3rem);
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 650;
  text-decoration: none;
}

.card {
  width: min(100%, 32rem);
  padding: clamp(1.25rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  background: #111019f0;
}

.server {
  margin: 0 0 .65rem;
  color: var(--accent);
  font-size: .92rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 1.5rem;
  font: 400 clamp(2rem, 4.5vw, 2.8rem)/1.05 Georgia, serif;
  letter-spacing: -.045em;
}

form, .field { display: grid; }
form { gap: 1rem; }
.field { gap: .35rem; }

label { font-weight: 500; }

input, select, button {
  min-height: 2.9rem;
  width: 100%;
  padding: .6rem .8rem;
  border: 1px solid var(--line);
  border-radius: .15rem;
  font: inherit;
}

input, select {
  background: var(--canvas);
  color: var(--ink);
}

button {
  margin-top: .35rem;
  background: var(--accent);
  color: #21151a;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: #f3c6a8; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.hint { color: var(--muted); font-size: .875rem; }
.validation-summary-valid { display: none; }
.errors { color: #ffd0c0; }
.errors ul { margin: 0; padding-left: 1.2rem; }
.return { color: var(--accent); }

.account-link { color: var(--muted); }
.account-action { margin-top: 1.25rem; }
[data-activate-form][hidden] { display: none; }

.signup-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.signup-progress li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .5rem .15rem .65rem;
  border-bottom: 2px solid #ddbb9f29;
  color: var(--muted);
  font-size: .78rem;
}

.signup-progress li span { color: #ad92a6; font-variant-numeric: tabular-nums; }
.signup-progress li[aria-current] { border-color: var(--accent); color: #ffe3d0; font-weight: 650; }
.signup-progress li[aria-current] span { color: var(--accent); }

.signup-step {
  display: grid;
  gap: .9rem;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.signup-step legend {
  margin-bottom: .65rem;
  padding: 0;
  color: var(--ink);
  font: 500 clamp(1.5rem, 5vw, 1.95rem)/1.1 "Cormorant Garamond", Georgia, serif;
}

.signup-actions {
  display: flex;
  gap: .65rem;
}

.signup-actions button {
  flex: 1.42;
  min-width: 0;
  width: auto;
  padding-inline: .5rem;
  font-size: clamp(.82rem, 4vw, 1rem);
}

.signup-actions [data-signup-back] { flex: .58; }

.signup-progress[hidden],
.signup-step[hidden],
.signup-actions [hidden] { display: none; }

.portal-shell.signup-race-layout {
  width: min(100% - 2rem, 63rem);
  justify-content: flex-start;
}

.signup-race-layout .account-card { width: 100%; }
.signup-arm-layout .account-card { width: min(100%, 38rem); }

.race-picker {
  display: grid;
  gap: 1.35rem;
}

.race-card-group h3 {
  margin: 0 0 .55rem;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 650;
}

.race-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: .7rem;
}

.race-card,
.signup-arm-option {
  position: relative;
  display: grid;
  min-width: 0;
  cursor: pointer;
}

.race-card input,
.signup-arm-option input {
  position: absolute;
  z-index: 1;
  width: 1.05rem;
  height: 1.05rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: inherit;
}

.race-card input {
  inset-block-start: .65rem;
  inset-inline-end: .65rem;
}

.race-card-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: #15131e;
}

.race-card-body img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 32%;
  background: #101019;
}

.race-card-copy {
  display: grid;
  gap: .3rem;
  padding: .7rem .75rem .8rem;
}

.race-card-copy strong { color: var(--ink); }
.race-card-specialty { color: var(--accent); font-size: .8rem; }
.race-card-description { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.race-card-hint { margin: 0; }

.race-card input:checked + .race-card-body {
  border-color: var(--accent);
  background: #292031;
  box-shadow: 0 0 0 1px var(--accent), 0 4px 15px #08050b99;
}

.race-card input:focus-visible + .race-card-body,
.signup-arm-option input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.signup-race-layout .signup-actions {
  position: sticky;
  z-index: 2;
  bottom: .6rem;
  width: min(100%, 32rem);
  margin-inline: auto;
  padding: .5rem .65rem .7rem;
  border: 1px solid #e1b69552;
  border-radius: 1.75rem;
  background: #1c1725;
  box-shadow: 0 4px 17px #08050bb3;
}

.signup-arm-picker { display: grid; gap: .75rem; }

.signup-arm-map {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: radial-gradient(ellipse at center, #21162c, #0b0a14 72%);
}

.signup-arm-map canvas {
  display: block;
  width: 100%;
  height: clamp(13rem, 51vw, 18.25rem);
  cursor: pointer;
}

.signup-arm-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}

[data-arm-choice="eira"] { --arm-color: #e9ab93; }
[data-arm-choice="liren"] { --arm-color: #99b7ee; }
[data-arm-choice="meros"] { --arm-color: #9fdbbe; }
[data-arm-choice="gelior"] { --arm-color: #c3a9f3; }

.signup-arm-option > span {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 2.7rem;
  padding: .4rem 1.9rem .4rem .65rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: #15131f;
  font-size: .85rem;
}

.signup-arm-option input {
  inset-block-start: 50%;
  inset-inline-end: .65rem;
  transform: translateY(-50%);
  accent-color: var(--arm-color);
}

.signup-arm-option i {
  flex: none;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--arm-color);
  box-shadow: 0 0 .65rem var(--arm-color);
}

.signup-arm-option input:checked + span {
  border-color: var(--arm-color);
  background: #272037;
}

@media (hover: hover) {
  .race-card:hover .race-card-body { border-color: var(--accent); }
  .signup-arm-option:hover > span { border-color: var(--arm-color); }
}

@media (max-width: 540px) {
  .race-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .race-card-copy { padding-inline: .55rem; }
  .signup-arm-option > span { gap: .3rem; padding-left: .45rem; font-size: .76rem; }
}

@media (max-height: 820px) {
  .portal-shell.signup-arm-layout { gap: .8rem; padding-block: .85rem; }
  .signup-arm-layout .account-card { padding: 1.1rem clamp(1.1rem, 4vw, 1.65rem); }
  .signup-arm-layout .account-card > h1 {
    margin-bottom: .5rem;
    font-size: clamp(2.05rem, 6vw, 2.85rem);
  }
  .signup-arm-layout .account-link { margin-block: .5rem .7rem; }
  .signup-arm-layout form { gap: .7rem; }
  .signup-arm-map canvas { height: clamp(12rem, 30vh, 15rem); }
}

body.portal-page {
  background: var(--canvas);
  font-family: Inter, system-ui, sans-serif;
}

.portal-scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  pointer-events: none;
}

.portal-scene-photo {
  position: absolute;
  inset: -4%;
  background: url("/assets/eclipse.jpg") 68% center / cover no-repeat;
  transform-origin: 68% 44%;
  animation: portal-drift 32s ease-in-out infinite alternate;
}

.portal-scene-photo::after {
  position: absolute;
  inset: 0;
  background: inherit;
  filter: blur(clamp(5px, .65vw, 12px)) brightness(.85);
  mask-image: linear-gradient(90deg, transparent 25%, #0009 60%, #000 82%);
  mix-blend-mode: screen;
  opacity: .18;
  animation: portal-corona 7s ease-in-out infinite alternate;
  content: "";
}

.portal-scene::after {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 47%, #0c0816b8, #120b1759 62%, #100a132e),
    linear-gradient(180deg, #0b071282, transparent 42%, #100a169e);
  content: "";
}

@keyframes portal-drift {
  from { transform: translate3d(-.8%, -.5%, 0) scale(1.015); }
  to { transform: translate3d(1.2%, .9%, 0) scale(1.085); }
}

@keyframes portal-corona {
  from { opacity: .12; }
  to { opacity: .46; }
}

.portal-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(.9rem, 3vh, 1.5rem);
  width: min(100% - 2rem, 40rem);
  min-height: 100vh;
  min-height: 100svh;
  padding-block: clamp(1.25rem, 4vh, 3rem);
}

.portal-shell--wide { width: min(100% - 2rem, 63rem); }

.portal-shell .brand {
  display: inline-flex;
  align-items: center;
  gap: .58rem;
  margin: 0;
  font-size: .8rem;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.portal-orbit {
  position: relative;
  width: 1.03rem;
  height: 1.03rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
}

.portal-orbit::after {
  position: absolute;
  inset: 18% -24%;
  border: 1px solid var(--accent);
  border-radius: 50%;
  transform: rotate(-47deg);
  content: "";
}

.portal-shell .card {
  border-color: #e1b69552;
  border-radius: 1.25rem;
  background: linear-gradient(155deg, #251b2dee, #13121bef 62%);
  box-shadow: 0 28px 85px #08050db0, inset 0 1px #edc6ab20;
}

.portal-shell .server {
  font-size: .77rem;
  letter-spacing: .23em;
}

.portal-shell .server-card {
  position: relative;
  width: min(100%, 36rem);
  padding: clamp(1.7rem, 6vw, 3.4rem) clamp(1.15rem, 6vw, 3.1rem);
  text-align: center;
}

.server-card::before {
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #f3c7aa8f, transparent);
  content: "";
}

.server-title {
  display: grid;
  gap: .03em;
  margin: .85rem 0 clamp(1.45rem, 5vw, 2.35rem);
  font: 500 clamp(2.55rem, 8.5vw, 5.15rem)/.91 "Cormorant Garamond", Georgia, serif;
  letter-spacing: -.055em;
}

.server-title em {
  color: #efb894;
  font-weight: 500;
}

.portal-shell .account-card > .server,
.portal-shell .account-card > h1 { text-align: center; }

.portal-shell .account-card > h1 {
  font: 500 clamp(2.05rem, 6vw, 3.35rem)/1 "Cormorant Garamond", Georgia, serif;
}

.portal-footer {
  margin: 0;
  text-align: center;
  font-size: .86rem;
}

.portal-footer .return {
  color: #e6c8b7;
  text-decoration-color: #dbad9080;
  text-underline-offset: .26em;
}

.portal-footer .return:hover { color: #ffdfc5; }

.login-entry {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.35rem;
  margin-bottom: 1.25rem;
  padding: .72rem 2rem;
  overflow: hidden;
  border: 1px solid #ddb8997a;
  border-radius: 999px;
  background: linear-gradient(180deg, #362936, #221a28 60%, #1a1420);
  box-shadow: inset 0 1px 2px #f7c9a748, inset 0 -7px 12px #110c1980, 0 4px 0 #0c0812, 0 8px 16px #08050d91;
  color: #fad4ba;
  font-size: .92rem;
  font-weight: 650;
  line-height: 1.22;
  text-align: center;
  text-decoration: none;
}

.login-entry::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(108deg, transparent 38%, #fff3da75 53%, transparent 67%);
  opacity: 0;
  transform: translateX(-75%);
  content: "";
  pointer-events: none;
  transition: opacity .28s ease, transform .58s ease;
}

.login-entry--primary,
.portal-shell button:not(.button-secondary) {
  border-color: #efbd9a;
  background: linear-gradient(180deg, #ffe2c9 0%, #f1bb97 36%, #e7a57c 71%, #d9916c 100%);
  box-shadow: inset 0 2px 3px #fff4dfba, inset 0 -7px 10px #a4583647, 0 4px 0 #743c31, 0 9px 21px #0d070f9e;
  color: #28151c;
}

.entry-arrow {
  position: absolute;
  inset-inline-end: clamp(.85rem, 5vw, 1.4rem);
  font-size: 1.23em;
  transition: transform .2s ease;
}

.server-actions {
  display: grid;
  gap: .85rem;
  width: min(100%, 24rem);
  margin-inline: auto;
}
.server-actions .login-entry { margin: 0; }

.login-entry,
.portal-shell button { transition: box-shadow .18s ease, filter .18s ease, transform .18s ease; }

.portal-shell button {
  min-height: 2.95rem;
  border-radius: 999px;
}

@media (hover: hover) {
  .login-entry:hover,
  .portal-shell button:not(.button-secondary):hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
  }

  .login-entry:hover::before {
    opacity: .72;
    transform: translateX(75%);
  }

  .login-entry:hover .entry-arrow { transform: translateX(4px); }
}

.login-entry:active,
.portal-shell button:not(.button-secondary):active {
  transform: translateY(3px) scale(.987);
  filter: brightness(.96);
  box-shadow: inset 0 2px 5px #4e261b3d, inset 0 -3px 6px #160c1e33, 0 1px 0 #3d2530;
}

@media (prefers-reduced-motion: reduce) {
  .portal-scene-photo, .portal-scene-photo::after { animation: none; }

  .login-entry,
  .login-entry::before,
  .entry-arrow,
  .portal-shell button { transition: none; }

  .login-entry:is(:hover, :active),
  .login-entry:hover .entry-arrow,
  .portal-shell button:not(.button-secondary):is(:hover, :active) { transform: none; }

  .login-entry::before { display: none; }
}

.button-secondary {
  background: transparent;
  color: var(--accent);
}

.button-secondary:hover { background: #e6b08b1c; }

.selection-portrait {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin: .3rem 0 .85rem;
  padding: .6rem;
  border: 1px solid var(--line);
  background: var(--canvas);
}

.selection-portrait[hidden] { display: none; }

.selection-portrait img {
  flex: 0 0 5.25rem;
  width: 5.25rem;
  height: 5.25rem;
  object-fit: cover;
}

.selection-portrait figcaption { display: grid; gap: .2rem; }
.selection-portrait figcaption span { color: var(--muted); font-size: .9rem; }

.field[hidden], .field-validation-valid { display: none; }

.galaxy-card { width: min(100%, 55rem); }
.galaxy-overview { text-align: center; }
.galaxy-overview > h1 {
  margin-bottom: 1.2rem;
  font: 500 clamp(2.3rem, 6.5vw, 4rem)/.95 "Cormorant Garamond", Georgia, serif;
}
.galaxy-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  width: min(100%, 34rem);
  margin: 0 auto 1.25rem;
}
.galaxy-totals dt { color: var(--muted); font-size: .85rem; }
.galaxy-totals dd { margin: .25rem 0 0; color: var(--accent); font-size: clamp(1.2rem, 4vw, 1.9rem); }
.galaxy-map {
  overflow: hidden;
  border: 1px solid #d7af924d;
  border-radius: .95rem;
  background: radial-gradient(ellipse at center, #231a2b, #0a0913 72%);
}
.galaxy-map canvas { display: block; width: 100%; height: clamp(15.5rem, min(62vw, 49svh), 27rem); cursor: crosshair; }
.map-legend { margin: 0 1rem 1rem; color: var(--muted); font-size: .85rem; }
.map-legend span {
  display: inline-block;
  width: .65rem;
  height: .65rem;
  margin-right: .4rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
}
.arm-nav, .galaxy-breadcrumb { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.arm-nav a, .galaxy-breadcrumb a { color: var(--accent); }
.arm-nav { justify-content: center; }
.arm-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem .83rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(180deg, #342737, #1d1723);
  box-shadow: inset 0 1px #eac4ab21;
  text-decoration: none;
}
.arm-nav a:hover { border-color: var(--accent); }
.arm-nav a[aria-current] {
  background: linear-gradient(180deg, #ffd8bc, #dfa07c);
  box-shadow: inset 0 1px #fff3e0b8, 0 2px 0 #743c31;
  color: #21151a;
}
.sector-form {
  grid-template-columns: auto minmax(3.5rem, 6rem) auto;
  justify-content: center;
  align-items: center;
  gap: .55rem;
  margin: 1.3rem 0;
}
.sector-form button { margin: 0; }
.system-list { list-style: none; margin: 0; padding: 0; }
.system-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); gap: .5rem; }
.system-list a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .3rem .5rem;
  align-items: center;
  padding: .6rem;
  text-align: start;
  color: var(--ink);
  border: 1px solid var(--line);
  text-decoration: none;
}
.system-list a:hover { background: #e6b08b16; }
.system-list a span:last-child { grid-column: 2; font-size: .8rem; color: var(--muted); }
.star-dot { display: inline-block; width: .65rem; height: .65rem; margin-right: .25rem; border-radius: 50%; background: #f4eee8; }
.star-dot[data-star="M"] { background: #fc8d81; }
.star-dot[data-star="K"] { background: #ffb478; }
.star-dot[data-star="G"] { background: #f7d488; }
.star-dot[data-star="B"], .star-dot[data-star="O"] { background: #9db9ff; }
.galaxy-return { margin: 1.4rem 0 0; }

.system-card {
  width: 100%;
  text-align: center;
}

.system-card .galaxy-breadcrumb {
  position: sticky;
  z-index: 2;
  inset-block-start: .6rem;
  justify-content: center;
  gap: .35rem .85rem;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 1.6rem;
  padding: .45rem .75rem;
  border: 1px solid #d7af923b;
  border-radius: 1rem;
  background: #191622f2;
  font-size: .83rem;
}

.system-header {
  display: grid;
  justify-items: center;
  margin: 0 0 clamp(1.25rem, 4vw, 2rem);
}

.system-header h1 {
  margin: .85rem 0 .3rem;
  font: 500 clamp(2.15rem, 6.8vw, 4.3rem)/.95 "Cormorant Garamond", Georgia, serif;
}

.system-header p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
}

.system-star-avatar {
  --star-center: #fffdf0;
  --star-surface: #ffdd9b;
  --star-rim: #f5a16c;
  position: relative;
  isolation: isolate;
  width: clamp(4.6rem, 13vw, 6.7rem);
  aspect-ratio: 1;
  border-radius: 50%;
}

.system-star-avatar[data-star="M"] { --star-surface: #ffa376; --star-rim: #e74f4b; }
.system-star-avatar[data-star="K"] { --star-surface: #ffbe76; --star-rim: #ed784a; }
.system-star-avatar[data-star="G"] { --star-surface: #ffda7d; --star-rim: #ee9c47; }
.system-star-avatar[data-star="A"] { --star-surface: #dfe8ff; --star-rim: #a3baff; }
.system-star-avatar[data-star="B"] { --star-surface: #bad7ff; --star-rim: #6b9df9; }
.system-star-avatar[data-star="O"] { --star-surface: #add9ff; --star-rim: #6192ee; }

.system-star-avatar::before {
  position: absolute;
  inset: -38%;
  z-index: -1;
  background: radial-gradient(circle, var(--star-rim), transparent 67%);
  opacity: .55;
  animation: star-halo 5.5s ease-in-out infinite alternate;
  content: "";
}

.system-star-surface {
  position: absolute;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, var(--star-center) 3%, var(--star-surface) 52%, var(--star-rim) 86%);
  box-shadow: inset 0 0 .47rem var(--star-rim), 0 0 .65rem var(--star-rim);
}

.system-star-surface::before {
  position: absolute;
  inset: -15%;
  background:
    radial-gradient(ellipse at 67% 21%, var(--star-center), transparent 19%),
    radial-gradient(ellipse at 29% 74%, var(--star-rim), transparent 34%),
    radial-gradient(ellipse at 19% 24%, var(--star-rim), transparent 29%),
    radial-gradient(ellipse at 73% 67%, var(--star-center), transparent 22%),
    conic-gradient(from 16deg at 58% 43%, transparent, var(--star-rim) 38deg, transparent 91deg,
      var(--star-center) 158deg, transparent 201deg, var(--star-rim) 242deg, transparent 304deg);
  filter: blur(3px) saturate(1.2);
  opacity: .64;
  animation: star-surface 31s linear infinite;
  content: "";
}

.system-world-grid { position: relative; }

.system-orbital-renderer {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.system-orbital-renderer[hidden] { visibility: hidden; }

.system-worlds {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.system-worlds li {
  display: flex;
  flex: 0 1 calc((100% - 1.3rem) / 3);
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  min-width: 0;
  max-width: 16rem;
  padding: .75rem .55rem .9rem;
  border: 1px solid #dec5bc2b;
  border-radius: .8rem;
  background: radial-gradient(ellipse at 50% 28%, #3a304b60, #10111bba 69%);
}

.system-worlds strong {
  max-width: 100%;
  font-size: .96rem;
  overflow-wrap: anywhere;
}

.system-worlds span {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
}

.system-worlds .world-start { color: var(--accent); }

.planet-satellite-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: .2rem;
  padding: .35rem .65rem;
  border: 1px solid #ddb89949;
  border-radius: 999px;
  color: #f0c9b1;
  font-size: .78rem;
  text-decoration: none;
}

.planet-satellite-link:hover { border-color: var(--accent); background: #e6b08b19; }

.planet-system-card .system-header h1 { margin-top: 0; }

.planet-orbit-map {
  position: relative;
  height: clamp(16rem, 48vw, 24rem);
  overflow: hidden;
  border: 1px solid #d7af9247;
  border-radius: .9rem;
  background: radial-gradient(ellipse at 50% 47%, #2b2036, #0e0d19 68%);
}

.planet-orbit-map > canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.planet-orbit-map .system-world-grid {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

.planet-orbit-map .system-planet-avatar { width: clamp(4.35rem, 16vw, 8.35rem); }

.planet-moon-heading {
  margin: 1.3rem 0 1rem;
  font: 500 clamp(1.65rem, 4vw, 2.25rem)/1 "Cormorant Garamond", Georgia, serif;
}

.moon-family + .moon-family { margin-top: 1rem; }
.moon-family h3 { margin: 0 0 .55rem; color: var(--accent); font-size: .88rem; }
.moon-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr));
  gap: .55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.moon-list li {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  padding: .55rem .65rem;
  border: 1px solid #dec5bc25;
  border-radius: .65rem;
  background: #10111b93;
  text-align: start;
}

.moon-list img { width: 2.75rem; height: 2.75rem; border-radius: 50%; object-fit: cover; }
.moon-list div { display: grid; gap: .16rem; min-width: 0; }
.moon-list strong { font-size: .88rem; overflow-wrap: anywhere; }
.moon-list span { color: var(--muted); font-size: .73rem; }

.system-planet-avatar {
  position: relative;
  isolation: isolate;
  width: clamp(4.4rem, 17vw, 6.7rem);
  aspect-ratio: 1;
}

.system-planet-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

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

@keyframes star-halo {
  from { transform: scale(.91); opacity: .45; }
  to { transform: scale(1.12); opacity: .68; }
}

@keyframes star-surface { to { transform: rotate(1turn); } }

@media (max-width: 540px) {
  .system-worlds li { flex-basis: calc((100% - .65rem) / 2); }
}

@media (min-width: 720px) and (max-height: 820px) {
  .portal-shell--wide { gap: .85rem; }
  .galaxy-overview { padding-block: 1.25rem; }
  .system-card { padding-block: 1.25rem; }
  .system-card .galaxy-breadcrumb, .system-header { margin-bottom: 1.05rem; }
  .system-star-avatar { width: 5rem; }
  .system-header h1 { font-size: 3.45rem; }
  .system-worlds li { padding-block: .55rem .65rem; }
  .system-planet-avatar { width: 4.75rem; }
  .system-card .galaxy-return { margin-top: 1.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  .system-star-avatar::before, .system-star-surface::before { animation: none; }
}

.colony-entry {
  display: inline-block;
  padding: .65rem 1rem;
  background: var(--accent);
  color: #21151a;
  font-weight: 650;
  text-decoration: none;
}

.colony-view {
  --panel: #14131df0;
  --quiet-line: #c3bed233;
  --mint: #bfdbca;
  display: grid;
  gap: 1rem;
}

.colony-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.3rem; }
.colony-nav a { color: var(--accent); }

.colony-header {
  display: flex;
  min-height: 9rem;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1.25rem clamp(1rem, 3.5vw, 2rem);
  border: 1px solid var(--line);
  background: linear-gradient(110deg, #11101bf2 50%, #251a2adb 100%);
}

.colony-header h1 { margin: 0 0 .4rem; overflow-wrap: anywhere; }
.colony-header p:not(.server) { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; }
.colony-header img {
  width: clamp(4.5rem, 15vw, 7.75rem);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.colony-resources {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .5rem;
  margin: 0;
}

.colony-resource {
  min-width: 0;
  padding: .75rem clamp(.5rem, 2vw, 1rem);
  border: 1px solid var(--quiet-line);
  background: var(--panel);
}

.colony-resource dt, .colony-rate { color: var(--muted); font-size: .8rem; }
.colony-resource dd { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem; margin: .25rem 0 0; }
.colony-resource dd strong { color: var(--accent); font-size: clamp(1.04rem, 2.5vw, 1.45rem); font-variant-numeric: tabular-nums; }
.colony-resource dd span { color: var(--muted); font-size: .79rem; }

.colony-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 1fr);
  gap: .9rem;
  align-items: start;
}

.colony-sites, .colony-detail {
  padding: 1rem clamp(.75rem, 3vw, 1.4rem);
  border: 1px solid var(--quiet-line);
  background: var(--panel);
  min-width: 0;
}

.colony-sites h2, .colony-detail h2 {
  margin: 0 0 .8rem;
  font: 400 clamp(1.35rem, 3vw, 1.8rem)/1.12 Georgia, serif;
}

.colony-terrain {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.25rem, 1fr));
  gap: .55rem;
  padding: 1.15rem;
  overflow: hidden;
  border: 1px solid #465368;
  border-radius: .65rem;
  background: #111724;
}

.colony-map-surface {
  z-index: -1;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
}

.colony-terrain.surface-positioned {
  display: block;
  padding: 0;
  height: clamp(19rem, 46vw, 28rem);
}

.colony-pad {
  display: grid;
  justify-items: center;
  min-width: 3.8rem;
  min-height: 2.6rem;
  align-content: center;
  color: #fdf4e9;
  text-decoration: none;
  outline-offset: 1px;
  --pad-light: color-mix(in srgb, var(--terrain-tone) 70%, var(--race-tone, #f0bc8d));
}

.surface-positioned .colony-pad {
  position: absolute;
  min-width: 0;
  width: clamp(2.4rem, 10%, 4.8rem);
  transform: translate(-50%, -50%);
}

.colony-pad-deck {
  position: relative;
  display: grid;
  place-items: center;
  width: 90%;
  aspect-ratio: 2.25;
  border: 1px solid var(--pad-light);
  border-radius: 50%;
  background: radial-gradient(ellipse, #1c2c40bb 47%, #1e2b3e 50% 62%, #182435 65%);
  box-shadow: 0 3px 0 #080e1b;
}

.colony-pad-deck::after {
  content: "";
  width: 15%;
  aspect-ratio: 1;
  background: linear-gradient(transparent 44%, var(--pad-light) 44% 56%, transparent 56%),
    linear-gradient(90deg, transparent 44%, var(--pad-light) 44% 56%, transparent 56%);
}

.colony-pad[data-building]:not([data-building=""]) .colony-pad-deck::after { display: none; }
.colony-pad:is([aria-current], :hover, :focus-visible) .colony-pad-deck {
  border-color: #ffdeb7;
  box-shadow: 0 0 .55rem #ffcf975c, 0 3px 0 #080e1b;
}

.colony-pad-building {
  --sprite-x: 0%;
  --sprite-y: 0%;
  position: absolute;
  width: 145%;
  aspect-ratio: 1;
  bottom: 14%;
  overflow: hidden;
  pointer-events: none;
}

.colony-pad-building img {
  position: absolute;
  width: 400%;
  height: 200%;
  max-width: none;
  left: var(--sprite-x);
  top: var(--sprite-y);
}

[data-variant="1"] .colony-pad-building, [data-variant="3"] .colony-pad-building { transform: scaleX(-1); }
[data-variant="1"] .colony-pad-building img { filter: sepia(.2) hue-rotate(15deg); }
[data-variant="2"] .colony-pad-building img { filter: hue-rotate(-14deg) saturate(.9); }
[data-variant="3"] .colony-pad-building img { filter: sepia(.12) hue-rotate(33deg); }

.colony-pad-building:is([data-kind="2"], [data-kind="6"]) { --sprite-x: -100%; }
.colony-pad-building:is([data-kind="3"], [data-kind="7"]) { --sprite-x: -200%; }
.colony-pad-building:is([data-kind="4"], [data-kind="8"]) { --sprite-x: -300%; }
.colony-pad-building:is([data-kind="5"], [data-kind="6"], [data-kind="7"], [data-kind="8"]) { --sprite-y: -100%; }

.colony-pad-caption {
  margin-top: .2rem;
  padding: 0 .19rem;
  border-radius: .2rem;
  background: #111825e8;
  color: #f7efe5;
  font-size: .68rem;
  line-height: 1.2;
  white-space: nowrap;
}

.surface-positioned .colony-pad:not([aria-current], :hover, :focus-visible)[data-building]:not([data-building=""]) .colony-pad-caption {
  visibility: hidden;
}

.colony-legend li::before {
  width: .38rem;
  aspect-ratio: 1;
  background: var(--terrain-tone);
  border-radius: 50%;
}

.colony-view [data-terrain="command"] { --terrain-tone: #efd09b; }
.colony-view [data-terrain="open"] { --terrain-tone: #a5c2cf; }
.colony-view [data-terrain="metal"] { --terrain-tone: #f6a880; }
.colony-view [data-terrain="silicon"] { --terrain-tone: #b8bafb; }
.colony-view [data-terrain="fuel"] { --terrain-tone: #85dccc; }

.colony-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font-size: .76rem;
  color: var(--muted);
}

.colony-legend li { display: inline-flex; align-items: center; gap: .4rem; }
.colony-legend li::before { content: ""; flex: none; width: .38rem; }

.colony-section-label { margin: 0 0 .3rem; font-size: .82rem; color: var(--muted); }
.colony-detail h3 { margin: .25rem 0; font-size: .99rem; overflow-wrap: anywhere; }
.colony-note { margin: .35rem 0; color: var(--muted); font-size: .84rem; line-height: 1.4; }
.colony-confirmation { color: var(--mint); margin: 0 0 .75rem; }
.colony-build-options, .colony-costs, .colony-output { margin: 0; padding: 0; list-style: none; }
.colony-build-options > li { padding: .75rem 0; border-top: 1px solid var(--quiet-line); }
.colony-build-options form { display: block; }
.colony-build-options button { min-height: 2.4rem; margin: .5rem 0 0; }
.colony-build-options button:disabled { opacity: .5; cursor: default; }
.colony-costs, .colony-output, .colony-production { display: flex; gap: .35rem .65rem; flex-wrap: wrap; }
.colony-costs { margin-top: .45rem; color: var(--accent); font-size: .8rem; }
.colony-output, .colony-production { color: var(--mint); font-size: .81rem; }
.colony-production { margin: .4rem 0 0; }

@media (max-width: 720px) {
  .colony-workspace { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 525px) {
  .colony-resources { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .colony-resource[data-resource="power"] { grid-column: 1 / -1; }
  .surface-positioned .colony-pad:not([aria-current], :hover, :focus-visible) .colony-pad-caption { visibility: hidden; }
}
