/* ===== 麦旅 (Mugitabi) Custom Styles ===== */

:root {
  --bg:            #F6F0E4;
  --card:          #FFFBF5;
  --accent:        #D59A2F;
  --accent-dark:   #B6751C;
  --success:       #4E8A58;
  --text:          #25180D;
  --text-muted:    #7A6855;
  --border:        rgba(37,24,13,0.12);
  --border-strong: rgba(37,24,13,0.28);
  --img-bg:        #EDE4D4;
  --tag-bg:        rgba(213,154,47,0.13);
  --radius:        14px;
  --font-sans:     'Noto Sans JP', sans-serif;
  --font-serif:    'Noto Sans JP', sans-serif;
  --nav-h:         64px;
  --topbar-h:      56px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: #111;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* ── Mobile container ── */
.app-shell {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 60px rgba(0,0,0,0.25);
}

/* ── TopBar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  backdrop-filter: blur(8px);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.topbar-logo-icon {
  font-size: 22px;
}

.topbar-logo-text {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
  color: var(--accent-dark);
  letter-spacing: 0.02em;
}

.topbar-title {
  flex: 1;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}

.topbar-back {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
}

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 200;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 4px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  box-shadow: 0 -2px 16px rgba(37,24,13,0.08);
  height: var(--nav-h);
}

.nav-item {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  flex: 1;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
  font-family: var(--font-sans);
}

.nav-item.active {
  color: var(--accent);
}

.nav-item-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item-label {
  font-size: 10px;
  font-weight: 500;
}

.nav-item.active .nav-item-label {
  font-weight: 700;
}

.nav-center-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(213,154,47,0.4);
  transform: translateY(-6px);
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-center-btn:hover {
  transform: translateY(-8px);
  box-shadow: 0 6px 20px rgba(213,154,47,0.5);
}

/* ── Main content padding for fixed nav ── */
.page-content {
  padding-bottom: calc(var(--nav-h) + 16px);
  min-height: calc(100vh - var(--topbar-h));
}

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.card-hover {
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(37,24,13,0.1);
}

/* ── Brewery image placeholder ── */
.brewery-img-placeholder {
  background: var(--img-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.brewery-img-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(182,117,28,0.07) 10px,
    rgba(182,117,28,0.07) 20px
  );
}

.brewery-img-emoji {
  font-size: 36px;
  position: relative;
  z-index: 1;
}

/* ── Tags / Pills ── */
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  background: var(--tag-bg);
  color: var(--accent-dark);
  letter-spacing: 0.02em;
}

.pill-open {
  background: rgba(78,138,88,0.15);
  color: var(--success);
}

.pill-closed {
  background: rgba(37,24,13,0.08);
  color: var(--text-muted);
}

.pill-seasonal {
  background: rgba(182,117,28,0.12);
  color: var(--accent-dark);
}

/* ── Stars ── */
.stars {
  display: inline-flex;
  gap: 2px;
}

.star-icon {
  width: 14px;
  height: 14px;
}

.star-filled { color: var(--accent); }
.star-empty  { color: var(--border-strong); }

/* ── Star Input (interactive) ── */
.star-input {
  display: flex;
  gap: 6px;
}

.star-input-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  transition: transform 0.1s;
  font-size: 32px;
  line-height: 1;
  color: var(--border-strong);
}

.star-input-btn.active,
.star-input-btn:hover {
  color: var(--accent);
}

.star-input-btn:hover {
  transform: scale(1.15);
}

/* ── Flavor slider ── */
.flavor-slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.flavor-label {
  font-size: 12px;
  color: var(--text-muted);
  width: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.flavor-slider {
  -webkit-appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

.flavor-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(213,154,47,0.4);
  cursor: pointer;
}

.flavor-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  width: 20px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Progress bar ── */
.progress-bar-wrap {
  background: var(--border);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  width: 100%;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

/* ── Flavor profile ── */
.flavor-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.flavor-profile-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  width: 60px;
  flex-shrink: 0;
}

.flavor-scale-label {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.flavor-track {
  flex: 1;
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
}

.flavor-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--border), var(--border-strong));
  border-radius: 999px;
}

.flavor-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 1px 5px rgba(213,154,47,0.55);
  z-index: 1;
}

