:root {
  --accent: #6b3fa0;        /* 落ち着いた紫（独立サイトとしての配色） */
  --accent-dark: #532f80;
  --accent-soft: #f1ecf8;
  --star: #f5a623;
  --ink: #1d1d27;
  --muted: #6b6b78;
  --line: #e7e7ee;
  --bg: #f6f5f9;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(40, 20, 70, .06);
  --max: 980px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* ---- ヘッダー ---- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.site-header .wrap {
  display: flex; align-items: center; gap: 10px;
  height: 58px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: .02em; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #9a6fd0);
  color: #fff; display: grid; place-items: center; font-size: 17px; font-weight: 900;
}
.brand .name { font-size: 17px; }
.brand .name small { display: block; font-size: 10px; color: var(--muted); font-weight: 600; letter-spacing: 0; }

/* ---- ヒーロー ---- */
.hero {
  background: linear-gradient(135deg, var(--accent), #8a5cc4);
  color: #fff;
  padding: 30px 0 26px;
}
.hero h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: .02em; }
.hero p { margin: 0; opacity: .92; font-size: 13.5px; }
.hero .pref-row {
  margin-top: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.hero .pref-row label { font-size: 13px; opacity: .9; }
.hero select {
  font: inherit; font-size: 15px; padding: 9px 12px; border-radius: 10px;
  border: 0; background: #fff; color: var(--ink); min-width: 160px; font-weight: 700;
}
.hero .hint { font-size: 12px; opacity: .85; }

/* ---- コントロール ---- */
.controls { padding: 18px 0 4px; }
.search-wrap { position: relative; margin-bottom: 14px; }
.search-wrap .search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 15px; opacity: .55; pointer-events: none; }
.search-wrap input {
  width: 100%; font: inherit; font-size: 15px; padding: 12px 14px 12px 40px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow);
}
.search-wrap input:focus { outline: none; border-color: var(--accent); }
.controls .bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.controls .count { font-size: 13px; color: var(--muted); }
.controls .count b { color: var(--ink); font-size: 16px; }
.controls .sort { font: inherit; font-size: 13px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line); background: #fff; }
.controls .bar-right { display: flex; align-items: center; gap: 10px; }

