:root {
  --bg-base: #1c102b;
  --card: rgba(255, 253, 248, 0.94);
  --card-border: rgba(184, 146, 66, 0.28);
  --text: #231d29;
  --muted: #62586b;
  --accent: #3d225c;
  --accent-dark: #25133b;
  --accent-soft: #f3edf8;
  --gold: #b89242;
  --gold-light: #e7d19b;
  --gold-bg: #fbf6ea;
  --font-serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

[v-cloak] {
  display: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text);
  min-height: 100vh;
}

/* --- 画面全体の和風背景スライドショー --- */
.bg-slideshow {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: var(--bg-base);
}

.bg-slide {
  position: absolute;
  top: 0;
  left: -6%;
  width: 112%;
  height: 100%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 2.5s ease-in-out;
  animation: panHorizontal 26s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

.bg-slide.active {
  opacity: 1;
}

.bg-slide.reverse {
  animation-direction: alternate-reverse;
}

@keyframes panHorizontal {
  0% {
    transform: translateX(-3%);
  }
  100% {
    transform: translateX(3%);
  }
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(28, 16, 43, 0.52) 0%,
    rgba(28, 16, 43, 0.24) 48%,
    rgba(28, 16, 43, 0.56) 100%
  );
  pointer-events: none;
}

/* --- ヘッダー（王朝紫 × 金線） --- */
header {
  position: relative;
  color: #fffdf8;
  padding: 44px 16px 26px;
  text-align: center;
  background: linear-gradient(180deg, rgba(37, 19, 59, 0.84) 0%, rgba(46, 26, 71, 0.72) 100%);
  backdrop-filter: blur(5px);
  border-bottom: 2px solid rgba(212, 175, 95, 0.55);
}

.header-kicker {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--gold-light);
  border: 1px solid rgba(231, 209, 155, 0.45);
  border-radius: 999px;
  padding: 2px 12px;
  margin-bottom: 10px;
}

header h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.52rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

header p {
  margin: 8px 0 0;
  font-size: 0.84rem;
  opacity: 0.94;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.official-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.official-links a {
  color: #fffdf8;
  text-decoration: none;
  font-size: 0.78rem;
  background: rgba(255, 253, 248, 0.14);
  border: 1px solid rgba(231, 209, 155, 0.45);
  padding: 6px 13px;
  border-radius: 20px;
  transition: background 0.15s, border-color 0.15s;
}

.official-links a:hover {
  background: rgba(231, 209, 155, 0.24);
  border-color: var(--gold-light);
}

.bg-switch {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(20, 10, 32, 0.52);
  color: #fffdf8;
  border: 1px solid rgba(231, 209, 155, 0.42);
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.15s;
}

.bg-switch:hover {
  background: rgba(20, 10, 32, 0.78);
}

/* --- メインコンテンツ --- */
main {
  max-width: 820px;
  margin: 22px auto 24px;
  padding: 0 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 18px 16px;
  margin-bottom: 18px;
  box-shadow: 0 8px 26px rgba(18, 8, 30, 0.28);
  backdrop-filter: blur(6px);
}

.card h2 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-dark);
  border-left: 4px solid var(--accent);
  box-shadow: inset 2px 0 0 0 var(--gold);
  padding-left: 10px;
  letter-spacing: 0.03em;
}

/* --- 読み込み・エラー表示 --- */
.state-banner {
  text-align: center;
  padding: 24px 14px;
  font-size: 0.88rem;
  color: var(--muted);
}

.state-banner.is-error {
  color: #991b1b;
  background: #fef2f2;
  border-radius: 10px;
}

.retry-btn {
  margin-top: 10px;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent);
  font-weight: bold;
  cursor: pointer;
}

/* --- 最新の実測状況 --- */
.latest-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.latest-header-left {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.latest-header h2 {
  margin: 0;
}

.latest-updated {
  font-size: 0.78rem;
  color: var(--muted);
}

.goods-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(61, 34, 92, 0.28);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.78rem;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.goods-btn:hover {
  background: #e9dff4;
  border-color: var(--accent);
}

.goods-btn:active {
  transform: scale(0.98);
}

.latest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-box {
  background: linear-gradient(180deg, #f8f4fb 0%, #f3edf8 100%);
  border: 1px solid rgba(61, 34, 92, 0.1);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.stat-val {
  font-size: 1.45rem;
  font-weight: bold;
  margin-top: 4px;
  color: var(--accent);
}

.latest-estimate {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.55;
  background: var(--gold-bg);
  border: 1px solid rgba(184, 146, 66, 0.35);
  color: #423115;
}

.latest-estimate.is-quiet {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.latest-estimate.is-preopen {
  background: var(--accent-soft);
  border-color: rgba(61, 34, 92, 0.22);
  color: var(--accent-dark);
}

/* --- 月別タブ --- */
.month-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 10px;
  min-height: 44px;
}

.month-tab {
  border: 1px solid #d4cadf;
  background: #fff;
  color: #463a52;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.month-tab:hover {
  border-color: var(--accent);
}

.month-tab.active {
  background: var(--accent);
  color: #fffdf8;
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(61, 34, 92, 0.24);
}

/* --- 混雑アイコン --- */
.crowd-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 0;
}

.crowd-icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

.crowd-icon.sm svg {
  width: 19px;
  height: 19px;
}

.crowd-icon.md svg {
  width: 24px;
  height: 24px;
}

/* --- 凡例 --- */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 10px;
  align-items: center;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.closed-chip {
  background: #e7e1ee;
  color: #6a5f76;
  font-size: 0.65rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
}

/* --- カレンダーグリッド --- */
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--muted);
  margin-bottom: 4px;
}

