/* =========================================================
   らんどべる！ プレオープン ご招待状
   ========================================================= */

:root {
  --pink: #f47fa6;
  --pink-deep: #e25d88;
  --pink-soft: #ffd9e6;
  --pink-pale: #fff1f6;
  --lav: #7c84c6;
  --lav-deep: #5f67ad;
  --lav-soft: #e4e7fa;
  --sky: #cfe3f5;
  --gold: #f6cf6e;
  --ink: #5d6080;
  --ink-soft: #8a8ca8;
  --white: #fff;

  --font-jp: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  --font-en: "Quicksand", "Zen Maru Gothic", sans-serif;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  /* 封筒の幅：画面に収まるように */
  --ew: min(86vw, 600px, calc((100svh - 250px) * 1.54));
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font-jp);
  color: var(--ink);
  background: #fff;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.is-loading,
body.is-intro { overflow: hidden; height: 100svh; }

img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
.sp { display: none; }
@media (max-width: 520px) { .sp { display: inline; } }

/* ---------------------------------------------------------
   背景
   --------------------------------------------------------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.bg-checker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 250vmax;
  height: 250vmax;
  margin: -125vmax 0 0 -125vmax;
  background:
    conic-gradient(#fde6ee 0 25%, #fffafc 0 50%, #e9effb 0 75%, #fffafc 0) 0 0 / 150px 150px;
  transform: rotate(45deg);
  opacity: .6;
  animation: checkerDrift 50s linear infinite;
}

.bg-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 42%, rgba(255,255,255,.95), rgba(255,255,255,0) 70%),
    radial-gradient(circle at 12% 18%, rgba(255, 196, 219, .35), transparent 40%),
    radial-gradient(circle at 88% 22%, rgba(196, 210, 250, .35), transparent 42%);
}


@keyframes checkerDrift { from { background-position: 0 0; } to { background-position: 150px 150px; } }

/* 雲：大小の円を密に重ねたタイルを横にリピート */
.bg-clouds {
  --cloud-h: clamp(170px, 30vh, 300px);
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--cloud-h);
}
.cloud-layer {
  position: absolute;
  inset: 0;
  background-repeat: repeat-x;
  background-position: 0 100%;
  background-size: auto 100%;
}
.cloud-far { background-image: url("../img/cloud-far.svg?v=202609231859"); opacity: .9; animation: cloudDrift 160s linear infinite; }
.cloud-back { background-image: url("../img/cloud-back.svg?v=202609231859"); animation: cloudDrift 120s linear infinite reverse; }
.cloud-front {
  background-image: url("../img/cloud-front.svg?v=202609231859");
  filter: drop-shadow(0 -3px 8px rgba(244, 127, 166, .25));
  animation: cloudDrift 90s linear infinite;
}
@keyframes cloudDrift { from { background-position-x: 0; } to { background-position-x: calc(var(--cloud-h) * 5); } }

.fx {
  position: fixed;
  inset: 0;
  z-index: 30;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------------------------------------------------------
   ローディング
   --------------------------------------------------------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background:
    radial-gradient(circle at 50% 45%, #fff 0, #fff4f8 60%, #fde6ef 100%);
  transition: opacity .8s ease, visibility .8s ease;
}
.loader-logo {
  width: min(62vw, 360px);
  animation: loaderBob 2.2s ease-in-out infinite;
  filter: drop-shadow(0 12px 24px rgba(244,127,166,.22));
}
.loader-dots { display: flex; gap: 8px; }
.loader-dots i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--pink);
  animation: dot 1.2s ease-in-out infinite;
}
.loader-dots i:nth-child(2) { background: var(--lav); animation-delay: .15s; }
.loader-dots i:nth-child(3) { background: var(--gold); animation-delay: .3s; }
body:not(.is-loading) .loader { opacity: 0; visibility: hidden; }

@keyframes loaderBob { 50% { transform: translateY(-8px) rotate(-1deg); } }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-8px); opacity: 1; } }