/* ── Search bar ── */
.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  color: var(--text);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus {
  border-color: var(--accent);
}

/* ── Filter chips ── */
.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-sans);
  white-space: nowrap;
}

.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.filter-select {
  padding: 6px 11px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text);
  font-family: var(--font-sans);
  outline: none;
  flex-shrink: 0;
}

/* ── Section header ── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.section-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.section-action {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
}

/* ── Note feed card ── */
.note-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px;
  margin-bottom: 10px;
}

.note-card-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.note-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-serif);
  flex-shrink: 0;
}

/* ── Brewery grid card ── */
.brewery-card {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  display: block;
}

.brewery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(37,24,13,0.1);
}

.brewery-card-img {
  height: 110px;
  position: relative;
}

.brewery-card-body {
  padding: 10px;
}

/* ── Beer list item ── */
.beer-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.beer-item:last-child { border-bottom: none; }

.beer-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--img-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

/* ── CTA Buttons ── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(213,154,47,0.3);
  font-family: var(--font-serif);
  text-decoration: none;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  background: var(--card);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font-sans);
  text-decoration: none;
  transition: background 0.15s;
}

.btn-secondary:hover { background: var(--bg); }

/* ── Form styles ── */
.form-field {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: var(--accent);
}

.form-textarea {
  width: 100%;
  padding: 11px 14px;
  background: transparent;
  border: none;
  font-size: 14px;
  color: var(--text);
  font-family: var(--font-sans);
  outline: none;
  resize: vertical;
  line-height: 1.7;
}

.form-error {
  color: #c44;
  font-size: 12px;
  margin-top: 4px;
}

/* ── Step indicator ── */
.steps {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
}

.step-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.step-circle.done {
  background: var(--accent);
  color: #fff;
}

.step-circle.current {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(213,154,47,0.25);
}

.step-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
}

.step-label.current {
  color: var(--accent);
  font-weight: 700;
}

/* ── Map ── */
#discover-map {
  height: 260px;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.leaflet-container {
  font-family: var(--font-sans) !important;
}

.leaflet-popup-content-wrapper {
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
}

.leaflet-popup-content {
  margin: 10px 12px !important;
  font-family: var(--font-sans);
}

/* ── Profile stat cards ── */
.stat-card {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 16px 10px;
  text-align: center;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 800;
  color: var(--accent-dark);
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Toast / Alert ── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: #fff;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: slideUp 0.3s ease;
}

.toast.error { background: #c44; }

@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 52px;
  margin-bottom: 14px;
}

.empty-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-sub {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ── Auth pages ── */
.auth-wrap {
  padding: 40px 24px calc(var(--nav-h) + 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - var(--topbar-h));
}

.auth-logo {
  font-size: 48px;
  margin-bottom: 8px;
}

.auth-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 900;
  color: var(--accent-dark);
  margin-bottom: 4px;
}

.auth-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 32px;
  text-align: center;
}

.auth-form {
  width: 100%;
  max-width: 360px;
}

/* ── Message alerts ── */
.messages-list {
  padding: 0 16px;
  margin-top: 8px;
}

.message-alert {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.message-success {
  background: rgba(78,138,88,0.15);
  color: var(--success);
  border: 1px solid rgba(78,138,88,0.3);
}

.message-error {
  background: rgba(200,68,68,0.1);
  color: #c44;
  border: 1px solid rgba(200,68,68,0.25);
}

/* ── Utility ── */
.text-accent    { color: var(--accent); }
.text-muted     { color: var(--text-muted); }
.font-serif     { font-family: var(--font-serif); }
.divider        { border: none; border-top: 1px solid var(--border); margin: 0; }

/* ── ABV / IBU stat blocks ── */
.beer-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.beer-stat-block {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 4px;
  text-align: center;
}

.beer-stat-value {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-dark);
  line-height: 1;
}

.beer-stat-key {
  font-size: 9px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-top: 3px;
}

/* ── Scrollbar hiding ── */
.scroll-x {
  overflow-x: auto;
  scrollbar-width: none;
}
.scroll-x::-webkit-scrollbar { display: none; }

/* ── Favorite button ── */
.fav-btn {
  background: rgba(255,251,245,0.88);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s;
  box-shadow: 0 1px 4px rgba(37,24,13,0.12);
}

.fav-btn:hover { transform: scale(1.1); }

