/* =========================================================
   LogSwap | styles
   Palette: cool off-white paper + ink + single coral accent
   (AI紫グラデ / near-black+acid-green / 新聞調 の3大デフォルトを回避)
   Type: M PLUS Rounded 1c (JP・丸ゴシック) + Baloo 2 (Latin wordmark・丸み) ※Setlog風
   ========================================================= */

:root {
  --paper: #e9e0f7;         /* LP：薄い紫（ラベンダー） */
  --paper-2: #ffffff;
  --ink: #1e1a28;           /* 寒色寄りのニアブラック */
  --ink-2: #4a4658;
  --muted: #7e7a8e;
  --line: #ddd2ef;          /* ラベンダー寄りの境界線 */
  --accent: #ff3fa3;        /* マゼンタ：差し色＝「交換したい」（Setlog寄せ） */
  --accent-ink: #d81f7f;    /* 明るい背景で読めるマゼンタ */
  --brand: #12b39a;         /* ミント緑：ロゴ（明るい背景で読める濃さ） */
  --ok: #12b39a;            /* 成立サイン＝ミント */
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(45, 38, 70, 0.07), 0 6px 16px rgba(45, 38, 70, 0.07);
  --shadow-md: 0 10px 30px rgba(45, 38, 70, 0.13);
  --shadow-lg: 0 30px 70px rgba(45, 38, 70, 0.22);
  --maxw: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: "M PLUS Rounded 1c", system-ui, "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
}