/* ---------------------------------------------------------
   封筒シーン
   --------------------------------------------------------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 4vh, 40px);
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  transition: opacity .9s ease, transform .9s var(--ease-out), visibility .9s;
}
.intro.is-gone {
  opacity: 0;
  visibility: hidden;
  transform: translateY(40px);
  pointer-events: none;
}

.intro-lead {
  margin: 0;
  text-align: center;
  font-weight: 700;
  font-size: clamp(17px, 2.4vw, 22px);
  letter-spacing: .12em;
  color: var(--lav-deep);
  opacity: 0;
  transform: translateY(12px);
}
.intro-lead-small {
  display: block;
  font-family: var(--font-en);
  font-size: .72em;
  font-weight: 600;
  letter-spacing: .4em;
  color: var(--pink);
  margin-bottom: 2px;
}
body.is-intro .intro-lead { animation: fadeUp .9s .9s var(--ease-out) forwards; }

.envelope-wrap {
  perspective: 1400px;
  --tx: 0deg;
  --ty: 0deg;
}

.envelope {
  position: relative;
  display: block;
  width: var(--ew);
  aspect-ratio: 160 / 104;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  outline: none;
  perspective: 1200px;
  transform: rotateX(var(--tx)) rotateY(var(--ty));
  transition: transform .5s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
}
body.is-intro .envelope {
  animation: envDrop 1.3s .2s var(--ease-out) forwards, envFloat 4.2s 1.5s ease-in-out infinite;
}
.envelope.is-open { animation: none !important; opacity: 1; }

.envelope:focus-visible { outline: 3px solid var(--lav); outline-offset: 10px; border-radius: 14px; }

@keyframes envDrop {
  0% { opacity: 0; translate: 0 -90px; rotate: -8deg; }
  55% { opacity: 1; translate: 0 10px; rotate: 3deg; }
  78% { translate: 0 -4px; rotate: -1deg; }
  100% { opacity: 1; translate: 0 0; rotate: 0deg; }
}
@keyframes envFloat {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  50% { translate: 0 -10px; rotate: -.6deg; }
}

.env-shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -9%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(170, 120, 160, .28), transparent 70%);
  filter: blur(6px);
  transform: translateZ(-1px);
}

.env-back {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,0) 40%),
    conic-gradient(from 45deg, #fbe2eb 0 25%, #fff5f8 0 50%, #e5ebfa 0 75%, #fff5f8 0) 0 0 / 22px 22px;
  box-shadow:
    inset 0 0 0 1px rgba(236, 178, 200, .6),
    0 18px 40px rgba(150, 110, 150, .22),
    0 3px 8px rgba(150, 110, 150, .12);
}

.env-card {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 6%;
  z-index: 3;
  aspect-ratio: 4500 / 2550;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 16px rgba(120, 100, 150, .18);
  transition: transform 1s var(--ease-out);
}
.env-card img { width: 100%; height: 100%; object-fit: cover; }

.env-pocket {
  position: absolute;
  inset: 0;
  z-index: 4;
  filter: drop-shadow(0 -1px 1.5px rgba(200, 130, 160, .14));
  pointer-events: none;
}
.env-pocket svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0 0 10px 10px;
  overflow: hidden;
}


.env-address {
  position: absolute;
  left: 7%;
  bottom: 10%;
  display: grid;
  line-height: 1.3;
  text-align: left;
}
.env-address-to {
  font-family: var(--font-en);
  font-weight: 700;
  font-size: calc(var(--ew) * .028);
  letter-spacing: .12em;
  color: var(--pink);
}
.env-address-name {
  font-weight: 700;
  font-size: calc(var(--ew) * .036);
  color: var(--lav-deep);
  border-bottom: 1px dashed rgba(124, 132, 198, .5);
  padding-bottom: 2px;
  max-width: calc(var(--ew) * .45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.env-stamp {
  position: absolute;
  right: 6%;
  bottom: 9%;
  width: 20%;
  aspect-ratio: 1.15;
  display: grid;
  place-items: center;
  padding: 4%;
  background:
    radial-gradient(circle, #fff 60%, transparent 61%) -4px -4px / 8px 8px,
    #fff;
  border: 2px solid #fff;
  outline: 1px dashed #f3b7cb;
  outline-offset: -5px;
  box-shadow: 0 2px 6px rgba(200, 130, 160, .25);
  transform: rotate(4deg);
}
.env-stamp img { width: 100%; }

.env-postmark {
  position: absolute;
  right: 23%;
  bottom: 16%;
  display: grid;
  place-items: center;
  width: calc(var(--ew) * .13);
  aspect-ratio: 1;
  border: 1.5px solid rgba(124, 132, 198, .45);
  border-radius: 50%;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: calc(var(--ew) * .014);
  line-height: 1.35;
  text-align: center;
  color: rgba(95, 103, 173, .6);
  transform: rotate(-14deg);
}

.env-flap {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  width: 100%;
  height: 61.5%;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  transition: transform .85s var(--ease-out);
}
.flap-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flap-face svg { width: 100%; height: 100%; display: block; }
.flap-inner { transform: rotateX(180deg); }

.env-seal {
  position: absolute;
  left: 50%;
  top: 56%;
  z-index: 6;
  width: 15%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 4px 6px rgba(200, 70, 110, .35));
  transition: transform .35s var(--ease-spring);
}
.env-seal svg { width: 100%; height: 100%; }
.env-seal::before {
  /* 呼吸する光の輪 */
  content: "";
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  border: 2px solid rgba(244, 127, 166, .55);
  animation: sealRing 2s ease-out infinite;
}
.envelope:hover .env-seal { transform: translate(-50%, -50%) scale(1.08) rotate(-6deg); }

