/* ぱぴぷぺぽん あそびサイト（試作） */
:root {
  --teal: #37bfbe;
  --teal-dark: #2aa5a3;
  --cream: #fff8ec;
  --ink: #20424e;
  --accent: #ff9f43;
  --accent-dark: #e8890c;
  --pink: #f48fb1;
  --radius: 20px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP",
    "Yu Gothic UI", sans-serif;
  background: linear-gradient(180deg, #bdeffb 0%, #eafbff 45%, #fff8ec 100%);
  color: var(--ink);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  text-align: center;
  padding: 22px 12px 6px;
}
.site-header h1 {
  margin: 0;
  font-size: clamp(22px, 5.4vw, 34px);
  letter-spacing: 0.04em;
  color: var(--ink);
}
.subtitle { margin: 4px 0 0; color: #4a7a88; font-size: 14px; }

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 14px 30px;
}

.panel {
  background: #ffffff;
  border: 3px solid var(--teal);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: 0 6px 0 rgba(42, 165, 163, 0.25);
}

.gate-lead { font-size: 20px; text-align: center; margin: 4px 0 16px; }

#gate-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
#code-input {
  font: inherit;
  font-size: 20px;
  padding: 12px 14px;
  border: 3px solid var(--teal);
  border-radius: 14px;
  width: min(300px, 72vw);
  text-align: center;
  background: var(--cream);
  color: var(--ink);
}
#gate-button, .big-action {
  font: inherit;
  font-size: 20px;
  font-weight: bold;
  padding: 12px 26px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--accent-dark);
  cursor: pointer;
}
#gate-button:active, .big-action:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--accent-dark);
}

.gate-message {
  text-align: center;
  min-height: 1.6em;
  color: #c62828;
  font-size: 17px;
  margin: 12px 0 0;
}

.for-parents {
  margin-top: 18px;
  background: var(--cream);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.7;
}
.for-parents h2 { font-size: 15px; margin: 2px 0 6px; }
.for-parents ul { margin: 0; padding-left: 1.2em; }

.menu-lead { text-align: center; font-size: 20px; margin: 6px 0 16px; }
.menu-buttons {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .menu-buttons { grid-template-columns: repeat(3, 1fr); }
}
.menu-card {
  font: inherit;
  background: #ffffff;
  border: 3px solid var(--teal);
  border-radius: var(--radius);
  padding: 18px 12px 14px;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(42, 165, 163, 0.25);
  color: var(--ink);
}
.menu-card:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(42,165,163,.25); }
.menu-card .icon { font-size: 40px; display: block; }
.menu-card .name { font-size: 20px; font-weight: bold; display: block; margin-top: 6px; }
.menu-card .desc { font-size: 13.5px; color: #4a7a88; display: block; margin-top: 6px; line-height: 1.5; }
.menu-foot { text-align: center; margin-top: 18px; }

.linklike {
  font: inherit;
  background: none;
  border: none;
  color: #2a7f8f;
  text-decoration: underline;
  cursor: pointer;
  font-size: 15px;
  padding: 6px;
}

.stage-head { display: flex; align-items: center; gap: 10px; }
.stage-head h2 { margin: 0; font-size: 22px; }
.stage-intro { font-size: 16.5px; line-height: 1.6; margin: 8px 0 12px; }
.stage-message {
  text-align: center;
  font-size: 19px;
  font-weight: bold;
  min-height: 1.5em;
  margin: 12px 0 4px;
  color: #d35400;
}
.stage-actions { text-align: center; margin-top: 8px; }

/* あそび共通の舞台 */
.scene {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 3px solid rgba(32, 66, 78, 0.15);
  background: #dff6ff;
  user-select: none;
  touch-action: manipulation;
}
.scene svg { display: block; width: 100%; height: auto; }
.scene .layer { position: absolute; inset: 0; }
.scene .layer svg { width: 100%; height: 100%; }

/* おきろ、ぽ！ */
.okiro-wrap { text-align: center; }
.okiro-po {
  width: min(300px, 68vw);
  margin: 4px auto 0;
  position: relative;
  transition: transform 0.18s ease;
}
.okiro-po svg { width: 100%; height: auto; display: block; }
.okiro-po.sleeping { animation: breathe 2.6s ease-in-out infinite; }
.okiro-po.bump { transform: scale(1.05); }
.okiro-po.awake { animation: jump 0.7s ease; }
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
@keyframes jump {
  0% { transform: translateY(0); }
  35% { transform: translateY(-34px) scale(1.04); }
  70% { transform: translateY(0); }
  85% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}
.zzz {
  position: absolute;
  top: 2%;
  right: 8%;
  font-size: 30px;
  color: #5b8dd9;
  font-weight: bold;
  animation: zfloat 2.2s ease-in-out infinite;
}
@keyframes zfloat {
  0% { transform: translateY(6px) rotate(-6deg); opacity: 0.5; }
  50% { transform: translateY(-8px) rotate(6deg); opacity: 1; }
  100% { transform: translateY(6px) rotate(-6deg); opacity: 0.5; }
}
.stars { font-size: 26px; letter-spacing: 0.18em; margin: 10px 0 2px; min-height: 1.4em; }
.stars .on { color: var(--accent-dark); }
.stars .off { color: #cfd8dc; }
.float-note {
  position: absolute;
  font-size: 30px;
  color: #d35400;
  font-weight: bold;
  pointer-events: none;
  animation: rise 1s ease-out forwards;
}
@keyframes rise {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-90px); opacity: 0; }
}

/* おとあつめ */
.orb {
  position: absolute;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(32, 66, 78, 0.3);
  color: #ffffff;
  font-size: 30px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: bob 2.4s ease-in-out infinite;
  transition: left 0.65s ease-in, top 0.65s ease-in, transform 0.65s ease-in, opacity 0.65s ease-in;
  z-index: 3;
}
@keyframes bob {
  0%, 100% { margin-top: -34px; }
  50% { margin-top: -28px; }
}
.orb.collected { transform: scale(0.25); opacity: 0.35; }
.ponta-box {
  position: absolute;
  left: 50%;
  bottom: 1.5%;
  width: 92px;
  margin-left: -46px;
  z-index: 2;
  pointer-events: none;
}
.ponta-box svg { width: 100%; height: auto; display: block; }
.pocket-count {
  text-align: center;
  font-size: 18px;
  margin-top: 10px;
}
.pocket-count .dot { font-size: 22px; letter-spacing: 0.15em; }

/* 『も』をさがせ */
.mo {
  position: absolute;
  width: 72px;
  margin-left: -36px;
  margin-top: -30px;
  z-index: 2;
  transition: transform 0.45s ease;
  pointer-events: none;
}
.mo svg { width: 100%; height: auto; display: block; }
.mo.wiggle { animation: wiggle 0.6s ease; }
.mo.found { transform: translateY(-46%) scale(1.25); }
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-7deg); }
  75% { transform: rotate(7deg); }
}
.scene .front-layer { z-index: 3; pointer-events: none; }
.celebrate-star {
  position: absolute;
  font-size: 34px;
  color: var(--accent-dark);
  pointer-events: none;
  animation: rise 1.2s ease-out forwards;
  z-index: 5;
}

.site-footer {
  text-align: center;
  color: #4a7a88;
  font-size: 12.5px;
  padding: 10px 12px 26px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