.fav-btn.active svg { color: #e05; fill: #e05; }

/* 480〜767px（タブレット・小さいPCウィンドウ）は実機スマホと同じ表示にする。
   以前あった「スマホフレーム風」演出（黒背景+角丸+上下マージン）は、
   position:fixed のボトムナビや 100dvh 基準のページ高さと矛盾し、
   ナビのはみ出し・ズレ・重なりを引き起こすため廃止した。 */

/* ── Desktop sidebar (hidden on mobile) ── */
.desktop-sidebar { display: none; }

/* ── Desktop layout (768px+) ── */
@media (min-width: 768px) {
  html, body { background: var(--bg); }

  .app-root {
    display: flex;
    min-height: 100vh;
    max-width: 1280px;
    margin: 0 auto;
  }

  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    width: 240px;
    flex-shrink: 0;
    background: var(--card);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 24px 12px;
  }

  .desktop-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    padding: 4px 12px;
    text-decoration: none;
  }

  .desktop-sidebar-logo-icon { font-size: 26px; }

  .desktop-sidebar-logo-text {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 20px;
    color: var(--accent-dark);
    letter-spacing: 0.02em;
  }

  .sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    transition: background 0.15s, color 0.15s;
    margin-bottom: 2px;
  }

  .sidebar-nav-item:hover {
    background: var(--bg);
    color: var(--text);
  }

  .sidebar-nav-item.active {
    background: rgba(213,154,47,0.13);
    color: var(--accent-dark);
  }

  .sidebar-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-serif);
    transition: opacity 0.15s;
  }

  .sidebar-add-btn:hover { opacity: 0.9; }

  /* App shell fills remaining space, no phone frame */
  .app-shell {
    flex: 1;
    max-width: none;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    min-height: 100vh;
    overflow: visible;
  }

  /* Bottom nav hidden on desktop */
  .bottom-nav { display: none; }

  /* Page content: 読みやすい幅に制限して中央揃え */
  .page-content {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 32px;
    padding-right: 32px;
    padding-bottom: 40px;
    box-sizing: border-box;
  }

  /* 地図ページはフル幅 */
  .page-content.page-full-width {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
  }

  /* Auth pages don't need nav clearance */
  .auth-wrap { padding: 60px 24px 60px; }

  /* Toast near bottom of viewport */
  .toast { bottom: 24px; }

  /* チェックイン送信ボタン: サイドバー(240px)を考慮した中央揃え */
  .checkin-submit-bar {
    left: calc(120px + 50vw);
    bottom: 24px;
  }
}

/* ── チェックイン送信バー（モバイル基本スタイル） ── */
.checkin-submit-bar {
  position: fixed;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 50;
  padding: 10px 16px 12px;
  box-sizing: border-box;
  background: linear-gradient(to bottom, transparent, var(--bg) 42%);
}

/* ════════════════════════════════════════════════════
   統計・バッジ（記録ページ）
   ════════════════════════════════════════════════════ */

/* ── 統計ヒーローカード ── */
.stat-hero {
  display: flex;
  align-items: stretch;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: 18px;
  padding: 18px 8px;
  margin-bottom: 24px;
  box-shadow: 0 6px 20px rgba(213,154,47,0.28);
}
.stat-hero-item { flex: 1; text-align: center; }
.stat-hero-num {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
}
.stat-hero-label {
  font-size: 10px;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  margin-top: 5px;
}
.stat-hero-sep { width: 1px; background: rgba(255,255,255,0.25); margin: 4px 0; }

/* ── セクション見出し ── */
.stats-section-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── バッジカテゴリ ── */
.badge-cat { margin-bottom: 26px; }
.badge-cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.badge-cat-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--tag-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.badge-cat-name {
  flex: 1;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.badge-cat-count {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-dark);
  background: var(--tag-bg);
  padding: 3px 10px;
  border-radius: 20px;
}
.badge-cat-progress {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 14px;
}
.badge-cat-progress > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.32,0.72,0,1);
}

