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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  font-family: "Nunito", system-ui, sans-serif;
  color: #2d1b45;
  background: #fff7f2;
}

.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.star {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #f4c4d4;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  opacity: 0.7;
  animation: twinkle 3.6s ease-in-out infinite;
}

.s1 { top: 12%; left: 14%; width: 12px; height: 12px; }
.s2 { top: 18%; right: 16%; animation-delay: 0.6s; }
.s3 { top: 28%; left: 8%; width: 7px; height: 7px; animation-delay: 1.2s; }
.s4 { top: 36%; right: 10%; animation-delay: 1.8s; }
.s5 { top: 48%; left: 18%; width: 8px; height: 8px; animation-delay: 0.3s; }
.s6 { top: 62%; right: 20%; animation-delay: 2.1s; }
.s7 { top: 72%; left: 12%; width: 11px; height: 11px; animation-delay: 0.9s; }
.s8 { top: 80%; right: 14%; animation-delay: 1.5s; }
.s9 { top: 8%; left: 46%; width: 6px; height: 6px; animation-delay: 2.4s; }
.s10 { bottom: 10%; left: 42%; animation-delay: 0.4s; }
.s11 { top: 22%; left: 72%; width: 8px; height: 8px; animation-delay: 1.1s; }
.s12 { bottom: 22%; right: 38%; width: 7px; height: 7px; animation-delay: 2.8s; }

.planet {
  position: absolute;
  overflow: visible;
  opacity: 0.45;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 0.25s, filter 0.25s, transform 0.25s;
}

.planet svg {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.planet:hover {
  opacity: 1;
  filter: brightness(1.08);
  transform: scale(1.06);
}

.planet-a {
  width: min(220px, 42vw);
  top: 6%;
  right: 3%;
}

.planet-b {
  width: min(140px, 28vw);
  top: 38%;
  left: 3%;
}

.planet-c {
  width: min(92px, 20vw);
  top: 56%;
  right: 14%;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 0.9; transform: scale(1.08); }
}

.page {
  position: relative;
  z-index: 1;
  width: min(40rem, calc(100% - 3rem));
  padding-top: 2.6rem;
  text-align: center;
  pointer-events: none;
}

.page a {
  pointer-events: auto;
}

.top-bar {
  position: relative;
  z-index: 2;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 1.2rem;
  background: #f4d4dc;
  overflow: visible;
}

.top-bar-home {
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  overflow: visible;
}

.top-bar-home svg {
  display: block;
  width: 52px;
  height: 52px;
  margin: -8px 0 0 -4px;
  overflow: visible;
  transition: transform 0.25s, filter 0.25s;
}

.top-bar-home:hover svg {
  transform: scale(1.12);
  filter: brightness(1.08);
}

.top-bar-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
}

.top-bar-links button {
  font: inherit;
  font-weight: 600;
  color: #7a4a62;
  background: transparent;
  border: 0;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

.top-bar-links button[aria-selected="true"] {
  color: #2d1b45;
  background: rgba(255, 255, 255, 0.72);
}

#about .intro + .intro {
  margin-top: 0.8rem;
}

.panel-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 600;
  font-style: italic;
  margin-bottom: 0.8rem;
}

.portrait {
  display: block;
  width: min(11rem, 46vw);
  height: min(11rem, 46vw);
  margin: 0 auto 1.1rem;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  box-shadow: 0 0 0 4px #fff7f2, 0 0 0 6px #f4c4d4;
}

.hello {
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
  color: #6d5a7a;
}

h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: 600;
  font-style: italic;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.intro {
  font-size: 1.15rem;
  line-height: 1.6;
  color: #6d5a7a;
}

.games {
  margin-top: 2rem;
}

.games h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
  color: #6d5a7a;
}

.game-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.game {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 5.4rem;
  padding: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 20px rgba(180, 120, 140, 0.1);
  text-decoration: none;
  color: #2d1b45;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.game:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(180, 120, 140, 0.16);
}

.game img,
.game span {
  grid-area: 1 / 1;
}

.game img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.25s;
}

.game span {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  transition: opacity 0.25s;
}

.game:hover span {
  opacity: 0;
}

.game:hover img {
  opacity: 1;
}

.mini-game {
  position: relative;
  z-index: 1;
  align-self: stretch;
  width: 100%;
  margin-top: 3rem;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.mini-game canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  background: transparent;
  touch-action: none;
}

.mini-ground {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.4rem;
  background: #f4d4dc;
  color: #7a4a62;
}

.mini-copy {
  text-align: left;
}

.mini-game h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
  color: #2d1b45;
}

.mini-hint {
  margin: 0;
  font-size: 0.85rem;
}

.mini-scores {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 1.4rem;
  row-gap: 0.1rem;
  text-align: left;
}

.mini-score {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .game-list {
    grid-template-columns: 1fr;
  }

  .game {
    min-height: 4.6rem;
  }
}