@keyframes sealRing {
  0% { transform: scale(.8); opacity: .9; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* 開封ステップ */
.envelope.step-seal .env-seal {
  animation: sealPop .55s var(--ease-out) forwards;
}
.envelope.step-seal .env-seal::before { display: none; }
@keyframes sealPop {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  35% { transform: translate(-50%, -50%) scale(1.3) rotate(-10deg); opacity: 1; }
  100% { transform: translate(-50%, -140%) scale(.2) rotate(40deg); opacity: 0; }
}

.envelope.step-flap .env-flap { transform: rotateX(180deg); }
.envelope.step-flap-under .env-flap { z-index: 2; }

.envelope.step-card .env-card { transform: translateY(-62%); }
.envelope.step-hide .env-card { visibility: hidden; }

.intro-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  box-shadow: 0 6px 20px rgba(200, 130, 170, .18), inset 0 0 0 1px rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .12em;
  color: var(--pink-deep);
  opacity: 0;
  transition: opacity .4s ease;
}
.hint-icon { display: inline-block; animation: heartBeat 1.4s ease-in-out infinite; }
body.is-intro .intro-hint { animation: fadeUp .8s 1.5s var(--ease-out) forwards; }
.intro.is-opening .intro-hint,
.intro.is-opening .intro-lead { animation: none; opacity: 0; transition: opacity .3s ease; }

@keyframes heartBeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.3); } 30% { transform: scale(1); } 45% { transform: scale(1.18); } }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* ---------------------------------------------------------
   開封後のページ
   --------------------------------------------------------- */
.letter {
  position: relative;
  z-index: 11;
  display: none;
  padding: calc(20px + env(safe-area-inset-top)) 16px calc(180px + env(safe-area-inset-bottom));
}
body.is-open .letter { display: block; }

.letter-head {
  display: flex;
  justify-content: center;
  padding: 8px 0 18px;
}
.letter-logo {
  width: min(52vw, 240px);
  filter: drop-shadow(0 8px 18px rgba(244,127,166,.2));
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .8s ease, transform .8s var(--ease-out);
}
body.is-revealed .letter-logo { opacity: 1; transform: none; }

