/* 色は SPEC §5.1 の名前で使う(ひるの組だけ。よるは P1 の 1-5)。値をじかに書くのはこの :root だけ */
:root {
  --sm-bg: #FFFFFF; --sm-surface: #FFFFFF; --sm-surface-2: #F6F3EC; --sm-line: #D9D5CC; --sm-control-border: #8A8F9C;
  --sm-text: #1F2430; --sm-text-2: #5B6170; --sm-primary: #C62828; --sm-on-primary: #FFFFFF; --sm-primary-pressed: #A51F1F;
  --sm-error: #B3261E; --sm-success: #2E7D32; --sm-link: #1A5FB4; --sm-focus: #1A5FB4;
  --sm-scrim: rgba(15, 26, 58, 0.72); --sm-santa-red: #C62828; --sm-track: #D9D5CC; --sm-santa-gold: #FFC107;
  /* 切り取りの画面はいつも黒(SPEC §5.4)。箱の絵の色は昼夜で変えない */
  --sm-crop-bg: #111111; --sm-crop-panel: #333333; --sm-crop-line: #555555; --sm-crop-chip: #666666; --sm-crop-text: #FFFFFF; --sm-crop-text-2: #CCCCCC; --sm-crop-on: #66E08A; --sm-crop-focus: #4C9FFE; --sm-crop-keep: #66E08A; --sm-crop-drop: #FFD54F; --sm-crop-ink: #111111;
  --sm-box-lid: #D32F2F; --sm-warm: #FFF8E1; --sm-warm-line: #F0C36D; --sm-gold-soft: #FFD54F; --sm-secret-bg: #3A1B1B;
  --sm-sky-day: #16234A; --sm-sky-night: #1A2A5C; --sm-night-0: #0D1634; --sm-night-1: #1A2A5C; --sm-night-2: #2A3C72; --sm-star: #FFE9A8; --sm-cream: #F4F1E8; --sm-white: #FFFFFF; --sm-checker-a: #D9D9D9; --sm-checker-b: #F4F4F4;
  --sm-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  --sm-font: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  --sm-ease: cubic-bezier(.2, 0, 0, 1); --sm-pop: cubic-bezier(.2, 1.4, .4, 1);
  font-family: var(--sm-font);
}
/* よるの組(SPEC §5.1。端末の時刻 18:00〜6:00 で html に data-look="night" を付ける)。箱・切り取りの色は昼夜で変えない */
:root[data-look="night"] {
  --sm-bg: #0F1A3A; --sm-surface: #1A2A5C; --sm-surface-2: #24376F; --sm-line: #3A4C86; --sm-control-border: #7F8FC4;
  --sm-text: #F4F1E8; --sm-text-2: #B9C2DE; --sm-primary: #FFC107; --sm-on-primary: #1A1A1A; --sm-primary-pressed: #E0A800;
  --sm-error: #FF8A80; --sm-success: #81C995; --sm-link: #9CC3FF; --sm-focus: #9CC3FF; --sm-track: #3A4C86;
  --sm-scrim: rgba(5, 10, 28, 0.78); --sm-checker-b: #24376F; --sm-checker-a: #1A2A5C;
}
:root { transition: none; }
body { background: var(--sm-bg); color: var(--sm-text); transition: background-color 400ms var(--sm-ease), color 400ms var(--sm-ease); }
@media (prefers-reduced-motion: reduce) { body { transition: none; } }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; color: var(--sm-text); -webkit-text-size-adjust: 100%; }
#map { position: fixed; inset: 0; }
[hidden] { display: none !important; }