.cal-weekdays div:nth-child(6) {
  color: #1976d2;
}

.cal-weekdays div:nth-child(7) {
  color: #c80000;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  min-height: 350px;
}

.cal-empty {
  background: transparent;
}

.cal-cell {
  border: 1.5px solid #e6dfec;
  background: #fff;
  border-radius: 8px;
  padding: 5px 2px 6px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  font-family: inherit;
  color: inherit;
}

.cal-cell:hover {
  border-color: var(--gold);
}

.cal-cell.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px rgba(61, 34, 92, 0.2);
}

.cal-cell.closed {
  background: #f5f2f8;
  border-color: #e6dfec;
  color: #9b90a6;
}

.cal-cell.past {
  background: #f5f2f8;
  border-color: #e6dfec;
  opacity: 0.65;
}

.cal-cell.past:hover {
  opacity: 0.88;
}

.cal-cell.past.active {
  opacity: 1;
  background: var(--accent-soft);
  border-color: var(--accent);
}

.cal-top {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  font-size: 0.76rem;
  font-weight: bold;
}

.cal-weather {
  font-size: 0.78rem;
  line-height: 1;
}

.cal-closed-label {
  font-size: 0.78rem;
  font-weight: bold;
  color: #9b90a6;
  margin: 6px 0;
}

.cal-min {
  font-size: 0.64rem;
  color: var(--muted);
}

.cal-badge {
  font-size: 0.58rem;
  font-weight: bold;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1.25;
  white-space: nowrap;
  margin-top: 2px;
}

.badge-opening {
  background: #fce7f3;
  color: #9d174d;
}

.badge-special {
  background: #ede9fe;
  color: #5b21b6;
}

.badge-switch {
  background: #fef3c7;
  color: #92400e;
}

.badge-final {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-night {
  background: #e0f2fe;
  color: #0369a1;
}

/* --- 詳細エリア見出し＆表示切替タブ --- */
.detail-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.detail-header h2 {
  margin: 0;
}

.view-toggle {
  display: inline-flex;
  background: #eae3f0;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.view-btn {
  border: none;
  background: transparent;
  color: #574a66;
  font-size: 0.78rem;
  font-weight: bold;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.view-btn.active {
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(37, 19, 59, 0.16);
}

/* --- 天気・イベントピル・アドバイス --- */
.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.weather-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: bold;
}

.event-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: bold;
}

.advice {
  background: var(--gold-bg);
  border-left: 4px solid var(--gold);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 14px;
}

.advice.is-past {
  background: #f3eff7;
  border-left-color: #7c6f8a;
  color: #3d3347;
}

/* --- 時間帯別の予想レンジ（横棒）ビュー --- */
.range-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 8px;
  min-height: 200px;
}

.range-row {
  display: grid;
  grid-template-columns: 48px 30px 1fr 86px;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 8px;
}

.range-row.is-now {
  background: #fef2f2;
  outline: 1.5px solid #fca5a5;
}

.range-hour {
  font-size: 0.88rem;
  font-weight: bold;
  color: #3a3044;
  white-space: nowrap;
}

.now-tag {
  display: inline-block;
  font-size: 0.6rem;
  background: #c80000;
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  margin-top: 2px;
}

.range-track {
  position: relative;
  height: 14px;
  background: #efeaf4;
  border-radius: 999px;
  overflow: hidden;
}

.range-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  min-width: 10px;
  transition: width 0.3s ease, left 0.3s ease;
}

.range-text {
  font-size: 0.84rem;
  font-weight: bold;
  text-align: right;
  color: #231d29;
  white-space: nowrap;
}

.range-note {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 8px;
}

.chart-wrap {
  position: relative;
  width: 100%;
}

.meta {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
  margin-top: 10px;
}