.hero {
  display: grid;
  justify-items: center;
  gap: 18px;
  margin-bottom: clamp(40px, 8vh, 72px);
}
.hero-card-wrap {
  width: min(100%, 1000px);
  perspective: 1200px;
}
.hero-card {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  position: relative;
  width: 100%;
  aspect-ratio: 4500 / 2550;
  border-radius: clamp(10px, 1.6vw, 18px);
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 30px 60px -20px rgba(130, 100, 160, .35),
    0 10px 24px rgba(200, 130, 170, .16),
    0 0 0 1px rgba(255,255,255,.9);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-origin: 50% 50%;
  transition: transform .5s var(--ease-out), box-shadow .5s ease;
  visibility: hidden;
  will-change: transform;
}
.hero-card.is-visible { visibility: visible; }
.hero-card.is-flying { transition: transform 1.1s var(--ease-out); transform-origin: 0 0; }
.hero-card img { width: 100%; height: 100%; object-fit: cover; }

.hero-card-holo {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.55), transparent 38%),
    linear-gradient(115deg, transparent 20%, rgba(255, 190, 220, .18) 38%, rgba(190, 210, 255, .2) 52%, rgba(255, 240, 190, .16) 64%, transparent 80%);
  background-size: 100% 100%, 220% 220%;
  background-position: 0 0, var(--mx) var(--my);
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}
.hero-card:hover .hero-card-holo { opacity: 1; }

.hero-card-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.75) 48%, transparent 60%);
  transform: translateX(-120%);
  pointer-events: none;
}
.hero-card.is-shine .hero-card-shine { animation: shine 1.4s .1s var(--ease-out) forwards; }
@keyframes shine { to { transform: translateX(120%); } }

.hero-caption {
  margin: 4px 0 0;
  font-weight: 700;
  font-size: clamp(15px, 2vw, 18px);
  letter-spacing: .14em;
  color: var(--lav-deep);
  text-align: center;
}

/* reveal */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s ease, transform .9s var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ブロック共通 */
.block {
  position: relative;
  width: min(100%, 760px);
  margin: 0 auto clamp(28px, 5vh, 44px);
  padding: clamp(28px, 5vw, 44px) clamp(20px, 5vw, 48px);
  border-radius: 28px;
  background: rgba(255, 255, 255, .82);
  box-shadow:
    0 20px 50px -24px rgba(150, 110, 170, .35),
    inset 0 0 0 1px rgba(255,255,255,.95),
    0 0 0 6px rgba(255, 235, 243, .55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
}
.block::before, .block::after {
  /* 角のきらきら */
  content: "✦";
  position: absolute;
  font-size: 18px;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(246, 207, 110, .7);
}
.block::before { top: 14px; left: 18px; }
.block::after { right: 18px; bottom: 12px; color: var(--pink); font-size: 14px; text-shadow: 0 0 8px rgba(244,127,166,.5); }

.block-eyebrow {
  margin: 0;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .42em;
  color: var(--pink);
}
.block-title {
  margin: 4px 0 22px;
  font-size: clamp(20px, 3.2vw, 26px);
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--lav-deep);
}

