:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #f4f0ed;
  background: #090a12;
  --muted: #b1b0c4;
  --line: #292938;
  --accent: #ffc397;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; cursor: pointer; touch-action: manipulation; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.topbar, main { max-width: 1272px; margin: auto; padding-inline: clamp(16px, 4vw, 54px); }
.topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 700; letter-spacing: .04em; }
.control { padding: 0 13px; min-height: 44px; border: 1px solid #414054; background: #161625; border-radius: 9px; font-size: .78rem; }
.control:hover, .control[aria-pressed='true'] { border-color: var(--accent); }

.introduction { padding-block: clamp(18px, 4vw, 46px) 30px; }
h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(3rem, 8.2vw, 6.8rem); font-weight: 400; line-height: .98; letter-spacing: -.075em; }
h1 em { color: var(--accent); font-weight: inherit; }
.introduction p { color: var(--muted); margin: 19px 0 0; line-height: 1.55; }
.explorer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 295px); gap: 16px; padding-bottom: 40px; }
.sky, .sidebar { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.sky { min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; position: relative; min-height: 478px; isolation: isolate; background: radial-gradient(ellipse at 46% 48%, #24172e 0%, #101020 49%, #0c0c17 78%); }
.map-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 17px 0; gap: 8px; position: relative; z-index: 4; }
.map-header h2, .directory h2, .eyebrow { font-size: .73rem; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; }
#sky, .bodies { position: absolute; inset: 0; width: 100%; height: 100%; }
#sky, .bodies { pointer-events: none; }
.map-foot { grid-row: 3; margin: 0; padding: 13px 17px; color: var(--muted); font-size: .72rem; z-index: 2; }
#map-selection { display: none; }
.body { --size: 34px; position: absolute; width: max(44px, var(--size)); height: max(44px, var(--size)); padding: 0; border: 0; border-radius: 50%; background: transparent; pointer-events: auto; z-index: 2; }
.body, .sun { top: 0; left: 0; }
.body canvas, .planet-icon { display: block; width: var(--size); height: var(--size); border-radius: 50%; }
.body canvas { margin: auto; pointer-events: none; }
.body .caption { position: absolute; left: 50%; top: calc(100% + 2px); transform: translateX(-50%); color: #e4dfef; font-size: .68rem; white-space: nowrap; text-shadow: 0 1px 4px #090a12, 0 0 6px #090a12; pointer-events: none; }
.body:hover, .body:focus-visible, .body[aria-pressed='true'] { z-index: 3; }
.body[aria-pressed='true'] { box-shadow: 0 0 0 1px var(--accent), 0 0 18px #ffc39755; }
.body[aria-pressed='true'] .caption { color: var(--accent); }
.sun { position: absolute; width: var(--size); height: var(--size); border-radius: 50%; box-shadow: 0 0 18px 5px #ff9a3959, 0 0 62px 13px #ed682a48; pointer-events: none; z-index: 1; }
.sidebar { background: #11111c; }
.details { min-height: 194px; padding: 24px 20px; border-bottom: 1px solid var(--line); background: radial-gradient(ellipse at top right, #2c1d30, #151420 77%); }
.eyebrow { color: var(--accent); margin: 0; }
.details h2 { font-family: Georgia, serif; font-weight: 400; font-size: 2.15rem; letter-spacing: -.045em; margin: 9px 0; }
.details p:last-child { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.directory { padding: 15px 12px 12px; }
.directory h2 { color: var(--muted); margin: 4px 8px 10px; }
.planet-row { --size: 24px; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; text-align: left; gap: 10px; width: 100%; min-height: 50px; padding: 7px 9px; background: transparent; border: 1px solid transparent; border-radius: 9px; }
.planet-row:hover { background: #202032; }
.planet-row[aria-pressed='true'] { border-color: #795b57; background: #261e2b; }
.planet-row .arrow { color: var(--muted); }

@media (max-width: 810px) {
  .explorer { grid-template-columns: minmax(0, 1fr); }
  .sky { min-height: clamp(395px, 72vw, 475px); }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  .details { min-height: auto; border-bottom: 0; border-right: 1px solid var(--line); }
  #map-selection { display: block; position: absolute; right: 16px; bottom: 46px; z-index: 3; margin: 0; padding: 8px 12px; border: 1px solid #795b57; border-radius: 9px; background: #1c1725; color: var(--accent); pointer-events: none; }
}

@media (max-width: 490px) {
  .topbar { min-height: 64px; }
  .sidebar { grid-template-columns: 1fr; }
  .details { min-height: 148px; border-right: 0; border-bottom: 1px solid var(--line); }
  #directory { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .map-foot { font-size: .68rem; }
}

.menu-page { background: radial-gradient(ellipse at 48% 0%, #211629, transparent 58%), #090a12; min-height: 100vh; }
.game-menu { max-width: 864px; padding-block: clamp(52px, 12vw, 130px) 48px; }
.game-menu h1 { text-align: center; margin-bottom: clamp(24px, 5vw, 52px); }
.game-tiles { margin: 0 auto; max-width: 628px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 3vw, 24px); }
.game-tile { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; aspect-ratio: 1; padding: clamp(12px, 2.8vw, 24px); border: 1px solid #51405c; border-radius: 16px; background: #151324; color: inherit; text-decoration: none; isolation: isolate; }
a.game-tile:hover, a.game-tile:focus-visible { border-color: var(--accent); }
.game-tile h2 { position: relative; margin: 0; font: 400 clamp(1rem, 4.1vw, 2rem)/1.15 Georgia, serif; }
.tile-arrow { position: relative; color: var(--accent); font-size: clamp(.9rem, 3vw, 1.25rem); }
.tile-art, .tile-placeholder { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; z-index: -1; }
.tile-art { background: radial-gradient(ellipse at 38% 36%, #39233e, #181527 58%, #11111d); }
.tile-art::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 17% 28%, #f8e6ff 0 1px, transparent 2px), radial-gradient(circle at 76% 19%, #bfb3d8 0 1px, transparent 2px), radial-gradient(circle at 85% 50%, #bfb3d8 0 1px, transparent 2px), radial-gradient(circle at 24% 62%, #e0c6d6 0 1px, transparent 2px), radial-gradient(circle at 58% 13%, #a996bc 0 1px, transparent 2px), radial-gradient(circle at 62% 62%, #a996bc 0 1px, transparent 2px), radial-gradient(circle at 12% 47%, #82738e 0 1px, transparent 2px); }
.tile-orbits { position: absolute; width: 84%; height: 33%; top: 24%; left: 8%; border: 1px solid #d8a9d063; border-radius: 50%; transform: rotate(-24deg); }
.tile-orbits::before, .tile-orbits::after { content: ''; position: absolute; inset: 17%; border: inherit; border-radius: inherit; }
.tile-orbits::after { inset: 33%; }
.tile-sun, .tile-earth, .tile-mars { position: absolute; aspect-ratio: 1; border-radius: 50%; }
.tile-sun { width: 18%; left: 41%; top: 31%; background: radial-gradient(circle at 35% 30%, #ffe6a0, #ffac65 46%, #b4462f 90%); box-shadow: 0 0 25px #ff9b6659; }
.tile-earth { width: 14%; left: 68%; top: 34%; background: radial-gradient(ellipse at 34% 40%, #77bb9d 0 16%, transparent 30%), radial-gradient(ellipse at 65% 56%, #679e89 0 17%, transparent 30%), radial-gradient(circle at 25% 25%, #aae0f6, #438bd0 45%, #172348 87%); box-shadow: 0 0 13px #6eb8e859; }
.tile-mars { width: 8%; left: 16%; top: 49%; background: radial-gradient(circle at 31% 27%, #f1b192, #a85442 58%, #382034); }
.upcoming-tile { background: #11111b; border-color: var(--line); color: var(--muted); }
.tile-placeholder { display: grid; place-items: center; padding-bottom: 17%; background: radial-gradient(ellipse at 50% 40%, #241f31, transparent 68%); }
.tile-placeholder span { display: block; width: 29%; aspect-ratio: 1; border: 1px dashed #817390; border-radius: 14px; transform: rotate(-12deg); }
