/* フォトギャラリー共通のスタイル（ホーム・クイズ・歌詞マップ・ミッションで共有） */
:root {
  --ink: #334155; --sub: #64748b; --line: #e8e6ef; --bg: #fcfbfa; --card: #fff;
  --pink: #f472b6; --purple: #a78bfa; --sky: #7dd3fc;
  --grad: linear-gradient(135deg, #f472b6 0%, #a78bfa 50%, #7dd3fc 100%);
  --gutter: clamp(16px, 3vw, 32px);   /* 画面の左右の余白: 画面が広いほど広げる */
  --nav-h: 60px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { body { padding-bottom: 0; } }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
img { -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }
[hidden] { display: none !important; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); }
.narrow { max-width: 640px; }

/* ヘッダー */
header { position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top); background: rgba(252,251,250,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.head { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 6px 0; }
.logo { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; }
.logo img { display: block; height: clamp(46px, 6vw, 60px); width: auto; }
.logo small { font-size: 8px; letter-spacing: .22em; color: var(--sub); font-weight: 500; line-height: 1; }
.back { font-size: 12px; color: var(--sub); text-decoration: none; width: 64px; padding: 8px 0; }
.acct { width: 64px; text-align: right; }
.acct button { border: 0; background: none; font-size: 12px; color: var(--sub); padding: 8px 0; }

/* ナビ: スマホは下に固定、PCはヘッダーの下に横並び */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; min-height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: #94a3b8; font-size: 10px; font-weight: 700; }
.tabs a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: #db2777; }
.topnav { display: none; }
@media (min-width: 900px) {
  .tabs { display: none; }
  .topnav { display: flex; justify-content: center; gap: 8px; padding: 0 0 10px; }
  .topnav a { text-decoration: none; font-size: 13px; font-weight: 700; color: var(--sub); padding: 7px 18px; border-radius: 999px; }
  .topnav a:hover { background: #f3f0f8; }
  .topnav a.on { background: #fdf2f8; color: #db2777; }
}

h2.sec { font-size: clamp(15px, 1.8vw, 18px); letter-spacing: .08em; text-align: center; margin: clamp(22px, 4vw, 40px) 0 14px; font-weight: 700; }
h2.sec.en { font-family: 'Cinzel', serif; font-size: clamp(17px, 2.2vw, 22px); }
.empty { text-align: center; color: var(--sub); font-size: 14px; padding: 48px 0; line-height: 1.8; }
.loading { text-align: center; color: var(--sub); font-size: 12px; padding: 16px; }

/* メンバーフィルター */
.pills { display: flex; gap: 10px; overflow-x: auto; padding: 12px var(--gutter) 14px; margin: 0 calc(-1 * var(--gutter)); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.pills::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .pills { flex-wrap: wrap; justify-content: center; overflow: visible; padding: 18px 0 8px; margin: 0; gap: 12px; } }
.pill { flex: none; min-height: 44px; border: 2.5px solid var(--c, #cbd5e1); background: #fff; border-radius: 999px; padding: 7px 16px; font-size: 14px; white-space: nowrap; font-weight: 700; display: flex; align-items: center; gap: 6px; transition: background .15s, transform .15s; }
.pill .n { font-size: 11px; font-weight: 500; color: var(--sub); }
.pill.on { background: var(--c, #cbd5e1); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.pill.all { --c: #cbd5e1; border-color: #cbd5e1; }
.pill.all.on { background: #e2e8f0; }
.pill:active { transform: scale(.97); }

/* 写真まわりの部品 */
.avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; background: #0f172a; color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 3px 10px; border-radius: 999px; background: #fff; color: #db2777; box-shadow: 0 1px 6px rgba(0,0,0,.12); }
.lbl { font-size: 10px; font-weight: 500; letter-spacing: .08em; opacity: .8; }
/* 歌割り（担当者）: メンバーはその色、ゲストなどメンバー以外はグレー */
.sgs { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 8px; vertical-align: middle; }
.sg { font-size: 10px; font-weight: 700; line-height: 1.5; padding: 1px 8px; border-radius: 99px; background: var(--c, #e2e8f0); color: #334155; white-space: nowrap; }
.sg.guest { color: #64748b; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.chip { font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: var(--c); }

/* ボタン */
.btn { flex: 1; display: block; text-align: center; border-radius: 12px; padding: 12px 10px; font-size: 14px; font-weight: 700; border: 1.5px solid var(--line); background: #fff; text-decoration: none; min-height: 44px; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; }
.btn.x { background: #0f172a; color: #fff; border-color: #0f172a; }
.btn:active { opacity: .85; }
.btn[disabled] { opacity: .45; cursor: default; }

/* いいね・リアクション */
.bar { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.rbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 13px; font-size: 14px; font-weight: 700; line-height: 1.2; transition: transform .12s, background .15s; }
.rbtn:active { transform: scale(.95); }
.rbtn.pop { animation: rbtn-pop .45s ease-out; }
@keyframes rbtn-pop { 0% { transform: scale(1); } 35% { transform: scale(1.22); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .rbtn.pop { animation: none; } }
.rbtn .c { font-size: 12px; font-weight: 500; color: var(--sub); }
.rbtn .t { font-size: 12px; }
.rbtn.on { border-color: var(--pink); background: #fdf2f8; }
.rbtn.on .c { color: #db2777; }
.rbtn.like .h { color: #cbd5e1; font-size: 16px; }
.rbtn.like.on .h { color: #ec4899; }
.bar.full { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 0; }
.bar.full .rbtn { border-radius: 14px; justify-content: flex-start; padding: 9px 12px; }
.bar.full .rbtn.like { grid-column: 1 / -1; justify-content: center; }

/* 写真の詳細 */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(15,23,42,.82); display: none; align-items: flex-end; justify-content: center; }
.modal.open { display: flex; }
#login-modal .note-limit { background: #fdf2f8; color: #be185d; border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 700; line-height: 1.6; margin-bottom: 10px; }
#login-modal { z-index: 55; }   /* 写真の詳細（50）の上に出す。下に隠れると、ログインを求められていることに気づけない */
.modal.center { align-items: center; }
@media (min-width: 640px) { .modal { align-items: center; } }
.sheet { background: #fff; width: 100%; max-width: 520px; max-height: 94vh; max-height: 94dvh; overflow-y: auto; overscroll-behavior: contain; border-radius: 22px 22px 0 0; position: relative; }
@media (min-width: 640px) { .sheet { border-radius: 22px; } }
.sheet .photo { background: #0f172a; }
.sheet .photo img { display: block; width: 100%; height: auto; max-height: 68vh; max-height: 68dvh; object-fit: contain; margin: 0 auto; }
/* PC・横向きの画面: 写真を左、情報を右に並べる */
@media (min-width: 900px), (orientation: landscape) and (min-width: 600px) {
  .modal { align-items: center; }
  .sheet { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr); max-width: 1080px; width: calc(100% - 48px); max-height: 92vh; max-height: 92dvh; overflow: hidden; border-radius: 22px; }
  .sheet .photo { display: flex; align-items: center; justify-content: center; min-height: 0; }
  .sheet .photo img { width: 100%; height: 100%; max-height: 92vh; max-height: 92dvh; }
  .sheet .info { overflow-y: auto; padding: 60px 24px 24px; }
}
.close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(15,23,42,.6); color: #fff; font-size: 20px; line-height: 1; z-index: 2; }
.info { padding: 16px 18px 22px; }
.by { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.by .avatar { width: 38px; height: 38px; }
.by b { display: block; font-size: 15px; }
.by small { color: var(--sub); font-size: 12px; }
.by .lbl { display: block; color: var(--purple); font-weight: 700; opacity: 1; margin-bottom: 1px; }
.meta { margin-top: 10px; font-size: 12px; color: var(--sub); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.songline { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #f8f5ff; font-size: 13px; line-height: 1.6; }
.songline b { color: #6d28d9; }
.songline small { display: block; color: var(--sub); font-size: 11px; }
.actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.note { margin-top: 12px; font-size: 11px; color: #94a3b8; text-align: center; }

/* ダイアログ・通知 */
.dialog { background: #fff; border-radius: 20px; width: calc(100% - 32px); max-width: 360px; padding: 24px 22px 20px; text-align: center; }
.dialog h3 { margin: 0 0 8px; font-size: 16px; }
.dialog p { margin: 0 0 16px; font-size: 13px; line-height: 1.8; color: var(--sub); }
.dialog .btn { margin-top: 8px; }
.gbtn { display: flex !important; align-items: center; justify-content: center; gap: 10px; }
.dialog small { display: block; margin-top: 12px; font-size: 11px; color: #94a3b8; }
footer { text-align: center; font-size: 11px; color: #94a3b8; padding: 28px 16px 40px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #0f172a; color: #fff; font-size: 13px; padding: 9px 18px; border-radius: 999px; z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 32px); text-align: center; }
@media (min-width: 900px) { .toast { bottom: 28px; } }
.toast.show { opacity: .95; }