/* アプリ（app.html）はダークテーマ。LP(index.html)はライトのまま。 */
.app-page {
  --paper: #101016;         /* アプリ背景：ニアブラック */
  --paper-2: #1c1c24;       /* カード・面 */
  --ink: #f3f1ef;           /* 主要テキスト（ニアホワイト） */
  --ink-2: #c3c0cc;
  --muted: #8a8797;
  --line: #2c2c37;          /* ダーク境界線 */
  --accent-ink: #ff93d2;    /* 暗背景で映える明るいマゼンタ */
  --brand: #40e0c9;         /* 暗背景で映える明るいミント */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 16px rgba(0, 0, 0, 0.42);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.66);
}
html.app-html, html:has(.app-page) { background: #101016; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* hidden 属性は常に最優先で隠す（display 指定に負けないように） */
[hidden] { display: none !important; }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.ico-line { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ico-solid { fill: currentColor; }

/* ---------------- Brand ---------------- */
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); }
.brand-glyph { color: var(--brand); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand-word { font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }

/* ---------------- Nav ---------------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 max(18px, env(safe-area-inset-left));
  max-width: var(--maxw); margin: 0 auto;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
}
.nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--line);
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a { padding: 9px 12px; font-size: 14px; font-weight: 500; color: var(--ink-2); border-radius: 999px; transition: color 0.2s, background 0.2s; }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  background: var(--ink); color: var(--paper-2) !important;
  font-weight: 700;
}
.nav-cta:hover { background: var(--accent); }

/* ---------------- Buttons ---------------- */
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 700; font-size: 15px;
  padding: 13px 22px; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform 0.15s var(--ease), background 0.2s, box-shadow 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(251, 74, 62, 0.28); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-primary:active { transform: translateY(1px) scale(0.99); }
.btn-primary.sm { padding: 10px 18px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--accent-ink); }
.link-arrow svg { transition: transform 0.2s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------------- Hero ---------------- */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) 20px clamp(40px, 7vw, 88px);
  display: grid; gap: clamp(28px, 5vw, 56px);
  grid-template-columns: 1fr;
  align-items: center;
}
.eyebrow {
  display: inline-block; margin: 0 0 14px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--accent-ink); text-transform: uppercase;
}
.hero-title {
  margin: 0 0 18px; font-weight: 900;
  font-size: clamp(34px, 7.5vw, 60px); line-height: 1.12; letter-spacing: -0.02em;
}
.hero-title .accent { color: var(--accent); }
.hero-sub { margin: 0 0 26px; max-width: 30em; font-size: clamp(15px, 1.6vw, 17px); color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------------- Phone / demo ---------------- */
.hero-demo { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.phone {
  width: min(360px, 92vw);
  background: #1b1a17;
  border-radius: 38px;
  padding: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.phone-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px 10px;
}
.phone-brand { font-family: "Baloo 2", sans-serif; font-weight: 700; color: #fff; font-size: 15px; letter-spacing: -0.01em; }

.stage { position: relative; height: clamp(440px, 64vh, 520px); }
.deck { position: absolute; inset: 0; }

.card {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--paper-2);
  border-radius: 26px; overflow: hidden;
  border: 1px solid rgba(27, 26, 23, 0.07);
  box-shadow: 0 2px 6px rgba(27, 26, 23, 0.06), 0 18px 44px rgba(27, 26, 23, 0.18);
  --tint: 0;
  touch-action: pan-y;
  user-select: none;
  transform-origin: center bottom;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
.card.dragging { transition: none; box-shadow: 0 4px 10px rgba(27, 26, 23, 0.08), 0 30px 60px rgba(27, 26, 23, 0.26); }
.card.leaving { transition: transform 0.5s cubic-bezier(0.33, 0, 0.2, 1), opacity 0.5s ease-out; }
.card.is-back { transform: scale(0.94) translateY(16px); filter: brightness(0.985) saturate(0.97); }
.card.enter { animation: promote 0.36s var(--ease); }
@keyframes promote { 0% { transform: scale(0.95) translateY(12px); opacity: 0.5; } 100% { transform: none; opacity: 1; } }

.card-media { position: relative; flex: 1 1 auto; min-height: 0; }
.card-photo, .card-video { width: 100%; height: 100%; object-fit: cover; }
.card-video { pointer-events: none; background: #1b1a17; } /* ドラッグはカードで拾う */
.card-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(27,26,23,0.16) 0%, rgba(0,0,0,0) 22%),
    linear-gradient(180deg, rgba(0,0,0,0) 38%, rgba(27,26,23,0.22) 60%, rgba(27,26,23,0.84) 100%);
}
.card-media::after {
  content: ""; position: absolute; inset: 0;
  opacity: var(--tint); background: #1b1a17; mix-blend-mode: multiply;
  transition: opacity 0.08s linear; pointer-events: none;
}
.card[data-dir="yes"] .card-media::after { background: var(--accent); }

/* 広告カード（スワイプ内。UIに溶け込むネイティブ風。実広告はこの枠に差す） */
.ad-media {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 30px 24px 26px; color: #fff; overflow: hidden;
}
.ad-premier .ad-media {
  background:
    radial-gradient(90% 55% at 82% 8%, rgba(255,255,255,0.30) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(158deg, #ff5cb3 0%, #ff2f9c 34%, #b31f77 68%, #6d134f 100%);
}
.ad-boost .ad-media {
  background:
    radial-gradient(90% 55% at 82% 8%, rgba(255,255,255,0.30) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(158deg, #4defd0 0%, #1cc7ab 36%, #11957f 70%, #0a5f51 100%);
}
/* やわらかい発光の飾り */
.ad-media::before {
  content: ""; position: absolute; right: -70px; bottom: -90px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 70%);
  pointer-events: none;
}
.ad-badge {
  position: absolute; top: 16px; left: 16px; z-index: 2;
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em;
  color: #fff; background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px; padding: 3px 10px;
  backdrop-filter: blur(2px);
}
.ad-empty-note {
  position: relative; z-index: 1; margin: 26px 0 0;
  font-size: 12.5px; line-height: 1.6; font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
}
.ad-hero { position: relative; z-index: 1; margin-top: auto; }
.ad-emoji { font-size: 40px; line-height: 1; display: block; margin-bottom: 12px; }
.ad-eyebrow {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.9); margin-bottom: 8px;
}
.ad-title {
  margin: 0 0 10px; font-size: 25px; line-height: 1.32; font-weight: 800;
  letter-spacing: -0.01em; text-shadow: 0 1px 12px rgba(27, 10, 30, 0.28);
}
.ad-sub { margin: 0; font-size: 13.5px; line-height: 1.6; color: rgba(255, 255, 255, 0.9); }
.ad-cta {
  position: relative; z-index: 1; margin-top: 18px;
  width: 100%; padding: 14px 16px; border: 0; border-radius: 14px;
  font-family: inherit; font-size: 15px; font-weight: 800; letter-spacing: 0.01em;
  color: #b31f77; background: #fff; cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.ad-boost .ad-cta { color: #0a5f51; }
.ad-cta:active { transform: translateY(1px) scale(0.99); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }

/* AdMob Native Advanced（Android/Web は返ってきたアセットをDOM描画） */
.ad-card .nad-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nad-media-empty { background: linear-gradient(155deg, #2a2a34, #14141a); }
.ad-card .nad-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0) 42%, rgba(10,8,14,0.55) 72%, rgba(10,8,14,0.92) 100%);
}
.nad-adchoices { position: absolute; top: 14px; right: 12px; z-index: 2; width: 16px; height: 16px; opacity: 0.9; }
.nad-info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 18px 18px 20px; color: #fff; }
.nad-row { display: flex; align-items: center; gap: 10px; }
.nad-icon { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
.nad-lines { display: flex; flex-direction: column; min-width: 0; }
.nad-head { font-size: 17px; font-weight: 800; line-height: 1.3; text-shadow: 0 1px 10px rgba(0,0,0,0.45); }
.nad-adv { font-size: 12px; color: rgba(255,255,255,0.82); }
.nad-body {
  margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: rgba(255,255,255,0.9);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nad-cta {
  margin-top: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: 13px;
  font-family: inherit; font-size: 14.5px; font-weight: 800; color: #b31f77; background: #fff;
  cursor: pointer; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* カード下部：丸いアイコン＋名前（Tinder風） */
.card-id {
  position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 2;
  display: flex; flex-direction: column; gap: 8px; color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.38);
}
.card-id-row { display: flex; align-items: center; gap: 12px; }
.card-avatar {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  border: 2.5px solid #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.card-name { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.card-bio {
  margin: 0; font-size: 13.5px; font-weight: 500; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.tag {
  font-family: "Baloo 2", sans-serif; font-size: 11.5px; font-weight: 500;
  padding: 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-ink);
}

/* swipe stamps */
.stamp {
  position: absolute; top: 18px; z-index: 3;
  font-size: 15px; font-weight: 800; letter-spacing: 0.02em;
  padding: 6px 12px; border-radius: 10px; border: 2.5px solid; opacity: 0;
  background: rgba(255, 255, 255, 0.9);
}
.stamp-yes { left: 16px; color: var(--accent-ink); border-color: var(--accent); transform: rotate(-10deg); }
.stamp-no { right: 16px; color: var(--ink); border-color: var(--ink); transform: rotate(10deg); }

/* coach hint */
.coach {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  display: flex; align-items: center; justify-content: space-between; padding: 0 8px;
}
.coach-side {
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 12px; border-radius: 14px;
  background: rgba(27, 26, 23, 0.72); color: #fff; font-size: 11px; font-weight: 700;
  animation: nudge 1.6s var(--ease) infinite;
}
.coach-l { animation-name: nudge-l; }
.coach-r { animation-name: nudge-r; }
@keyframes nudge-l { 0%,100% { transform: translateX(0); opacity: 0.55; } 50% { transform: translateX(-6px); opacity: 1; } }
@keyframes nudge-r { 0%,100% { transform: translateX(0); opacity: 0.55; } 50% { transform: translateX(6px); opacity: 1; } }

/* empty */
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 24px; background: var(--paper-2); border-radius: 24px; }
.empty-title { margin: 0; font-size: 17px; font-weight: 700; }
.empty-sub { margin: 0 0 6px; font-size: 13px; color: var(--muted); }

/* controls */
.controls { display: flex; align-items: flex-start; justify-content: center; gap: 22px; padding: 12px 0 4px; }
.ctrl-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ctrl {
  display: grid; place-items: center; cursor: pointer;
  background: var(--paper-2); color: var(--ink); border: 2px solid var(--line); border-radius: 50%;
  box-shadow: 0 6px 16px rgba(27, 26, 23, 0.14);
  transition: transform 0.14s var(--ease), background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.ctrl:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(27, 26, 23, 0.18); }
.ctrl:active { transform: scale(0.9); }
.ctrl-no { width: 62px; height: 62px; }
.ctrl-no:hover { color: var(--ink); background: var(--line); border-color: var(--muted); }
.ctrl-yes {
  width: 62px; height: 62px; color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 32%, var(--paper-2));
  background: color-mix(in srgb, var(--accent) 5%, var(--paper-2));
}
.ctrl-yes:hover { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: 0 12px 26px rgba(251, 74, 62, 0.4); }
.ctrl-info { width: 48px; height: 48px; color: var(--ink-2); }
.ctrl-cap { font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, 0.82); }
.demo-hint { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------------- Sections ---------------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(48px, 8vw, 96px) 20px; }
.section-head { max-width: 36em; margin-bottom: clamp(28px, 4vw, 44px); }
.section-head h2 { margin: 0 0 10px; font-size: clamp(24px, 4vw, 36px); font-weight: 900; letter-spacing: -0.02em; }
.section-head p { margin: 0; color: var(--ink-2); font-size: 15px; }

/* steps（本物の順序なので番号を使う） */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: 1fr; counter-reset: none; }
.step {
  position: relative; background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 26px 24px;
  box-shadow: var(--shadow-sm);
}
.step-no {
  display: inline-grid; place-items: center; width: 38px; height: 38px; margin-bottom: 14px;
  font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 17px;
  color: #fff; background: var(--accent); border-radius: 12px;
}
.step h3 { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
.step p { margin: 0; color: var(--ink-2); font-size: 14px; }

/* about */
.about { background: var(--ink); color: var(--paper); border-radius: clamp(24px, 4vw, 40px); max-width: calc(var(--maxw) - 0px); }
.about-grid { display: grid; gap: clamp(28px, 5vw, 56px); grid-template-columns: 1fr; align-items: center; }
.about-copy h2 { margin: 0 0 18px; font-size: clamp(24px, 4vw, 38px); font-weight: 900; line-height: 1.18; letter-spacing: -0.02em; }
.about-copy p { margin: 0 0 14px; color: #d7d4cc; font-size: 15px; max-width: 34em; }
.about-quiet { color: #a7a39a !important; }
.about .link-arrow { color: #ff7a70; }
.about-media { margin: 0; }
.about-photo { position: relative; }
.about-media img { width: 100%; border-radius: 20px; box-shadow: var(--shadow-lg); aspect-ratio: 4 / 5; object-fit: cover; background: #2a2925; }
.about-tl {
  position: absolute; left: 14px; bottom: 14px; right: 14px;
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--paper-2) 88%, transparent);
  backdrop-filter: blur(8px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-md);
}
.about-tl-cap { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); }
.about-tl-item { display: flex; gap: 10px; font-size: 13px; color: var(--ink); }
.about-tl-item b { font-family: "Baloo 2", sans-serif; font-weight: 600; color: var(--accent-ink); min-width: 42px; }
.about-media figcaption { margin-top: 12px; font-size: 12.5px; color: #a7a39a; }

/* ---------------- Footer ---------------- */
.footer { max-width: var(--maxw); margin: 0 auto; padding: 40px 20px 56px; border-top: 1px solid var(--line); }
.footer-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.footer-gh { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.footer-gh:hover { color: var(--ink); }
.footer-note { margin: 18px 0 4px; font-size: 12.5px; color: var(--muted); }
.footer-copy { margin: 0; font-family: "Baloo 2", sans-serif; font-size: 12px; color: var(--muted); }

/* ---------------- Overlays / dialogs ---------------- */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 22px;
  background: rgba(27, 26, 23, 0.55); backdrop-filter: blur(5px);
  animation: fade 0.18s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.dialog {
  width: 100%; max-width: 360px; background: var(--paper-2);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-lg);
  animation: rise 0.26s var(--ease);
}
@keyframes rise { from { transform: translateY(12px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }

.match-dialog { text-align: center; }
.match-kicker { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; color: var(--accent-ink); text-transform: uppercase; }
.match-title { margin: 0 0 6px; font-size: 24px; font-weight: 900; letter-spacing: -0.01em; }
.match-sub { margin: 0 0 18px; font-size: 13.5px; color: var(--ink-2); }
.match-logs { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 22px; }
.match-av { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 3px solid var(--paper-2); box-shadow: var(--shadow-sm); }
.match-you { display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, var(--paper-2)); color: var(--accent-ink); }
.match-swap { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; }
.dialog-actions { display: flex; flex-direction: column; gap: 10px; }

/* プライバシーポリシー同意 */
.pf-consent { margin-top: 2px; }
.pf-check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.6; color: var(--ink-2); cursor: pointer; }
.pf-check input { margin-top: 2px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); cursor: pointer; }
.pf-link { background: none; border: none; padding: 0; font: inherit; color: var(--accent-ink); font-weight: 700; text-decoration: underline; cursor: pointer; }
.policy-dialog { max-width: 400px; max-height: 84dvh; display: flex; flex-direction: column; }
.policy-title { margin: 0 0 12px; font-size: 20px; font-weight: 900; }
.policy-body { flex: 1; overflow-y: auto; margin-bottom: 16px; font-size: 13.5px; line-height: 1.75; color: var(--ink-2); }
.policy-body h3 { margin: 16px 0 4px; font-size: 14px; font-weight: 700; color: var(--ink); }
.policy-body p { margin: 0; }

/* viewer */
/* プロフィールビューアは全画面表示（トークより前面） */
#logViewer { padding: 0; z-index: 90; }
.viewer {
  max-width: none; width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0;
  overflow-y: auto; display: flex; flex-direction: column; align-items: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 20px calc(24px + env(safe-area-inset-bottom, 0px));
}
.viewer > * { width: 100%; max-width: 460px; }
.viewer-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin: 8px 0 22px; }
.viewer-av { width: 128px; height: 128px; border-radius: 28px; object-fit: cover; background: var(--line); box-shadow: var(--shadow-sm); }
.viewer-name { font-weight: 900; font-size: 22px; }
.viewer-vibe { font-size: 13.5px; color: var(--muted); }
.viewer-timeline { margin-bottom: 18px; }
.viewer-bio { margin: 0 0 14px; font-size: 14px; line-height: 1.75; color: var(--ink-2); white-space: pre-wrap; }
.viewer-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* 通報・ブロック */
.viewer-actions { display: flex; justify-content: center; gap: 18px; margin: 4px 0 14px; }
.viewer-flag {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; padding: 6px 8px; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.viewer-flag:hover { color: var(--accent-ink); }
.report-sub { margin: 0 0 14px; font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.report-reasons { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.report-reason {
  display: flex; align-items: center; gap: 10px; padding: 11px 10px; cursor: pointer;
  border-radius: 12px; font-size: 14px; color: var(--ink);
}
.report-reason:hover { background: var(--paper); }
.report-reason input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); cursor: pointer; }

/* confetti */
.confetti { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.cf {
  position: absolute; top: -12%; width: 9px; height: 14px; border-radius: 2px;
  animation: fall cubic-bezier(0.3, 0.7, 0.5, 1) forwards;
}
.cf.round { border-radius: 50%; }
@keyframes fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx, 0), 116vh) rotate(var(--r, 600deg)); opacity: 0.95; }
}

/* match: 派手な成立演出 */
.match-dialog { position: relative; overflow: hidden; }
.match-dialog > * { position: relative; z-index: 1; }
.match-dialog::before {                       /* サンバースト光線 */
  content: ""; position: absolute; z-index: 0; top: 118px; left: 50%;
  width: 560px; height: 560px; margin: -280px 0 0 -280px; pointer-events: none;
  background: repeating-conic-gradient(var(--accent) 0deg 0.7deg, transparent 0.7deg 10deg);
  opacity: 0.12; animation: rays 14s linear infinite;
}
.match-dialog::after {                         /* 中心グロー */
  content: ""; position: absolute; z-index: 0; top: 118px; left: 50%;
  width: 260px; height: 260px; transform: translate(-50%, -50%); pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, transparent) 0%, transparent 70%);
  animation: glowPulse 1.6s ease-in-out infinite;
}
@keyframes rays { to { transform: rotate(360deg); } }
@keyframes glowPulse { 0%, 100% { opacity: 0.45; transform: translate(-50%, -50%) scale(0.92); } 50% { opacity: 0.85; transform: translate(-50%, -50%) scale(1.08); } }

