/* コマドリ ブランド（brand/BRAND.md）
   Orange は面・装飾のみ。文字は明るい背景で Text Orange、暗い背景で Text Orange (Dark)。
   Orange の面に載せる文字は Ink（4.96:1）。白文字は使わない。 */
:root {
  --bg: #faf5ec;            /* Paper */
  --surface: #fffdf8;
  --text: #2a2320;          /* Ink */
  --muted: #6e625b;
  --line: #e6dccb;
  --accent: #ee6a2f;        /* Orange（面） */
  --accent-text: #2a2320;   /* Orange の面の上の文字 */
  --link: #b4431a;          /* Text Orange（明） */
  --ok: #1f7a4f;
  --radius: 14px;
  --font-head: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Noto Sans JP", "Hiragino Sans", "Meiryo", sans-serif;
  --font-body: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1715;          /* Night */
    --surface: #26201d;
    --text: #faf5ec;
    --muted: #b5a99f;
    --line: #3b332e;
    --link: #f4895a;        /* Text Orange (Dark) */
    --ok: #5fcf9a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font-body);
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
h1, h2 { font-family: var(--font-head); }
button, input { font: inherit; color: inherit; }
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: block; line-height: 0; text-decoration: none; }
.brand img { display: block; height: 42px; width: auto; margin: -5px 0 -5px -4px; }
.brand .logo-mark { display: none; }
[hidden] { display: none !important; }
#nav { display: flex; align-items: center; gap: 2px; }
#nav a { white-space: nowrap; font-size: 14px; padding: 6px 7px; border-radius: 999px; text-decoration: none; color: var(--muted); }
#nav a[aria-current="page"] { color: var(--text); background: var(--surface); }
main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; }
main.wide { max-width: 1040px; }
h1 { font-size: 22px; margin: 8px 0 12px; font-weight: 700; }
h2 { font-size: 16px; margin: 24px 0 8px; color: var(--muted); font-weight: 700; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-text); font-weight: 700; text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: default; }
.ghost { text-decoration: none; background: transparent; border: 1px solid var(--line); color: var(--text); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-weight: 500; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
input[type=text] {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg);
}
.banner { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--surface); }
.banner.active { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.banner strong { font-size: 18px; display: block; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.now { background: var(--accent); color: var(--accent-text); border-color: transparent; font-weight: 700; }
.tile .badge.now { position: absolute; top: 8px; left: 8px; }
.tile-wrap.now .tile { box-shadow: 0 0 0 2px var(--accent), 0 0 18px color-mix(in srgb, var(--accent) 55%, transparent); }
.tile-wrap.now .tile-world { top: 32px; }
.badge.late { color: var(--link); border-color: var(--link); }
.tile .badge.tile-late { position: absolute; left: 8px; bottom: 32px; font-size: 11px; padding: 0 7px; background: rgba(0,0,0,.6); color: #ffd9c4; border-color: rgba(255,217,196,.6); }
.player-caption .badge.player-late { margin-left: 6px; color: #ffd9c4; border-color: rgba(255,217,196,.6); background: rgba(0,0,0,.35); text-shadow: none; }
.world { font-weight: 600; }
.daynav .day-title { font-family: inherit; font-size: inherit; font-weight: 700; margin: 0; }
.daynav { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.grid a { display: block; border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 16/9; position: relative; }
.grid img { width: 100%; height: 100%; object-fit: cover; }
.grid span { position: absolute; left: 6px; bottom: 6px; font-size: 12px; background: rgba(0,0,0,.6); color: #fff; padding: 0 6px; border-radius: 6px; }
ul.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ul.people li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.code { font: 700 22px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.empty { text-align: center; padding: 32px 16px; }
.hero { text-align: center; padding: 32px 0; }
.hero h1 { font-size: 28px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg); z-index: 80; padding: 8px 16px; border-radius: 999px; font-size: 14px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 4px; }
.chips a { white-space: nowrap; text-decoration: none; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.chips a[aria-current] { background: var(--text); color: var(--bg); border-color: var(--text); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tile {
  position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden;
  aspect-ratio: 1 / 1; background: linear-gradient(135deg, #4a3a32, #1b1715); color: #fff; cursor: pointer; text-align: left;
}
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .lock { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; }
.tile .play { position: absolute; top: 8px; right: 8px; font-size: 12px; background: rgba(0,0,0,.55); border-radius: 999px; padding: 2px 8px; }
.tile-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 12px; display: flex; justify-content: space-between; gap: 4px; background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.tile-meta .who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-world { position: absolute; top: 8px; left: 8px; right: 44px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.player { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; display: grid; place-items: center; }
.player-stage { width: 100%; height: 100%; display: grid; place-items: center; }
.player-stage video, .player-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tile .tile-selfie { position: absolute; right: 8px; bottom: 30px; left: auto; top: auto; width: 34%; height: auto; aspect-ratio: 16 / 9; border-radius: 8px; border: 1.5px solid rgba(255,255,255,.9); box-shadow: 0 1px 4px rgba(0,0,0,.5); object-fit: cover; }
.tile .tile-selfie.empty { background: rgba(255,255,255,.25); }
/* 画面の映像 + 自撮りの窓（タップで入れ替え） */
.pip-wrap { --ratio: 1.7778; position: relative; width: min(100%, calc(100vh * var(--ratio))); max-height: 100%; aspect-ratio: var(--ratio); }
.pv { position: absolute; overflow: hidden; background: #000; }
.pv video { width: 100%; height: 100%; object-fit: contain; display: block; max-width: none; max-height: none; }
.pv.main { inset: 0; z-index: 0; }
.pv.inset { right: 8px; bottom: 8px; width: 30%; aspect-ratio: 16 / 9; z-index: 2; border-radius: 12px; border: 2px solid rgba(255,255,255,.9); box-shadow: 0 2px 10px rgba(0,0,0,.6); cursor: pointer; }
.pv.inset video { object-fit: cover; }
.pv.inset:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.player-progress { position: absolute; top: 10px; left: 12px; right: 100px; display: flex; gap: 4px; z-index: 2; }
.player-progress span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.3); }
.player-progress span.done { background: #fff; }
.player-close { position: absolute; top: 2px; right: 8px; z-index: 3; background: none; border: 0; color: #fff; font-size: 24px; cursor: pointer; padding: 6px 10px; }
.player-prev, .player-next { position: absolute; top: 0; bottom: 0; width: 35%; background: none; border: 0; cursor: pointer; z-index: 1; }
.player-prev { left: 0; }
.player-next { right: 0; }
.player-caption .badge.now { margin-left: 6px; }
.player-caption button { display: block; margin-top: 8px; color: #fff; border-color: rgba(255,255,255,.5); background: rgba(0,0,0,.35); }
.player-caption { position: absolute; left: 16px; right: 16px; bottom: 20px; z-index: 2; text-shadow: 0 1px 3px #000; }
.group { display: grid; gap: 10px; margin-bottom: 12px; }
.small-code { font-size: 16px; }
/* グループの「Discord に朝のお知らせ」 */
.webhook { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.webhook p { margin: 0; }
.webhook .warn { color: var(--link); font-weight: 700; }
.webhook summary { cursor: pointer; }
.webhook .steps { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 2px; }
.webhook form input { min-width: 0; flex: 1; }
.webhook .code { overflow-wrap: anywhere; font-size: 13px; letter-spacing: 0; font-weight: 500; }
.member-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.member-list li { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.section-head { margin: 24px 0 8px; }
.section-head h2 { margin: 0; }

/* 夜のタイトル・称号 */
.night { display: grid; gap: 10px; margin: 4px 0 12px; }
.night-title { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); border-left: 4px solid var(--accent); }
.night-title .kicker { font-size: 12px; color: var(--muted); }
.night-title strong { font-size: 22px; line-height: 1.35; overflow-wrap: anywhere; }
.trophies { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.trophies li { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.night > .ghost { justify-self: start; }

/* 今日の画面: クリップを最初の画面に入れるための、小さな見出し・チップ */
.log-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 16px 0 8px; }
.log-head h2 { margin: 0 auto 0 0; }
.log-head .ghost.small { padding: 4px 10px; font-size: 13px; min-height: 36px; }
.hint-btn { min-width: 32px; min-height: 32px; padding: 2px 8px; color: var(--muted); }
.today-hints { display: grid; gap: 2px; margin: 0 0 10px; }
.today-hints p { margin: 0; }
.now-line { margin: 0 0 10px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; overflow-wrap: anywhere; }

/* 朝の「昨日の結果」カード（今日の画面の一番上） */
.morning-card { gap: 6px; margin: 4px 0 12px; border-left: 4px solid var(--accent); }
.morning-scope { margin-left: 8px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; }
.morning-title { font: 900 22px/1.35 var(--font-head); overflow-wrap: anywhere; }
.morning-winner { font-size: 15px; overflow-wrap: anywhere; }
.morning-actions { margin-top: 4px; }

/* グループのゲーム（投票・一番乗り） */
.tile-wrap { position: relative; }
.tile-wrap.winner .tile { outline: 3px solid var(--accent); outline-offset: -3px; }
.tile-marks { position: absolute; left: 6px; bottom: 34px; display: flex; gap: 2px; font-size: 20px; text-shadow: 0 1px 3px #000; pointer-events: none; }
.vote {
  position: absolute; right: 6px; bottom: 34px; min-width: 44px; min-height: 32px; padding: 2px 10px;
  border-radius: 999px; border: 0; cursor: pointer; font-size: 14px; font-weight: 700;
  background: rgba(0,0,0,.6); color: #fff;
}
.vote.on { background: var(--accent); color: var(--accent-text); }
.vote.static { display: inline-flex; align-items: center; cursor: default; }
.vote:focus-visible, .tile:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* カード作成ダイアログ */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal-body { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; }
.modal-body h2 { margin: 0; }
.card-preview { min-height: 60px; }
.card-canvas { display: block; width: 100%; height: auto; border-radius: 10px; background: #1b1715; }

/* 招待リンク・チェックリスト・接続 */
.stack { display: grid; gap: 8px; justify-items: start; }
.btn.big { padding: 14px 24px; font-size: 17px; width: 100%; max-width: 360px; text-align: center; }
.invite h1 { font-size: 30px; margin: 4px 0; overflow-wrap: anywhere; }
.hero .btn.big { margin-top: 8px; }
.checklist { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 10px; }
.check { display: grid; grid-template-columns: 28px 1fr; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.check.done { border-color: var(--ok); }
.check .mark { font-size: 20px; line-height: 1.3; }
.check strong { font-size: 16px; }
.check .stack > * { max-width: 100%; }
.device { text-align: center; padding: 16px 0; display: grid; gap: 12px; justify-items: center; }
.device .card { text-align: left; width: 100%; }
.big-code { font-size: 34px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

.btn:hover:not(:disabled) { filter: brightness(1.05); }
.btn:active:not(:disabled) { filter: brightness(.95); }
.ghost:hover { border-color: var(--muted); }
main p a:not([class]) { color: var(--link); }

/* フッター（全ページ共通） */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 32px; font-size: 13px; color: var(--muted); }
.site-footer .inner { max-width: 1040px; margin: 0 auto; padding: 0 16px; display: grid; gap: 10px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer a { color: var(--muted); padding: 2px 0; }
.site-footer a:hover { color: var(--text); }
.site-footer .op { color: var(--text); }
.site-footer .disclaimer { margin: 0; }

/* 準備中ページ */
.pending { text-align: center; padding: 56px 16px; display: grid; gap: 8px; justify-items: center; }
.pending img { width: 72px; height: 72px; }
.pending h1 { margin: 8px 0 0; }

/* ランディング（ログイン前のトップ） */
body.is-landing .top { display: none; }
.landing { display: grid; gap: 56px; padding-bottom: 8px; }
.landing-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.landing-bar .brand img { height: 60px; margin: -7px 0 -7px -6px; }
.landing-hero { display: grid; gap: 32px; align-items: center; }
.landing-hero .eyebrow { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--link); }
.landing-hero h1 { margin: 0; font-size: 34px; line-height: 1.3; font-weight: 900; letter-spacing: .01em; }
.landing-hero h1 span { display: inline-block; }
.landing-hero .lead { margin: 16px 0 24px; color: var(--muted); font-size: 16px; line-height: 1.8; max-width: 34em; }
.landing-hero .btn.big { max-width: none; width: 100%; }
.landing-hero .note { margin: 12px 0 0; }
.hero-art { display: grid; place-items: center; padding: 8px; }
.today-mock {
  width: 100%; max-width: 360px; padding: 14px; border-radius: 22px; background: var(--bg);
  border: 1px solid var(--line); box-shadow: 0 18px 40px -22px rgba(42,35,32,.45); display: grid; gap: 8px; text-align: left; pointer-events: none; user-select: none;
}
.today-mock .daynav, .today-mock .chips, .today-mock .night, .today-mock .log-head { margin: 0; }
.today-mock .chips { padding-bottom: 0; }
.today-mock .log-head h2 { font-size: 15px; }
.today-mock .night-title strong { font-size: 19px; }
.today-mock .tiles { grid-template-columns: repeat(2, 1fr); }
.today-mock .tile { cursor: default; }
.today-mock .tile-wrap.now .tile { box-shadow: 0 0 0 2px var(--accent), 0 0 18px color-mix(in srgb, var(--accent) 55%, transparent); }
.today-mock .mock-selfie { background: linear-gradient(135deg, #f4a06f, #3a2418); }
.windows-note { margin: 8px 0 0; display: flex; align-items: center; flex-wrap: wrap; column-gap: 2px; row-gap: 4px; }
.windows-note .ghost.small { padding: 2px 10px; margin-left: 6px; }
.linklike { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; cursor: pointer; font: inherit; }
.landing-cta .windows-note { justify-content: center; }
.landing-cta-block { display: grid; gap: 10px; margin-top: 4px; justify-items: start; }
.landing-cta-block .btn.big { max-width: 360px; }
.landing-cta-block .cta-sub, .landing-cta-block .windows-note { margin: 0; }
.landing-cta-block .cta-secondary-row { margin-top: 6px; }
@media (max-width: 520px) { .landing-cta-block, .landing-cta-block .cta-secondary-row { justify-items: stretch; width: 100%; } .landing-cta-block .cta-secondary { flex: 1 1 100%; text-align: center; } }
.landing-cta .landing-cta-block { justify-items: center; }
.landing-cta .landing-cta-block .btn.big { width: 100%; }
/* SmartScreen（青い画面）の見本。Windows の画面を真似た絵なので、ライト・ダークで色を変えない */
.smartscreen-note { text-align: left; }
.smartscreen-note summary { cursor: pointer; color: var(--muted); }
.smartscreen-note[open] .ss-mock { margin-top: 8px; }
.smartscreen-note p { margin: 6px 0 0; color: var(--text); font-weight: 700; }
.more summary { cursor: pointer; color: var(--muted); }
.more p { margin: 6px 0 0; }
.ss-mock { display: flex; align-items: center; gap: 6px; max-width: 360px; pointer-events: none; user-select: none; }
.ss-panel { flex: 1 1 0; min-width: 0; display: grid; gap: 4px; padding: 8px 9px; background: #0b57a4; color: #fff; border-radius: 4px; font-size: 10px; line-height: 1.4; box-shadow: 0 6px 16px -8px rgba(0,0,0,.5); text-align: left; }
.ss-panel strong { font-size: 11px; }
.ss-title { width: 16px; height: 16px; border-radius: 50%; background: rgba(255,255,255,.9); color: #0b57a4; display: grid; place-items: center; font: 800 10px/1 var(--font-head); }
.ss-body { opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-link { justify-self: start; text-decoration: underline; font-weight: 700; outline: 2px solid #ffd24a; outline-offset: 2px; border-radius: 2px; }
.ss-actions { display: flex; gap: 6px; }
.ss-run, .ss-cancel { padding: 2px 8px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.5); }
.ss-run { background: #fff; color: #0b57a4; font-weight: 800; outline: 2px solid #ffd24a; outline-offset: 2px; }
.ss-arrow { color: var(--muted); font-weight: 800; }

.landing-steps h2 { margin: 0 0 16px; font-size: 22px; color: var(--text); text-align: center; }
.landing-steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.landing-steps li { display: grid; align-content: start; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.landing-steps .num { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-text); font: 900 20px/1 var(--font-head); }
.landing-steps li { align-items: center; }
.landing-steps h3 { margin: 2px 0 4px; font: 700 17px/1.4 var(--font-head); }
.landing-steps p { margin: 0; color: var(--muted); font-size: 14px; }
.landing-cta { text-align: center; padding: 28px 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 12px; justify-items: center; }
.landing-cta h2 { margin: 0; font-size: 20px; color: var(--text); }
.landing-cta .btn.big { max-width: 360px; }

@media (min-width: 820px) {
  .landing { gap: 88px; padding-top: 8px; }
  .landing-hero { grid-template-columns: 1.1fr .9fr; gap: 48px; }
  .landing-hero h1 { font-size: 46px; }
  .landing-hero .btn.big { width: auto; min-width: 300px; }
  .landing-steps ol { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .landing-steps li { grid-template-columns: 1fr; gap: 12px; padding: 24px; }
}
@media (prefers-color-scheme: dark) {
  .today-mock { box-shadow: 0 18px 40px -22px rgba(0,0,0,.8); }
}
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: filter .15s; }
}
main:not(.wide) + .site-footer .inner { max-width: 640px; }

/* 下部タブバー（スマホ） */
.tabbar { display: none; }
@media (max-width: 640px) {
  #nav { display: none; }
  body:has(#tabbar:not([hidden])) .logo-full { display: none; }
  body:has(#tabbar:not([hidden])) .logo-mark { display: block; height: 32px; width: auto; margin: 0; }
  body:has(#tabbar:not([hidden])) .top { padding-block: 8px; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 0 max(4px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-right));
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 56px; min-width: 44px; padding: 6px 2px;
    color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 500; line-height: 1.2; white-space: nowrap;
  }
  .tabbar .ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: var(--link); font-weight: 700; }
  .tabbar a[aria-current="page"] .ico { fill: color-mix(in srgb, var(--link) 16%, transparent); }
  body:has(#tabbar:not([hidden])) main { padding-bottom: calc(56px + env(safe-area-inset-bottom) + 24px); }
  body:has(#tabbar:not([hidden])) .site-footer { padding-bottom: calc(56px + env(safe-area-inset-bottom) + 24px); }
  body:has(#tabbar:not([hidden])) .toast { bottom: calc(68px + env(safe-area-inset-bottom)); }
}

/* 通報・ブロック・アカウント・管理 */
:root { --danger: #b3261e; --danger-text: #b3261e; }
@media (prefers-color-scheme: dark) { :root { --danger: #e8685e; --danger-text: #ff9a90; } .btn.danger { color: #1b1715; } }
textarea { width: 100%; min-height: 84px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); resize: vertical; font: inherit; color: inherit; }
input[type=text]:focus-visible, textarea:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.btn.danger { background: var(--danger); color: #fff; }
.ghost.danger { color: var(--danger-text); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.player-more { position: absolute; top: 2px; right: 50px; z-index: 3; background: none; border: 0; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; padding: 6px 10px; min-width: 44px; min-height: 44px; }
.player-menu { position: absolute; top: 46px; right: 12px; z-index: 4; min-width: 200px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: grid; box-shadow: 0 6px 24px rgba(0,0,0,.45); }
.player-menu button { background: none; border: 0; text-align: left; padding: 11px 12px; border-radius: 8px; cursor: pointer; min-height: 44px; }
.player-menu button:hover, .player-menu button:focus-visible { background: color-mix(in srgb, var(--text) 8%, transparent); }
.player-menu button.danger { color: var(--danger-text); }
.modal-body .reasons { display: grid; gap: 4px; border: 0; padding: 0; margin: 0; }
.modal-body .reasons legend { padding: 0; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.modal-body .reasons label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.modal-body .reasons label:has(input:checked) { border-color: var(--link); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.modal-body .reasons input { margin-top: 5px; accent-color: var(--accent); }
.modal-body .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.notice { border-radius: var(--radius); padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line)); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.stack-lg { display: grid; gap: 12px; }
.admin-report { display: grid; gap: 10px; }
.admin-report video { width: 100%; max-height: 360px; background: #000; border-radius: 10px; }
.admin-report .selfie-note { font-size: 12px; }
.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger-text); }
.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.admin-list > li.admin-report { display: grid; }
.admin-report .row > button { flex: 1 1 auto; }
/* 参加・フレンド申請の確認画面、ツールとの接続 */
.invite-confirm { justify-items: stretch; }
.invite-confirm h1 { margin: 0; overflow-wrap: anywhere; }
.invite-confirm .btn, .invite-confirm .ghost { text-align: center; }
.visibility-note { margin: 4px 0; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--link); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.warn-box { margin: 0; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--link); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); font-weight: 700; }
.device .stack > form, .device form.stack { justify-items: stretch; width: 100%; }
.code-input { font: 700 22px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.identity { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; font-size: 13px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.identity dt { color: var(--muted); }
.identity dd { margin: 0; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
/* 利用状況の計測（GA）の同意バナーと、アカウント画面のオン・オフ */
.ga-banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; max-width: 560px; margin-inline: auto;
  display: grid; gap: 6px; padding: 14px 16px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent);
  box-shadow: 0 8px 28px rgba(0,0,0,.22);
}
.ga-banner p { margin: 0; }
.ga-banner .ga-title { font-family: var(--font-head); font-weight: 700; font-size: 15px; line-height: 1.5; }
.ga-banner a { color: var(--link); margin-left: 4px; }
.ga-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.ga-actions .btn, .ga-actions .ghost { text-align: center; padding: 10px 12px; font-size: 15px; min-height: 44px; }
body.has-ga-banner { padding-bottom: 210px; }
@media (max-width: 640px) {
  body:has(#tabbar:not([hidden])) .ga-banner { bottom: calc(56px + env(safe-area-inset-bottom) + 10px); }
}
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch-row > span { display: grid; gap: 2px; }
input.switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 48px; height: 28px; margin: 0; border-radius: 999px;
  background: var(--line); border: 1px solid var(--muted); cursor: pointer; transition: background .15s;
}
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: transform .15s; }
input.switch:checked { background: var(--accent); border-color: var(--accent); }
input.switch:checked::after { transform: translateX(20px); background: var(--accent-text); }
input.switch:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { input.switch, input.switch::after { transition: none; } }

/* 招待・つかいかた・はじめよう */
.top-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
#nav { margin-left: auto; margin-right: 8px; }
@media (max-width: 640px) { .top-actions { margin-left: auto; } }
.btn.sm { padding: 6px 14px; font-size: 14px; min-height: 36px; }
.icon-btn { min-width: 36px; min-height: 36px; padding: 4px 10px; font-weight: 700; line-height: 1; }
a.icon-btn { display: inline-flex; align-items: center; justify-content: center; }
.icon-btn .ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[aria-current="page"] { color: var(--link); border-color: var(--link); }
.invite-cta { text-align: center; justify-items: center; margin-top: 16px; }
.invite-cta .cta-title { font-family: var(--font-head); font-size: 18px; }
.invite-cta p { margin: 0; }
.link-box { font-size: 14px; letter-spacing: 0; overflow-wrap: anywhere; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-weight: 500; }
.ok-line { margin: 0; color: var(--ok); font-weight: 700; }
.modal-body select { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.sheet-friend { border-top: 1px solid var(--line); padding-top: 10px; }
.stack > label, label.stack { width: 100%; }

.help-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; gap: 0; }
.help-track::-webkit-scrollbar { display: none; }
.help-card { flex: 0 0 100%; scroll-snap-align: center; display: grid; gap: 6px; align-content: start; padding: 0 2px; }
.help-card h3 { margin: 4px 0 0; font-family: var(--font-head); font-size: 18px; }
.help-card p { margin: 0; }
.help-dots { display: flex; justify-content: center; gap: 8px; }
.help-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.help-dots i.on { background: var(--accent); width: 20px; border-radius: 999px; }
.ill svg { display: block; width: 100%; height: auto; }
.ill.sm svg { max-width: 220px; margin: 0 auto; }
.ill .fl { fill: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.ill .fl2 { fill: var(--line); }
.ill .fs { fill: var(--surface); }
.ill .fa { fill: var(--accent); }
.ill .fa2 { fill: color-mix(in srgb, var(--accent) 45%, #000); }
.ill .fm { fill: var(--muted); }
.ill .ft { fill: var(--text); }
.ill .fk { fill: #2a2320; }
.ill .st { stroke: var(--text); stroke-width: 1.6; }
.ill .ss { stroke: var(--text); stroke-width: 2; fill: none; }
.ill .pulse { stroke: var(--accent); stroke-dasharray: 3 4; }
.ill .tx { font: 700 12px var(--font-body); }

.setup-card { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.setup-card .btn.big, .next-card .btn.big { max-width: none; }
.setup-card > * { max-width: 100%; }
.next-card { justify-items: stretch; text-align: center; padding: 24px 16px; }
.next-card h1 { margin: 0; font-size: 24px; }
.next-card p { margin: 0; }
.later-link { justify-self: center; }
.invite-login .visibility-note { text-align: left; max-width: 420px; margin: 12px auto; }
.device-card { justify-items: center; text-align: center; }
.device-card h1 { font-size: 22px; margin: 4px 0; }
.device-card .btn.big { max-width: 420px; }
.device-card .identity, .device-card > .stack { text-align: left; width: 100%; }
.manual summary { cursor: pointer; color: var(--muted); }
.manual .stack { margin-top: 10px; }
.toggle-row { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; cursor: pointer; }
.toggle-row input { margin-top: 4px; accent-color: var(--accent); }
.setup-card { margin-bottom: 12px; }
.setup-card .btn.big, .next-card .btn.big { font-size: 16px; padding: 14px 12px; }
.device-card p { text-align: center; }
.toast { width: max-content; max-width: calc(100vw - 32px); text-align: center; }
.friend-invite-card { margin-bottom: 12px; }
.friend-invite-card .small-links { gap: 8px; }

/* ---- ゲスト（ログインせずに始める）・招待ページのティザー・登録 ---- */
.guest-badge {
  display: inline-block; margin-left: .4em; padding: 0 .55em; border: 1px solid var(--line); border-radius: 999px;
  font-size: .72em; font-weight: 700; line-height: 1.6; color: var(--muted); background: var(--surface); vertical-align: .1em; white-space: nowrap;
}
.guest-bar, .flash-bar {
  display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center; justify-content: center;
  margin: 0; padding: .4rem 16px; font-size: 13px; background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-bottom: 1px solid var(--line);
}
.guest-bar[hidden], .flash-bar[hidden] { display: none; }
.guest-bar.used-up { background: color-mix(in srgb, var(--accent) 28%, var(--surface)); }
.guest-bar-link { color: var(--link); font-weight: 700; }
.flash-bar { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.cta-secondary, .big-ghost { display: inline-block; text-decoration: none; padding: .55rem 1.1rem; }
.big-ghost { text-align: center; }
.invite-login > .btn.big, .invite-login > .big-ghost { display: block; text-align: center; margin-top: .75rem; }
.teaser { display: grid; gap: .35rem; margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.teaser-title { font: 700 1.25rem/1.4 var(--font-head); }
.mosaic { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 6px; margin: .5rem auto; max-width: 26rem; width: 100%; overflow: hidden; border-radius: 10px; }
.mosaic-tile { display: grid; grid-template: 1fr 1fr / 1fr 1fr; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; filter: blur(7px) saturate(1.05); transform: scale(1.02); }
.mosaic-tile i { display: block; }
.teaser-zero { text-align: center; padding: 1.25rem 1rem; }
.teaser-zero .teaser-title { margin: 0; font-size: 1.05rem; }
.teaser-media { display: grid; }
.reel-wrap { display: grid; gap: .4rem; justify-items: center; margin: .5rem auto; width: 100%; max-width: 26rem; }
.reel { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: #1b1715; box-shadow: 0 10px 26px -16px rgba(42,35,32,.6); }
.reel video { display: block; width: 100%; height: 100%; object-fit: cover; background: #1b1715; }
.reel-stamp { position: absolute; left: 10px; bottom: 9px; padding: 2px 8px; border-radius: 6px; background: rgba(27,23,21,.55); color: #faf5ec; font: 700 12px/1.6 var(--font-head, inherit); letter-spacing: .04em; pointer-events: none; }
.reel-dots { position: absolute; right: 10px; bottom: 12px; display: flex; gap: 4px; pointer-events: none; }
.reel-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(250,245,236,.45); }
.reel-dots i.on { background: #faf5ec; }
.reel-play { position: absolute; inset: 0; margin: auto; width: 52px; height: 52px; border: 0; border-radius: 50%; background: rgba(27,23,21,.6); color: #faf5ec; font-size: 20px; cursor: pointer; }
.reel-play[hidden] { display: none; }
.reel.done video { filter: brightness(.7); }
.reel-again[hidden] { display: none; }
.friend-teaser { text-align: center; }
.teaser-line { margin: .5rem 0; text-align: left; }
.invite-login .teaser-line { max-width: 420px; margin: .25rem auto .75rem; }
.notice-card, .discord-prompt { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); margin-bottom: 12px; }
.retention-line { margin: -12px 0 20px; color: var(--link); font-weight: 700; }
.brand-line { margin: 4px 0 0; font-weight: 700; color: var(--muted); font-size: 14px; }
.teaser-setting { display: grid; gap: .25rem; }
@media (prefers-reduced-motion: reduce) { .reel-play { transition: none; } }
.guest-card, .summary-card, .trial-limit { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.summary-list { margin: 0; padding-left: 1.2rem; display: grid; gap: .2rem; }
.full-notice { margin: 0 0 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--link); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); font-weight: 700; text-align: left; max-width: 420px; margin-inline: auto; }
.invite-confirm .full-notice { max-width: none; }
.nb { white-space: nowrap; }
.guest-bar, .flash-bar { word-break: keep-all; overflow-wrap: anywhere; }
.flash-link { color: var(--link); font-weight: 700; }
.guest-bar-link { white-space: nowrap; }
.big-line { font-weight: 700; font-size: 16px; }
.download-other { justify-items: stretch; text-align: center; }
.download-other .btn, .download-other .ghost { text-align: center; }
.full-back { display: inline-block; margin: 16px 0; }
.trial-limit { margin-bottom: 12px; }

/* ホーム画面に追加のカード（スマホだけ。pwa.js）。タブバーの上に、小さく 1 枚 */
.pwa-card {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; max-width: 560px; margin-inline: auto;
  display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent);
  box-shadow: 0 8px 28px rgba(0,0,0,.22);
}
.pwa-card p { margin: 0; }
.pwa-card .pwa-title { font-family: var(--font-head); font-weight: 700; font-size: 15px; line-height: 1.5; }
.pwa-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.pwa-actions .btn, .pwa-actions .ghost { padding: 8px 16px; min-height: 40px; font-size: 14px; }
@media (max-width: 640px) {
  body:has(#tabbar:not([hidden])) .pwa-card { bottom: calc(56px + env(safe-area-inset-bottom) + 10px); }
}
/* ホーム画面から開いたとき（standalone）は、ノッチ・ホームバーを避ける */
@media (display-mode: standalone) {
  .top { padding-top: calc(10px + env(safe-area-inset-top)); }
}

/* 通知の確認カード・設定（pwa.js） */
.push-card { border-top: 3px solid var(--accent); margin-block: 12px; }
.push-card p { margin: 0; }
.push-types { width: 100%; border-top: 1px solid var(--line); padding-top: 12px; }
.push-types .switch-row, .push-card + .card { width: 100%; }
#push-master { flex: none; }
.people .ghost.danger { white-space: nowrap; }
