/* SnapDrop ファン用Web: 推し活ポップ（パステル＋ステッカー＋グラス）。モバイルファースト（§1）。 */
:root {
  --pink: #ff9ecc;
  --hot: #ff4d8d;
  --cyan: #99e6fa;
  --lav: #c7b5ff;
  --cream: #fff7e6;
  --mint: #b3f7d9;
  --ink: #2a2233;
  --card: #ffffff;
  --radius: 26px;
  --shadow: 5px 5px 0 var(--ink);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: "Zen Maru Gothic", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

/* ふわふわ背景（CSS図形のみ・絵文字なし） */
.bg { position: fixed; inset: 0; overflow: hidden; z-index: -1; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .55;
  animation: drift 14s ease-in-out infinite;
}
.blob-a { width: 320px; height: 320px; background: var(--pink); top: -80px; left: -60px; }
.blob-b { width: 300px; height: 300px; background: var(--cyan); top: 30%; right: -90px; animation-delay: -4s; }
.blob-c { width: 280px; height: 280px; background: var(--lav); bottom: -70px; left: 10%; animation-delay: -8s; }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(0, -28px) scale(1.08); }
}

.container {
  max-width: 520px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 18px calc(48px + env(safe-area-inset-bottom));
}

/* ヘッダー / ロゴ */
.header { text-align: center; margin-bottom: 22px; }

/* ヘッダー背景画像（タイトル部分の背景）。アイコン/タイトル/サブ文がこの上に乗る。 */
.header.has-hero {
  position: relative;
  margin: calc(-1 * max(28px, env(safe-area-inset-top))) -18px 24px;
  padding: max(40px, calc(env(safe-area-inset-top) + 16px)) 18px 26px;
  background-image:
    linear-gradient(to bottom, rgba(0, 0, 0, .30), rgba(0, 0, 0, .58)),
    var(--hero);
  background-size: cover;
  background-position: center;
  border-radius: 0 0 30px 30px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .45);
}
.has-hero .logo { filter: drop-shadow(0 3px 10px rgba(0, 0, 0, .55)); }
.has-hero .subtitle { color: rgba(255, 255, 255, .94); text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.has-hero .cast-avatar { border-color: #fff; }

.cast-avatar {
  display: block;
  width: 92px;
  height: 92px;
  margin: 0 auto 10px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--hot);
  box-shadow: 0 6px 24px color-mix(in srgb, var(--hot) 55%, transparent);
  animation: pop-in .5s cubic-bezier(.2, 1.3, .5, 1) both;
}
.logo {
  font-family: "Baloo 2", "Zen Maru Gothic", sans-serif;
  font-weight: 800;
  font-size: clamp(2.6rem, 12vw, 3.6rem);
  line-height: 1;
  margin: 0;
  letter-spacing: -.5px;
  background: linear-gradient(120deg, var(--hot), var(--lav) 60%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(2px 3px 0 rgba(42, 34, 51, .15));
}
.logo-img {
  display: block;
  margin: 0 auto;
  width: min(78%, 340px);
  height: auto;
  filter: drop-shadow(0 3px 8px rgba(42, 34, 51, .18));
}
.subtitle {
  margin: 8px 0 0;
  font-weight: 700;
  color: #6b5e73;
  font-size: 1rem;
}

/* ステータス（読込/エラー） */
.status {
  text-align: center;
  font-weight: 700;
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: var(--card);
  border: 2.5px solid var(--ink);
  box-shadow: var(--shadow);
}
.status.error { background: #ffe1ec; color: #b00048; }

/* アセットカード（ステッカー風） */
.cards { display: grid; gap: 22px; margin-bottom: 30px; }
.card {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  animation: pop-in .45s cubic-bezier(.2, 1.3, .5, 1) both;
}
.card:nth-child(2) { animation-delay: .06s; }
.card:nth-child(3) { animation-delay: .12s; }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to { opacity: 1; transform: none; }
}

.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 0 4px; }
.chip {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 13px;
  border: 2.5px solid var(--ink);
  flex: none;
}
.chip svg { width: 22px; height: 22px; }
.chip.static { background: var(--pink); }
.chip.movie { background: var(--cyan); }
.chip.movie_plain { background: var(--lav); }
.chip.timelapse { background: var(--mint); }
.card-title { font-size: 1.15rem; font-weight: 700; margin: 0; }

/* プレビュー本体 */
.media {
  position: relative;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #f1ecf7, #e9f6fb);
  border: 2px solid rgba(42, 34, 51, .12);
  aspect-ratio: 4 / 5;
}
.media img, .media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  background: #15121b;
}
.sound-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  font-family: inherit;
  font-weight: 800;
  font-size: .82rem;
  color: #fff;
  padding: 7px 13px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.sound-badge.active { background: var(--hot); }

/* 動画の再生ボタン（タップするまで動画を読み込まない＝通信節約） */
.play-overlay {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: rgba(0, 0, 0, .45);
  cursor: pointer;
  z-index: 2;
}
.play-overlay::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 13px 0 13px 22px;
  border-color: transparent transparent transparent #fff;
}
.play-overlay.hidden { display: none; }
.media.loading::after {
  content: "";
  position: absolute; inset: 0;
  margin: auto;
  width: 34px; height: 34px;
  border: 4px solid rgba(42, 34, 51, .2);
  border-top-color: var(--hot);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 保存ボタン（ぷにっとグラデ） */
.save-btn {
  margin-top: 14px;
  width: 100%;
  padding: 15px 18px;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(120deg, var(--hot), var(--lav));
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .12s cubic-bezier(.2, 1.3, .5, 1), box-shadow .12s;
  -webkit-tap-highlight-color: transparent;
}
.save-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--ink);
}
.save-btn:disabled { opacity: .55; cursor: default; }

.card-hint {
  margin: 10px 4px 0;
  font-size: .85rem;
  font-weight: 700;
  color: var(--hot);
  text-align: center;
}
.card-hint[hidden] { display: none; }

/* 保存ガイド（グラス） */
.guide {
  background: rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 10px 30px rgba(255, 77, 141, .12);
}
.guide h2 { font-size: 1.1rem; margin: 0 0 10px; font-weight: 700; }
.guide ol { margin: 0 0 8px; padding-left: 1.2em; line-height: 1.8; font-weight: 500; }
.note { color: #6b5e73; font-size: .85rem; margin: 6px 0 0; font-weight: 500; }

@media (min-width: 600px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .cards .card:first-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .blob, .card, .media.loading::after { animation: none; }
}

/* 落書きオーバーレイ／タイムラプス再生キャンバス */
.media { position: relative; }
.doodle-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ===== アプリ訴求バナー（Webで開いた=未インストールの可能性大） ===== */
.app-promo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 14px 0 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(255, 77, 141, .12), rgba(124, 77, 255, .10));
  border: 1.5px solid rgba(255, 77, 141, .35);
}
.app-promo-text {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.app-promo-text strong {
  font-size: 14px;
  color: #B4275E;
}
.app-promo-text span {
  font-size: 11.5px;
  color: #8a7a8f;
  line-height: 1.5;
}
.app-promo-actions {
  display: flex;
  gap: 8px;
}
.app-promo-btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  background: #1c1424;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(28, 20, 36, .25);
}
.app-promo-btn:active { transform: scale(.97); }