/* --- 混雑傾向・よくある質問 --- */
.guide-text {
  font-size: 0.86rem;
  line-height: 1.75;
  color: #3a3044;
  margin: 0 0 12px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  border: 1px solid #e6dfec;
  border-radius: 8px;
  background: #faf7fc;
  padding: 8px 12px;
}

.faq-item summary {
  font-size: 0.86rem;
  font-weight: bold;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "＋";
  font-size: 0.9rem;
  color: var(--gold);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "－";
}

.faq-item p {
  margin: 8px 0 2px;
  font-size: 0.83rem;
  line-height: 1.68;
  color: #3a3044;
}

/* --- 開発者応援カード（OFUSE） --- */
.support-card {
  text-align: center;
  padding: 16px;
}

.support-card p {
  margin: 0 0 12px;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.65;
}

.ofuse-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #583182 100%);
  color: #fffdf8;
  font-weight: bold;
  font-size: 0.92rem;
  text-decoration: none;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid rgba(231, 209, 155, 0.45);
  box-shadow: 0 3px 10px rgba(37, 19, 59, 0.22);
  transition: transform 0.15s, box-shadow 0.15s;
}

.ofuse-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(37, 19, 59, 0.3);
}

.support-note {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--muted);
}

/* --- フッター --- */
footer {
  max-width: 820px;
  margin: 0 auto 32px;
  padding: 14px 16px;
  text-align: center;
  font-size: 0.73rem;
  color: rgba(255, 253, 248, 0.9);
  background: rgba(37, 19, 59, 0.72);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(231, 209, 155, 0.28);
  border-radius: 10px;
  line-height: 1.75;
}

footer a {
  color: var(--gold-light);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.footer-links {
  margin: 6px 0 0;
}

/* --- グッズ品切れ情報ポップアップ（モーダル） --- */
.goods-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 10, 32, 0.66);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.goods-modal {
  width: 100%;
  max-width: 560px;
  max-height: 84vh;
  background: #fffdf9;
  border-radius: 14px;
  border: 1px solid rgba(184, 146, 66, 0.4);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.goods-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: var(--accent);
  color: #fffdf8;
  border-bottom: 2px solid var(--gold);
}

.goods-modal-header h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1rem;
  border: none;
  box-shadow: none;
  padding: 0;
  color: #fffdf8;
}

.goods-modal-close {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.goods-modal-close:hover {
  background: rgba(255, 255, 255, 0.32);
}

.goods-modal-body {
  padding: 14px 16px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 0.85rem;
  line-height: 1.55;
}

.goods-notice {
  background: var(--gold-bg);
  border: 1px solid rgba(184, 146, 66, 0.32);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 0.76rem;
  color: #4f4128;
  margin-bottom: 14px;
}

.goods-group {
  margin-bottom: 14px;
}

.goods-group:last-of-type {
  margin-bottom: 10px;
}

.goods-group-title {
  font-size: 0.84rem;
  font-weight: bold;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.goods-group-sub {
  font-size: 0.72rem;
  font-weight: normal;
  color: var(--muted);
  margin: -4px 0 8px;
}

.goods-item {
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid #e6dfec;
  background: #ffffff;
}

.goods-item.st-sold_out_permanent {
  background: #fef2f2;
  border-color: #fecaca;
}

.goods-item.st-out_of_stock_restock {
  background: #fff7ed;
  border-color: #fed7aa;
}

.goods-item.st-out_of_stock_unknown {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.goods-item.st-restocked {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.goods-item-name {
  font-weight: bold;
  font-size: 0.88rem;
  color: #231d29;
  margin-bottom: 4px;
}

.goods-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.74rem;
  color: var(--muted);
}

.goods-item-meta a {
  color: var(--accent);
  text-decoration: underline;
}

.goods-item-note {
  margin-top: 6px;
  font-size: 0.76rem;
  color: #3a3044;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 6px;
  padding: 5px 8px;
}

.goods-history {
  margin-top: 6px;
  font-size: 0.73rem;
  color: #534663;
}

.goods-history summary {
  cursor: pointer;
  color: var(--accent);
}

.goods-history ul {
  margin: 4px 0 0;
  padding-left: 16px;
}

.goods-history li {
  margin-bottom: 2px;
}

.goods-modal-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e6dfec;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--muted);
}

.goods-modal-footer a {
  color: var(--accent);
  font-weight: bold;
  text-decoration: none;
}

.goods-modal-footer a:hover {
  text-decoration: underline;
}

.goods-state-msg {
  text-align: center;
  padding: 24px 10px;
  color: var(--muted);
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.28rem;
  }
  .range-row {
    grid-template-columns: 42px 26px 1fr 76px;
    gap: 6px;
  }
  .range-text {
    font-size: 0.78rem;
  }
}