/* リスト/地図 切替 */
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.view-toggle .vt { font: inherit; font-size: 13px; padding: 7px 12px; border: 0; background: #fff; color: var(--muted); cursor: pointer; }
.view-toggle .vt.active { background: var(--accent); color: #fff; font-weight: 700; }

/* 地図 */
.store-map { height: 70vh; min-height: 420px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); margin: 16px 0 40px; }
.map-pop { font-size: 13px; line-height: 1.6; }
.map-pop strong { font-size: 14px; }
.map-pop .r { color: var(--star); font-weight: 700; }
.map-pop .a { color: var(--muted); font-size: 12px; }
.map-pop a { color: var(--accent); font-weight: 700; }
.leaflet-container { font: inherit; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-size: 12.5px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer;
  transition: .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

/* ---- 店舗グリッド ---- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 16px 0 40px; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 16px 14px; border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px; transition: .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(40,20,70,.10); border-color: #d9d3ea; }
.card .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card .ward { font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.card h3 { margin: 0; font-size: 16.5px; }
.card .rate { display: flex; align-items: center; gap: 8px; }
.card .rate .num { font-size: 19px; font-weight: 800; color: var(--ink); }
.card .rate .num.none { color: var(--muted); font-size: 14px; font-weight: 600; }
.card .rate .cnt { font-size: 12px; color: var(--muted); }
.card .meta { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.card .meta .ico { color: var(--accent); }

/* ---- 星 ---- */
.stars { position: relative; display: inline-block; line-height: 1; white-space: nowrap; font-size: 16px; }
.stars::before { content: "★★★★★"; color: #e3e0ea; letter-spacing: 1px; }
.stars-fill { position: absolute; top: 0; left: 0; overflow: hidden; white-space: nowrap; }
.stars-fill::before { content: "★★★★★"; color: var(--star); letter-spacing: 1px; }

/* ---- 店舗詳細 ---- */
.back { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); margin: 16px 0 8px; }
.back:hover { color: var(--accent); }
.detail-head { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; border: 1px solid var(--line); }
.detail-head .ward { font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; font-weight: 700; }
.detail-head h1 { margin: 8px 0 12px; font-size: 24px; }
.detail-head .info { font-size: 13.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.detail-head .links { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-dark); }
.btn:hover { border-color: var(--accent); }

/* 店舗詳細の地図 */
.detail-map { height: 320px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }

/* 評価サマリー */
.summary { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; border: 1px solid var(--line); margin-top: 14px; display: grid; grid-template-columns: 150px 1fr; gap: 22px; }
@media (max-width: 560px) { .summary { grid-template-columns: 1fr; gap: 14px; } }
.summary .big { text-align: center; }
.summary .big .num { font-size: 44px; font-weight: 800; line-height: 1.1; }
.summary .big .num.none { font-size: 18px; color: var(--muted); }
.summary .big .cnt { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.aspect { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 7px; }
.aspect .lbl { color: var(--muted); }
.aspect .track { background: #eeebf4; height: 8px; border-radius: 999px; overflow: hidden; }
.aspect .track i { display: block; height: 100%; background: var(--star); border-radius: 999px; }
.aspect .v { text-align: right; font-weight: 700; font-size: 12.5px; }

/* 投稿フォーム */
.section-title { font-size: 16px; margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title .bar { width: 4px; height: 18px; background: var(--accent); border-radius: 2px; }
.form { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; border: 1px solid var(--line); }
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.field .req { color: #d64545; font-size: 11px; margin-left: 4px; }
.field .opt { color: var(--muted); font-size: 11px; margin-left: 4px; font-weight: 500; }
.field textarea, .field input[type=text] {
  width: 100%; font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; resize: vertical; background: #fcfbfe;
}
.field textarea:focus, .field input:focus { outline: none; border-color: var(--accent); }
.aspect-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
@media (max-width: 480px) { .aspect-grid { grid-template-columns: 1fr; } }
.aspect-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.aspect-row .lbl { font-size: 13px; color: var(--muted); }

/* 星入力 */
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { font-size: 26px; color: #e3e0ea; cursor: pointer; line-height: 1; transition: color .1s; }
.star-input label.sm { font-size: 20px; }
.star-input input:checked ~ label,
.star-input label:hover, .star-input label:hover ~ label { color: var(--star); }

.form .submit-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form .note { font-size: 11.5px; color: var(--muted); }

/* 写真添付（フォーム） */
.field input[type=file] { font: inherit; font-size: 13px; }
.photo-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.photo-preview .pp { width: 64px; height: 64px; border-radius: 8px; background-size: cover; background-position: center; border: 1px solid var(--line); }

/* 口コミ一覧 */
.review { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; border: 1px solid var(--line); margin-bottom: 12px; }
.review .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.review .who { font-weight: 700; font-size: 13.5px; }
.review .date { font-size: 12px; color: var(--muted); }
.review .ov { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.review .ov .num { font-weight: 800; }
.review .body { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.review .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.review .tags span { font-size: 11px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px; }
.review.reported { opacity: .6; }

/* 口コミ内の写真 */
.rv-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.rv-photo { width: 92px; height: 92px; border-radius: 10px; border: 1px solid var(--line); background-size: cover; background-position: center; cursor: pointer; padding: 0; transition: .15s; }
.rv-photo:hover { transform: scale(1.03); }

/* いいね・通報 */
.rv-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.rv-btn { font: inherit; font-size: 12.5px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; transition: .15s; }
.rv-btn:hover { border-color: var(--accent); color: var(--accent); }
.rv-btn b { color: var(--ink); }
.rv-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.rv-btn.on b { color: var(--accent); }
.rv-btn.ghost { border-color: transparent; color: var(--muted); }
.rv-btn.ghost:hover { color: #d64545; }
.rv-btn.danger { color: #fff; background: #d64545; border-color: #d64545; }
.rv-report-wrap { display: inline-flex; align-items: center; gap: 8px; }
.rv-report-wrap .confirm-q { font-size: 12.5px; color: var(--muted); }
.reported-note { font-size: 12.5px; color: var(--muted); }

/* ライトボックス */
.lightbox { position: fixed; inset: 0; background: rgba(20,12,35,.85); display: none; align-items: center; justify-content: center; z-index: 60; padding: 24px; cursor: zoom-out; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }

.empty { text-align: center; color: var(--muted); padding: 36px 16px; background: var(--card); border-radius: var(--radius); border: 1px dashed var(--line); }
.empty b { color: var(--ink); display: block; margin-bottom: 4px; }

/* ---- 広告 ---- */
.ad-zone { margin: 18px 0; }
.ad-slot { margin: 0 auto; max-width: 970px; }
.ad-label { display: block; text-align: center; font-size: 10px; letter-spacing: .1em; color: #b3b0bd; margin-bottom: 5px; }
.ad-slot .adsbygoogle { display: block; }
.ad-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100px; border: 1px dashed #cfc9de; border-radius: 12px; color: var(--muted);
  font-size: 13px; font-weight: 700;
  background: repeating-linear-gradient(45deg, #faf9fc, #faf9fc 12px, #f2eff8 12px, #f2eff8 24px);
}
.ad-placeholder small { font-weight: 500; font-size: 11px; color: #aaa; margin-top: 3px; }

/* ---- フッター ---- */
.site-footer { border-top: 1px solid var(--line); background: var(--card); margin-top: 30px; padding: 22px 0 40px; }
.site-footer .disclaimer { font-size: 11.5px; color: var(--muted); line-height: 1.8; }
.site-footer .copy { font-size: 11px; color: var(--muted); margin-top: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 13px;
  font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.25); opacity: 0; pointer-events: none;
  transition: .25s; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- 認証ヘッダー ---- */
.auth-slot { margin-left: auto; display: flex; align-items: center; }
.login-btn {
  font: inherit; font-size: 12.5px; font-weight: 700; padding: 7px 14px; border-radius: 999px;
  border: 1.5px solid var(--accent); background: #fff; color: var(--accent); cursor: pointer;
  white-space: nowrap; transition: .15s;
}
.login-btn:hover { background: var(--accent); color: #fff; }
.logout-btn {
  font: inherit; font-size: 11.5px; color: var(--muted); background: none; border: none;
  cursor: pointer; padding: 4px 8px; border-radius: 6px; white-space: nowrap;
}
.logout-btn:hover { background: var(--bg); color: var(--ink); }

.user-chip { display: flex; align-items: center; gap: 8px; }
.uc-av {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--accent-soft); flex-shrink: 0;
}
.uc-av-ico { display: flex; align-items: center; justify-content: center; background: var(--bg); font-size: 16px; }
.uc-info { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.uc-name { font-size: 13px; font-weight: 700; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-pts { font-size: 11.5px; font-weight: 700; color: var(--accent); }
.uc-bar { width: 60px; height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; }
.uc-bar-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s; }
@media (max-width: 540px) { .uc-info { display: none; } }

/* ---- レベルバッジ ---- */
.lv-badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; border-width: 1px; border-style: solid;
  white-space: nowrap; line-height: 1.6;
}

/* ---- ランキングセクション ---- */
.ranking-section { margin-bottom: 40px; }
.ranking-list {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line); overflow: hidden;
}
.ranking-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.ranking-item:last-child { border-bottom: none; }
.rank-no { font-size: 18px; min-width: 28px; text-align: center; }
.rank-av {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--line); background: var(--bg); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rank-pt { font-size: 16px; font-weight: 800; color: var(--accent); white-space: nowrap; }
.rank-pt small { font-size: 11px; font-weight: 600; }
