/* ========================================
   アプリのダウンロード（/download/）— パステル版
   台紙（css/cards.css の .paper）の上に1枚のカードを貼るだけの小さなページ。
   表示の切り替え（判定中・案内・読み込み失敗）は js/download-redirect.js が
   <html> の dl-resolving クラスと #dlContent / #dlError の hidden 属性で行う。
   配色トークンは css/site.css
   ======================================== */

.dl-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 48px 16px;
}

.dl-page {
  width: 100%;
  max-width: 560px;
  text-align: center;
}

.dl-paper {
  padding: 48px 20px 40px;
}

@media (min-width: 640px) {
  .dl-paper {
    padding: 56px 40px 48px;
  }
}

/* 台紙の上に1枚だけ貼るカード。#dlContent / #dlError の hidden を効かせるため display は指定しない */
.dl-card {
  --r: -1deg;
  max-width: none;
  padding: 36px 20px 28px;
  border-radius: 28px;
}

.dl-card.bcard--memo {
  --r: 1deg;
}

.dl-card > * + * {
  margin-top: 24px;
}

.dl-brand {
  min-height: 44px;
  color: var(--c-berry-deep);
}

.dl-heading > * + * {
  margin-top: 12px;
}

.dl-title {
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: clamp(1.75rem, 7vw, 2.25rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.dl-lead {
  color: var(--c-ink-soft);
}

/* 落書き（飾り）。台紙の角に添える */
.dl-doodle {
  position: absolute;
  width: 32px;
  height: 32px;
  color: var(--doodle);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.dl-doodle--a { --doodle: var(--c-pink-tint);  left: 18px;  top: 14px; transform: rotate(-12deg); }
.dl-doodle--b { --doodle: var(--c-lemon-tint); right: 18px; bottom: 12px; transform: rotate(10deg); }

/* ── ストアのバッジ ── */
.dl-badges {
  gap: 8px 16px;
}

.dl-badges a {
  display: inline-block;
  transition: transform 0.2s ease;
}

.dl-badges a:hover,
.dl-badges a:focus-visible {
  transform: scale(1.05);
}

.dl-badges a:active {
  transform: scale(0.95);
}

.dl-badges img {
  height: 56px;
  width: auto;
}

/* Google Play のバッジは画像の上下に余白を含むので、そのぶん大きくして App Store とそろえる */
.dl-badges .dl-badge-play {
  height: 70px;
}

.dl-noscript-links {
  font-size: 0.875rem;
}

.dl-noscript-links a,
.dl-lang-link {
  color: var(--c-ink-soft);
  transition: color 0.2s ease;
}

.dl-noscript-links a:hover,
.dl-lang-link:hover,
.dl-lang-link:focus-visible {
  color: var(--c-berry-deep);
}

/* ── 言語切替（?lang=） ── */
.dl-lang {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  color: var(--c-ink-soft);
}

.dl-lang-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 9999px;
}

.dl-lang-link[aria-current="true"] {
  background: var(--c-pink);
  color: var(--c-berry-deep);
  font-weight: 700;
}

/* ── 判定中 ──
   判定中は案内を伏せてローディングだけ見せる。
   JSが無い環境ではこのクラスが付かないため、案内（両ストアのバッジ）がそのまま表示される */
#dlLoading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 160px;
}

.dl-resolving #dlLoading { display: flex; }
.dl-resolving #dlContent,
.dl-resolving #dlError { display: none; }

.dl-loading-text {
  font-size: 0.875rem;
  color: var(--c-ink-soft);
}

.dl-spinner {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 4px solid var(--c-pink);
  border-top-color: var(--c-berry);
  animation: dl-spin 0.9s linear infinite;
}

@keyframes dl-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .dl-spinner { animation: none; }

  .dl-badges a,
  .dl-lang-link,
  .dl-noscript-links a {
    transition: none;
  }
}