.btn { font: inherit; font-size: 16px; font-weight: 700; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--sm-control-border); background: var(--sm-surface); color: var(--sm-text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.btn.primary { background: var(--sm-primary); border-color: var(--sm-primary); color: var(--sm-on-primary); }
.btn.primary:active { background: var(--sm-primary-pressed); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 48px; padding: 0 12px; font-size: 14px; }
.btn:disabled { background: var(--sm-surface-2); color: var(--sm-text-2); border-color: transparent; cursor: default; opacity: 1; }

.maplibregl-ctrl-bottom-right { bottom: 22px; }

.gift .pager { display: flex; align-items: center; gap: 14px; color: var(--sm-crop-text); font-size: 16px; }
.gift .pager .count { min-width: 3em; text-align: center; }
.gift:not(.open) .pager { display: none; }
.gift { touch-action: pan-y; }
.present-row { display: flex; align-items: center; gap: 12px; min-height: 64px; margin-bottom: 8px; }
.present-row img { max-height: 80px; max-width: 120px; background: repeating-conic-gradient(#ddd 0 25%, var(--sm-bg) 0 50%) 0 0 / 14px 14px; border-radius: 8px; }

.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: rgba(30,30,30,.92); color: var(--sm-bg); padding: 10px 18px; border-radius: 20px; z-index: 50; font-size: 14px; max-width: calc(100% - 32px); text-align: center; }

/* 地図の上の印 */
.santa { width: 112px; height: 56px; cursor: pointer; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.santa .bob { width: 100%; height: 100%; animation: bob 2.4s ease-in-out infinite; }
.santa img { width: 100%; height: 100%; display: block; transition: transform .25s ease; -webkit-user-drag: none; }
.santa.west img { transform: scaleX(-1); }
@keyframes bob { 0%, 100% { transform: translateY(2px) rotate(-1.2deg); } 50% { transform: translateY(-3px) rotate(1.2deg); } }
@media (prefers-reduced-motion: reduce) { .santa .bob { animation: none; } .santa img { transition: none; } }

/* プレゼントの箱の演出 */
.gift { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 30; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px; padding: 16px; }
.gift .box { position: relative; width: 240px; height: 240px; cursor: pointer; }
.gift .img { max-width: min(80vw, 420px); max-height: 52vh; display: none; }
.gift.open .box { display: none; }
.gift.open .img, .gift.open .secret { display: block; }
.gift .tap { color: var(--sm-crop-text); font-size: 16px; }
.gift.open .tap { display: none; }

/* 切り取りの画面 */
.crop { position: fixed; inset: 0; z-index: 40; background: var(--sm-crop-bg); color: var(--sm-crop-text); display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.crop .top, .crop .bottom { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.crop .top h2 { flex: 1; margin: 0; font-size: 18px; }
.crop .tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 4px 12px; }
.crop .chip { font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 16px; border: 1px solid var(--sm-crop-chip); background: transparent; color: var(--sm-crop-text); cursor: pointer; }
.crop .chip.on { background: var(--sm-crop-text); color: var(--sm-crop-bg); font-weight: 700; }
.crop .sw { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-left: auto; cursor: pointer; }
.crop .sw input { appearance: none; -webkit-appearance: none; position: relative; width: 44px; height: 26px; margin: 0; border-radius: 13px; background: var(--sm-crop-chip); cursor: pointer; transition: background .2s; }
.crop .sw input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--sm-crop-text); transition: transform .2s; }
.crop .sw input:checked { background: var(--sm-crop-on); }
.crop .sw input:checked::after { transform: translateX(18px); }
.crop .sw input:focus-visible { outline: 3px solid var(--sm-crop-focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .crop .sw input, .crop .sw input::after { transition: none; } }
.crop .view { flex: 1; min-height: 0; position: relative; touch-action: none; }
.crop canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.crop .msg { font-size: 13px; color: var(--sm-crop-text-2); padding: 4px 12px; min-height: 1.4em; }
.crop .bottom .btn { flex: 1; }
.crop .btn { background: var(--sm-crop-panel); color: var(--sm-crop-text); border-color: var(--sm-crop-line); }
.crop .btn.primary { background: var(--sm-primary); border-color: var(--sm-primary); color: var(--sm-on-primary); }
.crop .busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.5); font-size: 16px; z-index: 2; }

/* W7 複数プレゼント: 横に流れる帯(art/mock/gifts 案 A)。1 個のときは使わない */
.gift .strip { display: none; position: relative; width: 100%; height: min(52vh, 110vw); overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.gift.open .strip { display: block; }
.gift .strip .it { position: absolute; left: 50%; top: 50%; object-fit: contain; will-change: transform; cursor: pointer; -webkit-user-drag: none; }
.gift .strip.anim .it { transition: transform .38s cubic-bezier(.2,.9,.3,1.15), filter .38s, opacity .38s; }
.gift .dots { display: none; justify-content: center; gap: 4px; }
.gift.open .dots { display: flex; }
.gift .dots button { width: 48px; height: 48px; padding: 0; border: 0; background: none; cursor: pointer; }
.gift .dots button::after { content: ""; display: block; width: 10px; height: 10px; margin: auto; border-radius: 50%; background: rgba(255,255,255,.35); transition: transform .2s, background .2s; }
.gift .dots button[aria-current="true"]::after { background: var(--sm-gold-soft); transform: scale(1.3); }
.gift .pager .btn { min-height: 48px; min-width: 48px; }
@media (prefers-reduced-motion: reduce) { .gift .strip.anim .it, .gift .dots button::after { transition: none; } }

/* W8 シークレット: 到着の紙ふぶき(短い) */
.gift .confetti { position: absolute; left: 50%; top: 45%; width: 10px; height: 14px; border-radius: 2px; pointer-events: none; z-index: 40; animation: confetti 1.3s ease-out forwards; }
@keyframes confetti { from { opacity: 1; transform: translate(0, 0) rotate(0); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); } }
@media (prefers-reduced-motion: reduce) { .gift .confetti { display: none; } }

/* W11 スタートのサンタの家(見本 art/mock/house 案 2)。タップは地図に通す */
.house { position: relative; pointer-events: none; --u: 1px; z-index: 1; }
.santa { z-index: 2; }
.house .main { position: absolute; inset: 0; width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.house .puff { position: absolute; pointer-events: none; opacity: 0; animation: puff 3.9s linear infinite; animation-delay: var(--dl); }
@keyframes puff {
  0% { opacity: 0; transform: translate(0, 0) scale(.45); }
  12% { opacity: .95; }
  70% { opacity: .55; }
  100% { opacity: 0; transform: translate(calc(var(--u) * 9), calc(var(--u) * -26)) scale(1.3); }
}
@media (prefers-reduced-motion: reduce) { .house .puff { animation: none; opacity: var(--so); transform: translate(calc(var(--u) * var(--sx)), calc(var(--u) * var(--sy))) scale(var(--ss)); } }

/* W13 背景消しで残す物が無いときの札 */
.crop .empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 80%; padding: 14px 20px; border-radius: 16px; background: rgba(0,0,0,.78); border: 1px solid var(--sm-crop-chip); color: var(--sm-crop-text); font-size: 16px; font-weight: 700; text-align: center; white-space: pre-line; pointer-events: none; z-index: 2; }
.crop .btn:disabled { opacity: .4; cursor: default; }

/* JavaScript が動かないときの題と文(SPEC §8) */
.noscript { position: fixed; inset: 0; z-index: 100; background: var(--sm-bg); color: var(--sm-text); padding: 32px 16px; text-align: center; }
.noscript h1 { font-size: 22px; margin: 0 0 12px; }

/* ---- 字(SPEC §5.2) ---- */
.t-display { font-size: 32px; line-height: 40px; font-weight: 700; margin: 0; text-align: center; }
.t-title { font-size: 22px; line-height: 30px; font-weight: 700; margin: 0 0 8px; }
.t-headline { font-size: 18px; line-height: 26px; font-weight: 700; margin: 0; }
.t-sub { font-size: 16px; line-height: 24px; font-weight: 700; margin: 20px 0 8px; }
.t-body { font-size: 16px; line-height: 24px; margin: 0 0 8px; }
.t-note { font-size: 14px; line-height: 20px; color: var(--sm-text-2); margin: 6px 0 12px; }
.center { text-align: center; }
.sm-screen :focus-visible, .dialog :focus-visible, .notice :focus-visible, .toast :focus-visible { outline: 3px solid var(--sm-focus); outline-offset: 2px; }

/* ---- 画面の骨組み(地図の画面の上に重なる) ---- */
.sm-screen { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; background: var(--sm-bg); color: var(--sm-text); word-break: auto-phrase; line-break: strict; }
.sm-bar { flex: none; min-height: 56px; display: flex; align-items: center; gap: 4px; padding: env(safe-area-inset-top) 8px 0; border-bottom: 1px solid var(--sm-line); }
.sm-bar h1 { flex: 1; }
.icon-btn { width: 48px; height: 48px; flex: none; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 22px; cursor: pointer; }
.sm-step { font-size: 14px; color: var(--sm-text-2); padding-right: 8px; }
.sm-body { flex: 1; min-height: 0; overflow-y: auto; width: 100%; max-width: 640px; margin: 0 auto; }
.sm-pad { padding: 16px; }
.sm-foot { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--sm-line); background: var(--sm-bg); width: 100%; max-width: 640px; margin: 0 auto; }
.sm-foot .t-note { margin: 0; }
.btn.big { min-height: 56px; font-size: 18px; width: 100%; }
.btn.thin { background: var(--sm-surface); color: var(--sm-text); border-color: var(--sm-control-border); }
.btn.wide { width: 100%; }
.btn.text { background: none; border-color: transparent; color: var(--sm-link); }
.err { margin: 8px 0 0; color: var(--sm-error); font-size: 14px; line-height: 20px; font-weight: 700; }
.err::before { content: "!"; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-right: 6px; border-radius: 50%; border: 2px solid currentColor; font-size: 12px; }

