/* Styles for the six games with AI inside. */
.detail-chip { display: inline-block; background: var(--sticky); border-radius: 999px; padding: 4px 12px; font-family: var(--font-hand); font-size: 1.1rem; animation: pop-in 0.4s var(--ease-pop) both; }
.detail-chip:nth-child(2) { animation-delay: 0.08s; }
.detail-chip:nth-child(3) { animation-delay: 0.16s; }
.detail-chip:nth-child(4) { animation-delay: 0.24s; }
.linkish { border: 0; background: none; color: var(--ink-soft); text-decoration: underline; cursor: pointer; font: inherit; }

/* ---------- moon animal maker ---------- */
.g-moon .moon-stage { background: #121838; }
.g-moon .moon-name {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: var(--paper); color: var(--navy);
  font-family: var(--font-title); font-weight: 700; font-size: 1.2rem; padding: 6px 16px; border-radius: 999px; box-shadow: var(--shadow);
}

/* ---------- what-if machine ---------- */
.g-whatif .machine {
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; background: linear-gradient(180deg, #bc3824, #8f2a1c);
  border-radius: 26px; padding: 18px; box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.2), var(--shadow);
}
.g-whatif .reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.g-whatif .reel { display: grid; gap: 6px; justify-items: center; }
.g-whatif .reel-label { font-family: var(--font-title); font-weight: 700; color: var(--gold-hi); letter-spacing: 0.1em; font-size: 0.85rem; }
.g-whatif .reel-window {
  width: 100%; height: 64px; overflow: hidden; border-radius: 14px; background: var(--paper); position: relative;
  box-shadow: inset 0 8px 10px -6px rgba(0, 0, 0, 0.35), inset 0 -8px 10px -6px rgba(0, 0, 0, 0.35);
}
.g-whatif .reel-strip { will-change: transform; }
.g-whatif .reel-item { height: 64px; display: grid; place-items: center; text-align: center; padding: 0 8px; font-family: var(--font-hand); font-size: 1.15rem; line-height: 1.1; color: var(--ink); }
.g-whatif .reel-lock { border: 0; border-radius: 999px; padding: 4px 10px; background: rgba(255, 250, 242, 0.85); font-family: var(--font-title); font-size: 0.8rem; cursor: pointer; }
.g-whatif .reel-lock[aria-pressed='true'] { background: var(--gold-hi); }
.g-whatif .lever { position: relative; width: 64px; height: 150px; border: 0; background: none; cursor: pointer; }
.g-whatif .lever::before { content: ''; position: absolute; left: 28px; top: 30px; width: 8px; height: 100px; border-radius: 4px; background: #d9d9d9; transform-origin: 50% 100%; transition: transform 0.25s; }
.g-whatif .lever-knob { position: absolute; left: 14px; top: 8px; width: 36px; height: 36px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3c4, var(--gold-hi) 45%, var(--gold)); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); transition: transform 0.25s; }
.g-whatif .lever-text { position: absolute; left: 0; right: 0; bottom: 0; font-family: var(--font-title); font-weight: 700; color: var(--cream); }
.g-whatif .lever.pulled .lever-knob { animation: lever-pull 0.6s var(--ease-pop); }
.g-whatif .lever.pulled::before { animation: lever-stick 0.6s var(--ease-pop); }
@keyframes lever-pull { 40% { transform: translateY(70px); } }
@keyframes lever-stick { 40% { transform: scaleY(0.35); } }
.g-whatif .kind-row { display: flex; flex-wrap: wrap; gap: 8px; }
.g-whatif .kind { border: 3px solid #e6dcc8; background: #fff; border-radius: 999px; padding: 8px 16px; cursor: pointer; font-family: var(--font-title); font-weight: 600; color: var(--navy); }
.g-whatif .kind[aria-checked='true'] { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.g-whatif .whatif-shelf { display: flex; flex-wrap: wrap; gap: 8px; }
.g-whatif .shelf-item { background: #efe5d2; border-radius: 12px; padding: 6px 12px; font-family: var(--font-hand); font-size: 1.05rem; }

/* ---------- groove escape ---------- */
.g-groove .stem { font-family: var(--font-hand); font-size: clamp(1.8rem, 4vw, 2.5rem); text-align: center; margin: 10px 0; color: var(--navy); }
.g-groove .words { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; align-items: center; }
.g-groove .word-chip {
  border: 0; border-radius: 16px; padding: 8px 18px; background: var(--sticky); cursor: pointer; font-family: var(--font-title); font-weight: 600;
  color: var(--navy); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15); transition: transform 0.2s var(--ease-pop);
}
.g-groove .word-chip:hover:not([disabled]) { transform: translateY(-4px) rotate(-2deg); }
.g-groove .word-chip.picked { background: var(--gold-hi); transform: scale(1.12); }
.g-groove .bars { display: grid; gap: 6px; max-width: 460px; margin: 14px auto 0; }
.g-groove .bar-row { display: grid; grid-template-columns: 80px 1fr 44px; gap: 10px; align-items: center; font-family: var(--font-title); }
.g-groove .bar { height: 16px; border-radius: 999px; background: #eee3cf; overflow: hidden; }
.g-groove .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); border-radius: 999px; transition: width 1s var(--ease-pop); }
.g-groove .groove-main { display: grid; gap: 12px; }
.groove-meter { display: flex; align-items: center; gap: 10px; font-family: var(--font-title); font-size: 0.9rem; color: var(--ink-soft); margin: 6px 0; }
.meter-track { position: relative; flex: 1; height: 14px; border-radius: 999px; background: linear-gradient(90deg, #8ba446, #f4c652, #bc3824); }
.meter-track i { position: absolute; top: -6px; width: 6px; height: 26px; border-radius: 3px; background: var(--navy); transform: translateX(-50%); animation: needle 1s var(--ease-pop) both; }
@keyframes needle { from { opacity: 0; transform: translateX(-50%) scaleY(0.2); } }

/* ---------- solar system ---------- */
.g-solar .solar-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(240px, 1fr); gap: 18px; align-items: start; }
.g-solar .solar-stage {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; cursor: crosshair; overflow: hidden;
  background: radial-gradient(circle, #2b2f6b, #121838 70%); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.08), var(--shadow);
}
.g-solar .orbit {
  position: absolute; left: 50%; top: 50%; width: calc(var(--r) * 100%); height: calc(var(--r) * 100%); transform: translate(-50%, -50%);
  border: 2px dashed rgba(255, 255, 255, 0.22); border-radius: 50%; pointer-events: none;
}
.g-solar .orbit-dust { border-style: dotted; border-color: rgba(255, 255, 255, 0.15); }
.g-solar .orbit-spin { position: absolute; inset: 0; animation: spin-slow var(--dur) linear infinite; }
.g-solar .orbiter { position: absolute; left: 50%; top: 50%; transform: rotate(var(--a)) translateX(calc(var(--r) * 50cqw)) rotate(calc(-1 * var(--a))); }
.g-solar .solar-stage { container-type: inline-size; }
.g-solar .orbit-label {
  pointer-events: auto; translate: -50% -50%; display: block; max-width: 120px; border: 0; border-radius: 12px; padding: 4px 8px; cursor: pointer;
  font-family: var(--font-hand); font-size: 0.95rem; line-height: 1.1; background: var(--paper); color: var(--ink); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  animation: spin-slow var(--dur) linear infinite reverse;
}
.g-solar .orbit-planet .orbit-label { background: #ffd6a8; }
.g-solar .orbit-moon .orbit-label { background: #e3e7f2; }
.g-solar .orbit-asteroid .orbit-label { background: #d9c7a8; font-size: 0.85rem; }
.g-solar .orbit-dust .orbit-label { background: rgba(255, 255, 255, 0.55); font-size: 0.8rem; }
.g-solar .sun {
  position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff3c4, var(--gold-hi) 45%, var(--gold)); box-shadow: 0 0 40px rgba(244, 198, 82, 0.8);
  display: grid; place-items: center; text-align: center; animation: sun-pulse 3s ease-in-out infinite;
}
.g-solar .sun > span:first-child { font-size: 1.6rem; color: #fff; }
.g-solar .sun-label { position: absolute; inset: 12%; display: grid; place-items: center; font-family: var(--font-hand); font-size: 0.85rem; line-height: 1.05; color: var(--navy); }
.g-solar .solar-stage.celebrate .sun { animation: sun-pulse 0.8s ease-in-out 3, sun-pulse 3s 2.4s ease-in-out infinite; }
@keyframes sun-pulse { 50% { box-shadow: 0 0 70px rgba(244, 198, 82, 1); transform: translate(-50%, -50%) scale(1.06); } }
.g-solar .idea-tray { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; }
.g-solar .idea-chip { border: 3px solid #e6dcc8; border-radius: 14px; background: #fff; padding: 6px 12px; cursor: pointer; font-family: var(--font-hand); font-size: 1.1rem; transition: transform 0.2s var(--ease-pop); animation: pop-in 0.4s var(--ease-pop) both; }
.g-solar .idea-chip.selected { border-color: var(--gold); background: var(--sticky); transform: scale(1.06) rotate(-2deg); }
.g-solar .zone-btns { display: grid; gap: 6px; margin-top: 12px; }
.g-solar .zone-btn { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border: 0; border-radius: 12px; padding: 8px 12px; background: #efe5d2; cursor: pointer; text-align: left; }
.g-solar .zone-btn small { color: var(--ink-soft); font-size: 0.85rem; }
.g-solar .compare { margin: 8px 0 0; padding-left: 1.1em; font-size: 0.98rem; }
.g-solar .compare .match { color: var(--grass); font-weight: 700; }

/* ---------- question flipper ---------- */
.g-flipper .flip-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: start; }
.g-flipper .flip-well {
  --level: 0; position: relative; height: 300px; border-radius: 30px 30px 90px 90px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 110%, #6b4fd6, #2b2f6b 55%, #121838); box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}
.g-flipper .well-glow { position: absolute; left: 50%; bottom: -40px; width: 160px; height: 160px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, rgba(130, 240, 242, 0.5), transparent 70%); animation: twinkle 3s ease-in-out infinite; }
.g-flipper .ledge { position: absolute; left: 20%; right: 20%; bottom: calc(var(--i) * 22% + 10px); height: 10px; border-radius: 6px; background: #8a6a3f; box-shadow: 0 4px 0 #5a4630; }
.g-flipper .ledge:nth-child(odd) { left: 26%; right: 14%; }
.g-flipper .flip-marble {
  position: absolute; left: 50%; bottom: calc(var(--level) * 22% + 20px); width: 34px; height: 34px; margin-left: -17px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #b48cff 40%, #6b3fc4); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
  transition: bottom 0.7s var(--ease-pop);
}
.g-flipper .flip-marble.jump { animation: hop 0.7s var(--ease-pop); }
.g-flipper .well-rim { position: absolute; top: 10px; left: 0; right: 0; text-align: center; font-family: var(--font-title); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.12em; color: var(--gold-hi); }
.g-flipper .flip-well.escaped .flip-marble { bottom: calc(100% - 50px); box-shadow: 0 0 30px rgba(244, 198, 82, 1); }
.g-flipper .flip-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.g-flipper .flip-tool { display: grid; gap: 2px; text-align: left; border: 3px solid #e6dcc8; background: #fff; border-radius: 16px; padding: 10px; cursor: pointer; transition: transform 0.2s var(--ease-pop); }
.g-flipper .flip-tool:hover { transform: translateY(-3px); }
.g-flipper .flip-tool[aria-checked='true'] { border-color: var(--navy); background: #eef0ff; }
.g-flipper .flip-tool .icon { font-size: 1.6rem; }
.g-flipper .flip-tool small { color: var(--ink-soft); font-size: 0.82rem; line-height: 1.25; }
.g-flipper .flip-card { perspective: 1000px; min-height: 150px; }
.g-flipper .flip-inner { position: relative; min-height: 150px; transform-style: preserve-3d; transition: transform 0.9s var(--ease-pop); }
.g-flipper .flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.g-flipper .flip-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 20px; padding: 16px 20px; display: grid; align-content: center; box-shadow: var(--shadow); }
.g-flipper .flip-face p { margin: 4px 0 0; font-family: var(--font-hand); font-size: clamp(1.3rem, 3vw, 1.7rem); line-height: 1.2; }
.g-flipper .flip-face small { font-family: var(--font-title); font-weight: 600; opacity: 0.8; }
.g-flipper .front { background: #e6e0d4; color: var(--ink-soft); }
.g-flipper .back { background: var(--navy); color: var(--cream); transform: rotateY(180deg); }
.g-flipper .back small { color: var(--gold-hi); }
.g-flipper .flip-history { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; font-family: var(--font-hand); font-size: 1.15rem; color: var(--ink-soft); }

/* ---------- north star ---------- */
.g-north .ns-stage { background: linear-gradient(180deg, #121838, #2b2f6b 70%, #6a4a85); min-height: 260px; display: grid; align-items: end; }
.g-north .ns-sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.g-north .ns-form { position: relative; z-index: 1; display: grid; gap: 10px; padding: 18px; }
.g-north .ns-form textarea { resize: vertical; font-family: var(--font-hand); font-size: 1.35rem; background: rgba(255, 250, 242, 0.95); }
.g-north .ns-card { width: 100%; height: auto; border-radius: 16px; margin-top: 8px; box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3); animation: rise-in 0.7s var(--ease-pop); }

@media (max-width: 760px) {
  .g-solar .solar-layout, .g-flipper .flip-layout { grid-template-columns: 1fr; }
  .g-flipper .flip-well { height: 220px; }
  .g-whatif .machine { grid-template-columns: 1fr; }
  .g-whatif .lever { width: 100%; height: 60px; }
  .g-whatif .lever::before, .g-whatif .lever-knob { display: none; }
  .g-whatif .lever-text { position: static; display: block; background: var(--gold-hi); color: var(--navy); border-radius: 999px; padding: 12px; }
}
