/* コミヨソ一般公開レジャー施設（サンリオ・よみうりランド）共通スタイル
 * スマホ幅 375px 最優先・CLS対策（min-height）必須
 */

:root {
  --card-bg: #ffffff;
  --text: #1e293b;
  --muted: #5b6778;
  --border: #e2e8f0;
  --accent: #163b6d;
  --accent-dark: #0d2547;
  --accent-soft: #eef4fc;
  --accent-border: #c9dcf4;
  --bg-page: #f4f7fb;
  --header-gradient: linear-gradient(135deg, #0d2244 0%, #19457e 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background-color: var(--bg-page);
  color: var(--text);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- ヘッダー --- */
.site-header {
  background: var(--header-gradient);
  color: #ffffff;
  padding: 20px 14px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.header-inner {
  max-width: 840px;
  margin: 0 auto;
  text-align: center;
}

.brand-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.brand-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 3px 11px;
}

.collecting-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #1e293b;
  background: #fde68a;
  border-radius: 999px;
  padding: 3px 10px;
}

.site-header h1 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.38;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.28);
}

.header-sub {
  margin: 8px 0 0;
  font-size: 0.82rem;
  opacity: 0.94;
}

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

.official-links a {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.36);
  padding: 5px 12px;
  border-radius: 999px;
  transition: background 0.15s;
}

.official-links a:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* --- メインコンテナ ＆ カード --- */
.container {
  max-width: 840px;
  margin: 16px auto 24px;
  padding: 0 12px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 15px;
  margin-bottom: 16px;
  box-shadow: 0 3px 14px rgba(15, 23, 42, 0.06);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.card h2 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.35;
  border-left: 4px solid var(--accent);
  padding-left: 9px;
  color: #0f172a;
}

.updated-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
  padding-left: 13px;
}

.refresh-btn {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.refresh-btn:hover {
  background: var(--accent-border);
}

/* --- 4段階統一混雑アイコン --- */
.crowd-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  vertical-align: middle;
  flex-shrink: 0;
}

.crowd-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

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

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

.crowd-icon.lg {
  width: 40px;
  height: 40px;
}

/* --- ① リアルタイム総合サマリー --- */
.summary-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

@media (min-width: 600px) {
  .summary-strip {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 14px;
  }
}

.summary-level-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.summary-icon-slot {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-label {
  font-size: 0.74rem;
  color: var(--muted);
}

.summary-level-text {
  font-size: 1.12rem;
  font-weight: 800;
  color: #0f172a;
}

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric-box {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
  min-width: 0;
}

.metric-label {
  font-size: 0.71rem;
  color: var(--muted);
}

.metric-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-dark);
  margin-top: 2px;
  white-space: nowrap;
}

.metric-val.metric-sub {
  font-size: 0.92rem;
}

.status-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.82rem;
  margin-bottom: 12px;
}