/* 出し方の部品(SPEC §3.16) */
.toast { display: flex; align-items: center; gap: 8px; }
.toast-act { font: inherit; font-weight: 700; min-height: 48px; padding: 0 8px; border: 0; background: none; color: var(--sm-gold-soft); cursor: pointer; }
.notice { position: fixed; left: 12px; right: 12px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60; margin: auto; max-width: 560px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 16px; border-radius: 20px; background: var(--sm-surface); color: var(--sm-text); border: 1.5px solid var(--sm-error); box-shadow: var(--sm-shadow); }
.notice span { flex: 1 1 100%; font-size: 16px; line-height: 24px; }
.dialog { position: fixed; inset: 0; z-index: 70; background: var(--sm-scrim); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog-card { width: 100%; max-width: 420px; background: var(--sm-surface); color: var(--sm-text); border-radius: 24px; padding: 20px 16px; display: flex; flex-direction: column; gap: 8px; }
.dialog-buttons { display: flex; gap: 12px; margin-top: 8px; }
.dialog-buttons .btn { flex: 1; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* ---- 3.2 場所をえらぶ ---- */
.place-box { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--sm-surface-2); }
#place-map { position: absolute; inset: 0; }
.center-pin { position: absolute; left: 50%; top: 50%; width: 52px; height: 60px; transform: translate(-50%, -90%); transition: transform .15s; pointer-events: none; z-index: 3; }
.center-pin.house { width: auto; height: 60px; transform: translate(-48%, -88%); }
.center-pin.lifted { transform: translate(-50%, calc(-90% - 8px)); }
.center-pin.house.lifted { transform: translate(-48%, calc(-88% - 8px)); }
.fab { position: absolute; right: 16px; bottom: 28px; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--sm-surface); color: var(--sm-text); box-shadow: var(--sm-shadow); display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 4; }
.fab.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.place-attrib { position: absolute; right: 4px; bottom: 2px; margin: 0; font-size: 12px; line-height: 16px; padding: 0 6px; border-radius: 4px; background: var(--sm-surface); color: var(--sm-text); opacity: .85; z-index: 4; }
.place-maperr { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; width: min(80%, 320px); padding: 16px; border-radius: 20px; background: var(--sm-surface); box-shadow: var(--sm-shadow); text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.place-panel { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--sm-bg); border-top: 1px solid var(--sm-line); width: 100%; max-width: 640px; margin: 0 auto; }
.place-hint { min-height: 48px; margin: 0; }
@media (prefers-reduced-motion: reduce) { .fab.busy svg { animation: none; } .center-pin { transition: none; } }

/* ---- 3.3 日時 ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 48px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--sm-control-border); background: var(--sm-surface); color: var(--sm-text); font: inherit; font-size: 16px; cursor: pointer; }
.chip[aria-checked="true"] { background: var(--sm-primary); color: var(--sm-on-primary); border-color: var(--sm-primary); font-weight: 700; }
.chip[aria-checked="true"]::before { content: "✓ "; }
.chip small { font-size: 13px; font-weight: 400; }
.field { display: block; min-height: 48px; margin-top: 8px; padding: 0 12px; font: inherit; font-size: 16px; border-radius: 12px; border: 1.5px solid var(--sm-control-border); background: var(--sm-surface); color: var(--sm-text); }
.summary { margin-top: 20px; padding: 14px 16px; border-radius: 20px; background: var(--sm-surface-2); font-size: 16px; line-height: 24px; }
.summary .btn.text { min-height: 48px; padding: 0 8px; }

/* ---- 3.1 ようこそ(絵は仮: いまのそりの絵を紺の地に) ---- */
.hero { flex: none; height: min(66.7vw, 40%); min-height: 140px; position: relative; overflow: hidden; container-type: inline-size; background: url(img/welcome-day.svg) center bottom / cover no-repeat, var(--sm-sky-day); }
:root[data-look="night"] .hero { background: url(img/welcome-night.svg) center bottom / cover no-repeat, var(--sm-sky-night); }
.hero-sleigh { position: absolute; left: 0; top: 22%; width: 140px; height: auto; animation: fly 8s linear infinite; }
@keyframes fly { 0% { transform: translate(-150px, 24px) rotate(-4deg); } 50% { transform: translate(calc(50cqw - 70px), 0) rotate(0); } 100% { transform: translate(100cqw, 16px) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .hero-sleigh { animation: none; left: 30.5cqw; } }
.app-name { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--sm-text-2); letter-spacing: .08em; }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 16px; line-height: 24px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--sm-primary); color: var(--sm-on-primary); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* ---- 3.4 プレゼント ---- */
.gift-list { list-style: none; margin: 12px 0 8px; padding: 0; }
.gift-list li { display: flex; align-items: center; gap: 8px; min-height: 72px; border-bottom: 1px solid var(--sm-line); }
.gift-list .no { flex: none; width: 22px; text-align: center; font-weight: 700; }
.thumb { flex: none; width: 56px; height: 56px; border-radius: 12px; object-fit: contain; background: repeating-conic-gradient(var(--sm-checker-a) 0 25%, var(--sm-checker-b) 0 50%) 0 0 / 14px 14px; }
.thumb.q { background: var(--sm-secret-bg); display: flex; align-items: center; justify-content: center; color: var(--sm-santa-gold); font-size: 28px; font-weight: 800; }
.gift-list .nm { flex: 1; min-width: 0; font-size: 16px; }
.gift-list .nm small { display: block; font-size: 14px; color: var(--sm-text-2); }
.ib { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: none; color: var(--sm-text); font-size: 20px; cursor: pointer; }
.ib[data-off] { visibility: hidden; }
.privacy { margin-top: 20px; }
.btn.wide + .t-note { margin-top: 4px; }

