:root {
  /* https://morphos.ameyanagi.com/gallery?system=morphous-smoky-quartz */
  --background: oklch(0.214 0.019 266.1);
  --foreground: oklch(0.960 0.003 17.2);
  --card: oklch(0.253 0.022 269.2);
  --card-foreground: oklch(0.960 0.003 17.2);
  --popover: oklch(0.253 0.022 269.2);
  --popover-foreground: oklch(0.960 0.003 17.2);
  --primary: oklch(0.623 0.043 298.2);
  --primary-foreground: oklch(0.214 0.019 266.1);
  --secondary: oklch(0.354 0.028 282.1);
  --secondary-foreground: oklch(0.960 0.003 17.2);
  --muted: oklch(0.354 0.028 282.1);
  --muted-foreground: oklch(0.813 0.019 303.4);
  --accent: oklch(0.799 0.105 49.1);
  --accent-foreground: oklch(0.214 0.019 266.1);
  --destructive: oklch(0.486 0.056 290.7);
  --border: oklch(1 0 0 / 12%);
  --input: oklch(1 0 0 / 16%);
  --ring: oklch(0.623 0.043 298.2);
  --chart-1: oklch(0.623 0.043 298.2);
  --chart-2: oklch(0.486 0.056 290.7);
  --chart-3: oklch(0.799 0.105 49.1);
  --chart-4: oklch(0.740 0.160 32.1);
  --chart-5: oklch(0.623 0.043 298.2);
  --sidebar: oklch(0.240 0.020 267.8);
  --sidebar-foreground: oklch(0.960 0.003 17.2);
  --sidebar-primary: oklch(0.623 0.043 298.2);
  --sidebar-primary-foreground: oklch(0.214 0.019 266.1);
  --sidebar-accent: oklch(0.354 0.028 282.1);
  --sidebar-accent-foreground: oklch(0.960 0.003 17.2);
  --sidebar-border: oklch(1 0 0 / 12%);
  --sidebar-ring: oklch(0.623 0.043 298.2);
  --radius: 0.5rem;

  font-family: "Noto Sans JP", "Noto Sans", "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
}

html {
  background: var(--background);
  color: var(--foreground);
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  box-sizing: border-box;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(320px, 0.9fr);
  gap: 24px;
  width: min(1100px, 100%);
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  /* box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25); */
  box-sizing: border-box;
}

.visual-pane {
  min-height: 420px;
  border-radius: calc(var(--radius) + 0.2rem);
  border: 1px dashed var(--border);
  background: var(--sidebar);
}

.control-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

h1 {
  margin-top: 0;
  margin-bottom: 8px;
}

label {
  /* display: block; */
  margin-top: 16px;
  margin-bottom: 6px;
  font-weight: 600;
}

input,
button {
  font: inherit;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.selector {
  margin-bottom: 14px;
}

input[type=number] {
  width: 80%;
  box-sizing: border-box;
  margin-bottom: 14px;
}

button {
  cursor: pointer;
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  font-weight: 700;
}

button:hover {
  opacity: 0.8;
}

#status {
  margin-top: 12px;
  /* color: #cbd5e1; */
}

@media (max-width: 860px) {
  body {
    padding: 16px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 16px;
  }

  .visual-pane {
    min-height: 220px;
  }
}

.universe {
  /* background: radial-gradient(circle at center, #1b2735 0%, #050508 100%); */
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  position: relative;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle 2s infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.2; transform: scale(1); }
  to { opacity: 1; transform: scale(1.2); }
}

.shooting-star {
  position: absolute;
  width: 150px;
  height: 1px;
  background: linear-gradient(90deg, white, transparent);
  offset-path: path("M300,-300 L-500,500");
  animation: shoot 5s infinite;
}

.sun {
  /* 太陽の「左上の角」を画面の中央に指定 */
  position: absolute;
  top: 50%; left: 50%;
  /* 少し右下にずれているのを、左上に移動させて、太陽の中心が画面の真ん中になる */
  transform: translate(-50%, -50%);
  width: 60px; height: 60px;
  background: white;
  border-radius: 50%;
  z-index: 10;
}

.planet-border {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid white;
  border-radius: 50%;
  background: transparent;
  z-index: 10;

  &.a1 {
    width: 140px; height: 140px;
  }
  &.a2 {
    width: 200px; height: 200px;
  }
}

.planet {
  background: white;
  border-radius: 50%;
  z-index: 10;

  &.a1 {
    width: 20px; height: 20px;
    offset-path: circle(70px at center);
    animation: orbit 3s linear infinite;
  }
  &.a2 {
    width: 15px; height: 15px;
    offset-path: circle(100px at center);
    animation: orbit 5s linear infinite;
  }
}

@keyframes orbit {
  from { offset-distance: 0%; }
  to { offset-distance: 100%; }
}