/* カウントダウン */
.cd-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 2vw, 16px);
}
.cd-cell {
  display: grid;
  gap: 2px;
  padding: clamp(12px, 2.6vw, 20px) 4px clamp(10px, 2vw, 14px);
  border-radius: 20px;
  background: linear-gradient(180deg, #fff, #fff4f8);
  box-shadow: 0 8px 18px -10px rgba(226, 93, 136, .45), inset 0 0 0 1.5px #ffdce8;
}
.cd-num {
  font-family: var(--font-en);
  font-weight: 700;
  font-size: clamp(30px, 7vw, 56px);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--pink) 10%, var(--lav) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cd-num.tick { animation: tick .45s var(--ease-spring); }
@keyframes tick { 0% { transform: translateY(-6px) scale(1.12); opacity: .4; } 100% { transform: none; opacity: 1; } }
.cd-label {
  font-family: var(--font-en);
  font-weight: 600;
  font-size: clamp(9px, 1.6vw, 12px);
  letter-spacing: .2em;
  color: var(--ink-soft);
}
.cd-status {
  margin: 0;
  padding: 18px 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff0f5, #eef1fd);
  font-weight: 700;
  font-size: clamp(17px, 3vw, 22px);
  letter-spacing: .08em;
  color: var(--pink-deep);
}
.cd-bar {
  position: relative;
  height: 10px;
  margin: 26px 6px 10px;
  border-radius: 99px;
  background: #f3eef6;
  box-shadow: inset 0 1px 2px rgba(120, 100, 150, .15);
}
.cd-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb7cf, var(--pink), var(--lav));
  transition: width 1.6s var(--ease-out);
}
.cd-bar-star {
  position: absolute;
  right: -8px;
  top: 50%;
  translate: 0 -50%;
  font-style: normal;
  font-size: 22px;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(246, 207, 110, .9);
  animation: twinkle 1.8s ease-in-out infinite;
}
@keyframes twinkle { 50% { transform: scale(1.25) rotate(20deg); } }
.cd-note { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); letter-spacing: .06em; }

