/* SpaceCrafting title-menu inspired palette (Hud::drawTitleMenu) */
:root {
  --bg: #000000;
  --panel: rgba(18, 20, 32, 0.97);
  --panel-border: rgba(100, 140, 210, 0.78);
  --title-core-1: #76a8ff;
  --title-core-2: #d5f0ff;
  --text: #d7e4fc;
  --muted: #96a8c9;
  --dim: #5f6e91;
  --accent: #c8e6ff;
  --link: #a8d4ff;
  --link-hover: #ffffff;
  --danger: #ff8c8c;
  --ok: #7dffc8;
  --input-bg: rgba(8, 10, 20, 0.9);
  --glow: rgba(118, 168, 255, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

/* Animated canvas starfield + vector rocks (see assets/starfield.js) */
.starfield-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: #000;
}

.site-header {
  position: relative;
  z-index: 2;
  border-bottom: 2px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(12, 16, 28, 0.95) 0%, rgba(6, 8, 14, 0.9) 100%);
}

.header-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem 1.25rem;
}

.logo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--title-core-2);
  text-shadow:
    0 0 12px var(--glow),
    0 0 28px rgba(118, 168, 255, 0.25);
}

.logo-mark {
  color: var(--title-core-1);
  font-size: 1.15rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px var(--glow));
}

.logo-mark .bi {
  vertical-align: -0.08em;
}

.logo-wordmark {
  text-transform: none;
  letter-spacing: 0.04em;
}

.nav {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem 1rem;
}

.nav-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.nav-spacer {
  flex: 1 1 auto;
  min-width: 1rem;
  height: 1px;
  align-self: center;
}

