:root {
  color-scheme: dark;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  color: #f2f5f8;
  background: #000;
  --muted: #b5c2ce;
  --ice: #d4e8f7;
  --line: #bbd2df40;
  --entry-header-height: 110px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; background: transparent; }
a { color: var(--ice); text-underline-offset: 5px; }
button, input { font: inherit; }
button, .button {
  cursor: pointer; min-height: 44px; border: 1px solid transparent; border-radius: 0;
  padding: 12px 20px; background: transparent; color: #f2f5f8;
  text-decoration: none; text-align: center;
  text-shadow: 0 1px 8px #000, 0 0 18px #b7dfff25;
  transition: color .18s ease, text-shadow .18s ease, transform .18s ease;
}
button:disabled { opacity: .42; cursor: not-allowed; }
button:hover:not(:disabled), .button:hover {
  background: transparent; border-color: transparent; color: #fff;
  text-shadow: 0 0 10px #f5fbff8a, 0 0 28px #8bcfff6b;
  transform: scale(1.035);
}
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid #cceaff; outline-offset: 5px;
}
h1:focus, h2:focus { outline: none; }
input {
  width: 100%; min-width: 0; min-height: 48px; border: 1px solid #bbd2df70;
  border-radius: 0; padding: 13px 15px; color: #fff; background: #030912b8; font-size: 16px;
}
label { display: block; margin-bottom: 10px; font-size: 13px; }
h1, h2 { font-weight: 400; letter-spacing: -.025em; text-shadow: 0 2px 20px #000; }
h1 { font-size: clamp(2.25rem,4.2vw,4.6rem); line-height: 1.05; margin: 15px 0 24px; }
h2 { font-size: clamp(1.5rem,2.6vw,2.5rem); margin: 10px 0; }
p { line-height: 1.6; color: var(--muted); text-shadow: 0 1px 8px #000; }
.eyebrow { font: 10px/1.5 'IBM Plex Mono',monospace; letter-spacing: .2em; color: #c1d9e9; }
.fine { font-size: 12px; line-height: 1.65; }
.text-button { font-size: 12px; padding: 10px 12px; }
.primary { color: #fff; font-weight: 500; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.entry-header {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: 20px 4vw; gap: 24px; min-height: var(--entry-header-height);
}
.entry-header nav { display: flex; align-items: center; gap: 24px; font-size: 12px; }
.entry-header #identity { color: var(--muted); max-width: 30ch; overflow-wrap: anywhere; }
.entry-header a { text-decoration: none; }
.entry-footer {
  position: relative; z-index: 1; min-height: 62px; padding: 12px 4vw;
  display: flex; align-items: center; gap: 24px; font-size: 11px;
}
.entry-footer .eyebrow { margin-right: auto; }
#lobby {
  position: relative; z-index: 1; min-height: calc(100svh - var(--entry-header-height) - 62px);
  padding: 0 6vw 40px;
}
.view-top { display: flex; align-items: center; gap: 18px; min-height: 48px; }
.mode-picker { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.mode-picker button { padding: 9px 16px; font-size: 13px; border-radius: 999px; }
.mode-picker button[aria-pressed=true] { background: #cce3f01c; color: #fff; box-shadow: inset 0 0 0 1px #cce3f03a; }
.mode-picker #mode-colonization[aria-pressed=true] { color: #fff1bf; background: #f0cf8730; box-shadow: inset 0 0 0 1px #ffe4a650; }
body[data-entry-mode=colonization] .threat { color: #d6edb3; }
body[data-entry-mode=colonization] #select-planet { color: #fff1c9; text-shadow: 0 2px 10px #000,0 0 28px #ffe4a64a; }
body[data-entry-mode=colonization] #campaign-name { border-radius: 14px; background: #2c30257d; border-color: #d5d8b780; }
body[data-entry-mode=colonization] #campaign-name:focus { border-color: #f7e7ad; }
.colony-menu-action > span, .colony-menu h1, .colony-menu .menu-actions button > span,
body[data-entry-mode=colonization] .planet-title h1 { font-family: 'Segoe Print','Bradley Hand','Chalkboard SE',cursive; }
.menu-actions .colony-menu-action { color: #f4eccf; text-shadow: 0 2px 12px #000,0 0 24px #cee3aa55; }
.colony-menu .colony-intro { color: #dae3d2; font-size: 13px; margin: -8px 0 0; }
.colony-menu .menu-actions button { color: #fff8e4; font-size: 29px; }
.colony-menu .menu-actions .war-zone-action > span { font-family: 'IBM Plex Sans',system-ui,sans-serif; }
.colony-menu .menu-actions .war-zone-action { margin-top: 10px; letter-spacing: .025em; }
body[data-entry-mode=colonization] .planet-info dd { color: #eef0df; }
/* Golden light scatters through thin dust; the surrounding universe stays dark. */
html:has(body[data-entry-mode=colonization]) { background: #080c0d; }
body[data-entry-mode=colonization] { color: #f7f5e8; background: #080c0d; --muted: #c8cec0; --ice: #eee9d3; --line: #d8d5b740; }
body[data-entry-mode=colonization] :is(button,.button,h1,h2,p,.planet-info,.save-view,.eyebrow,.planet-title .eyebrow,.planet-info dd,.planet-info dt,.lore-note,.colony-intro,.menu-actions small) {
  color: #eeeede; text-shadow: 0 1px 4px #08100c,0 0 14px #08100c99;
}
body[data-entry-mode=colonization] :is(.colony-menu h1,.menu-actions button,#select-planet) { color: #fff9dd; text-shadow: 0 1px 4px #08100c,0 0 20px #f6d88924; }
body[data-entry-mode=colonization] .threat { color: #d6e7b1; }
body[data-entry-mode=colonization] :is(button,.button):hover:not(:disabled) { color: #fff5cb; text-shadow: 0 0 8px #fff3c255,0 0 22px #ffe5a644; }
body[data-entry-mode=colonization] input { color: #f7f3df; background: #111a15b3; border-color: #d7c99380; text-shadow: none; }
body[data-entry-mode=colonization] #campaign-name { background: #111a15b3; border-color: #d7c99380; }
body[data-entry-mode=colonization] input::placeholder { color: #b9bfad; }
body[data-entry-mode=colonization] #message:not(:empty) { color: #f0d89c; text-shadow: 0 1px 4px #08100c,0 0 12px #08100c; }
body[data-entry-mode=colonization] #message.error { color: #ffc4ae; }
body[data-entry-mode=colonization] :is(.delete-campaign,.delete-confirm,.delete-confirmation p) { color: #ffc4ae; }
body[data-entry-mode=colonization] :is(button,a,input):focus-visible { outline-color: #ebd49a; }
body[data-entry-mode=colonization] #campaign-name:focus { border-color: #ebd49a; }
body[data-entry-mode=colonization] .entry-brand img { filter: drop-shadow(0 1px 2px #263b2bd9); }
body[data-entry-mode=colonization] :is(.planet-title h1,.planet-title .eyebrow,.colony-menu h1,.colony-menu .colony-intro,.colony-menu .eyebrow,.colony-menu .menu-actions button,.colony-menu .menu-actions small) {
  color: #fffced; text-shadow: 0 1px 3px #263b2de6,0 0 12px #263b2d80;
}
body[data-entry-wormhole] .menu-view { opacity: .08; transition: opacity .18s ease; }
.status-area {
  position: fixed; z-index: 5; left: 50%; bottom: max(24px,env(safe-area-inset-bottom));
  transform: translateX(-50%); width: min(660px,calc(100% - 40px));
  margin: 0; text-align: center; pointer-events: none;
}
#message:empty { display: none; }
#message:not(:empty) {
  background: transparent; border: 0; margin: 0; padding: 8px 0;
  color: #e9d498; font-size: 13px; overflow-wrap: anywhere;
  text-shadow: 0 1px 4px #000,0 0 12px #000;
}
#message.error { color: #ffc0b9; }
#signin { font-size: 13px; pointer-events: auto; }
#active { position: relative; z-index: 3; margin: 5px auto 16px; text-align: center; max-width: 650px; }
#active .button { display: inline-block; }
#leave-help { margin: 6px 0; }
#active:not([hidden]) ~ .menu-view { padding-top: 10px; }

/* The menu reads as luminous type floating over the globe, with no menu cards. */
.menu-view {
  max-width: 620px; margin: 0 auto; padding-top: clamp(22px,5vh,76px);
  padding-bottom: 50px; text-align: center;
}
.menu-view h1 { font-size: clamp(2rem,3vw,3.2rem); color: #fff; text-shadow: 0 2px 22px #000,0 0 30px #b7dfff35; }
.menu-actions { display: grid; justify-items: center; margin-top: 26px; gap: 10px; }
.menu-actions button {
  width: min(100%,480px); display: block; border: 0; padding: 16px 12px;
  font-size: 32px; font-weight: 400; color: #fff; text-align: center;
  text-shadow: 0 2px 12px #000,0 0 22px #d8edff55;
}
.menu-actions button:hover:not(:disabled) { transform: scale(1.055); text-shadow: 0 0 12px #fff9,0 0 36px #9ed6ff85; }
.menu-actions small { display: block; font: 12px/1.5 'IBM Plex Sans',sans-serif; color: #c1ccd5; margin-top: 6px; }
.signal-arrival .menu-actions { animation: entry-signal .22s steps(2,end) 1; }
@keyframes entry-signal {
  0% { clip-path: inset(20% 0 50% 0); transform: translateX(-3px); }
  45% { clip-path: inset(0 0 22% 0); transform: translateX(3px); }
  100% { clip-path: inset(0); transform: none; }
}

.planet-title-anchor { position: relative; }
.planet-title {
  position: absolute; left: calc(var(--entry-planet-x,42vw) - 34vw); top: 7px;
  width: 56vw; text-align: center; pointer-events: none;
}
.planet-title h1 { font-size: clamp(3rem,5vw,6rem); margin: 10px 0; }
.planet-title .eyebrow { color: #dfebf3; }
.planet-arrow {
  position: absolute; top: calc(var(--entry-planet-y,49svh) - var(--entry-lobby-top,var(--entry-header-height)) - 45px);
  width: 62px; height: 90px; border: 0; font: 300 80px/1 'IBM Plex Sans',sans-serif;
  padding: 0; z-index: 2; text-shadow: 0 1px 12px #000,0 0 20px #b2dcff30;
}
.planet-arrow.previous { left: max(8px,1.5vw); }
.planet-arrow.next { right: max(8px,1.5vw); }
.planet-arrow:hover:not(:disabled) { transform: scale(1.13); }
#new-view { position: relative; }
.planet-info {
  position: absolute; right: 0; top: clamp(65px,11svh,125px);
  width: min(26vw,300px); padding: 0 0 20px; background: transparent;
  text-shadow: 0 2px 10px #000;
}
.threat { font: 12px 'IBM Plex Mono',monospace; letter-spacing: .14em; color: #ff9088; }
.planet-info > p:not(.fine):not(.threat) { font-size: 14px; }
.planet-info dl { margin-top: 25px; }
.planet-info dl div { padding: 9px 0; }
.planet-info dt { font: 9px 'IBM Plex Mono',monospace; letter-spacing: .12em; color: #b1c1ce; text-transform: uppercase; }
.planet-info dd { margin: 5px 0 0; font-size: 14px; color: #e2ebf3; }
.lore-note { font-size: 10px; color: #a2b3bf; }
.establish {
  position: relative; width: min(52vw,600px);
  margin-left: calc(var(--entry-planet-x,42vw) - 6vw - min(26vw,300px));
  padding-top: max(40px,calc(var(--entry-planet-bottom,83svh) + 20px - var(--entry-content-top,158px)));
  text-align: center;
}
#select-planet { min-width: 220px; font-size: 22px; padding: 12px 24px; }
#select-planet[aria-pressed=true] { opacity: 1; color: #fff; text-shadow: 0 0 16px #c9e8ff70; }
#create-panel { margin-top: 10px; padding: 10px 0; background: transparent; }
#create-panel h2 { font-size: 18px; }
#create { display: flex; flex-direction: column; gap: 12px; align-items: center; width: min(100%,440px); margin: 0 auto; }
#create button { white-space: nowrap; }
#campaign-name:focus { outline: none; border-color: #d8e0e6; }
#save-limit { margin-top: 8px; }
body[data-entry-view=continue] .planet-title { width: 40vw; left: calc(var(--entry-planet-x,29vw) - 26vw); }
.save-view {
  position: relative; width: min(35vw,430px); margin: 50px 4vw 0 auto;
  padding: 0; background: transparent; text-shadow: 0 2px 12px #000;
}
.save-view > .fine { max-width: 44ch; }
.campaign-card { display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; padding: 18px 0; align-items: center; }
.campaign-card strong { font-size: 19px; font-weight: 500; overflow-wrap: anywhere; }
.campaign-card p { margin: 6px 0 0; font-size: 12px; }
.campaign-card button { min-width: 64px; padding: 10px 5px; }
.campaign-actions { display: flex; flex-direction: column; align-items: stretch; }
.delete-campaign, .delete-confirm { color: #ffb4ad; }
.delete-confirmation { grid-column: 1 / -1; text-align: right; }
.delete-confirmation p { color: #ffb4ad; text-align: left; }
.delete-confirmation button + button { margin-left: 12px; }
#campaign-list { max-height: 43vh; overflow: auto; scrollbar-width: thin; padding: 0 8px; margin: 0 -8px; }
.empty-saves { padding: 20px 0; }
.save-actions { display: flex; gap: 14px; justify-content: space-between; margin-top: 6px; }
.save-actions button { padding: 10px 0; }
.join-view { max-width: 510px; margin: clamp(15px,7vh,75px) auto 0; padding: 24px 0; background: transparent; }
.join-view h1 { font-size: clamp(2rem,4vw,3.4rem); }
#join { margin: 30px 0 20px; }
#join-submit { width: 100%; margin-top: 16px; font-size: 21px; }
#invitation-code { font: 14px 'IBM Plex Mono',monospace; letter-spacing: .025em; }

@media (max-width:1100px) and (min-width:761px) {
  .entry-header nav { gap: 14px; }
  .planet-info { width: 27vw; }
  .planet-info > p:not(.fine):not(.threat) { font-size: 12px; }
  .planet-info dd { font-size: 12px; }
  .save-view { width: 35vw; margin-right: 3vw; }
  .save-view h2 { font-size: 30px; }
}
@media (max-width:760px) {
  .entry-header { gap: 12px; padding: 14px 20px; align-items: flex-start; }
  .entry-header nav { font-size: 11px; gap: 12px; max-width: 175px; flex-wrap: wrap; justify-content: flex-end; }
  .entry-header #identity { flex-basis: 100%; text-align: right; font-size: 10px; max-width: 20ch; }
  .entry-footer { padding: 10px 20px; gap: 10px; flex-wrap: wrap; }
  .entry-footer .eyebrow { font-size: 8px; flex-basis: 100%; margin: 0; }
  .entry-footer a { margin-left: auto; }
  .entry-footer button { padding-left: 0; }
  #lobby { padding: 0 24px 24px; min-height: calc(100svh - 200px); }
  .view-top { min-height: 44px; gap: 10px; flex-wrap: wrap; }
  .view-top .eyebrow { font-size: 9px; }
  .mode-picker { flex-basis: 100%; justify-content: center; margin: 0 0 5px; }
  .mode-picker button { min-width: 125px; }
  .menu-view { padding-top: 24px; padding-bottom: 24px; }
  .menu-view h1 { font-size: 2rem; }
  .menu-view .eyebrow { font-size: 9px; }
  .menu-actions { margin-top: 20px; gap: 6px; }
  .menu-actions button { padding: 13px 8px; font-size: 27px; }
  .colony-menu .menu-actions button { font-size: 25px; }
  .menu-actions small { font-size: 11px; }
  .planet-title, body[data-entry-view=continue] .planet-title {
    position: relative; left: auto; top: auto; width: 100%; padding-top: 10px;
    height: max(210px,calc(var(--entry-planet-bottom,430px) - var(--entry-content-top,154px) + 18px));
    text-align: center;
  }
  .planet-title h1 { font-size: 42px; margin: 7px 0; }
  .planet-title .eyebrow { font-size: 9px; margin: 0; }
  .planet-arrow { top: calc(var(--entry-planet-y,30svh) - var(--entry-lobby-top,var(--entry-header-height)) - 35px); height: 70px; width: 40px; font-size: 62px; }
  .planet-arrow.previous { left: 5px; }
  .planet-arrow.next { right: 5px; }
  #new-view { display: flex; flex-direction: column; }
  .establish { order: 0; width: 100%; margin: 0; padding: 0; }
  #select-planet { width: 100%; font-size: 22px; }
  #create-panel { padding: 4px 0; }
  #create input { font-size: 16px; }
  .planet-info { order: 1; position: static; width: 100%; max-width: none; margin: 24px 0 0; padding: 0; }
  .planet-info > .threat { margin: 0 0 8px; }
  .planet-info > p:not(.fine):not(.threat) { font-size: 12px; }
  .planet-info dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin: 12px 0 0; }
  .planet-info dl div { padding: 8px 0; }
  .planet-info dd { font-size: 12px; }
  .lore-note { margin: 8px 0; }
  .save-view { width: 100%; margin: 0; padding: 0; }
  .save-view h2 { font-size: 26px; }
  #campaign-list { max-height: 390px; }
  .campaign-card { gap: 8px; padding: 16px 0; }
  .campaign-card strong { font-size: 17px; }
  .campaign-card button { min-width: 60px; }
  .save-actions { gap: 12px; }
  .save-actions button { padding: 10px 4px; }
  .join-view { margin-top: 35px; padding-top: 5px; }
  .join-view > .eyebrow { font-size: 9px; }
  .join-view > p { font-size: 13px; }
  .join-view h1 { font-size: 36px; }
  #invitation-code { font-size: 12px; letter-spacing: 0; padding: 13px 10px; }
  #active { margin: 8px 0 16px; }
  #active .button { width: 100%; font-size: 13px; }
  #leave-help { font-size: 11px; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* The arrow jump and pod dive play on the canvas behind the lobby. */
.planet-title { transition: opacity .4s ease; }
body[data-entry-jump] .planet-title { opacity: 0; transition-duration: .08s; }
.entry-header, .entry-footer, #lobby { transition: opacity .6s ease; }
body.entry-diving .entry-header, body.entry-diving .entry-footer, body.entry-diving #lobby { opacity: 0; pointer-events: none; }
.dive-skip { position: fixed; left: 0; right: 0; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 2; margin: 0; text-align: center; font-size: 12px; color: #dfe9eecc; pointer-events: none; }
.dive-touch { display: none; }
@media (pointer: coarse) { .dive-mouse { display: none; } .dive-touch { display: inline; } }
body.entry-world::after { content: ''; position: fixed; inset: 0; z-index: 3; background: #000; opacity: 0; pointer-events: none; transition: opacity 1s ease-in; }
body.entry-world.entry-dark::after { opacity: 1; }
body.entry-world.entry-fast::after { transition-duration: .45s; }