/* ---- 3.5 できた ---- */
.center-col { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; }
.done-star { width: 88px; height: 88px; border-radius: 50%; background: var(--sm-surface-2); color: var(--sm-santa-gold); font-size: 52px; display: flex; align-items: center; justify-content: center; }

/* ---- 3.6 地図(子どもの画面)の札・ボタン・著作権表示 ---- */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.card { position: fixed; top: max(12px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); right: 140px; max-width: 420px; z-index: 5; padding: 10px 16px 12px; border-radius: 20px; background: color-mix(in srgb, var(--sm-surface) 96%, transparent); color: var(--sm-text); box-shadow: var(--sm-shadow); font-variant-numeric: tabular-nums; word-break: auto-phrase; line-break: strict; }
.card p { margin: 0; }
.card .c1 { font-size: 15px; line-height: 20px; }
.card .c2 { font-size: 22px; line-height: 30px; font-weight: 700; }
.card .c3 { font-size: 14px; line-height: 20px; color: var(--sm-text-2); }
.card.big1 .c1 { font-size: 22px; line-height: 30px; font-weight: 700; }
.card.pop { animation: pop 250ms var(--sm-pop); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
.adult { position: fixed; top: max(12px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); z-index: 6; height: 56px; min-width: 56px; padding: 0 16px; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; background: var(--sm-surface); color: var(--sm-text); box-shadow: var(--sm-shadow); font: inherit; font-size: 18px; font-weight: 700; cursor: pointer; }
.adult::before { content: ""; position: absolute; inset: -4px; } /* 押せる範囲は 56×56 以上 */
.adult-t { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.adult-t b { font-size: 18px; }
.adult-t small { font-size: 12px; font-weight: 400; color: var(--sm-text-2); }
.adult:focus-visible, .btn:focus-visible { outline: 3px solid var(--sm-focus); outline-offset: 2px; }
.bar { position: fixed; left: 16px; right: 16px; bottom: max(28px, calc(env(safe-area-inset-bottom) + 28px)); display: flex; flex-direction: column; align-items: center; gap: 12px; z-index: 5; pointer-events: none; }
.bar .btn { pointer-events: auto; }
.bar-main { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.ad-banner { position: relative; pointer-events: auto; width: min(468px, 100%); }
.ad-banner[hidden] { display: none; }
.ad-banner a, .ad-banner img { display: block; width: 100%; height: auto; aspect-ratio: 468 / 60; }
.ad-banner .ad-tag { position: absolute; left: 4px; top: -14px; font-size: 10px; line-height: 12px; color: var(--sm-text-2, #444); background: color-mix(in srgb, var(--sm-surface) 80%, transparent); padding: 0 4px; border-radius: 3px; }
.bar-main #see { margin-top: 0; }
#see { width: auto; max-width: 100%; padding: 0 28px; box-shadow: var(--sm-shadow); }
.btn.round { border-radius: 999px; box-shadow: var(--sm-shadow); }
.attrib { position: fixed; right: 4px; bottom: 2px; font-size: 12px; line-height: 16px; background: color-mix(in srgb, var(--sm-surface) 80%, transparent); color: var(--sm-text); padding: 0 6px; border-radius: 4px; z-index: 6; }
.maplibregl-ctrl-top-right { top: 50%; transform: translateY(-50%); }
@media (prefers-reduced-motion: reduce) { .card.pop { animation: none; } }

/* 見出しに移したフォーカス(画面を開いたとき)は、押せる物ではないので枠を出さない。ボタン・欄の枠は残す */
.sm-screen h1[tabindex="-1"]:focus, .sm-screen h1[tabindex="-1"]:focus-visible { outline: none; }
/* 重なり: 下の帯・本文を上にし、かざり(絵・星・番号)はタップを通す */
.sm-body { position: relative; z-index: 1; }
.sm-foot, .sm-bar, .place-panel { position: relative; z-index: 2; }
.hero, .done-star, .num, .steps { pointer-events: none; }

/* ---- 3.7 箱と帯(W0-8) ---- */
.gift { background: var(--sm-scrim); }
.gift .close-x { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--sm-white); color: var(--sm-night-0); font-size: 22px; font-weight: 700; cursor: pointer; z-index: 45; }
.gift .tap { color: var(--sm-white); font-size: 22px; font-weight: 700; }
.gift .cap { display: none; margin: 0; color: var(--sm-white); font-size: 20px; line-height: 28px; font-weight: 700; text-align: center; }
.gift.open .cap { display: block; }
.gift .count { display: none; margin: 0; color: var(--sm-white); font-size: 16px; }
.gift.open .count { display: block; }
.gift .pager { display: none; align-items: center; justify-content: center; gap: 8px; }
.gift.open .pager { display: flex; }
.gift:not(.open) .pager { display: none; }
.gift .pager .btn { min-height: 48px; min-width: 96px; background: var(--sm-white); color: var(--sm-night-0); border-color: transparent; font-size: 16px; padding: 0 12px; }
.gift .dots { display: flex; gap: 0; }
.gift.open .dots { display: flex; }
.gift .dots button::after { width: 10px; height: 10px; background: color-mix(in srgb, var(--sm-white) 60%, transparent); }
.gift .dots button[aria-current="true"]::after { width: 12px; height: 12px; background: var(--sm-santa-gold); transform: none; }
.gift .box { cursor: pointer; animation: box-wiggle 2.5s ease-in-out infinite; }
.gift.open .box { animation: none; }
@keyframes box-wiggle { 0%, 80%, 100% { transform: rotate(0); } 86% { transform: rotate(-3deg); } 92% { transform: rotate(3deg); } }
.gift :focus-visible { outline: 3px solid var(--sm-santa-gold); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .gift .box { animation: none; } }

/* ---- 3.8 到着の祝いの幕(W0-8) ---- */
.arrive { position: fixed; inset: 0; z-index: 35; background: var(--sm-scrim); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); overflow: hidden; }
.arrive .a-title { text-wrap: balance; margin: 0; color: var(--sm-white); font-size: 32px; line-height: 40px; font-weight: 700; text-align: center; }
.arrive .a-open { width: min(100%, 320px); }
.arrive .a-box { display: block; position: relative; width: 168px; height: 168px; animation: a-drop 900ms var(--sm-pop) both, a-wobble 2.5s ease-in-out 900ms infinite; }
@keyframes a-drop { from { transform: translateY(-60vh); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes a-wobble { 0%, 80%, 100% { transform: rotate(0); } 86% { transform: rotate(-4deg); } 92% { transform: rotate(4deg); } }
.arrive.calm .a-box { animation: a-fade 150ms ease-out both; }
@keyframes a-fade { from { opacity: 0; } to { opacity: 1; } }
.a-confetti { position: absolute; inset: 0; pointer-events: none; }
.a-confetti i { position: absolute; top: -16px; width: 10px; height: 14px; border-radius: 2px; animation: a-fall var(--d) ease-in var(--dl) both; }
@keyframes a-fall { from { transform: translate(0, 0) rotate(0); opacity: 1; } to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); opacity: 1; } }
.arrive :focus-visible { outline: 3px solid var(--sm-santa-gold); outline-offset: 3px; }

/* 着いたあと、そりはゆれずに止まる(1 回だけ小さくはねる) */
.santa.arrived .bob { animation: arrive-hop 500ms var(--sm-pop) 1 both; }
@keyframes arrive-hop { 0% { transform: translateY(0); } 40% { transform: translateY(-8px); } 100% { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .santa.arrived .bob { animation: none; } }

/* ---- 3.9 設定の確かめ ---- */
.adult { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.adult::after { content: ""; position: absolute; inset: -4px; padding: 4px; border-radius: 999px; background: conic-gradient(var(--sm-santa-gold) calc(var(--hold, 0) * 1turn), color-mix(in srgb, var(--sm-santa-gold) 25%, transparent) 0); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); pointer-events: none; opacity: 0; }
.adult.holding::after { opacity: 1; }
.adult.flash::after { animation: adult-flash 600ms ease-out; }
@keyframes adult-flash { 0% { opacity: 0; } 30% { opacity: .9; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .adult.holding { background: var(--sm-santa-gold); color: var(--sm-night-0); } .adult.holding::after { opacity: 0; } .adult.flash::after { animation: none; } }
.adult-hint { position: fixed; top: calc(max(12px, env(safe-area-inset-top)) + 66px); right: max(16px, env(safe-area-inset-right)); z-index: 6; max-width: 15em; margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--sm-surface); color: var(--sm-text); font-size: 13px; line-height: 18px; box-shadow: var(--sm-shadow); }
.gate-card { position: relative; align-items: center; text-align: center; }
.gate-card .x { position: absolute; top: 8px; right: 8px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 20px; cursor: pointer; }
.gate-q { margin: 4px 0; font-size: 32px; line-height: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gate-a { display: inline-block; min-width: 2.2em; min-height: 44px; border-bottom: 3px solid var(--sm-text); vertical-align: bottom; }
.keypad { display: grid; grid-template-columns: repeat(3, 64px); gap: 10px; justify-content: center; }
.keypad button { height: 56px; white-space: nowrap; padding: 0; border-radius: 16px; border: 1.5px solid var(--sm-control-border); background: var(--sm-surface); color: var(--sm-text); font: inherit; font-size: 22px; font-weight: 700; cursor: pointer; }
.shake { animation: shake .3s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } }

/* ---- 3.10 計画(最小) ---- */
.rows { margin: 16px 0; border-top: 1px solid var(--sm-line); }
.prow { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 64px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--sm-line); background: none; color: var(--sm-text); font: inherit; font-size: 16px; text-align: left; cursor: pointer; }
.prow .k { flex: none; width: 6.5em; font-weight: 700; }
.prow .v { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; color: var(--sm-text-2); }
.prow .chev { flex: none; color: var(--sm-text-2); font-size: 22px; }
.prow:disabled { cursor: default; }
.mini { width: 28px; height: 28px; border-radius: 6px; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--sm-checker-b); }
.mini img { width: 100%; height: 100%; object-fit: contain; }
.mini.q { background: var(--sm-secret-bg); color: var(--sm-santa-gold); font-weight: 800; }
.plan-actions { margin: 16px 0; }
.btn.text.danger { color: var(--sm-error); display: flex; margin: 16px auto 0; }

/* ---- 3.12 共有する ---- */
.share-list { margin: 0 0 12px; padding-left: 1.2em; font-size: 16px; line-height: 24px; }
.share-list li { margin-bottom: 8px; }
.share-list small { display: block; font-size: 14px; line-height: 20px; color: var(--sm-text-2); }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 16px; }
.check input { width: 24px; height: 24px; accent-color: var(--sm-primary); }
#share-made { display: flex; flex-direction: column; gap: 8px; }

/* ---- 3.13 もらった計画 ---- */
.recv-badge { position: fixed; top: 100px; left: max(16px, env(safe-area-inset-left)); z-index: 5; height: 36px; padding: 0 0 0 14px; display: inline-flex; align-items: center; gap: 2px; border-radius: 999px; background: color-mix(in srgb, var(--sm-surface) 96%, transparent); color: var(--sm-text); box-shadow: var(--sm-shadow); font-size: 14px; }
.recv-badge button { position: relative; width: 36px; height: 36px; border: 0; background: none; color: inherit; font-size: 16px; cursor: pointer; }
.recv-badge button::before { content: ""; position: absolute; inset: -6px; }
.recv-note { margin-bottom: 16px; padding: 12px 16px; border-radius: 20px; background: var(--sm-surface-2); }
.seg2 { display: flex; gap: 8px; margin-bottom: 16px; }
.seg2 button { flex: 1; min-height: 48px; border-radius: 999px; border: 1.5px solid var(--sm-control-border); background: var(--sm-surface); color: var(--sm-text); font: inherit; font-size: 16px; cursor: pointer; }
.seg2 button[aria-checked="true"] { background: var(--sm-primary); border-color: var(--sm-primary); color: var(--sm-on-primary); font-weight: 700; }

/* ---- 地図が読めなかったとき(子ども向けの画面。カードの数え方は動いたまま) ---- */
.map-fail { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 24px; border-radius: 24px; background: var(--sm-surface); color: var(--sm-text); box-shadow: var(--sm-shadow); font-size: 20px; font-weight: 700; text-align: center; }
.map-fail p { margin: 0; }

/* 見た目が 48 より小さい丸・ボタンは、押せる範囲だけ 48 に広げる */

/* 広告の余地(場所だけ。いまは空。SPEC §10) */
.ad-room:empty { min-height: 0; }

/* ---- 3.11 写真の切り取り: 上は ✕ だけ・案内は下の欄(写真にかぶせない) ---- */
.crop .top { min-height: 56px; padding: 4px 4px 4px 4px; }
.crop .top .x { width: 48px; height: 48px; border: 0; border-radius: 50%; background: none; color: var(--sm-crop-text); font-size: 20px; cursor: pointer; }
.crop .guide { display: flex; align-items: flex-start; gap: 8px; padding: 8px 16px 0; min-height: calc(2 * 24px + 8px); font-size: 16px; line-height: 24px; }
.crop .guide p { margin: 0; }
.crop .guide .bang { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: var(--sm-crop-drop); color: var(--sm-crop-ink); font-weight: 800; text-align: center; line-height: 22px; font-size: 14px; }
.crop .tools { gap: 12px; padding: 8px 16px 0; justify-content: space-between; }
.crop .seg { display: flex; gap: 8px; }
.crop .chip { min-height: 48px; padding: 0 18px; font-size: 16px; border-radius: 24px; }
.crop .sw { margin-left: 0; font-size: 16px; min-height: 48px; }
.crop .undo-row { display: flex; justify-content: flex-end; padding: 0 16px; }
.crop .undo-row .chip { min-height: 48px; }
.crop .marks { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 16px 0; }
.crop .marks .chip { min-height: 48px; font-size: 14px; padding: 0 14px; }
.crop .marks .keep { border-color: var(--sm-crop-keep); }
.crop .marks .removed { border-color: var(--sm-crop-drop); border-style: dashed; }
.crop .bottom { padding: 8px 16px 12px; }
.crop .bottom .btn { min-height: 56px; }
.crop .btn:focus-visible, .crop .chip:focus-visible, .crop .x:focus-visible { outline: 3px solid var(--sm-crop-focus); outline-offset: 2px; }

/* ---- 1-3 最後の 60 秒の数え・進みの線・着く場所の印 ---- */
.card.s5 .c2 { font-size: 56px; line-height: 64px; font-weight: 700; }
.card.s5.n96 .c2 { font-size: 96px; line-height: 104px; }
.cbar { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px; }
.cbar img { flex: none; display: block; }
.cbar .track { position: relative; flex: 1; height: 6px; border-radius: 3px; background: var(--sm-track); }
.cbar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0%); border-radius: 3px; background: var(--sm-santa-gold); }
.cbar .dot { position: absolute; top: 50%; left: var(--p, 0%); width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--sm-santa-red); box-shadow: 0 0 0 2px var(--sm-surface); }
.goal-mark { width: 48px; height: 48px; pointer-events: none; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .25)); }
.goal-mark img { position: relative; display: block; }
.goal-mark .ring { position: absolute; left: 2px; top: 23px; width: 44px; height: 44px; margin-top: 0; border-radius: 50%; border: 3px solid var(--sm-santa-gold); opacity: 0; pointer-events: none; }
.goal-mark.flying .ring { animation: gring 2.4s ease-out infinite; }
@keyframes gring { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .goal-mark.flying .ring { animation: none; transform: scale(1.2); opacity: .7; } }

