/* Beyond the Glass — 温かみのある、写真が主役のデザイン */
:root {
  --wine: #7b2d43;
  --wine-dark: #4a202c;
  --cream: #faf6f0;
  --paper: #fffdf9;
  --ink: #33302c;
  --muted: #8a8178;
  --line: #e7ddd2;
  --gold: #c9a35f;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(74, 32, 44, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

/* ヘッダー */
.app-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--wine-dark); color: #fff;
}
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: 0.04em; }
.brand-sub { font-size: 11px; opacity: 0.75; }
.identity-chip {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.14); color: #fff;
  border: 1px solid rgba(255,255,255,0.25); border-radius: 999px; padding: 3px 12px 3px 4px;
}
.identity-picker { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.identity-picker select { border-radius: 8px; padding: 5px; border: none; }

/* タブ */
.tabbar {
  position: sticky; top: 57px; z-index: 29;
  display: flex; gap: 2px; overflow-x: auto;
  background: var(--paper); border-bottom: 1px solid var(--line);
  padding: 4px 6px; scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: none; border: none; border-radius: 10px; padding: 6px 10px; color: var(--muted);
}
.tab.active { background: #f6e8ec; color: var(--wine); font-weight: 700; }
.tab-icon { font-size: 18px; }
.tab-label { font-size: 11px; white-space: nowrap; }

/* 共通レイアウト */
.view { max-width: 680px; margin: 0 auto; padding: 16px 14px 90px; }
.section-title { font-size: 17px; margin: 22px 0 10px; color: var(--wine-dark); }
.section-title:first-child { margin-top: 0; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; margin-bottom: 14px;
}
.muted { color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; font-size: 14px; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; }
.avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold); color: #fff; font-weight: 700;
}

/* ボタン・フォーム */
.btn {
  display: inline-block; background: var(--wine); color: #fff; border: none;
  border-radius: 999px; padding: 9px 18px; font-size: 14px; font-weight: 600;
}
.btn.ghost { background: #fff; color: var(--wine); border: 1px solid var(--wine); }
.btn.small { padding: 5px 12px; font-size: 12px; }
.btn.danger { background: #b3382e; }
.btn:disabled { opacity: 0.45; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--wine-dark); }
.field input[type="text"], .field input[type="date"], .field input[type="number"],
.field select, .field textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.field textarea { min-height: 64px; resize: vertical; }
.form-box { background: var(--paper); border: 1px dashed var(--gold); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }

/* ハート */
.heart { background: none; border: none; font-size: 15px; padding: 4px 6px; color: var(--muted); }
.heart .heart-count { font-size: 13px; margin-left: 2px; }

/* 投稿・ワインカード */
.post-photo, .wine-photo { width: 100%; border-radius: 10px; display: block; object-fit: cover; }
.post-head, .wine-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.post-head .name, .wine-head .name { font-weight: 700; font-size: 14px; }
.post-head .date, .wine-head .date { color: var(--muted); font-size: 12px; margin-left: auto; }
.post-menu-btn { margin-left: auto; background: none; border: none; font-size: 18px; color: var(--muted); padding: 2px 6px; }
.card-actions { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.comment { font-size: 13px; padding: 6px 0; border-top: 1px solid var(--line); }
.comment .cname { font-weight: 700; margin-right: 6px; }
.comment-form { display: flex; gap: 6px; margin-top: 8px; }
.comment-form input { flex: 1; padding: 7px 9px; border: 1px solid var(--line); border-radius: 999px; }
.wine-name { font-size: 16px; font-weight: 700; }
.wine-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.wine-info-box { background: #f8f1e6; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 10px; line-height: 1.7; }
.tag { display: inline-block; background: #f6e8ec; color: var(--wine); border-radius: 999px; padding: 1px 9px; font-size: 11px; margin-right: 4px; }

/* 2×2ボタン */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.grid2 button, .grid2 .nav-btn {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 8px; font-size: 15px; font-weight: 700; color: var(--wine-dark);
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none;
}
.grid2 .count { font-size: 12px; color: var(--muted); font-weight: 400; }
.nav-btn.wide { grid-column: 1 / -1; flex-direction: row; justify-content: center; }

/* アルバム */
.album-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.album-grid figure { margin: 0; position: relative; }
.album-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.album-del {
  position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,0.55); color: #fff;
  border: none; border-radius: 999px; width: 26px; height: 26px; line-height: 1;
}

/* 嗜好のバー（2段組み） */
.dist-row { margin-bottom: 12px; }
.dist-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dist-name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.dist-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.dist-bar { height: 9px; background: #efe6da; border-radius: 999px; margin-top: 4px; overflow: hidden; }
.dist-bar > div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--wine)); border-radius: 999px; }

/* 産地マップ */
.map-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #dcebf2; }
.map-viewport { overflow: hidden; touch-action: none; height: 300px; position: relative; }
.map-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.map-pin {
  position: absolute; transform: translate(-50%, -100%); background: none; border: none;
  font-size: 22px; line-height: 1; padding: 0; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}
.map-tools { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; z-index: 3; }
.map-tools button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 16px; }

/* スロット */
.slot-box { text-align: center; padding: 18px 10px; }
.slot-display {
  font-size: 20px; font-weight: 700; color: var(--wine); min-height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: #f8f1e6; border-radius: 12px; padding: 10px; margin-bottom: 12px;
}

/* 全画面オーバーレイ（アーカイブ詳細・メンバーページ） */
.overlay-view {
  position: fixed; inset: 0; z-index: 50; background: var(--cream);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.overlay-inner { max-width: 680px; margin: 0 auto; padding: 14px 14px 90px; }
.back-btn { background: none; border: none; color: var(--wine); font-weight: 700; font-size: 15px; padding: 6px 0; }

/* モーダル・ライトボックス・トースト */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80; background: rgba(40, 20, 26, 0.55);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-box {
  background: var(--paper); border-radius: 18px 18px 0 0; width: 100%; max-width: 680px;
  max-height: 88vh; overflow-y: auto; padding: 18px 16px 26px;
}
.modal-title { margin: 0 0 8px; font-size: 16px; }
.modal-body { font-size: 14px; line-height: 1.7; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.lightbox { text-align: center; }
.lightbox img { max-height: 76vh; border-radius: 10px; }
.lightbox-cap { margin-top: 8px; font-size: 13px; color: var(--muted); }
.lightbox-close { position: absolute; top: 10px; right: 14px; background: none; border: none; font-size: 26px; color: var(--muted); }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90;
  background: var(--wine-dark); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; box-shadow: var(--shadow); max-width: 88vw; text-align: center;
}

/* その他 */
.hero {
  background: linear-gradient(135deg, var(--wine-dark), var(--wine)); color: #fff;
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.hero .hero-theme { font-size: 21px; font-weight: 700; margin: 4px 0; }
.hero .hero-meta { font-size: 13px; opacity: 0.85; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #f3ece2; border-radius: 999px; padding: 4px 11px; font-size: 12px; }
.search-row { display: flex; gap: 8px; margin-bottom: 12px; }
.search-row input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; }
.search-row select { padding: 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.progress { font-size: 13px; color: var(--muted); margin: 6px 0; }
details.more > summary { cursor: pointer; color: var(--wine); font-weight: 600; font-size: 14px; padding: 8px 0; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
.rsvp-btns { display: flex; gap: 6px; }
.rsvp-btns button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 13px; font-size: 13px; }
.rsvp-btns button.on { background: var(--wine); color: #fff; border-color: var(--wine); }
.check-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
