/* 百年花火 駐車場 空き状況 — 100hanabi.jp の配色・書体に合わせる */
:root {
  --bg: #e1d4c3;
  --paper: #fff;
  --ink: #333;
  --ink-soft: #6b625c;
  --accent: #9E2224;
  --open: #008C04;
  --few: #B97728;
  --full: #AD1315;
  --none: #9a948e;
  --sky: #c8daeb;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  font-feature-settings: "palt" 1;
  letter-spacing: 0.05em;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > main { flex: 1 0 auto; width: 100%; }

img { max-width: 100%; height: auto; display: block; }

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

[hidden] { display: none !important; }

/* --- ヘッダー（公式サイトの日程バナー） --- */
.hero { background: #efe7dc; }
.hero-img { display: block; max-width: 1100px; margin: 0 auto; }

/* --- 本文 --- */
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.band {
  background: var(--accent);
  color: #fff;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.2em;
  padding: 4px 8px;
}

.title {
  font-family: 'Zen Old Mincho', serif;
  font-weight: 900;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  text-align: center;
  margin: 16px 0 0;
  line-height: 1.3;
}

.asof {
  text-align: center;
  color: var(--ink-soft);
  margin: 4px 0 16px;
  font-size: 0.95rem;
}

/* 凡例 */
.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  padding: 0;
  margin: 0 0 16px;
  font-weight: 700;
}
.legend li { display: flex; align-items: center; gap: 6px; }
.legend .mark {
  display: inline-grid;
  place-items: center;
  width: 1.8em;
  height: 1.8em;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
}

.s-open .mark, .legend .s-open { background: var(--open); }
.s-few .mark, .legend .s-few { background: var(--few); }
.s-full .mark, .legend .s-full { background: var(--full); }
.s-none .mark { background: var(--none); }

/* 駐車場一覧 */
.lots {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.lot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--paper);
  border-left: 8px solid var(--none);
  border-radius: 6px;
  padding: 14px 14px 14px 16px;
  min-height: 88px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}
.lot.s-open { border-left-color: var(--open); }
.lot.s-few { border-left-color: var(--few); }
.lot.s-full { border-left-color: var(--full); }

.lot-info { min-width: 0; display: grid; gap: 4px; }
.lot-name { font-weight: 700; font-size: 1.2rem; line-height: 1.35; }
.lot-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.lot-map { font-weight: 700; }
.lot-map::before { content: "▶ "; font-size: 0.7em; }

.lot-status {
  flex: none;
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 92px;
}
.lot-status .mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1;
}
.lot-status .label { font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.s-open .label { color: var(--open); }
.s-few .label { color: var(--few); }
.s-full .label { color: var(--full); }
.s-none .label { color: var(--none); }

.error {
  margin: 16px 0 0;
  padding: 10px 12px;
  background: #fbe9e9;
  color: var(--full);
  border-radius: 6px;
  font-weight: 700;
}

.warn {
  margin: 20px 0 0;
  padding: 12px 14px;
  border: 2px solid var(--full);
  border-radius: 6px;
  background: #fff;
  color: var(--full);
  font-weight: 700;
}

.map { margin-top: 24px; }
.map h2 {
  font-family: 'Zen Old Mincho', serif;
  font-weight: 900;
  font-size: 1.3rem;
  text-align: center;
  margin: 0 0 10px;
}
.map img { width: 100%; border-radius: 6px; box-shadow: 0 1px 3px rgb(0 0 0 / 0.15); }
.map-note { text-align: center; font-size: 0.85rem; color: var(--ink-soft); margin: 6px 0 0; }

.notes {
  margin-top: 24px;
  padding: 14px 16px;
  background: rgb(255 255 255 / 0.6);
  border-radius: 6px;
  font-size: 0.9rem;
}
.notes p { margin: 0; }
.notes p + p { margin-top: 4px; }

.back { text-align: center; margin: 24px 0 0; font-weight: 700; }

.foot {
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.85rem;
  background: linear-gradient(135deg, var(--sky), #fff 10% 90%, var(--sky));
}

/* --- 管理画面 --- */
.admin .title { margin-top: 20px; }

.current {
  text-align: center;
  font-weight: 700;
  margin: 8px 0 16px;
  min-height: 1.6em;
}

.choices { display: grid; gap: 12px; }

.choice {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 84px;
  padding: 12px 20px;
  border: 3px solid transparent;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1.5rem;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}
.choice .mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
}
.choice:active { transform: scale(0.98); }
.choice[aria-checked="true"], .choice[aria-checked="true"] .label { color: #fff; }
.choice[aria-checked="true"] .mark { background: rgb(255 255 255 / 0.25); }
.choice.s-open[aria-checked="true"] { background: var(--open); border-color: var(--open); }
.choice.s-few[aria-checked="true"] { background: var(--few); border-color: var(--few); }
.choice.s-full[aria-checked="true"] { background: var(--full); border-color: var(--full); }
.choice[aria-checked="true"]::after { content: "表示中"; margin-left: auto; font-size: 0.9rem; font-weight: 700; }

.busy .choice { opacity: 0.6; pointer-events: none; }

.toast {
  min-height: 3em;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  visibility: hidden;
}
.toast.show { visibility: visible; background: #e6f4e6; color: #0b5d0e; }
.toast.show.err { background: #fbe9e9; color: var(--full); }

.reset { text-align: center; margin: 32px 0 0; }
.reset button {
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: none;
  border: 1px solid #b9ada0;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
}