/* ── バッジグループ ── */
.badge-grp { margin-bottom: 16px; }
.badge-grp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
}
.badge-grp-name { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.badge-grp-count { font-size: 11px; font-weight: 600; color: var(--text-muted); }

/* ── バッジタイル ── */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.badge-tile {
  position: relative;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 16px;
  padding: 14px 6px 10px;
  text-align: center;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.badge-tile:active { transform: scale(0.94); }
.badge-tile.earned {
  border-color: rgba(213,154,47,0.45);
  box-shadow: 0 3px 14px rgba(213,154,47,0.18);
  background: linear-gradient(180deg, #fffdf8 0%, var(--card) 100%);
}
.badge-tile-img {
  width: 72px; height: 72px;
  object-fit: contain;
  display: block;
  margin: 0 auto 8px;
}
.badge-tile:not(.earned) .badge-tile-img { opacity: 0.55; }
.badge-tile.earned .badge-tile-img {
  filter: drop-shadow(0 4px 8px rgba(213,154,47,0.35));
}
.badge-tile-fallback {
  width: 72px; height: 72px;
  border-radius: 50%;
  margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  background: var(--border); color: var(--text-muted);
}
.badge-tile.earned .badge-tile-fallback { background: var(--accent); color: #fff; }
.badge-tile-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.badge-tile.earned .badge-tile-name { color: var(--text); }
.badge-tile-check {
  position: absolute;
  top: 7px; right: 7px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #4E8A58;
  color: #fff;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(78,138,88,0.4);
}

/* ── バッジ詳細ダイアログ ── */
.badge-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20,10,0,0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1300;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}
.badge-modal-overlay.open { opacity: 1; pointer-events: all; }
.badge-modal {
  width: 100%;
  max-width: 320px;
  background: var(--card);
  border-radius: 24px;
  padding: 28px 22px 24px;
  text-align: center;
  position: relative;
  transform: scale(0.82) translateY(14px);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  max-height: 85dvh;
  overflow-y: auto;
}
.badge-modal-overlay.open .badge-modal { transform: scale(1) translateY(0); }
.badge-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.badge-modal-img {
  width: 170px; height: 170px;
  object-fit: contain;
  margin: 4px auto 14px;
  display: block;
}
.badge-modal-img.earned { filter: drop-shadow(0 10px 22px rgba(213,154,47,0.45)); }
.badge-modal-img.locked { opacity: 0.55; }
.badge-modal-fallback {
  width: 150px; height: 150px;
  border-radius: 50%;
  margin: 8px auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; letter-spacing: 2px;
  background: var(--border); color: var(--text-muted);
}
.badge-modal-fallback.earned { background: var(--accent); color: #fff; }
.badge-modal-stars { font-size: 17px; color: var(--accent); letter-spacing: 3px; margin-bottom: 6px; }
.badge-modal-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}
.badge-modal-grp {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--tag-bg);
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.badge-modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 16px;
}
.badge-modal-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 24px;
}
.badge-modal-status.earned { background: rgba(78,138,88,0.12); color: #4E8A58; }
.badge-modal-status.locked { background: var(--bg); color: var(--text-muted); }

/* デスクトップ: バッジグリッドを4列に */
@media (min-width: 768px) {
  .badge-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ════════════════════════════════════════════════════
   通報（Report）機能
   ════════════════════════════════════════════════════ */

/* ── ⋯ 通報ボタン ── */
.report-kebab-btn {
  background: none;
  border: none;
  padding: 4px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.report-kebab-btn:hover { background: var(--bg); color: var(--text); }

/* ── 通報モーダル ── */
.report-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20,10,0,0.5);
  z-index: 1500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.report-modal-overlay.open { opacity: 1; pointer-events: all; }
.report-modal {
  width: 100%;
  max-width: 430px;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 20px 20px max(20px, env(safe-area-inset-bottom, 0px));
  max-height: 85dvh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32,0.72,0,1);
}
.report-modal-overlay.open .report-modal { transform: translateY(0); }
.report-modal-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 4px;
}
.report-modal-target {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  min-height: 16px;
}
.report-reason-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.report-reason-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.report-reason-item:last-child { border-bottom: none; }
.report-reason-item input[type="radio"] {
  width: 18px; height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.report-detail-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  resize: vertical;
  box-sizing: border-box;
  margin-bottom: 16px;
}
.report-modal-actions { display: flex; gap: 10px; }
.report-btn-cancel, .report-btn-submit {
  flex: 1;
  padding: 13px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.report-btn-cancel { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.report-btn-submit { background: #E05252; color: #fff; }