.match-kicker { animation: dropIn 0.5s var(--ease) both; }
.match-title { animation: popIn 0.55s 0.1s var(--ease) both; transform-origin: center; }
.match-you { animation: flyL 0.6s 0.15s var(--ease) both; }
.match-logs .match-av { animation: flyR 0.6s 0.15s var(--ease) both; }
.match-swap { animation: spark 0.5s 0.5s var(--ease) both; }
.match-swap::after {                            /* スワップ周りのリング */
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0; animation: ring 0.9s 0.55s ease-out forwards;
}
@keyframes dropIn { 0% { opacity: 0; transform: translateY(-10px); } 100% { opacity: 1; transform: none; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.6); } 60% { opacity: 1; transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes flyL { 0% { opacity: 0; transform: translateX(-46px) scale(0.6) rotate(-12deg); } 65% { transform: translateX(7px) scale(1.08); } 100% { opacity: 1; transform: none; } }
@keyframes flyR { 0% { opacity: 0; transform: translateX(46px) scale(0.6) rotate(12deg); } 65% { transform: translateX(-7px) scale(1.08); } 100% { opacity: 1; transform: none; } }
@keyframes spark { 0% { opacity: 0; transform: scale(0) rotate(-120deg); } 70% { opacity: 1; transform: scale(1.3) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes ring { 0% { opacity: 0.8; transform: scale(0.6); } 100% { opacity: 0; transform: scale(2.4); } }

/* ---------------- Reveal on scroll ---------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.steps .step.reveal { transition-delay: 0s; }
.steps .step:nth-child(2).reveal { transition-delay: 0.08s; }
.steps .step:nth-child(3).reveal { transition-delay: 0.16s; }

/* ---------------- Responsive ---------------- */
@media (min-width: 760px) {
  .hero { grid-template-columns: 1.05fr 0.95fr; padding-top: clamp(40px, 6vw, 80px); }
  .hero-copy { order: 1; }
  .hero-demo { order: 2; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .about-grid { grid-template-columns: 1.1fr 0.9fr; }
  .about-media { order: 2; }
  .about-media img { max-width: 380px; margin-left: auto; }
}

@media (max-width: 540px) {
  .nav-links a:not(.nav-cta) { display: none; }   /* 狭い端末はCTAのみ残す */
  /* ファーストビューで実機デモが見えるよう、コピー側を引き締める */
  .hero { padding-top: 18px; gap: 22px; }
  .eyebrow { margin-bottom: 10px; }
  .hero-title { font-size: clamp(30px, 8.5vw, 40px); margin-bottom: 12px; }
  .hero-sub { margin-bottom: 18px; font-size: 14px; line-height: 1.6; }
  .hero-actions { gap: 10px; margin-bottom: 14px; }
  .btn-primary, .btn-ghost { padding: 11px 18px; font-size: 14px; }
  .hero-note { font-size: 12.5px; }
  .phone { width: min(330px, 90vw); }
  .stage { height: clamp(420px, 58vh, 480px); }
}

/* ---------------- Standalone app page (app.html) ---------------- */
.app-page {
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% -10%, #f1e9ff 0%, rgba(241, 233, 255, 0) 60%),
    radial-gradient(90% 60% at 50% 112%, color-mix(in srgb, var(--accent) 7%, var(--paper)) 0%, var(--paper) 55%);
}
.app-shell {
  display: flex; flex-direction: column;
  width: 100%; max-width: 460px; margin: 0 auto;
  height: 100dvh;
  /* ステータスバー/ノッチ回避（Android15+ のエッジ・トゥ・エッジや iOS ノッチ対応） */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.app-bar {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 58px; padding: 0 14px;
  border-bottom: 1px solid var(--line);
}
.app-bar .brand-word { font-size: 17px; }
.app-back {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 50%; color: var(--ink-2); transition: background 0.2s, color 0.2s;
}
.app-back:hover { background: var(--line); color: var(--ink); }
.app-bar-spacer { width: 38px; flex: 0 0 auto; } /* app-back と対でブランドを中央寄せ */

/* スワイプ右上の絞り込み（虫眼鏡）。※丸アイコンにはしない＝プレーンなアイコンボタン */
.app-search {
  border: none; background: transparent; color: var(--ink-2); cursor: pointer;
  padding: 6px; margin-right: 2px; display: inline-grid; place-items: center; flex: 0 0 auto;
}
.app-search:hover { color: var(--brand); }
.filter-locked { color: var(--accent-ink); font-weight: 700; }
.filter-sub-btn { width: 100%; margin: 2px 0 14px; }

/* 言語切替（プロフィール下部） */
.contact-row { text-align: center; margin-top: 12px; }
.contact-link {
  font-family: inherit; font-size: 13px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px;
}
.contact-link:hover { color: var(--ink); }
.lang-row { text-align: center; margin-top: 12px; }
.lang-toggle {
  border: 1px solid var(--line); background: transparent; color: var(--ink-2);
  font-family: inherit; font-size: 12.5px; font-weight: 700; padding: 7px 18px;
  border-radius: 999px; cursor: pointer;
}
.lang-toggle:hover { border-color: var(--ink-2); color: var(--ink); }

/* 自分のプロフィール画像（アプリバー右の丸アイコン） */
.my-avatar {
  width: 36px; height: 36px; flex: 0 0 auto; padding: 0; border: none; cursor: pointer;
  border-radius: 50%; overflow: hidden; background: var(--paper-2);
  display: inline-grid; place-items: center; color: var(--muted);
  box-shadow: 0 1px 4px rgba(27, 26, 23, 0.12);
}
.my-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* スワイプ画面のブースト（所持していると右上に出る） */
.swipe-boost {
  position: absolute; top: 12px; right: 12px; z-index: 6;
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper-2); box-shadow: 0 4px 14px rgba(27, 26, 23, 0.20);
}
.swipe-boost.is-active {
  box-shadow: 0 0 0 3px #f5b301, 0 6px 18px rgba(245, 179, 1, 0.5);
  animation: boostpulse 1.5s ease-in-out infinite;
}
@keyframes boostpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.09); } }
.swipe-boost-badge {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
@media (prefers-reduced-motion: reduce) { .swipe-boost.is-active { animation: none; } }

.app-stage { flex: 1 1 auto; min-height: 0; display: flex; padding: 16px 16px 0; }
.app-stage .stage { flex: 1; width: 100%; height: auto; min-height: 0; }
.app-controls { flex: 0 0 auto; align-items: center; gap: 28px; padding: 18px 0 22px; }
.ctrl-cap.dark { color: var(--ink-2); }
.demo-hint.dark { color: var(--muted); padding: 4px 16px 12px; }

/* 明るい背景ではコーチの白カードを少しだけ濃く */
.app-page .coach-side { background: rgba(27, 26, 23, 0.78); }

/* ---------------- 下部タブ＋各ビュー ---------------- */
.view-pad { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 16px 18px; }
.view-title { margin: 4px 0 14px; font-size: 20px; font-weight: 900; letter-spacing: -0.01em; }

/* ネイティブ実バナー表示時は、下部オーバーレイに隠れないよう余白を確保 */
#view-chat.has-native-banner { padding-bottom: 112px; }

/* ログ下部バナー（自社／Webフォールバック。ネイティブは実AdMobバナー） */
.log-banner {
  position: sticky; bottom: 0; z-index: 3;
  display: flex; align-items: center; gap: 12px;
  width: 100%; margin-top: 14px; padding: 12px 14px;
  border: 0; border-radius: 16px; cursor: pointer; text-align: left;
  color: #fff; font-family: inherit;
  background:
    radial-gradient(90% 130% at 88% 6%, rgba(255,255,255,0.30) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(120deg, #ff5cb3 0%, #ff2f9c 46%, #b31f77 100%);
  box-shadow: 0 12px 28px rgba(45, 15, 40, 0.38);
  transition: transform 0.12s var(--ease);
}
.log-banner:active { transform: translateY(1px) scale(0.995); }
.lb-badge {
  flex: 0 0 auto; font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
  color: #fff; background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.4); border-radius: 999px; padding: 2px 7px;
}
.lb-emoji { flex: 0 0 auto; font-size: 22px; line-height: 1; }
.lb-text { display: flex; flex-direction: column; line-height: 1.32; margin-right: auto; min-width: 0; }
.lb-title { font-size: 14px; font-weight: 800; }
.lb-sub { font-size: 11.5px; color: rgba(255,255,255,0.9); }
.lb-arrow { flex: 0 0 auto; font-size: 18px; font-weight: 800; opacity: 0.9; }

.tabbar {
  flex: 0 0 auto; display: flex;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
}
.tab {
  flex: 1; position: relative; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 14px 0; border: none; background: none;
  color: var(--muted); transition: color 0.2s;
}
.tab.is-active { color: var(--accent); }
.tab .ico-line { color: currentColor; }
.tab-badge {
  position: absolute; top: 3px; left: calc(50% + 6px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  display: grid; place-items: center;
  background: #e5342a; color: #fff; font-size: 10px; font-weight: 700;
}
.tab-dot {
  position: absolute; top: 5px; left: calc(50% + 8px);
  width: 9px; height: 9px; border-radius: 50%; background: #e5342a;
  box-shadow: 0 0 0 2px var(--paper);
}

/* チャット（成立した相手） */
.chat-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 32px 12px; line-height: 1.7; }
.chat-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px; border: none; background: transparent; border-radius: 14px;
  cursor: pointer; text-align: left; font-family: inherit; transition: background 0.15s;
}
.chat-row:hover { background: var(--paper-2); }
.chat-av { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--line); flex: 0 0 auto; }
.chat-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-name { font-weight: 700; font-size: 15px; }
.chat-last { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-go { color: var(--muted); font-size: 22px; line-height: 1; flex: 0 0 auto; }

/* プロフィールタブ */
.ps-card { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 12px 0 4px; }
.ps-av { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; background: var(--line); border: 3px solid var(--paper-2); box-shadow: var(--shadow-sm); }
.ps-av-empty { display: grid; place-items: center; color: var(--muted); }
.ps-name { font-size: 20px; font-weight: 900; }
.ps-meta { font-size: 13.5px; color: var(--ink-2); }
.ps-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 4px; }
.ps-sub { width: 84px; height: 84px; border-radius: 14px; object-fit: cover; margin-top: 10px; border: 1px solid var(--line); }
.ps-note { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.view-profile .btn-ghost { width: 100%; margin-top: 18px; }
#view-profile .btn-ghost { width: 100%; margin-top: 18px; }

/* アカウント削除（控えめな危険操作リンク＋確認ダイアログ内の実行ボタン） */
.btn-danger-link {
  display: block; width: 100%; margin-top: 14px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px;
}
.btn-danger-link:hover { color: #c8362b; }
.btn-danger {
  background: #c8362b; color: #fff; border: 1px solid #c8362b;
  border-radius: 999px; padding: 12px 20px;
  font-family: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
}
.btn-danger:hover { background: #b02e24; border-color: #b02e24; }
.pf-vsize { color: var(--ink-2); }

/* ---------------- 初回プロフィール入力 ---------------- */
.profile-setup {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
  width: 100%; padding: 8px 4px 12px; overflow-y: auto;
}
.profile-setup .ps-head { margin-bottom: 2px; }
.ps-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ps-head-row h2 { margin: 0; }
.profile-setup h2 { font-size: 22px; font-weight: 900; letter-spacing: -0.01em; }
.profile-setup .ps-sub { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.ps-preview-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: var(--paper-2); border: 1.5px solid var(--line); color: var(--ink);
  font-family: inherit; font-size: 13px; font-weight: 700;
  transition: border-color 0.2s, background 0.2s;
}
.ps-preview-btn:hover { border-color: var(--ink); }
.ps-preview-btn .ico-line { color: var(--accent); }

/* ハッシュタグ選択チップ */
.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-chip {
  font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 7px 13px; border-radius: 999px;
  background: var(--paper-2); border: 1.5px solid var(--line); color: var(--ink-2);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.pf-chip:hover { border-color: var(--ink-2); }
.pf-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* プレビュー（モーダル） */
.preview-dialog { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.preview-cap { margin: 0; align-self: flex-start; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.preview-dialog .pf-card-preview { width: 220px; max-width: 100%; }
.preview-dialog .btn-primary { width: 100%; }

.pf-field { display: flex; flex-direction: column; gap: 6px; }
.pf-field label, .pf-field .pf-field-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.pf-hint { margin: 0; font-size: 12px; color: var(--muted); }
.pf-err { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--accent-ink); }
.pf-input {
  background: var(--paper-2); border: 1.5px solid var(--line); border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit; font-size: 15px; color: var(--ink);
  padding: 12px 14px; width: 100%;
}
.pf-input::placeholder { color: var(--muted); }
.pf-input:focus-visible {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
/* プルダウンもアプリ仕様に（ネイティブの標準見た目を消してカスタム矢印） */
.pf-select-wrap { position: relative; }
.pf-select-wrap select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  width: 100%; padding-right: 40px; cursor: pointer;
}
.pf-select-wrap::after {
  content: ""; position: absolute; right: 16px; top: 50%; pointer-events: none;
  width: 9px; height: 9px; margin-top: -3px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
}
.pf-select-wrap:focus-within::after { border-color: var(--accent); }
/* プレースホルダ的な未選択状態は少し淡く */
.pf-select-wrap select:invalid, .pf-select-wrap select option[value=""] { color: var(--muted); }

.pf-input[aria-invalid="true"], .pf-input[aria-invalid="true"]:focus-visible {
  border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.profile-setup .btn-primary { margin-top: 4px; width: 100%; }
/* ネイティブのファイル選択UIは隠し、カスタムボタンに差し替え */
.pf-file-input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.pf-upload {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 10px 16px; border-radius: 999px; cursor: pointer;
  background: var(--paper-2); border: 1.5px solid var(--line); color: var(--ink);
  font-family: inherit; font-size: 14px; font-weight: 700;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.pf-upload:hover { border-color: var(--ink); }
.pf-upload .ico-line { color: var(--accent); }
.pf-file-input:focus-visible + .pf-upload {
  outline: 2.5px solid var(--accent); outline-offset: 2px;
}
.pf-upload.is-set {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, var(--paper-2));
}

/* 相手に表示されるプロフィールのプレビュー（動画を大きく＋左下に画像アイコン） */
.pf-card-preview {
  position: relative; width: 200px; max-width: 100%; aspect-ratio: 3 / 4;
  border-radius: 18px; overflow: hidden; background: #14131a; box-shadow: var(--shadow-md);
}
.pf-pv-media { width: 100%; height: 100%; }
.pf-pv-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-pv-empty {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  text-align: center; color: #fff; opacity: 0.72; font-size: 12.5px; line-height: 1.5; background: #2a2733;
}
.pf-pv-icon {
  position: absolute; left: 12px; bottom: 12px; width: 56px; height: 56px;
  border-radius: 14px; object-fit: cover; border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); background: var(--line);
}

/* 動画の見せ方エディタ（トリミング・向き調整） */
.ve-dialog { width: min(92vw, 380px); }
.ve-stage { display: flex; justify-content: center; margin: 14px 0; }
.ve-canvas {
  width: auto; height: min(52vh, 460px); max-width: 100%;
  aspect-ratio: 4 / 5; border-radius: 18px; background: #1b1a17;
  touch-action: none; cursor: grab; display: block;
  box-shadow: var(--shadow-md);
}
.ve-canvas:active { cursor: grabbing; }
.ve-tools { display: flex; gap: 10px; }
.ve-btn {
  flex: 1 1 0; padding: 11px 8px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--paper-2);
  font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer;
}
.ve-btn:hover { border-color: var(--accent-ink); }
.ve-zoom {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 2px 2px; font-size: 14px; color: var(--muted);
}
.ve-zoom input { flex: 1 1 auto; accent-color: var(--accent-ink); }

@media (min-width: 600px) {
  .app-shell {
    height: auto; min-height: 100dvh;
    justify-content: center;
    padding: 24px 0 calc(24px + env(safe-area-inset-bottom));
  }
  .app-page .app-stage .stage { height: clamp(480px, 70vh, 580px); flex: 0 0 auto; }
}

/* 横向き・低い画面：広い画面用レイアウトに入ってもカードがはみ出さないよう詰める */
@media (orientation: landscape) and (max-height: 600px) {
  .app-shell {
    height: 100dvh; min-height: 0;
    justify-content: flex-start;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .app-bar { height: 50px; }
  .app-stage { padding: 8px 16px 0; }
  .app-page .app-stage .stage { height: auto; flex: 1 1 auto; min-height: 0; }
  .app-controls { gap: 20px; padding: 8px 0 10px; }
  .app-controls .ctrl-no, .app-controls .ctrl-yes { width: 52px; height: 52px; }
  .app-controls .ctrl-info { width: 42px; height: 42px; }
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .coach { display: none; }
}

/* =========================================================
   追加機能：ハンドルID / 交換用ID / トーク枠 / モザイク / トーク画面 / 課金
   ========================================================= */

/* ハンドルID入力（@プレフィックス付き） */
.pf-handle-wrap { position: relative; display: flex; align-items: center; }
.pf-handle-at { position: absolute; left: 14px; font-weight: 700; color: var(--muted); pointer-events: none; }
.pf-handle-input { padding-left: 30px; }
.pf-input:disabled, .pf-input.is-locked { background: var(--paper); color: var(--muted); cursor: not-allowed; }
.pf-handle-wrap.is-locked .pf-handle-at { color: var(--muted); }
.pf-locked-note { color: var(--accent-ink); font-weight: 700; }

/* 招待ID（チップ入力） */
.invite-box {
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper-2); padding: 8px 10px;
}
.invite-box:focus-within { border-color: var(--accent); }
.invite-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.invite-chips:not(:empty) { margin-bottom: 8px; }
.invite-chip {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  background: color-mix(in srgb, var(--accent) 12%, var(--paper-2)); color: var(--accent-ink);
  border-radius: 999px; padding: 5px 5px 5px 12px; font-size: 13px; font-weight: 700;
}
.invite-code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-x {
  display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px;
  border: none; border-radius: 50%; background: rgba(30, 26, 40, 0.10); color: inherit; cursor: pointer;
}
.invite-x:hover { background: rgba(30, 26, 40, 0.2); }
.invite-input {
  width: 100%; border: none; background: transparent; padding: 5px 2px; outline: none;
  font-family: inherit; font-size: 15px; color: var(--ink);
}
.invite-input::placeholder { color: var(--muted); }

/* チャットタブ：見出し行（ログ（0/5）＋上限解放） */
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.chat-head .view-title { margin: 0; }
.chat-count { font-size: 15px; font-weight: 700; color: var(--muted); margin-left: 2px; }
.chat-unlock {
  flex: 0 0 auto; border: none; background: color-mix(in srgb, var(--accent) 12%, var(--paper-2));
  color: var(--accent-ink); font-family: inherit; font-weight: 700; font-size: 12.5px;
  padding: 8px 15px; border-radius: 999px; cursor: pointer;
}
.chat-unlock:hover { background: color-mix(in srgb, var(--accent) 20%, var(--paper-2)); }

/* プロフィールタブ：見出し行（プロフィール＋編集の鉛筆アイコン） */
.profile-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.profile-head .view-title { margin: 0; }
.profile-edit-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border: none; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--paper-2));
  color: var(--accent-ink); cursor: pointer;
}
.profile-edit-btn:hover { background: color-mix(in srgb, var(--accent) 20%, var(--paper-2)); }

/* 成立・未トーク（モザイクで上部に） */
.pending-wrap { margin-bottom: 14px; }
.pending-head {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 12.5px; color: var(--muted); margin-bottom: 8px; font-weight: 700;
}
.pending-count { color: var(--accent-ink); }
.pending-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.pending-item {
  position: relative;
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: none; background: transparent; cursor: pointer; font-family: inherit; width: 64px;
}
.pending-clock {
  position: absolute; top: -3px; left: -1px; z-index: 1;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--paper-2); box-shadow: var(--shadow-sm);
}
.pending-clock.green { color: var(--ok); }
.pending-clock.yellow { color: #d99a12; }
.pending-clock.red { color: #e5342a; }
.pending-av {
  width: 60px; height: 60px; border-radius: 50%; object-fit: cover; background: var(--line);
  border: 2px solid var(--paper-2); box-shadow: var(--shadow-sm);
  filter: blur(7px) saturate(0.9); /* トーク前はモザイク */
}
.pending-name {
  font-size: 11.5px; color: var(--ink-2); max-width: 64px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; filter: blur(3px);
}
.chat-idok {
  font-size: 10.5px; font-weight: 700; color: var(--ok);
  background: color-mix(in srgb, var(--ok) 14%, var(--paper-2)); padding: 1px 7px; border-radius: 999px; margin-left: 4px;
}

/* トーク画面 */
/* トーク画面は全画面表示 */
#threadOverlay { padding: 0; }
.thread-dialog {
  max-width: none; width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0;
  display: flex; flex-direction: column; padding: 0; overflow: hidden;
}
.thread-head {
  display: flex; align-items: center; gap: 11px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
  border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.thread-av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--line); cursor: pointer; }
.thread-id { flex: 1; min-width: 0; }
.thread-name { font-weight: 800; font-size: 15.5px; }
.thread-handle { font-size: 12px; color: var(--muted); }
.thread-close { border: none; background: transparent; color: var(--ink-2); cursor: pointer; padding: 4px; border-radius: 8px; }
.thread-close:hover { background: var(--paper); }

.thread-log {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px;
  background: var(--paper);
}
.thread-hint { color: var(--muted); font-size: 13px; text-align: center; margin: auto 0; }
.bubble {
  max-width: 76%; padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.55;
  word-break: break-word;
}
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.bubble.them { align-self: flex-start; background: var(--paper-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bubble.is-stamp { background: transparent !important; border: none !important; padding: 2px 6px; line-height: 1; }
.bubble.is-stamp .stk { width: 64px; height: 64px; display: block; }

/* ID交換バー */
.idx-bar { flex: 0 0 auto; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--paper-2); }
.idx-bar.wait { text-align: center; }
.idx-wait { font-size: 12px; color: var(--muted); }
.idx-bar.ready { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.idx-btn {
  border: none; background: var(--accent); color: #fff; font-family: inherit; font-weight: 700; font-size: 14px;
  padding: 10px 20px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.idx-btn .ico-line { color: #fff; }
.idx-btn:hover { background: #000; }
.idx-btns { display: flex; gap: 8px; align-items: center; }
.idx-unmatch {
  border: 1px solid var(--line); background: var(--paper-2); color: var(--ink-2);
  font-family: inherit; font-weight: 700; font-size: 13px; padding: 9px 16px; border-radius: 999px; cursor: pointer;
}
.idx-unmatch:hover { border-color: var(--accent); color: var(--accent-ink); }
.idx-cap { font-size: 11px; color: var(--muted); }
.idx-cap-strong { font-size: 12px; color: var(--accent-ink); font-weight: 700; }
.idx-bar.addid { display: flex; flex-direction: column; gap: 8px; }
.idx-add { display: flex; gap: 8px; }
.idx-add-input {
  flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper-2);
  padding: 9px 12px; font-family: inherit; font-size: 15px; color: var(--ink); outline: none;
}
.idx-add-input:focus { border-color: var(--accent); }
.idx-add-btn {
  flex: 0 0 auto; border: none; background: var(--accent); color: #fff; font-family: inherit; font-weight: 700;
  font-size: 14px; padding: 9px 18px; border-radius: 999px; cursor: pointer;
}
.idx-add-btn:hover { background: var(--accent-ink); }
.thread-input.is-disabled { opacity: 0.45; pointer-events: none; }
.idx-bar.revealed { display: flex; flex-direction: column; gap: 6px; }
.idx-done { font-weight: 800; color: var(--ok); font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.idx-pair { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.idx-label { flex: 0 0 68px; color: var(--muted); font-size: 11.5px; }
.idx-val { font-weight: 700; color: var(--ink); word-break: break-all; }

/* 定型文＋スタンプ入力 */
.thread-input { flex: 0 0 auto; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--paper-2); }
.thread-stamps { display: flex; gap: 6px; margin-bottom: 8px; }
.stamp-btn {
  border: 1px solid var(--line); background: var(--paper-2); border-radius: 12px; cursor: pointer;
  padding: 5px 8px; flex: 1; display: grid; place-items: center; line-height: 1;
}
.stamp-btn .stk { width: 34px; height: 34px; display: block; }
.stamp-btn:hover { border-color: var(--ink); }

/* ビュー見出しの左に置くミニステッカー（ログ／プロフィール） */
.vt-ico { display: inline-flex; vertical-align: -0.28em; margin-right: 7px; }
.vt-ico .stk { width: 26px; height: 26px; display: block; }
.thread-phrases { display: flex; flex-wrap: wrap; gap: 6px; }
.phrase-btn {
  border: 1px solid var(--line); background: var(--paper-2); border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 12.5px; color: var(--ink); padding: 7px 13px;
}
.phrase-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.thread-unmatch {
  flex: 0 0 auto; border: none; background: transparent; color: var(--muted);
  font-family: inherit; font-size: 12px; padding: 10px; cursor: pointer; text-decoration: underline;
}
.thread-unmatch:hover { color: var(--accent-ink); }

/* 上限オーバーレイ */
.limit-dialog { text-align: center; }
.limit-actions { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.limit-actions .btn-primary, .limit-actions .btn-ghost { width: 100%; }

/* スワイプ上限：LogSwap Premier のフルスクリーン案内 */
.promo-overlay { padding: 0; place-items: stretch; }
.promo-sheet {
  position: relative;
  width: 100%; max-width: 420px; margin: auto;
  min-height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 64px 28px 40px; text-align: center;
  background:
    radial-gradient(120% 70% at 50% -8%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%),
    radial-gradient(120% 60% at 50% 108%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    var(--paper);
  animation: rise 0.3s var(--ease);
}
.promo-close {
  position: absolute; top: 16px; left: 16px;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: none; border-radius: 50%; cursor: pointer;
  background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink);
}
.promo-close:hover { background: color-mix(in srgb, var(--ink) 16%, transparent); }
.promo-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--brand); margin-bottom: 6px; }
.promo-glyph { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.promo-word {
  font-family: "Baloo 2", var(--font-jp, inherit); font-weight: 700;
  font-size: 26px; letter-spacing: -0.01em; color: var(--ink);
}
.promo-word-accent { color: var(--brand); }
.promo-lead { margin: 6px 0 18px; font-size: 15px; font-weight: 700; color: var(--ink-2); }
.promo-list {
  list-style: none; margin: 0 0 22px; padding: 0;
  display: flex; flex-direction: column; gap: 12px; text-align: left;
}
.promo-list li {
  position: relative; padding-left: 30px;
  font-size: 15px; font-weight: 700; color: var(--ink);
}
.promo-list li::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 20px; height: 20px; margin-top: -10px; border-radius: 50%;
  background: var(--brand) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 12l5 5 9-10' fill='none' stroke='%23101016' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/13px no-repeat;
}
.promo-price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 20px; }
.promo-price-num { font-size: 40px; font-weight: 900; letter-spacing: -0.02em; color: var(--ink); }
.promo-price-unit { font-size: 15px; font-weight: 700; color: var(--muted); }
.promo-cta { width: 100%; max-width: 320px; font-size: 16px; padding: 15px; }
.promo-ad { width: 100%; max-width: 320px; margin-top: 12px; }
.promo-adnote { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.promo-sheet .iap-legal { max-width: 320px; margin-top: 16px; }

/* サブスクの必須表記（自動更新の説明＋規約/プライバシーのリンク）App Store審査要件 */
.iap-legal { margin: 12px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); text-align: center; }
.iap-legal-link {
  background: none; border: none; padding: 0; font: inherit; font-size: inherit;
  color: var(--accent-ink); text-decoration: underline; cursor: pointer;
}

/* プレミアム（課金デモ） */
.premium-card {
  margin-top: 16px; padding: 18px; border-radius: var(--radius-lg);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--paper-2)), var(--paper-2));
  border: 1px solid var(--line);
}
.premium-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.premium-badge { font-weight: 900; font-size: 15px; letter-spacing: -0.01em; }
.premium-state { font-size: 12px; font-weight: 700; color: var(--muted); padding: 3px 10px; border-radius: 999px; background: var(--paper); }
.premium-state.on { color: #fff; background: var(--ok); }
.premium-list { margin: 0 0 14px; padding-left: 18px; font-size: 13px; color: var(--ink-2); line-height: 1.9; }
.premium-card .btn-primary.sm { width: 100%; }
.premium-plans { display: flex; gap: 8px; }
.premium-plans .btn-primary, .premium-plans .btn-ghost { flex: 1; width: auto; }
#subCancelBtn { width: 100%; }
.premium-restore {
  display: block; width: 100%; margin-top: 10px; padding: 4px;
  background: none; border: none; font-family: inherit; font-size: 12px;
  color: var(--muted); text-decoration: underline; cursor: pointer;
}
.premium-restore:hover { color: var(--ink-2); }
.premium-filter { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.premium-sub { margin: 0 0 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.boost-btn { width: 100%; margin-top: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.boost-note { margin: 8px 0 0; font-size: 12.5px; font-weight: 700; color: var(--accent-ink); text-align: center; display: flex; align-items: center; justify-content: center; gap: 5px; }

.ps-handle { font-size: 13px; color: var(--muted); font-weight: 700; margin-top: -2px; }
.ps-bio { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