.status-banner.is-closed {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

/* --- フィルタ ＆ ソート --- */
.controls-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

@media (min-width: 640px) {
  .controls-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cat-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.cat-tabs::-webkit-scrollbar {
  display: none;
}

@media (min-width: 640px) {
  .cat-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

.cat-tab {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cat-tab.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.sort-wrap {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
}

.sort-select {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* --- 待ち時間アイテム一覧（CLS防止 min-height） --- */
.wait-list {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.loading-placeholder {
  text-align: center;
  padding: 36px 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.wait-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.wait-row.is-dim {
  background: #f8fafc;
  opacity: 0.86;
}

.wait-row-left {
  min-width: 0;
  flex: 1 1 auto;
}

.wait-item-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
}

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

.cat-chip {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 0.71rem;
  font-weight: 600;
}

.typical-chip {
  color: #64748b;
}

.wait-row-right {
  flex-shrink: 0;
  text-align: right;
  display: flex;
  align-items: center;
  gap: 7px;
}

.wait-min-badge {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  min-width: 74px;
  padding: 5px 10px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.96rem;
  background: #f1f5f9;
  color: #0f172a;
}

.wait-min-badge.lvl-1 {
  background: #e3f2fd;
  color: #0d47a1;
}

.wait-min-badge.lvl-2 {
  background: #e8f5e9;
  color: #1b5e20;
}

.wait-min-badge.lvl-3 {
  background: #fff3e0;
  color: #b45309;
}

.wait-min-badge.lvl-4 {
  background: #ffebee;
  color: #b71c1c;
}

.status-pill {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.st-suspended {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.status-pill.st-closed_reception {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.status-pill.st-out_of_hours {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.status-pill.st-unknown {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.hours-footnote {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

/* --- 15分未満（公式リスト非掲載）アトラクション補足セクション --- */
.under-threshold-section {
  margin-top: 12px;
}

.under-info-banner {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.81rem;
  line-height: 1.5;
  margin-bottom: 8px;
}

.under-list-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  padding: 9px 11px;
}

.under-list-box summary {
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 700;
  color: #1e293b;
}

.under-list-sub {
  margin: 6px 0 8px;
  font-size: 0.73rem;
  color: var(--muted);
}

.under-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

@media (min-width: 600px) {
  .under-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.under-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 10px;
  min-width: 0;
}

.under-row-name {
  font-size: 0.83rem;
  font-weight: 700;
  color: #1e293b;
  word-break: break-word;
}

.under-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e3f2fd;
  color: #0d47a1;
  white-space: nowrap;
}

/* --- ② 時間帯別推移グラフ ＆ 予想幅 --- */
.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding-left: 13px;
}

.weather-pill,
.event-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.weather-pill {
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
}

.event-pill.badge-night {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.event-pill.badge-rain_up {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.event-pill.badge-rain_down {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--accent-soft);
}

.view-btn {
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  padding: 6px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.view-btn.active {
  background: var(--accent);
  color: #ffffff;
}

.advice-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.84rem;
  color: #1e293b;
  margin-bottom: 12px;
}

.advice-box.is-past {
  background: #f1f5f9;
  color: #475569;
}

.chart-wrap {
  position: relative;
  width: 100%;
  min-height: 250px;
  height: 260px;
}

.range-view {
  min-height: 250px;
}

.range-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.range-row {
  display: grid;
  grid-template-columns: 54px 26px minmax(0, 1fr) 82px;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 8px;
}

.range-row.is-now {
  background: #fff1f2;
}

.range-row.is-actual {
  background: #f8fafc;
}

.range-hour {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  line-height: 1.2;
}

.now-tag,
.actual-tag {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-top: 2px;
}

.now-tag {
  background: #c80000;
  color: #ffffff;
}

.actual-tag {
  background: #64748b;
  color: #ffffff;
}

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

.range-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  min-width: 6px;
}

.range-text {
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
  color: #1e293b;
  white-space: nowrap;
}

.view-note {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

/* --- 14日間混雑予想カレンダー（CLS防止 min-height） --- */
.legend-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.75rem;
  color: #334155;
}

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

.closed-chip {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 5px;
}

.cal-weekdays .sat {
  color: #1d4ed8;
}

.cal-weekdays .sun {
  color: #dc2626;
}

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

.cal-empty {
  min-height: 76px;
}

.cal-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  min-width: 0;
  padding: 5px 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.14s, background 0.14s, transform 0.1s;
}

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

.cal-cell.active {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
}

.cal-cell.past {
  background: #f1f5f9;
  color: #64748b;
  opacity: 0.82;
}

.cal-cell.past.active {
  opacity: 1;
  border: 2px solid #475569;
}

.cal-cell.closed {
  background: #f8fafc;
  color: #94a3b8;
}

.cal-cell.is-today {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.cal-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  padding: 0 2px;
}

.cal-day.sat {
  color: #1d4ed8;
}

.cal-day.sun {
  color: #dc2626;
}

.cal-weather {
  font-size: 0.74rem;
}

.cal-pop {
  font-size: 0.62rem;
  color: #475569;
  line-height: 1;
}

.cal-min {
  font-size: 0.66rem;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

.cal-closed-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  margin: 6px 0;
}

.cal-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-badge.badge-night {
  background: #e0e7ff;
  color: #3730a3;
}

.cal-badge.badge-rain_up {
  background: #fee2e2;
  color: #991b1b;
}

.cal-badge.badge-rain_down {
  background: #d1fae5;
  color: #065f46;
}

.meta-footnote {
  margin-top: 10px;
  font-size: 0.74rem;
  color: var(--muted);
}

/* --- ③ ガイド ＆ 開閉式 FAQ --- */
.guide-lead {
  font-size: 0.86rem;
  color: #334155;
  margin: 0 0 12px;
}

.guide-points {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.guide-point {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 13px;
}

.guide-point h3 {
  margin: 0 0 5px;
  font-size: 0.9rem;
  color: #0f172a;
}

.guide-point p {
  margin: 0;
  font-size: 0.83rem;
  color: #334155;
}

.faq-heading {
  margin: 0 0 10px;
  font-size: 0.94rem;
  color: #0f172a;
}

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

.faq-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  padding: 10px 12px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.86rem;
  color: #0f172a;
}

.faq-item p {
  margin: 8px 0 2px;
  font-size: 0.83rem;
  color: #334155;
}

/* --- AdSense 枠（CLS防止 min-height: 100px） --- */
.ad-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px 12px;
  margin-bottom: 16px;
  text-align: center;
}

.ad-label {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-bottom: 4px;
}

.ad-slot {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* --- OFUSE 応援カード --- */
.support-card {
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, var(--accent-soft) 100%);
}

.support-card p {
  margin: 0 0 12px;
  font-size: 0.86rem;
  color: #334155;
}

.ofuse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 22px;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.14);
  transition: opacity 0.15s;
}

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

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

/* --- フッター --- */
.site-footer {
  background: #1e293b;
  color: #e2e8f0;
  padding: 20px 14px 26px;
  font-size: 0.78rem;
  text-align: center;
}

.footer-inner {
  max-width: 840px;
  margin: 0 auto;
}

.footer-disclaimer {
  margin: 0 0 10px;
  line-height: 1.65;
}

.site-footer a {
  color: #ffffff;
  text-decoration: underline;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 8px;
}

/* --- スマホ幅（375px〜480px）最適化 --- */
@media (max-width: 480px) {
  .site-header {
    padding: 16px 10px 18px;
  }
  .site-header h1 {
    font-size: 1.08rem;
  }
  .container {
    padding: 0 8px;
  }
  .card {
    padding: 14px 11px;
    border-radius: 14px;
  }
  .cal-grid {
    gap: 3px;
  }
  .cal-cell {
    padding: 4px 1px;
    min-height: 76px;
  }
  .cal-top {
    font-size: 0.66rem;
    padding: 0 1px;
  }
  .cal-min {
    font-size: 0.58rem;
    letter-spacing: -0.02em;
  }
  .crowd-icon {
    width: 22px;
    height: 22px;
  }
  .crowd-icon.lg {
    width: 36px;
    height: 36px;
  }
  .range-row {
    grid-template-columns: 48px 24px minmax(0, 1fr) 74px;
    gap: 5px;
  }
  .wait-min-badge {
    min-width: 64px;
    padding: 4px 7px;
    font-size: 0.88rem;
  }
}
