:root {
  --deep: #030817;
  --panel: rgba(9, 18, 45, 0.84);
  --panel-strong: rgba(12, 22, 58, 0.95);
  --line: rgba(148, 214, 255, 0.2);
  --soft: rgba(228, 242, 255, 0.76);
  --white: #fff;
  --cyan: #22dcff;
  --blue: #4d79ff;
  --violet: #8447ff;
  --magenta: #e642ff;
  --gold: #ffca50;
  --green: #37e58f;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
  color: var(--white);
  background:
    radial-gradient(circle at 42% 36%, rgba(119, 61, 255, 0.3), transparent 28rem),
    radial-gradient(circle at 70% 26%, rgba(34, 220, 255, 0.16), transparent 34rem),
    linear-gradient(145deg, #02040c, #070d25 52%, #130823);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(112, 226, 255, 0.52) 0 1px, transparent 1.5px);
  background-position: 0 0, 24px 32px;
  background-size: 90px 90px, 140px 140px;
  opacity: 0.42;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.galaxy-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 330px;
  gap: 16px;
  padding: 18px;
}

.galaxy-sidebar,
.planet-drawer,
.carousel-panel,
.event-panel,
.tab-row,
.search-box {
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(13, 24, 58, 0.88), rgba(5, 11, 28, 0.9));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
}

.galaxy-sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  border-radius: 18px;
  padding: 14px;
}

.back-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 2rem;
  line-height: 1;
}

.galaxy-brand {
  display: grid;
  gap: 4px;
}

.brand-orb {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 50%, #fff 0 5%, transparent 7%),
    conic-gradient(from 20deg, var(--cyan), var(--violet), var(--magenta), var(--cyan));
  box-shadow: 0 0 30px rgba(132, 71, 255, 0.5);
}

.galaxy-brand strong {
  font-family: "Baloo 2", Inter, sans-serif;
  font-size: 1.35rem;
  line-height: 0.9;
}

.galaxy-brand small,
.player-card span,
.player-card small {
  color: rgba(228, 242, 255, 0.68);
  font-size: 0.78rem;
  font-weight: 800;
}

.galaxy-sidebar nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.galaxy-sidebar nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 900;
}

.galaxy-sidebar nav a.is-active,
.galaxy-sidebar nav a:hover {
  border-color: rgba(132, 71, 255, 0.65);
  background: linear-gradient(135deg, rgba(132, 71, 255, 0.62), rgba(70, 116, 255, 0.22));
  box-shadow: 0 0 26px rgba(132, 71, 255, 0.32);
}

.galaxy-sidebar nav span {
  width: 24px;
  color: #9cefff;
  text-align: center;
}

.galaxy-sidebar nav em {
  margin-left: auto;
  min-width: 18px;
  min-height: 18px;
  border-radius: 999px;
  background: var(--gold);
  color: #251200;
  font-size: 0.72rem;
  font-style: normal;
  text-align: center;
}

.player-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(148, 214, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.avatar {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(148, 214, 255, 0.75);
  border-radius: 14px;
  background: linear-gradient(145deg, #243d8b, #19b5ff);
  font-weight: 1000;
}

.xp-bar,
.planet-progress {
  overflow: hidden;
  height: 8px;
  margin: 6px 0 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.xp-bar i,
.planet-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--violet));
}

.galaxy-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(520px, 1fr) auto;
  gap: 14px;
}

.galaxy-topbar,
.galaxy-controls,
.galaxy-bottom,
.currency-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.galaxy-topbar,
.galaxy-controls,
.galaxy-bottom {
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 6px;
  color: #8ff0ff;
  font-size: 0.74rem;
  font-weight: 1000;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: "Baloo 2", Inter, sans-serif;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 0.88;
}

h2 {
  margin-bottom: 0;
}

.currency-row span,
.currency-row button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(148, 214, 255, 0.16);
  border-radius: 13px;
  background: rgba(4, 9, 24, 0.62);
  font-weight: 1000;
}

.currency-row button {
  width: 42px;
  justify-content: center;
  color: #d9c6ff;
  cursor: pointer;
}

.currency-row b {
  width: 15px;
  height: 20px;
  display: inline-block;
  clip-path: polygon(50% 0, 100% 34%, 82% 100%, 18% 100%, 0 34%);
}

