:root {
  --ink: #fff1dc;
  --gold: #ffc27a;
  --amber: #ff9a3c;
  --deep: #120803;
  --glow: 0 0 6px rgba(255, 170, 90, .85), 0 0 22px rgba(255, 130, 40, .55), 0 0 48px rgba(255, 110, 20, .3);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--deep);
  color: var(--ink);
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

#sky {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  display: block;
}

.page {
  position: relative; z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) auto;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px calc(env(safe-area-inset-bottom, 0px) + 14px);
}

/* ---------- ロゴ ---------- */
.brand { text-align: center; pointer-events: none; user-select: none; }
.tagline {
  margin: 0 0 2px;
  font-family: "Klee One", "Zen Maru Gothic", serif;
  font-size: clamp(12px, 3.4vw, 15px);
  letter-spacing: .18em;
  color: #ffe2bf;
  text-shadow: 0 0 10px rgba(255, 150, 60, .7);
  opacity: 0; animation: rise 1.4s .2s ease-out forwards;
}
.logo {
  margin: 0;
  font-family: "Cinzel", "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(40px, 13vw, 68px);
  line-height: 1.05;
  letter-spacing: .12em;
  padding-left: .12em;
  color: #fff4e2;
  text-shadow: var(--glow);
  opacity: 0; animation: rise 1.6s .05s ease-out forwards, breathe 5s 2s ease-in-out infinite;
}
.sub {
  margin: 2px 0 0;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-family: "Cinzel", serif;
  font-size: clamp(11px, 3.2vw, 14px);
  letter-spacing: .42em;
  padding-left: .42em;
  color: #ffe6c7;
  text-shadow: 0 0 8px rgba(255, 150, 60, .8);
  opacity: 0; animation: rise 1.4s .45s ease-out forwards;
}
.sub span { display: block; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, #ffcf98); }
.sub span:last-child { transform: scaleX(-1); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes breathe { 50% { text-shadow: 0 0 8px rgba(255, 190, 110, .95), 0 0 30px rgba(255, 140, 50, .7), 0 0 64px rgba(255, 110, 20, .4); } }

/* ---------- 3Dの舞台 ---------- */
.scene {
  position: relative;
  min-height: 300px;
  touch-action: none;           /* 混ぜる操作中にページがスクロールしない */
  user-select: none; -webkit-user-select: none;
  cursor: grab;
}
.scene.dragging { cursor: grabbing; }
.scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#fx { pointer-events: none; }
#gl { opacity: 0; transition: opacity 1.6s ease; -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%); }
#gl.ready { opacity: 1; }

.hint {
  position: absolute; left: 0; right: 0; bottom: 4px;
  margin: 0; text-align: center; pointer-events: none;
  font-family: "Klee One", "Zen Maru Gothic", serif;
  font-size: clamp(13px, 3.8vw, 16px);
  letter-spacing: .08em;
  color: #fff0dc;
  text-shadow: 0 0 10px rgba(255, 140, 40, .9), 0 1px 2px rgba(0, 0, 0, .8);
  transition: opacity .6s ease, transform .6s ease;
}
.hint .hint-text { display: inline-block; animation: hintPulse 3.2s ease-in-out infinite; }
.hint.swap { opacity: 0; transform: translateY(6px); }
@keyframes hintPulse { 50% { opacity: .62; } }

.fallback { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px; }
.fallback p { margin: 0; text-shadow: var(--glow); }
.fb-open { font-family: "Cinzel", serif; letter-spacing: .2em; font-size: 22px; }
.fb-date { font-size: 34px; font-weight: 700; }
.fb-place { font-size: 24px; font-weight: 700; }

/* ---------- メール登録 ---------- */
.signup {
  width: 100%; max-width: 440px; margin: 0 auto;
  text-align: center;
  padding-top: 6px;
}
.lead {
  margin: 0 0 10px;
  font-size: clamp(13px, 3.7vw, 15px);
  font-weight: 700;
  letter-spacing: .06em;
  color: #fff0dc;
  text-shadow: 0 0 10px rgba(255, 140, 40, .8);
}
form {
  display: flex; gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(30, 14, 6, .62);
  border: 1px solid rgba(255, 190, 120, .45);
  box-shadow: 0 0 0 1px rgba(255, 150, 60, .08), 0 0 24px rgba(255, 120, 30, .18), inset 0 0 18px rgba(255, 140, 50, .08);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: box-shadow .6s ease, border-color .6s ease;
}
.signup.callout form {
  border-color: rgba(255, 210, 150, .9);
  animation: callout 1.8s ease-in-out 3;
}
@keyframes callout { 50% { box-shadow: 0 0 0 4px rgba(255, 170, 80, .18), 0 0 40px rgba(255, 140, 40, .55), inset 0 0 18px rgba(255, 140, 50, .14); } }
.field { flex: 1; min-width: 0; display: flex; }
input[type=email] {
  flex: 1; min-width: 0;
  font: inherit; font-size: 16px; /* iOSでズームされないよう16px */
  color: #fff6ea;
  background: transparent;
  border: 0; outline: none;
  padding: 10px 6px 10px 16px;
}
input[type=email]::placeholder { color: rgba(255, 225, 190, .55); }
button {
  flex: none;
  font: inherit; font-size: 15px; font-weight: 700; letter-spacing: .1em;
  color: #2a1204;
  border: 0; border-radius: 999px;
  padding: 10px 20px;
  background: linear-gradient(180deg, #ffe0b0, #ffb45e 55%, #f08f2e);
  box-shadow: 0 0 16px rgba(255, 150, 50, .55), inset 0 1px 0 rgba(255, 255, 255, .6);
  cursor: pointer;
  transition: transform .15s ease, filter .2s ease, opacity .2s;
}
button:active { transform: scale(.96); }
button:disabled { opacity: .6; cursor: default; }
button.loading .btn-label { animation: hintPulse 1s ease-in-out infinite; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.msg { min-height: 1.4em; margin: 8px 0 0; font-size: 13.5px; line-height: 1.5; color: #ffe2bf; }
.msg.ok { color: #fff3d6; text-shadow: 0 0 10px rgba(255, 170, 70, .9); }
.msg.err { color: #ffc0a0; }
.note { margin: 2px 0 0; font-size: 11px; color: rgba(255, 225, 195, .55); letter-spacing: .05em; }
.signup.done form { display: none; }

@media (min-width: 700px) {
  .page { grid-template-rows: auto minmax(420px, 1fr) auto; }
}
@media (prefers-reduced-motion: reduce) {
  .logo, .hint .hint-text { animation: none; opacity: 1; }
}