/* 登校方法 */
.step-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}
.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(90deg, #fff5f9, #f5f6fe);
  box-shadow: inset 0 0 0 1px #fbe3ec;
}
.step-no {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffa3c3, var(--pink-deep));
  color: #fff;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 6px 12px -4px rgba(226, 93, 136, .6);
}
.step:nth-child(2) .step-no { background: linear-gradient(135deg, #aeb4ec, var(--lav-deep)); box-shadow: 0 6px 12px -4px rgba(95,103,173,.6); }
.step:nth-child(3) .step-no { background: linear-gradient(135deg, #ffd98c, #eab04a); box-shadow: 0 6px 12px -4px rgba(234,176,74,.6); }
.step h3 { margin: 2px 0 2px; font-size: 16px; font-weight: 700; color: var(--lav-deep); letter-spacing: .04em; }
.step p { margin: 0; font-size: 14px; color: var(--ink-soft); }

.notes {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: left;
}
.notes li::before { content: "※ "; color: var(--pink); }

/* ボタン */
.actions {
  display: grid;
  gap: 12px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding-top: 0;
  padding-bottom: 0;
}
.actions::before, .actions::after { display: none; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px 26px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .08em;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition: transform .25s var(--ease-spring), box-shadow .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:focus-visible { outline: 3px solid var(--lav); outline-offset: 3px; }

.btn-primary {
  min-height: 62px;
  color: #fff;
  font-size: 17px;
  background: linear-gradient(135deg, #ff9fc0 0%, var(--pink) 45%, #b08be0 100%);
  box-shadow: 0 14px 28px -12px rgba(226, 93, 136, .75), inset 0 -3px 0 rgba(0,0,0,.08), inset 0 2px 0 rgba(255,255,255,.35);
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: btnShine 3.6s 1s ease-in-out infinite;
}
@keyframes btnShine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.btn-primary span:first-child { white-space: nowrap; }
@media (max-width: 420px) {
  .btn { letter-spacing: .03em; padding-inline: 18px; }
  .btn-primary { font-size: 15px; }
}
.btn-arrow { transition: transform .25s var(--ease-out); }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

.btn-ghost {
  color: var(--lav-deep);
  background: rgba(255,255,255,.9);
  box-shadow: 0 8px 20px -12px rgba(95, 103, 173, .5), inset 0 0 0 1.5px #dfe2f7;
}
.btn-small { min-height: 46px; padding: 8px 20px; font-size: 14px; color: #fff; background: linear-gradient(135deg, #ff9fc0, var(--pink-deep)); box-shadow: 0 8px 16px -8px rgba(226, 93, 136, .7); }

.actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .actions-row { grid-template-columns: 1fr; } }

.letter-foot {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-top: 36px;
  font-family: var(--font-en);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--ink-soft);
}
.letter-foot p { margin: 0; }
.replay {
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--pink-deep);
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .08em;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 5px;
}

/* トースト */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 40;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(95, 103, 173, .92);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  transform: translate(-50%, 20px);
  opacity: 0;
  transition: opacity .3s ease, transform .3s var(--ease-out);
  pointer-events: none;
  white-space: nowrap;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* 動き：OSの「アニメーション効果オフ」に関係なく常に再生する */

/* 拡大表示 */
.hero-card { cursor: zoom-in; }
.zoom-hint {
  margin: -6px 0 0;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--ink-soft);
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(255, 244, 248, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s;
  cursor: zoom-out;
}
.lightbox.is-show { opacity: 1; visibility: visible; }
.lightbox img {
  width: min(96vw, 1600px);
  border-radius: 14px;
  box-shadow: 0 30px 60px -20px rgba(130, 100, 160, .45);
  transform: scale(.94);
  transition: transform .45s var(--ease-out);
}
.lightbox.is-show img { transform: none; }
@media (orientation: portrait) and (max-width: 700px) {
  /* 縦画面では横向きにして大きく表示 */
  .lightbox img {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(86svh, calc((100vw - 32px) * 1.76));
    max-width: none;
    transform: translate(-50%, -50%) rotate(90deg) scale(.94);
  }
  .lightbox.is-show img { transform: translate(-50%, -50%) rotate(90deg); }
}
.lightbox-close {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--pink-deep);
  font-size: 22px;
  box-shadow: 0 6px 16px rgba(200, 130, 170, .3);
  cursor: pointer;
}

/* ---------------------------------------------------------
   招待ID ゲート
   --------------------------------------------------------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 70px 16px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
body.is-gate { overflow: hidden; height: 100svh; }
body.is-gate .gate,
body.is-unlocking .gate { display: grid; }

.gate-card {
  position: relative;
  width: min(100%, 420px);
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 78px clamp(22px, 6vw, 40px) 26px;
  border-radius: 32px;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 214, 229, .55), transparent 55%),
    rgba(255, 255, 255, .9);
  box-shadow:
    0 34px 70px -30px rgba(150, 110, 170, .55),
    inset 0 0 0 1px #fff,
    0 0 0 8px rgba(255, 235, 243, .65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-align: center;
  animation: gateIn .9s var(--ease-spring) both;
}
.gate-card::before {
  /* チケットのような点線の縁 */
  content: "";
  position: absolute;
  inset: 10px;
  border: 1.5px dashed rgba(244, 127, 166, .35);
  border-radius: 24px;
  pointer-events: none;
}
.gate-card::after {
  content: "✦  ♡  ✦";
  position: absolute;
  bottom: -30px;
  left: 50%;
  translate: -50% 0;
  font-size: 14px;
  letter-spacing: .5em;
  color: var(--pink);
  opacity: .7;
}
@keyframes gateIn {
  from { opacity: 0; transform: translateY(30px) scale(.94); }
  to { opacity: 1; transform: none; }
}

/* 南京錠 */
.gate-lock {
  position: absolute;
  top: -62px;
  left: 50%;
  width: 112px;
  translate: -50% 0;
  animation: lockFloat 3.2s ease-in-out infinite;
  filter: drop-shadow(0 12px 16px rgba(226, 93, 136, .35));
}
.gate-lock svg { display: block; width: 100%; overflow: visible; }
.lock-shackle { transform-origin: 86px 66px; transition: transform .6s var(--ease-spring); }
.lock-heart { transform-origin: 60px 95px; animation: heartBeat 1.6s ease-in-out infinite; }
.lock-glow {
  position: absolute;
  left: 50%;
  top: 68%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  translate: -50% -50%;
  background: radial-gradient(circle, rgba(255,255,255,.95), rgba(255, 214, 229, .6) 40%, transparent 70%);
  opacity: 0;
  pointer-events: none;
}
@keyframes lockFloat { 50% { translate: -50% -6px; } }

.gate-eyebrow { margin: 0; font-family: var(--font-en); font-weight: 700; font-size: 11px; letter-spacing: .42em; color: var(--pink); }
.gate-title { margin: 0; font-size: clamp(19px, 4.8vw, 23px); font-weight: 700; letter-spacing: .08em; color: var(--lav-deep); }
.gate-text { margin: 0 0 10px; font-size: 13px; line-height: 1.8; color: var(--ink-soft); letter-spacing: .06em; }

.gate-field { position: relative; width: 100%; }
.gate-key {
  position: absolute;
  left: 16px;
  top: 50%;
  translate: 0 -50%;
  width: 20px;
  height: 20px;
  color: var(--pink);
  pointer-events: none;
}
.gate-key svg, .gate-eye svg { width: 100%; height: 100%; display: block; }
.gate-field input {
  width: 100%;
  padding: 15px 52px 15px 46px;
  border: 1.5px solid #f6d3e0;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, #fff8fb);
  box-shadow: inset 0 2px 4px rgba(226, 93, 136, .06);
  font: inherit;
  font-family: var(--font-en), var(--font-jp);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .08em;
  color: var(--lav-deep);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.gate-field input::placeholder { color: #c9c3d6; font-weight: 500; }
.gate-field input:focus { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(244,127,166,.18), inset 0 2px 4px rgba(226, 93, 136, .06); }
.gate-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  translate: 0 -50%;
  width: 38px;
  height: 38px;
  padding: 9px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--lav);
  opacity: .6;
  cursor: pointer;
  transition: opacity .2s, background .2s;
}
.gate-eye:hover { opacity: 1; background: var(--lav-soft); }

.gate-remember { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); cursor: pointer; user-select: none; }
.gate-remember input { accent-color: var(--pink); width: 16px; height: 16px; margin: 0; }

.gate-submit { width: 100%; margin-top: 4px; }
.gate-submit:disabled { cursor: wait; }
body.is-checking .gate-submit-text::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "・"; } 50% { content: "・・"; } 75% { content: "・・・"; } }