/* ---- 3.14 リハーサル ---- */
.plan-actions.two { display: flex; gap: 8px; }
.plan-actions.two .btn { flex: 1; }
.reh-badge { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 7; height: 36px; padding: 0 4px 0 14px; display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; background: var(--sm-santa-red); color: var(--sm-white); box-shadow: var(--sm-shadow); font-size: 14px; font-weight: 700; white-space: nowrap; }
.reh-badge button { position: relative; min-width: 48px; height: 36px; border: 0; border-radius: 999px; background: none; color: inherit; font: inherit; cursor: pointer; }
.reh-badge button::before { content: ""; position: absolute; inset: -6px -2px; }

/* ---- 7 画面の幅と向き(SPEC §7) ---- */
/* 拡大・縮小(細かく指せる端末だけ JS が足す)は右のまん中。札と重ねない */
.maplibregl-ctrl-top-right { top: 50%; transform: translateY(-50%); }
/* スマホ横(高さ 480 未満): 札は左上(幅 320 まで)・主ボタンは右下・さがすは左下・親の画面は幅 560 で縦に流れる(主ボタンは流れの最後) */
@media (max-height: 479px) and (orientation: landscape) {
  .card { right: auto; width: min(320px, calc(100vw - 160px)); max-width: 320px; }
  .card .c1 { font-size: 14px; line-height: 18px; } .card .c2 { font-size: 20px; line-height: 26px; } .card.s5 .c2 { font-size: 40px; line-height: 44px; } .card.s5.n96 .c2 { font-size: 64px; line-height: 68px; }
  .bar { left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); flex-direction: row; justify-content: space-between; align-items: flex-end; }
  .bar-main { width: auto; max-width: 62vw; align-items: flex-end; }
  .ad-banner { width: min(468px, 62vw); }
  .sm-screen:not(#s-place) { display: block; overflow-y: auto; overscroll-behavior: contain; }
  .sm-screen:not(#s-place) .sm-bar { position: sticky; top: 0; background: var(--sm-bg); }
  .sm-screen:not(#s-place) .sm-body { overflow: visible; max-width: 560px; }
  .sm-screen:not(#s-place) .sm-foot { max-width: 560px; border-top: 0; }
  .hero { height: 30vh; min-height: 96px; }
  /* 場所をえらぶ: 地図は左・案内とボタンの板は右(幅 300) */
  #s-place { display: grid; grid-template-columns: 1fr 300px; grid-template-rows: auto 1fr; }
  #s-place .sm-bar { grid-column: 1 / -1; }
  #s-place .place-box { grid-column: 1; grid-row: 2; }
  #s-place .place-panel { grid-column: 2; grid-row: 2; max-width: none; overflow-y: auto; border-top: 0; border-left: 1px solid var(--sm-line); justify-content: center; }
  /* 切り取り: 写真は左・案内とボタンは右(幅 300) */
  .crop { display: grid; grid-template-columns: 1fr 300px; grid-template-rows: auto auto auto auto auto 1fr; align-content: stretch; }
  .crop .top { grid-column: 1 / -1; grid-row: 1; }
  .crop .view { grid-column: 1; grid-row: 2 / -1; }
  .crop .marks, .crop .guide, .crop .tools, .crop .undo-row { grid-column: 2; }
  .crop .bottom { grid-column: 2; grid-row: 6; align-self: end; }
  .crop .tools { flex-wrap: wrap; }
  /* 箱・祝いは短い辺の 50% まで */
  .gift .box { scale: .8; margin: -20px 0; }
  .arrive .a-box { scale: .7; margin: -24px 0; }
  .arrive .a-title { font-size: 26px; line-height: 32px; }
}
/* 幅 840 以上(タブレット・PC): 札は左上(幅 360 まで)・親の画面は左に幅 400 の板で、右に地図が見えたまま */
@media (min-width: 840px) {
  .card { max-width: 360px; right: auto; }
  #s-plan, #s-when, #s-gifts, #s-share, #s-about { right: auto; width: 400px; box-shadow: 0 0 24px rgba(0, 0, 0, .25); border-right: 1px solid var(--sm-line); }
  #s-plan .sm-body, #s-when .sm-body, #s-gifts .sm-body, #s-share .sm-body, #s-about .sm-body, #s-plan .sm-foot, #s-when .sm-foot, #s-gifts .sm-foot, #s-share .sm-foot { max-width: none; }
  /* 場所をえらぶ・切り取り: 地図・写真は画面いっぱい、案内とボタンは左の板(幅 400) */
  #s-place .place-panel { position: absolute; left: 16px; bottom: 16px; width: 400px; max-width: calc(100vw - 32px); border: 0; border-radius: 24px; box-shadow: var(--sm-shadow); background: var(--sm-bg); z-index: 4; }
  #s-place .fab { right: 16px; }
  .crop { display: grid; grid-template-columns: 400px 1fr; grid-template-rows: auto auto auto auto auto 1fr; }
  .crop .top { grid-column: 1 / -1; grid-row: 1; }
  .crop .view { grid-column: 2; grid-row: 2 / -1; }
  .crop .marks, .crop .guide, .crop .tools, .crop .undo-row { grid-column: 1; }
  .crop .bottom { grid-column: 1; grid-row: 6; align-self: end; }
  .gift .box { scale: 1.15; margin: 20px 0; }
  .gift .strip { width: min(100%, 560px); }
}
/* 600〜839: スマホ縦と同じ。余白 24・中身は幅 560 までで中央 */
@media (min-width: 600px) and (max-width: 839px) { .sm-body.sm-pad { padding-left: 24px; padding-right: 24px; max-width: 560px; } .sm-foot { padding-left: 24px; padding-right: 24px; max-width: 560px; } }

/* §6-6 フォーカスの輪: 地図の上の物にも出す(focus の色 3px・外に 2px) */
:focus-visible { outline: 3px solid var(--sm-focus); outline-offset: 2px; box-shadow: 0 0 0 5px var(--sm-bg); }
.santa:focus-visible { border-radius: 12px; }

/* ---- 2-2 箱の新しい絵(AR-3)+ W6 開ける演出 A「ぽん！と はじける」(D41)。動きは js/boxfx.js が毎コマ書く。台 240×240 ---- */
.gift .box .p { position: absolute; display: block; }
.gift .box .body, .gift .box .body-open { left: 20px; top: 106px; width: 200px; height: 130px; }
.gift .box .lidset { left: 10px; top: 22px; width: 220px; height: 94px; transform-origin: 110px 71px; }
.gift .box .lid { position: absolute; left: 0; top: 48px; width: 220px; height: 46px; }
.gift .box .bow { position: absolute; left: 50px; top: 0; width: 120px; height: 60px; }
.gift .box .glow { left: 0; top: -74px; width: 240px; height: 190px; transform-origin: 120px 190px; opacity: 0; transform: scale(.2); }
.gift .box .body-open { opacity: 0; }
.gift .box img { pointer-events: none; }
.gift .box .qm { display: none; left: 82px; top: 136px; width: 76px; height: 76px; }
.gift.sb .box .qm { display: block; }
.gift.sb .cap { display: block; opacity: 0; }
.gift.opening .box, .gift.shaking .box { animation: none; }
.gift.opening .tap { visibility: hidden; }
.gift .box.leave { display: block; }
/* 演出の層: 後ろの光と紙ふぶきは中身の後ろ(z-index -1)。中身が箱の口を出るまでは口より上だけ見せる */
.gift .fx { position: absolute; inset: 0; pointer-events: none; }
.gift .fx-glow { position: absolute; width: 0; height: 0; z-index: -1; }
.gift .fx-halo { position: absolute; left: -250px; top: -250px; width: 500px; height: 500px; border-radius: 50%; opacity: .9; background: radial-gradient(circle, rgba(255,246,214,.8) 0, rgba(255,224,130,.3) 45%, rgba(255,224,130,0) 70.7%); }
.gift .fx-rays { position: absolute; left: -320px; top: -320px; opacity: .8; animation: fx-spin 30s linear infinite; }
@keyframes fx-spin { to { transform: rotate(360deg); } }
.gift .fx-conf { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: -1; }
.gift .fx-org { position: absolute; width: 0; height: 0; z-index: 2; }
.gift .fx-hwrap { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.gift .fx-hero { position: absolute; display: block; will-change: transform; }
.gift .fx-flash { position: absolute; left: 0; top: 0; width: 680px; height: 680px; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle, #fff 0, rgba(255,243,196,.85) 55%, rgba(255,224,130,0) 100%); z-index: 3; }
.gift .fx-spark { position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; z-index: 4; opacity: 0; transform: scale(var(--s)); animation: fx-twinkle 2.4s ease-in-out infinite; }
.gift .fx-spark:nth-of-type(2n) { animation-duration: 3s; animation-delay: -.7s; }
.gift .fx-spark:nth-of-type(3n) { animation-duration: 3.6s; animation-delay: -1.5s; }
.gift .fx-spark.away { visibility: hidden; }
@keyframes fx-twinkle { 0%, 100% { transform: scale(calc(var(--s) * .65)); } 50% { transform: scale(var(--s)); } }
.gift .fx.still .fx-rays, .gift .fx.still .fx-spark { animation: none; }
/* 置きかえのあと、文と送るボタンがふわっと(見本の 1400〜1700ms)。動きを減らす設定では全体が 150ms でふわっと */
.gift.open.fade :is(.cap, .count, .pager) { animation: fx-in 300ms both; }
.gift.open.soft :is(.img, .strip, .cap, .count, .pager) { animation: fx-in 150ms both; }
@keyframes fx-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .gift .fx-rays, .gift .fx-spark { animation: none; } .gift .box { transition: none; } }

/* ---- 2-3 計画の「着く場所」の小さい地図の絵 ---- */
.thumb-map { position: relative; flex: none; width: 72px; height: 48px; border-radius: 12px; overflow: hidden; background: var(--sm-surface-2); border: 1px solid var(--sm-line); }
.thumb-map #thumb-map-gl { position: absolute; inset: 0; display: block; }
.thumb-map #thumb-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -88%); pointer-events: none; }
.thumb-map.circle #thumb-pin { display: none; }
.thumb-map.circle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: color-mix(in srgb, var(--sm-santa-gold) 25%, transparent); border: 2px solid var(--sm-santa-gold); }

/* ---- W5-1 中身(写真・帯)をいちばん手前に。箱は開いたら消える(display:none)ので重ならない。念のため手前に出し、ふたは箱の中だけで動く ---- */
.gift .img, .gift .strip { position: relative; z-index: 3; }
.gift .box { z-index: 1; }
@media (max-height: 560px) { .gift.opening:not(.open) .box { scale: .7; margin: -36px 0; } }

/* 楽天のトースト広告(D44)。下から上がって出る小さな札 */
.ad-toast { position: fixed; left: 50%; bottom: var(--ad-bottom, 120px); z-index: 25; width: var(--ad-size, 160px); transform: translate(-50%, 24px); opacity: 0; transition: transform .3s ease-out, opacity .3s; background: var(--sm-surface, #fff); border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.3); overflow: hidden; }
.ad-toast[hidden] { display: none; }
.ad-toast.in { transform: translate(-50%, 0); opacity: 1; }
.ad-toast.out { transform: translate(-50%, 24px); opacity: 0; }
.ad-toast a, .ad-toast img { display: block; width: var(--ad-size, 160px); height: var(--ad-size, 160px); }
.ad-banner.rise { animation: ad-rise .35s ease-out; }
@keyframes ad-rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.ad-toast .ad-tag { position: absolute; left: 6px; top: 4px; z-index: 1; font-size: 10px; line-height: 14px; padding: 0 4px; border-radius: 3px; background: rgba(255,255,255,.85); color: #444; }
.ad-toast .ad-x { position: absolute; right: 0; top: 0; z-index: 1; width: 48px; height: 48px; padding: 0; border: 0; background: none; color: #333; font-size: 16px; cursor: pointer; }
.ad-toast .ad-x::after { content: "✕"; position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 50%; background: rgba(255,255,255,.85); }
.ad-toast .ad-x { font-size: 0; }
.ad-toast .ad-x::after { font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .ad-toast, .ad-toast.in, .ad-toast.out { transition: none; transform: translate(-50%, 0); } }

/* W12 直し: 幅 480 未満の縦は、札を左右 12 の幅いっぱいにし、設定ボタンは札のすぐ下の右(札の下端は JS が --card-bottom に入れる) */
@media (max-width: 479px) {
  .card { left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); max-width: none; }
  .adult { top: calc(var(--card-bottom, 12px) + 8px); right: max(12px, env(safe-area-inset-right)); }
  .adult-hint { top: calc(var(--card-bottom, 12px) + 8px + 56px + 6px); right: max(12px, env(safe-area-inset-right)); }
  .recv-badge { top: calc(var(--card-bottom, 12px) + 8px + 10px); }
}

/* W13 直し(幅 360): 右に値の無い行は字を列いっぱいに・2 つのボタンは 1 行・見出しの「(あと N 日)」は 2 行目 */
.prow .k.solo { flex: 1; width: auto; }
.plan-actions.two .btn { white-space: nowrap; padding-left: 8px; padding-right: 8px; }
#plan-sum { white-space: pre-line; }