.crystal { background: linear-gradient(#8ff0ff, #236bff); }
.coin { border-radius: 50%; clip-path: none !important; background: linear-gradient(#ffe88b, #f49020); }
.gem { background: linear-gradient(#f6a6ff, #7a37ff); }

.tab-row {
  overflow-x: auto;
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
}

.tab-row button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 17px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.tab-row button.is-active {
  color: #fff;
  background: linear-gradient(135deg, #5d35ff, #9c42ff);
  box-shadow: 0 0 24px rgba(132, 71, 255, 0.46);
}

.search-box {
  min-width: min(420px, 100%);
  display: grid;
  gap: 5px;
  padding: 9px 13px;
  border-radius: 16px;
}

.search-box span {
  color: rgba(228, 242, 255, 0.58);
  font-size: 0.7rem;
  font-weight: 900;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font-weight: 900;
}

.galaxy-map {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 214, 255, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 50% 52%, rgba(132, 71, 255, 0.32), transparent 28%),
    radial-gradient(ellipse at 50% 52%, rgba(34, 220, 255, 0.16), transparent 46%),
    radial-gradient(circle at 28% 28%, rgba(255, 97, 55, 0.18), transparent 15rem),
    rgba(2, 6, 17, 0.72);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.54), 0 28px 80px rgba(0, 0, 0, 0.34);
}

.star-field,
.nebula,
.orbit-ring {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.star-field {
  background-image:
    radial-gradient(circle, #fff 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(143, 240, 255, 0.8) 0 1px, transparent 1.5px);
  background-size: 68px 68px, 112px 112px;
  opacity: 0.52;
}

.nebula-one {
  background: radial-gradient(ellipse at 28% 74%, rgba(198, 52, 255, 0.28), transparent 20rem);
}

.nebula-two {
  background: radial-gradient(ellipse at 80% 30%, rgba(34, 220, 255, 0.22), transparent 24rem);
}

.orbit-ring {
  inset: 20% 23%;
  border: 1px solid rgba(185, 124, 255, 0.34);
  border-radius: 50%;
  box-shadow: 0 0 50px rgba(132, 71, 255, 0.16);
  transform: rotate(-8deg);
}

.orbit-two {
  inset: 13% 15%;
  opacity: 0.48;
  transform: rotate(15deg);
}

.planet-node {
  position: absolute;
  z-index: 2;
  width: 132px;
  min-height: 120px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transform: translate(-50%, -50%);
  text-align: center;
}

.planet-art,
.mini-planet,
.planet-preview::before {
  display: block;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.92), transparent 8%),
    radial-gradient(circle at 48% 45%, var(--planet-one), var(--planet-two) 54%, var(--planet-three));
  box-shadow:
    inset -16px -20px 30px rgba(0, 0, 0, 0.38),
    0 0 34px var(--planet-glow);
}

.planet-art {
  width: 84px;
  height: 84px;
  margin: 0 auto 7px;
}

.planet-xl .planet-art { width: 126px; height: 126px; }
.planet-lg .planet-art { width: 102px; height: 102px; }
.planet-sm .planet-art { width: 72px; height: 72px; }

.planet-node strong,
.planet-node small,
.planet-node em {
  display: block;
  text-shadow: 0 3px 10px #000;
}

.planet-node strong {
  font-weight: 1000;
  text-transform: uppercase;
}

.planet-node small,
.planet-node em {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 800;
}

.planet-node.is-selected .planet-art {
  outline: 3px solid rgba(255, 255, 255, 0.78);
  outline-offset: 7px;
}

.planet-crystal {
  --planet-one: #d06cff;
  --planet-two: #5138ff;
  --planet-three: #10194d;
  --planet-glow: rgba(186, 82, 255, 0.74);
}

.planet-lava {
  --planet-one: #ffd35d;
  --planet-two: #e64c24;
  --planet-three: #371012;
  --planet-glow: rgba(255, 99, 34, 0.7);
}

.planet-sky {
  --planet-one: #e8fbff;
  --planet-two: #53baff;
  --planet-three: #2b3caa;
  --planet-glow: rgba(94, 196, 255, 0.64);
}

.planet-slime {
  --planet-one: #d6ff72;
  --planet-two: #34e583;
  --planet-three: #113b28;
  --planet-glow: rgba(72, 255, 137, 0.58);
}

.planet-metal {
  --planet-one: #97d7ff;
  --planet-two: #4e6d8d;
  --planet-three: #131823;
  --planet-glow: rgba(85, 184, 255, 0.45);
}

.planet-ice {
  --planet-one: #ffffff;
  --planet-two: #87e8ff;
  --planet-three: #2642a0;
  --planet-glow: rgba(155, 239, 255, 0.6);
}

.planet-mushroom {
  --planet-one: #ff91ef;
  --planet-two: #8c55ff;
  --planet-three: #1b174c;
  --planet-glow: rgba(255, 112, 232, 0.52);
}

.planet-desert {
  --planet-one: #ffe08c;
  --planet-two: #d8862e;
  --planet-three: #4a2611;
  --planet-glow: rgba(255, 196, 88, 0.52);
}

.unknown-planet {
  position: absolute;
  left: 54%;
  bottom: 8%;
  z-index: 1;
  display: grid;
  place-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
}

.unknown-planet span {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 28%, #4b3d65, #101321 58%, #05070d);
  box-shadow: 0 0 20px rgba(120, 94, 165, 0.26);
  font-weight: 1000;
}

.galaxy-bottom {
  align-items: stretch;
}

.carousel-panel,
.event-panel {
  border-radius: 18px;
  padding: 14px;
}

.carousel-panel {
  min-width: 0;
  flex: 1;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-title span {
  color: #9cefff;
  font-size: 0.82rem;
  font-weight: 900;
}

.world-strip {
  overflow-x: auto;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(140px, 1fr);
  gap: 10px;
}

.world-card {
  display: grid;
  gap: 5px;
  min-height: 126px;
  padding: 10px;
  border: 1px solid rgba(148, 214, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.world-card.is-selected {
  border-color: rgba(34, 220, 255, 0.72);
  background: rgba(34, 220, 255, 0.12);
}

.mini-planet {
  width: 52px;
  height: 52px;
}

.world-card small,
.world-card em {
  color: rgba(228, 242, 255, 0.62);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
}

.event-panel {
  width: 260px;
  display: grid;
  gap: 10px;
}

.event-panel article {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(148, 214, 255, 0.16);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
}

.event-panel article span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--violet), var(--blue));
}

.event-panel small {
  display: block;
  color: rgba(228, 242, 255, 0.62);
}

.planet-drawer {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  border-radius: 20px;
  padding: 14px;
}

.drawer-close {
  display: none;
}

.planet-preview {
  position: relative;
  min-height: 164px;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 72%, var(--planet-glow), transparent 8rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
}

.planet-preview::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 122px;
  height: 122px;
  transform: translate(-50%, -50%);
}

.planet-copy h2 {
  margin: 5px 0 2px;
  font-family: "Baloo 2", Inter, sans-serif;
  font-size: 2.55rem;
  line-height: 0.86;
  text-transform: uppercase;
}

.planet-copy p {
  margin-bottom: 0;
  color: rgba(228, 242, 255, 0.7);
  font-weight: 800;
}

.rarity-pill {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border: 1px solid rgba(198, 96, 255, 0.44);
  border-radius: 999px;
  color: #f1ccff !important;
  background: rgba(132, 71, 255, 0.16);
  font-size: 0.72rem;
  font-weight: 1000 !important;
  text-transform: uppercase;
}

.level-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: rgba(228, 242, 255, 0.76);
  font-size: 0.82rem;
  font-weight: 900;
}

.planet-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.planet-stats span,
.featured-beast,
.resource-panel,
.home-planet-card {
  border: 1px solid rgba(148, 214, 255, 0.16);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.06);
}

.planet-stats span {
  display: grid;
  gap: 4px;
  padding: 11px;
}

.planet-stats b {
  color: rgba(228, 242, 255, 0.62);
  font-size: 0.72rem;
}

.planet-stats strong {
  font-size: 1.2rem;
}

.featured-beast,
.resource-panel {
  padding: 12px;
}

.featured-beast p,
.resource-panel p {
  margin-bottom: 9px;
  color: #b99cff;
  font-size: 0.78rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.featured-beast div {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 12px;
  align-items: center;
}

.featured-beast strong,
.featured-beast small {
  display: block;
}

.featured-beast small {
  width: fit-content;
  margin-top: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(132, 71, 255, 0.24);
  color: #dabdff;
}

.beast-token {
  width: 68px;
  height: 58px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 68% 28%, #fff 0 5%, transparent 7%),
    linear-gradient(135deg, var(--planet-one), var(--planet-two) 56%, var(--planet-three));
  box-shadow: 0 0 24px var(--planet-glow);
}

#resourceList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#resourceList span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(148, 214, 255, 0.15);
  border-radius: 12px;
  background: rgba(4, 9, 24, 0.5);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 900;
}

.drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.visit-button,
.drawer-actions button,
.home-planet-card a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 214, 255, 0.18);
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  font-weight: 1000;
}

