:root { color-scheme: dark; }
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Pretendard, Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2436 0%, #0c0f16 60%, #080a0f 100%);
  background-attachment: fixed;
  color: #e8edf6;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

main {
  max-width: 38rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.hero { text-align: center; margin-bottom: 2rem; position: relative; }
.hero-kids {
  display: block; height: 4.5rem; width: auto; margin: 0 auto .6rem;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.35));
}
h1 {
  font-size: clamp(2rem, 7vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #ffffff, #aab6cc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.intro { margin-top: .9rem; color: #9aa6bc; font-size: 1.02rem; }
.address { margin-top: .5rem; color: #7d8aa0; font-size: .92rem; }

h2 { font-size: 1.05rem; color: #c3cde0; margin-bottom: .75rem; font-weight: 600; }

.empty { text-align: center; color: #7d8aa0; padding: 2rem 0; }

.toast {
  background: #15321f; border: 1px solid #2c6b43; color: #b7f3cd;
  padding: .8rem 1rem; border-radius: .8rem; text-align: center; margin-bottom: 1.5rem;
}
.toast.error { background: #3a1a1f; border-color: #7a3340; color: #f3b7c1; }

/* ---- Guest calendar + date panels ---- */
.cal-block {
  background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.08);
  border-radius: 1rem; padding: 1.25rem; margin-bottom: 1.25rem;
}

.dates { margin-top: 1.25rem; }

/* One panel per open date; revealed when its calendar day is clicked (:target). */
.date-panel {
  display: none;
  background: rgba(255,255,255,.035); border: 1px solid rgba(120,150,210,.45);
  border-radius: 1rem; padding: 1.25rem; scroll-margin-top: 1rem;
}
.date-panel:target { display: block; }

.date-panel-head { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: 1rem; }
.day { font-size: 1.15rem; font-weight: 600; }
.note { font-size: .85rem; color: #9aa6bc; }
.count {
  font-size: .82rem; color: #aeb9cf; white-space: nowrap; margin-left: auto;
  background: rgba(120,150,210,.16); padding: .35rem .7rem; border-radius: 2rem;
}

.guest-list { list-style: none; margin-bottom: 1rem; display: flex; flex-direction: column; gap: .4rem; }
.guest-list li {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  font-size: .92rem; padding: .5rem .7rem;
  background: rgba(255,255,255,.03); border-radius: .6rem;
}
.guest-name { font-weight: 600; }
.guest-size { font-size: .78rem; color: #8fd6a8; }
.guest-msg { color: #9aa6bc; font-size: .85rem; }

/* ---- Forms ---- */
.reserve-form { display: flex; flex-direction: column; gap: .6rem; }
.reserve-form .row { display: flex; gap: .6rem; }
.reserve-form .row input[type="text"] { flex: 1; }
.reserve-form input[type="number"] { width: 5rem; }

input, button {
  font: inherit; border-radius: .65rem; border: 1px solid rgba(255,255,255,.12);
  padding: .7rem .85rem; background: rgba(255,255,255,.04); color: #e8edf6;
}
input::placeholder { color: #6f7b90; }
input:focus { outline: none; border-color: rgba(120,150,210,.6); background: rgba(255,255,255,.06); }

button {
  cursor: pointer; font-weight: 600; border: none;
  background: linear-gradient(180deg, #4f7bd6, #3a5fb0); color: #fff;
  transition: filter .15s ease;
}
button:hover { filter: brightness(1.1); }
button.danger { background: linear-gradient(180deg, #c0556a, #9a3e50); }
button.small { padding: .25rem .55rem; line-height: 1; }

/* ---- Admin ---- */
.admin-block {
  background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.08);
  border-radius: 1rem; padding: 1.25rem; margin-bottom: 1.25rem;
}
.logout { position: absolute; top: 0; right: 0; }
.logout button { background: rgba(255,255,255,.08); padding: .45rem .8rem; font-weight: 500; }

.admin-date { padding: .9rem 0; border-top: 1px solid rgba(255,255,255,.06); }
.admin-date:first-of-type { border-top: none; }
.admin-date.closed { opacity: .55; }
.admin-date-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.admin-date-head .day { font-size: 1rem; }
.badge { font-size: .78rem; color: #aeb9cf; background: rgba(120,150,210,.16); padding: .25rem .6rem; border-radius: 2rem; }
.admin-actions { margin-left: auto; display: flex; gap: .4rem; }
.admin-actions button { padding: .35rem .7rem; font-size: .82rem; font-weight: 500; }
.admin-date .guest-list { margin-top: .7rem; }
.inline-del { margin-left: auto; }

.note-edit { display: flex; gap: .4rem; margin-top: .5rem; }
.note-edit input { flex: 1; padding: .4rem .6rem; font-size: .85rem; }
.note-edit button { font-size: .8rem; font-weight: 500; background: rgba(255,255,255,.08); }

/* ---- Admin calendar ---- */
.cal-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: .9rem; }
.cal-title { font-weight: 600; min-width: 7rem; text-align: center; }
.cal-arrow {
  text-decoration: none; color: #c3cde0; font-size: 1.2rem; line-height: 1;
  background: rgba(255,255,255,.06); border-radius: .5rem; padding: .3rem .75rem;
}
.cal-arrow:hover { background: rgba(255,255,255,.14); color: #fff; }

/* minmax(0,1fr) lets columns shrink below their content so 7 cells never
   overflow the container on narrow screens. */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .25rem; }
.cal-dow { text-align: center; font-size: .75rem; color: #8a93a8; padding: .3rem 0; }
.cal-dow.sun, .cal-cell.sun .cal-num { color: #e08b94; }
.cal-dow.sat, .cal-cell.sat .cal-num { color: #8aa6d9; }

.cal-cell-form { display: flex; }
.cal-cell {
  width: 100%; aspect-ratio: 1 / 1; padding: .2rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .12rem;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07);
  border-radius: .55rem; color: #c3cde0; font-weight: 500; text-decoration: none;
}
/* Only interactive cells (admin buttons, guest open-date links) react to hover. */
a.cal-cell:hover, button.cal-cell:hover { filter: none; background: rgba(255,255,255,.09); }
.cal-cell.empty { background: transparent; border: none; cursor: default; }
.cal-cell.muted { opacity: .4; }  /* guest: in-month day with no open slot */
.cal-cell.today { border-color: rgba(120,150,210,.65); }
.cal-cell.open { background: linear-gradient(180deg, #1d4a2e, #163a24); border-color: #2c6b43; }
.cal-cell.open .cal-num, .cal-cell.open .cal-meta { color: #b7f3cd; }
/* Open AND already has guests: amber, not red — "others are coming", still bookable. */
.cal-cell.open.booked { background: linear-gradient(180deg, #4a3a1d, #3a2e16); border-color: #7a6326; }
.cal-cell.open.booked .cal-num, .cal-cell.open.booked .cal-meta { color: #f3d9a8; }
.cal-cell.closed { opacity: .6; }
.cal-cell.closed .cal-num { text-decoration: line-through; }
.cal-num { font-size: .92rem; line-height: 1; }
.cal-meta {
  font-size: .58rem; opacity: .85; line-height: 1;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-help {
  margin-top: .8rem; font-size: .78rem; color: #9aa6bc;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem 1rem;
}
.legend { display: inline-flex; align-items: center; gap: .35rem; }
.legend-note { color: #7d8aa0; }
.dot { width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; }
.dot.open { background: #2c6b43; }
.dot.booked { background: #7a6326; }

.form-note { font-size: .78rem; color: #7d8aa0; text-align: center; }

/* ---- Guest self-cancel ---- */
.cancel-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.08);
  border-radius: .8rem; padding: .9rem 1.1rem; margin-bottom: .6rem;
}
.cancel-item-main { display: flex; flex-direction: column; gap: .15rem; }
.cancel-item .note { color: #9aa6bc; }

/* ---- Admin: phone + confirmation status ---- */
.guest-phone { font-size: .82rem; color: #aeb9cf; text-decoration: none; }
.guest-phone:hover { color: #e8edf6; }
.status-badge {
  font-size: .72rem; padding: .15rem .5rem; border-radius: 2rem;
  background: rgba(255,255,255,.08); color: #c3a25a;
}
.status-badge.ok { background: #15321f; color: #8fd6a8; }
.guest-list li.confirmed { background: rgba(44,107,67,.14); }
.rsvp-actions { margin-left: auto; display: flex; gap: .35rem; }
.rsvp-actions button { font-weight: 500; }

footer {
  margin-top: 3rem; text-align: center; font-size: .8rem; color: #5b6577;
}
footer a { color: #7d8aa0; text-decoration: none; }
footer a:hover { color: #e8edf6; }
