:root {
  --ink: #14221d;
  --muted: #65736d;
  --green: #1e5a46;
  --green-dark: #174737;
  --green-soft: #eaf2ee;
  --gold: #c49a55;
  --cream: #f5f1e8;
  --paper: #fffefa;
  --line: #dfe5e1;
  --danger: #a83d39;
  --danger-soft: #faeceb;
  --shadow: 0 18px 50px rgba(25, 45, 37, 0.09);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(196,154,85,.12), transparent 22rem),
    linear-gradient(180deg, #faf8f2 0%, #f4f3ee 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.shell { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250,248,242,.88);
  border-bottom: 1px solid rgba(20,34,29,.08);
  backdrop-filter: blur(18px);
}
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 43px; height: 43px; border-radius: 13px;
  background: var(--green); color: white; font-size: 25px; box-shadow: 0 7px 20px rgba(30,90,70,.22);
}
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 18px; letter-spacing: -.01em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .09em; }
.live-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 13px; font-weight: 750; }
.live-badge i { width: 8px; height: 8px; border-radius: 50%; background: #2c9a67; box-shadow: 0 0 0 5px rgba(44,154,103,.11); }

.main-grid { padding-block: 64px 30px; }
.hero { max-width: 760px; margin-bottom: 30px; }
.eyebrow, .step { margin: 0 0 8px; color: var(--green); text-transform: uppercase; letter-spacing: .13em; font-weight: 800; font-size: 12px; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
h1 { margin: 0; font-size: clamp(38px, 7vw, 64px); line-height: .98; }
.hero > p:last-child { max-width: 670px; margin: 18px 0 0; color: var(--muted); font-size: 18px; line-height: 1.6; }
h2 { margin: 0; font-size: 26px; }
.card { background: rgba(255,254,250,.95); border: 1px solid rgba(20,34,29,.09); border-radius: var(--radius); box-shadow: var(--shadow); }
.signup-panel { padding: clamp(20px, 4vw, 38px); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.selection-count { color: var(--muted); font-size: 13px; font-weight: 750; }
.field { display: grid; gap: 8px; margin-top: 20px; }
.field > span { font-size: 13px; font-weight: 780; }
input, textarea {
  width: 100%; color: var(--ink); background: white; border: 1px solid #cfd8d3; border-radius: 11px;
  padding: 13px 14px; outline: none; transition: border-color .16s, box-shadow .16s;
}
input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(30,90,70,.1); }
textarea { resize: vertical; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.dates-heading { margin: 38px 0 16px; padding-top: 30px; border-top: 1px solid var(--line); }
.events { display: grid; gap: 14px; }
.event-card {
  position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(220px, .8fr); gap: 18px;
  align-items: center; padding: 18px; background: white; border: 1px solid var(--line); border-radius: 15px;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.event-card.selectable:hover { border-color: #9db7ac; transform: translateY(-1px); box-shadow: 0 9px 24px rgba(20,34,29,.07); }
.event-card.selected { border-color: var(--green); box-shadow: 0 0 0 3px rgba(30,90,70,.1); }
.event-card.full { background: #fafaf8; }
.event-checkbox { width: 22px; height: 22px; accent-color: var(--green); }
.date-block { display: flex; align-items: center; gap: 14px; min-width: 0; }
.date-tile { flex: 0 0 62px; overflow: hidden; text-align: center; border: 1px solid var(--line); border-radius: 12px; }
.date-tile strong { display: block; padding: 5px; color: white; background: var(--green); font-size: 11px; letter-spacing: .08em; }
.date-tile span { display: block; padding: 7px 5px 8px; font-family: Georgia, serif; font-size: 24px; font-weight: 700; }
.event-title { margin: 0 0 5px; font-weight: 800; }
.event-meta, .event-notes { color: var(--muted); font-size: 13px; line-height: 1.45; }
.event-notes { margin-top: 5px; }
.roster { min-width: 0; }
.roster-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.roster-head strong { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.availability { color: var(--green); font-size: 12px; font-weight: 800; }
.availability.full-label { color: var(--danger); }
.players { display: flex; flex-wrap: wrap; gap: 7px; }
.player-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 31px; padding: 5px 9px; background: var(--green-soft); border-radius: 999px; font-size: 12px; font-weight: 720; }
.player-number { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; color: white; background: var(--green); font-size: 10px; }
.cancel-booking { border: 0; padding: 0; background: transparent; color: var(--danger); font-weight: 900; line-height: 1; }
.empty-seat { color: #89968f; background: #f0f2f0; font-weight: 600; }
.empty-seat .player-number { background: #abb5b0; }
.closed-pill { display: inline-block; padding: 5px 9px; border-radius: 999px; color: #725426; background: #f7ecd7; font-size: 12px; font-weight: 800; }

.sticky-submit { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--line); }
.privacy-note { color: var(--muted); font-size: 12px; }
.primary-button, .secondary-button {
  display: inline-flex; justify-content: center; align-items: center; min-height: 45px; border-radius: 11px; padding: 11px 17px;
  font-weight: 800; text-decoration: none; border: 1px solid transparent; transition: transform .15s, opacity .15s, background .15s;
}
.primary-button { color: white; background: var(--green); }
.primary-button:hover:not(:disabled) { background: var(--green-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; }
.secondary-button { color: var(--ink); background: white; border-color: var(--line); }
.secondary-button:hover { background: #f7f8f6; }
.secondary-button.small { min-height: 37px; padding: 8px 12px; font-size: 12px; }
.text-button { border: 0; color: var(--green); background: transparent; padding: 5px; font-weight: 800; }
.danger-button { color: var(--danger); border-color: #e9c7c5; background: var(--danger-soft); }
.button-row { display: flex; align-items: center; gap: 9px; }
.help-card { margin-top: 20px; padding: 27px; }
.help-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.help-steps div { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.help-steps b { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 50%; color: white; background: var(--green); }
.loading-card, .empty-state { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed #cbd4cf; border-radius: 14px; }
.spinner { display: inline-block; width: 17px; height: 17px; margin-right: 8px; border: 2px solid #c8d3ce; border-top-color: var(--green); border-radius: 50%; vertical-align: -3px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.footer { display: flex; justify-content: space-between; padding-block: 25px 40px; color: var(--muted); font-size: 12px; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 9px; width: min(390px, calc(100% - 36px)); }
.toast { padding: 14px 16px; border-radius: 12px; color: white; background: var(--ink); box-shadow: 0 14px 45px rgba(0,0,0,.22); animation: toast-in .2s ease-out; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--green); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.admin-main { padding-block: 52px; }
.login-card { max-width: 470px; margin: 45px auto; padding: 35px; }
.login-card h1 { font-size: 42px; }
.login-card p:not(.eyebrow) { color: var(--muted); line-height: 1.5; }
.login-card .primary-button { width: 100%; margin-top: 20px; }
.admin-topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.admin-topbar h1 { font-size: clamp(38px, 6vw, 56px); }
.admin-layout { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 25px; align-items: start; }
.event-form-card { position: sticky; top: 98px; padding: 25px; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin-list-heading { margin-bottom: 14px; }
.admin-events { display: grid; gap: 14px; }
.admin-event { padding: 22px; }
.admin-event-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.admin-event h3 { margin: 0; font-family: Georgia, serif; font-size: 22px; }
.admin-event .event-meta { margin-top: 6px; }
.status-pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.status-pill.open { color: var(--green); background: var(--green-soft); }
.status-pill.closed { color: #725426; background: #f7ecd7; }
.admin-roster { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.admin-roster-title { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.admin-player { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf0ee; }
.admin-player:last-child { border-bottom: 0; }
.admin-player-name { display: flex; align-items: center; gap: 9px; font-weight: 750; }
.remove-player { border: 0; padding: 5px; color: var(--danger); background: transparent; font-size: 12px; font-weight: 800; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

@media (max-width: 820px) {
  .event-card { grid-template-columns: 28px 1fr; }
  .roster { grid-column: 2; }
  .admin-layout { grid-template-columns: 1fr; }
  .event-form-card { position: static; }
  .help-steps { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .shell { width: min(100% - 22px, 1120px); }
  .site-header { position: static; }
  .header-inner { min-height: 68px; }
  .brand strong { font-size: 15px; }
  .live-badge { display: none; }
  .main-grid { padding-top: 38px; }
  .signup-panel { padding: 18px; }
  .section-heading { align-items: flex-start; }
  .event-card { gap: 11px; padding: 13px; }
  .date-block { align-items: flex-start; }
  .date-tile { flex-basis: 53px; }
  .date-tile span { font-size: 21px; }
  .roster { grid-column: 1 / -1; }
  .sticky-submit { position: sticky; bottom: 0; z-index: 10; display: grid; margin-inline: -18px; margin-bottom: -18px; padding: 14px 18px 18px; background: rgba(255,254,250,.96); backdrop-filter: blur(12px); }
  .primary-button { width: 100%; }
  .privacy-note { text-align: center; }
  .admin-topbar { align-items: flex-start; flex-direction: column; }
  .two-fields { grid-template-columns: 1fr; }
  .stack-mobile { align-items: stretch; flex-direction: column; }
  .admin-event-head { flex-direction: column; }
}

/* Version 2: email ownership and multi-date admin calendar */
[hidden] { display: none !important; }
.identity-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-help { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.cancel-booking { cursor: pointer; font-size: 17px; }
.cancel-booking:hover { transform: scale(1.12); }

.admin-layout { grid-template-columns: minmax(360px, 420px) minmax(0, 1fr); }
.calendar-picker { margin-top: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; }
.calendar-header { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; min-height: 52px; padding: 5px 8px; border-bottom: 1px solid var(--line); }
.calendar-header strong { text-align: center; font-family: Georgia, "Times New Roman", serif; font-size: 18px; }
.calendar-nav { width: 36px; height: 36px; border: 0; border-radius: 9px; color: var(--green); background: var(--green-soft); font-size: 27px; line-height: 1; cursor: pointer; }
.calendar-nav:hover { background: #dcebe4; }
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-weekdays { padding: 9px 7px 4px; color: var(--muted); font-size: 10px; font-weight: 850; text-align: center; text-transform: uppercase; letter-spacing: .04em; }
.calendar-days { gap: 4px; padding: 5px 7px 10px; }
.calendar-day { position: relative; display: grid; place-items: center; min-width: 0; aspect-ratio: 1; padding: 2px; border: 1px solid transparent; border-radius: 9px; color: var(--ink); background: transparent; font-weight: 750; cursor: pointer; }
.calendar-day:hover:not(:disabled) { border-color: #9db7ac; background: var(--green-soft); }
.calendar-day.selected { color: white; background: var(--green); }
.calendar-day.existing { color: #87938d; background: #f0f2f0; }
.calendar-day:disabled { cursor: not-allowed; opacity: .58; }
.calendar-day.blank { visibility: hidden; }
.calendar-day i { position: absolute; right: 2px; bottom: 1px; left: 2px; overflow: hidden; font-size: 7px; font-style: normal; font-weight: 850; text-overflow: ellipsis; text-transform: uppercase; }
.selected-date-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 12px; font-weight: 800; }
.selected-dates { display: flex; flex-wrap: wrap; gap: 7px; min-height: 34px; margin-top: 8px; }
.selected-date-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 9px; border: 0; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 800; cursor: pointer; }
.selected-date-chip span { color: var(--danger); font-size: 15px; line-height: 1; }
.calendar-hint { align-self: center; color: var(--muted); font-size: 12px; }
.admin-player-details { min-width: 0; }
.admin-player-email { margin: 3px 0 0 28px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }

@media (max-width: 820px) {
  .identity-fields { grid-template-columns: 1fr; gap: 0; }
  .admin-layout { grid-template-columns: 1fr; }
}

/* Version 3: confirmed schedule summary */
.confirmed-panel { margin-bottom: 20px; padding: 28px; border-top: 4px solid var(--gold); }
.confirmed-heading { align-items: flex-start; margin-bottom: 20px; }
.confirmed-heading h2 { margin-top: 2px; }
.section-description { margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.schedule-count { display: inline-flex; flex: 0 0 auto; align-items: center; min-height: 31px; padding: 6px 11px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 12px; font-weight: 850; }
.confirmed-schedule { display: grid; gap: 11px; }
.confirmed-row { display: grid; grid-template-columns: minmax(250px, .9fr) minmax(330px, 1.35fr); gap: 22px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfa; }
.confirmed-row.is-confirmed { border-color: #b7d0c3; background: linear-gradient(105deg, #f5faf7, #fffefa); box-shadow: inset 4px 0 0 var(--green); }
.confirmed-date { display: flex; align-items: center; gap: 13px; min-width: 0; }
.date-tile.compact { flex-basis: 52px; min-width: 52px; padding: 7px 5px; }
.date-tile.compact span { font-size: 23px; }
.confirmed-date h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 18px; line-height: 1.25; }
.confirmed-date p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.confirmed-roster { min-width: 0; }
.confirmed-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.confirmed-status strong { padding: 4px 8px; border-radius: 999px; color: #725426; background: #f7ecd7; font-size: 11px; }
.confirmed-status.complete span { color: var(--green); }
.confirmed-status.complete strong { color: white; background: var(--green); }
.confirmed-players { display: flex; flex-wrap: wrap; gap: 7px; }
.confirmed-player { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; max-width: 100%; padding: 5px 9px 5px 5px; border: 1px solid #d7e4dd; border-radius: 999px; background: white; font-size: 12px; font-weight: 750; }
.confirmed-player-number { display: grid; place-items: center; flex: 0 0 21px; width: 21px; height: 21px; border-radius: 50%; color: white; background: var(--green); font-size: 10px; }
.confirmed-cancel { margin-left: 1px; cursor: pointer; font-size: 16px; }
.confirmed-empty { display: flex; align-items: center; justify-content: center; gap: 13px; min-height: 92px; padding: 22px; color: var(--muted); border: 1px dashed #cbd4cf; border-radius: 14px; text-align: left; line-height: 1.5; }
.confirmed-empty-icon { display: grid; place-items: center; flex: 0 0 39px; height: 39px; border-radius: 50%; color: white; background: var(--green); font-size: 20px; }

@media (max-width: 820px) {
  .confirmed-row { grid-template-columns: 1fr; gap: 14px; }
}

@media (max-width: 560px) {
  .confirmed-panel { padding: 18px; }
  .confirmed-heading { gap: 12px; }
  .schedule-count { white-space: nowrap; }
  .confirmed-row { padding: 13px; }
  .confirmed-date { align-items: flex-start; }
  .confirmed-date h3 { font-size: 17px; }
}