.visit-button {
  grid-column: 1 / -1;
  min-height: 54px;
  background: linear-gradient(135deg, #7a34ff, #511cff);
  box-shadow: 0 0 32px rgba(132, 71, 255, 0.38);
  text-transform: uppercase;
}

.drawer-actions button.is-active {
  border-color: rgba(55, 229, 143, 0.46);
  background: rgba(55, 229, 143, 0.16);
  color: #c9ffe3;
}

.home-planet-card {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 11px;
  align-items: center;
  padding: 11px;
}

.home-planet-card span {
  display: block;
  margin: 3px 0 10px;
  color: rgba(228, 242, 255, 0.62);
  font-size: 0.78rem;
  font-weight: 800;
}

.home-planet-card a {
  min-height: 38px;
  background: linear-gradient(135deg, #198cff, #1644c7);
}

@media (max-width: 1220px) {
  .galaxy-shell {
    grid-template-columns: 84px minmax(0, 1fr) 310px;
  }

  .galaxy-brand strong,
  .galaxy-brand small,
  .galaxy-sidebar nav a:not(.is-active) {
    font-size: 0;
  }

  .galaxy-sidebar nav a {
    justify-content: center;
    padding: 0;
  }

  .galaxy-sidebar nav span {
    font-size: 1rem;
  }

  .player-card {
    grid-template-columns: 1fr;
  }

  .player-card div:not(.avatar) {
    display: none;
  }
}

@media (max-width: 980px) {
  .galaxy-shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .galaxy-sidebar {
    position: static;
    height: auto;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }

  .galaxy-brand {
    grid-template-columns: 46px 1fr;
    align-items: center;
  }

  .galaxy-brand small {
    grid-column: 2;
  }

  .galaxy-sidebar nav {
    grid-column: 1 / -1;
    grid-auto-flow: column;
    overflow-x: auto;
  }

  .galaxy-sidebar nav a,
  .galaxy-sidebar nav a:not(.is-active) {
    min-width: 92px;
    font-size: 0.78rem;
  }

  .player-card {
    display: none;
  }

  .planet-drawer {
    position: fixed;
    inset: auto 10px 10px;
    z-index: 20;
    max-height: 86vh;
    height: auto;
    transform: translateY(calc(100% + 22px));
    transition: transform 220ms ease;
  }

  .planet-drawer.is-open {
    transform: translateY(0);
  }

  .drawer-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.36);
    cursor: pointer;
    font-size: 1.4rem;
  }
}