.gate-error { min-height: 1.4em; margin: 0; font-size: 13px; font-weight: 700; color: var(--pink-deep); }
.gate-logo { width: min(46%, 150px); margin-top: 2px; opacity: .9; }

/* 間違い */
.gate-card.is-shake { animation: shake .5s ease; }
.gate-card.is-shake .gate-lock { animation: lockNo .5s ease; }
@keyframes shake { 20% { translate: -8px 0; } 40% { translate: 7px 0; } 60% { translate: -5px 0; } 80% { translate: 3px 0; } }
@keyframes lockNo { 25% { rotate: -10deg; } 50% { rotate: 8deg; } 75% { rotate: -4deg; } }

/* 解錠アニメーション */
body.is-unlocking .gate-lock { animation: lockPop .7s var(--ease-spring) forwards; }
body.is-unlocking .lock-shackle { transform: translateY(-16px) rotate(28deg); }
body.is-unlocking .lock-heart { animation: none; }
body.is-unlocking .lock-glow { animation: glow 1s ease-out forwards; }
body.is-unlocking .gate-card > :not(.gate-lock) { transition: opacity .35s ease; opacity: .0; }
body.is-unlocking .gate-card {
  animation: cardAway 1.1s .55s var(--ease-out) forwards;
  box-shadow: 0 0 0 8px rgba(255, 235, 243, .65), 0 0 60px rgba(255, 179, 205, .8);
}
body.is-unlocking .gate-card::before,
body.is-unlocking .gate-card::after { opacity: 0; transition: opacity .3s; }
@keyframes lockPop {
  0% { translate: -50% 0; scale: 1; }
  40% { translate: -50% 40px; scale: 1.35; }
  100% { translate: -50% 90px; scale: 1.5; }
}
@keyframes glow {
  0% { opacity: 0; scale: .4; }
  40% { opacity: 1; scale: 3; }
  100% { opacity: 0; scale: 9; }
}
@keyframes cardAway {
  0% { opacity: 1; transform: none; filter: none; }
  100% { opacity: 0; transform: scale(1.12); filter: blur(8px); }
}