.nav-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-main a,
.nav-actions a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav a {
  color: var(--link);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav a:hover,
.nav a.active {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav-link-ii-signup {
  color: #d8b4fe !important;
  text-decoration: none;
  font-weight: 600;
  text-shadow: 0 0 12px rgba(168, 85, 247, 0.45);
}

.nav-link-ii-signup:hover,
.nav-link-ii-signup.active {
  color: #f5e1ff !important;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-shadow: 0 0 16px rgba(192, 132, 252, 0.65);
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.nav-link-ii-signup .bi {
  color: inherit;
}

.heading-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.heading-icon .bi {
  flex-shrink: 0;
  opacity: 0.92;
}

.site-footer .bi {
  margin-right: 0.25rem;
  vertical-align: -0.1em;
  opacity: 0.85;
}

.footer-copy {
  margin-right: 0.15rem;
}

.main {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.main--home,
.main--wide {
  max-width: 960px;
}

.hero-title {
  text-align: center;
  margin: 1.5rem 0 0.5rem;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(180deg, var(--title-core-2) 0%, var(--title-core-1) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 20px var(--glow));
}

.hero-tag {
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.panel {
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-radius: 4px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.panel h1,
.panel h2 {
  margin-top: 0;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.panel h1 {
  font-size: 1.5rem;
}

.panel h2 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.lead {
  font-size: 1.08rem;
  color: var(--text);
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

ul.feature-list {
  margin: 1rem 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

ul.feature-list li {
  margin-bottom: 0.35rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.4rem;
  border: 2px solid var(--panel-border);
  border-radius: 4px;
  background: rgba(42, 68, 112, 0.55);
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
}

.btn:hover {
  background: rgba(62, 98, 158, 0.75);
  color: #fff;
}

.btn-primary {
  background: rgba(55, 95, 140, 0.8);
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  border: 1px solid var(--panel-border);
}

.alert .bi {
  flex-shrink: 0;
  margin-top: 0.12rem;
}

.alert-error {
  background: rgba(80, 30, 35, 0.5);
  color: var(--danger);
}

.alert-ok {
  background: rgba(20, 50, 40, 0.5);
  color: var(--ok);
}

label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

input[type="email"],
input[type="password"],
input[type="text"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(100, 140, 210, 0.5);
  border-radius: 3px;
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.site-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1.5rem 1rem;
  border-top: 1px solid rgba(100, 140, 210, 0.25);
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, transparent);
  color: var(--dim);
  font-size: 0.88rem;
}

.footer-hint {
  margin: 0.35rem 0 0;
  opacity: 0.85;
}

.build-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.build-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(100, 140, 210, 0.2);
}

.build-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--link);
  font-weight: 600;
}

.build-list a:hover {
  color: var(--link-hover);
}

.edition-card {
  margin-bottom: 1.5rem;
}

.edition-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.edition-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.manual-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(100, 140, 210, 0.65);
  border-radius: 999px;
  color: var(--link);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.manual-pill:hover {
  color: var(--link-hover);
  border-color: var(--title-core-1);
  background: rgba(55, 95, 140, 0.35);
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem 1rem;
  margin-top: 1.25rem;
}

.edition-free {
  text-align: center;
}

.edition-free .edition-head {
  justify-content: center;
}

.play-browser-wrap {
  display: flex;
  justify-content: center;
  margin-top: 0.15rem;
  margin-bottom: 0.35rem;
  transform: translateY(-0.85rem);
}

.web-mac-note strong {
  color: #c084fc;
}

.btn-play-browser {
  font-size: 1.28rem;
  padding: 0.95rem 2rem;
  gap: 0.65rem;
  background: linear-gradient(180deg, #34d399 0%, #059669 55%, #047857 100%);
  border: 2px solid #065f46;
  color: #ecfdf5;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  box-shadow:
    0 0 0 1px rgba(167, 243, 208, 0.25),
    0 6px 20px rgba(5, 150, 105, 0.35);
}

.btn-play-browser:hover {
  background: linear-gradient(180deg, #6ee7b7 0%, #10b981 50%, #059669 100%);
  border-color: #34d399;
  color: #fff;
}

.btn-play-browser__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  flex-shrink: 0;
}

.btn-play-browser__chrome {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.edition-free .download-row {
  justify-content: center;
  margin-top: 0.5rem;
}

.install-help {
  margin-top: 1.35rem;
  text-align: left;
  border: 1px solid rgba(100, 140, 210, 0.5);
  border-radius: 4px;
  background: rgba(8, 12, 24, 0.72);
}

.install-help > summary {
  cursor: pointer;
  padding: 0.7rem 1rem;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.install-help > summary::-webkit-details-marker {
  display: none;
}

.install-help > summary::marker {
  content: "";
}

.install-help[open] > summary {
  border-bottom: 1px solid rgba(100, 140, 210, 0.28);
}

.install-help-body {
  padding: 1rem 1.15rem 1.35rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.install-help-body h3 {
  margin: 1.1rem 0 0.45rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--accent);
}

.install-help-body h3:first-child {
  margin-top: 0;
}

.install-steps {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.install-steps li {
  margin-bottom: 0.45rem;
}

.install-help-body code,
.install-cmd code {
  font-size: 0.88rem;
}

.install-inline {
  display: inline;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(100, 140, 210, 0.35);
}

.install-cmd {
  margin: 0.5rem 0 0;
  padding: 0.65rem 0.85rem;
  overflow-x: auto;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(100, 140, 210, 0.35);
  color: var(--title-core-2);
  font-size: 0.86rem;
  line-height: 1.45;
}

.linux-dropdown {
  position: relative;
  display: inline-block;
  text-align: left;
}

.linux-dropdown__btn {
  cursor: pointer;
  font: inherit;
}

.linux-dropdown__menu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 20;
  min-width: 220px;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  text-align: left;
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-radius: 4px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}

.linux-dropdown:hover .linux-dropdown__menu,
.linux-dropdown:focus-within .linux-dropdown__menu {
  display: block;
}

.linux-dropdown__link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  text-align: left;
  color: var(--link);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}

.linux-dropdown__link:hover {
  color: var(--link-hover);
  background: rgba(55, 95, 140, 0.45);
}

.sc2-alpha {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.5rem;
  align-items: flex-start;
}

.sc2-alpha__icon {
  flex-shrink: 0;
  color: var(--title-core-1);
  filter: drop-shadow(0 0 12px var(--glow));
}

.sc2-alpha__body {
  flex: 1;
  min-width: 220px;
}

.sc2-alpha__body .edition-title {
  margin-bottom: 0.5rem;
}

.edition-ii {
  border-color: rgba(192, 132, 252, 0.88);
  background: linear-gradient(
    155deg,
    rgba(52, 22, 72, 0.96) 0%,
    rgba(26, 10, 42, 0.98) 45%,
    rgba(32, 14, 58, 0.97) 100%
  );
  box-shadow:
    0 0 0 1px rgba(168, 85, 247, 0.15),
    0 10px 48px rgba(100, 40, 180, 0.35),
    0 8px 32px rgba(0, 0, 0, 0.5);
}

.edition-ii .edition-title,
.edition-ii .edition-title .heading-icon {
  color: #f0e4ff;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  filter: drop-shadow(0 0 18px rgba(168, 85, 247, 0.55));
}

.edition-ii .edition-title .bi {
  color: #d8b4fe;
}

.edition-ii .lead {
  color: #e4d4f8;
}

.edition-ii .lead strong {
  color: #f0ddff;
}

.edition-ii .sc2-alpha__icon {
  color: #d8b4fe;
  filter: drop-shadow(0 0 16px rgba(168, 85, 247, 0.65));
}

.edition-ii .btn-primary {
  background: linear-gradient(180deg, rgba(147, 51, 234, 0.92) 0%, rgba(107, 33, 168, 0.95) 100%);
  border-color: rgba(216, 180, 254, 0.75);
  color: #fdf4ff;
}

.edition-ii .btn-primary:hover {
  background: linear-gradient(180deg, rgba(167, 75, 250, 1) 0%, rgba(126, 45, 200, 1) 100%);
  color: #fff;
}

.edition-ii .btn:not(.btn-primary) {
  border-color: rgba(192, 132, 252, 0.55);
  color: #edd9ff;
  background: rgba(55, 22, 88, 0.55);
}

.edition-ii .btn:not(.btn-primary):hover {
  border-color: rgba(216, 180, 254, 0.85);
  background: rgba(80, 35, 120, 0.75);
  color: #fff;
}

.panel-ii-downloads {
  border-color: rgba(192, 132, 252, 0.65);
  background: linear-gradient(165deg, rgba(38, 16, 58, 0.95) 0%, rgba(18, 10, 32, 0.98) 100%);
  box-shadow: 0 0 24px rgba(120, 50, 200, 0.2), 0 8px 32px rgba(0, 0, 0, 0.45);
}

.panel-ii-downloads h1 .heading-icon {
  color: #f0e4ff;
}

.panel-ii-downloads h1 .heading-icon .bi {
  color: #d8b4fe;
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.55));
}

.manual-toc-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--accent);
}

.manual-toc-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.manual-toc-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--link);
}

.manual-toc-list a:hover {
  color: var(--link-hover);
}

.manual-toc-list .bi {
  opacity: 0.85;
}

.manual-section h2 {
  font-size: 1.1rem;
  margin-top: 1.25rem;
}

.manual-section h2:first-of-type {
  margin-top: 0;
}

.manual-list {
  color: var(--muted);
  padding-left: 1.2rem;
}

.manual-list li {
  margin-bottom: 0.35rem;
}

.manual-table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid rgba(100, 140, 210, 0.35);
  border-radius: 4px;
}

.manual-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.manual-table th,
.manual-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(100, 140, 210, 0.2);
  text-align: left;
  white-space: nowrap;
}

.manual-table th {
  color: var(--accent);
  background: rgba(12, 20, 40, 0.6);
  position: sticky;
  top: 0;
}

.manual-table tbody tr:hover td {
  background: rgba(40, 70, 120, 0.2);
}

.manual-mode-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
}

.manual-mode-bar-label {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.manual-plain-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  user-select: none;
}

.manual-plain-toggle input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--title-core-1);
}

.manual-title-plain,
.manual-prose-plain {
  display: none;
}

body.manual-plain .manual-title-story,
body.manual-plain .manual-prose-story {
  display: none !important;
}

body.manual-plain .manual-title-plain,
body.manual-plain .manual-prose-plain {
  display: block;
}

.manual-section .manual-title-plain {
  margin-top: 0;
}

body.manual-plain .manual-prose-plain .muted {
  color: var(--muted);
}