@media (max-width: 720px) {
  .galaxy-main {
    grid-template-rows: auto auto 520px auto;
  }

  .galaxy-topbar,
  .galaxy-controls,
  .galaxy-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .currency-row {
    overflow-x: auto;
  }

  .search-box {
    min-width: 0;
  }

  .event-panel {
    width: 100%;
  }

  .planet-node {
    width: 110px;
  }

  .planet-art {
    width: 70px;
    height: 70px;
  }

  .planet-xl .planet-art {
    width: 96px;
    height: 96px;
  }

  .planet-lg .planet-art {
    width: 82px;
    height: 82px;
  }
}

.hub-placeholder {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.hub-placeholder .back-button {
  position: fixed;
  left: 18px;
  top: 18px;
}

.hub-placeholder section {
  width: min(760px, 100%);
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 80% 20%, rgba(34, 220, 255, 0.18), transparent 18rem),
    linear-gradient(145deg, rgba(13, 24, 58, 0.9), rgba(5, 11, 28, 0.94));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
}

.hub-placeholder h1 {
  margin-bottom: 14px;
}

.hub-placeholder p:not(.eyebrow) {
  color: var(--soft);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.6;
}

.hub-placeholder .visit-button {
  width: fit-content;
  min-width: 190px;
  margin-top: 18px;
}
