:root {
  color-scheme: light;
  --ink: #1d2430;
  --muted: #626c7a;
  --paper: #f6f2e8;
  --panel: #fffaf0;
  --line: #d7cab1;
  --amber: #e8a13a;
  --teal: #249e9b;
  --rose: #d7657f;
  --navy: #263b5e;
  --green: #3f8f62;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 18%, rgba(232, 161, 58, 0.18), transparent 24rem),
    linear-gradient(145deg, #f6f2e8 0%, #e8eef0 54%, #f7efe4 100%);
  color: var(--ink);
}

button,
a {
  font: inherit;
}

.shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 38px;
}

.top-nav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 30px;
}

.top-nav a {
  color: var(--navy);
  border: 1px solid rgba(38, 59, 94, 0.28);
  background: rgba(255, 250, 240, 0.72);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.hero {
  max-width: 790px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.76rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.15rem, 7vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.lede {
  max-width: 720px;
  color: #4d5968;
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 16px 0 0;
}

.game-panel,
.rules {
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.84);
  box-shadow: 0 18px 48px rgba(43, 50, 55, 0.11);
  border-radius: 8px;
}

.game-panel {
  padding: 18px;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.status-row div {
  min-height: 62px;
  border: 1px solid rgba(38, 59, 94, 0.12);
  background: rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  padding: 10px 12px;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.status-row strong {
  font-size: 1.35rem;
}

.planetarium-wrap {
  display: grid;
  place-items: center;
  min-height: 460px;
  padding: 10px;
}

.planetarium {
  position: relative;
  width: min(76vw, 430px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 9%, rgba(255, 250, 240, 0.92) 9% 16%, transparent 16%),
    radial-gradient(circle at 50% 50%, #20304d 0%, #111928 63%, #0d111d 100%);
  border: 10px solid #c6a76a;
  box-shadow: inset 0 0 0 2px rgba(255, 244, 210, 0.5), 0 18px 44px rgba(20, 28, 44, 0.28);
  overflow: hidden;
}

.orbit {
  position: absolute;
  inset: var(--inset);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
}

.window,
.planet {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: rotate(var(--angle)) translateY(calc(-1 * var(--radius))) rotate(calc(-1 * var(--angle)));
  border-radius: 50%;
}

.window {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 2px dashed currentColor;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 18px currentColor;
}

.planet {
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  background: currentColor;
  border: 3px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 16px currentColor;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.aligned {
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.28), 0 0 24px currentColor;
}

.amber { color: var(--amber); }
.teal { color: var(--teal); }
.rose { color: var(--rose); }

.star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 50%;
}

.message {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #3d4855;
  font-weight: 700;
  margin: 8px 0 14px;
}

.ring-controls,
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.ring-control {
  display: grid;
  grid-template-columns: minmax(58px, auto) 44px 44px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(38, 59, 94, 0.13);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  padding: 8px;
  font-weight: 800;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  cursor: pointer;
  font-weight: 800;
  padding: 10px 14px;
}

button:hover:not(:disabled),
button:focus-visible:not(:disabled) {
  background: #16233a;
}

button:disabled {
  cursor: not-allowed;
  background: #9fa8b4;
}

.controls {
  margin-top: 12px;
}

.controls button {
  background: var(--green);
}

.controls button:hover:not(:disabled),
.controls button:focus-visible:not(:disabled) {
  background: #2f704d;
}

.rules {
  margin-top: 18px;
  padding: 18px 22px;
}

.rules h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.rules ul {
  margin: 0;
  padding-left: 20px;
  color: #4d5968;
  line-height: 1.6;
}

@media (max-width: 700px) {
  .shell {
    width: min(100% - 20px, 560px);
    padding-top: 14px;
  }

  .top-nav {
    justify-content: flex-start;
    margin-bottom: 20px;
  }

  .status-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .planetarium-wrap {
    min-height: 340px;
    padding: 0;
  }

  .ring-control {
    grid-template-columns: 1fr 42px 42px;
    width: 100%;
  }
}
