:root {
  --green: #a4d65e;
  --green-dark: #7fb63a;
  --green-pale: #e6f5cf;
  --black: #000;
  --ink: #111;
  --white: #fff;
  --gray: #bdbdbd;
  --gray-light: #f1f1f1;
  --amber: #ffe7a3;
  --amber-dark: #b58100;
  --red: #e5484d;
  --venmo: #008cff;
  --radius: 10px;
  --shadow: 0 6px 20px rgba(0, 0, 0, .35);
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --script: "Caveat", "Segoe Script", cursive;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--black);
  color: var(--white);
  line-height: 1.45;
  padding-bottom: 110px; /* room for the sticky checkout bar */
}

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

/* ---------------------------------------------------------------- hero */
.hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 16px 8px;
  max-width: 1100px;
  margin: 0 auto;
}

.logo {
  flex: 0 0 auto;
  width: 132px;
  height: 132px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--white);
}
.logo svg, .logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 600px) { .logo { width: 160px; height: 160px; } }
.player { margin: 6px 0 0; font-size: 15px; color: var(--gray); }
.player strong { color: var(--white); font-weight: 700; }
.player[hidden] { display: none; }

.hero-text { min-width: 0; }
.eyebrow { margin: 0; font-weight: 700; color: var(--green); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.month-title { font-family: var(--script); font-size: clamp(48px, 10vw, 84px); line-height: .95; margin: 2px 0 6px; font-weight: 700; }
.payout { margin: 0; font-size: 20px; }
.payout strong { font-size: 30px; color: var(--green); font-weight: 900; }

/* -------------------------------------------------------------- how it works */
.how {
  max-width: 1100px;
  margin: 14px auto 0;
  padding: 16px;
  background: var(--green);
  color: var(--ink);
  border-radius: var(--radius);
}
@media (min-width: 600px) { .how { margin-left: 16px; margin-right: 16px; } }
@media (min-width: 1132px) { .how { margin-left: auto; margin-right: auto; } }
.how h2 { margin: 0 0 6px; font-size: 18px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; }
.how ol { margin: 0 0 10px; padding-left: 22px; }
.how li { margin: 2px 0; }
.how .dates { margin: 0 0 10px; font-size: 14px; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; font-weight: 600; }
.legend li { display: flex; align-items: center; gap: 6px; }
.swatch { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--ink); display: inline-block; }
.swatch.available { background: var(--white); }
.swatch.selected { background: var(--green-pale); border-color: var(--green-dark); box-shadow: inset 0 0 0 2px var(--green-dark); }
.swatch.reserved { background: var(--amber); border-color: var(--amber-dark); }
.swatch.paid { background: var(--green-dark); border-color: var(--green-dark); }

/* ----------------------------------------------------------------- calendar */
main { max-width: 1100px; margin: 0 auto; padding: 16px; }

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
@media (min-width: 600px) { .calendar { gap: 10px; } }

.weekday {
  background: var(--green);
  color: var(--white);
  font-weight: 600;
  text-align: center;
  padding: 8px 2px;
  border-radius: 6px;
  font-size: 12px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}
.weekday .long { display: none; }
@media (min-width: 600px) {
  .weekday { font-size: 15px; padding: 10px 4px; }
  .weekday .long { display: inline; }
  .weekday .short { display: none; }
}

.day {
  position: relative;
  appearance: none;
  border: 0;
  padding: 0;
  font: inherit;
  min-height: 64px;
  background: var(--white);
  color: var(--ink);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
  box-shadow: 0 0 0 0 transparent;
}
.day.empty { background: transparent; cursor: default; }
.day .num { font-weight: 600; font-size: 13px; padding: 5px 6px 0; }
.day .label {
  margin-top: auto;
  width: 100%;
  font-size: 10px;
  line-height: 1.15;
  font-weight: 700;
  padding: 3px 5px 5px;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.day .entries { display: none; }
.day .who {
  font-size: 10px;
  font-weight: 500;
  padding: 0 5px;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
@media (min-width: 600px) {
  .day { min-height: 96px; border-radius: 8px; }
  .day .entries { display: inline; }
  .day .num { font-size: 18px; padding: 8px 10px 0; }
  .day .label { font-size: 12px; padding: 4px 10px 8px; }
  .day .who { font-size: 13px; padding: 0 10px; }
}

.day.available:hover { transform: translateY(-2px); box-shadow: 0 0 0 3px var(--green); }
.day.available .label { color: var(--gray); font-weight: 600; }
.day.available .price { color: var(--green-dark); font-weight: 700; }

.day.selected { background: var(--green-pale); box-shadow: 0 0 0 3px var(--green-dark); }
.day.selected .label { color: var(--green-dark); }
.day.selected .check {
  position: absolute; top: 4px; right: 5px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--green-dark); color: var(--white);
  font-size: 12px; font-weight: 900; line-height: 18px; text-align: center;
}

.day.reserved { background: var(--amber); cursor: not-allowed; }
.day.reserved .label { color: var(--amber-dark); }

.day.paid { background: var(--green-dark); color: var(--white); cursor: not-allowed; }
.day.paid .label { color: var(--white); }
.day.paid .who { color: rgba(255, 255, 255, .9); }

.day:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.progress { text-align: center; color: var(--gray); font-size: 14px; margin: 14px 0 0; }
.progress strong { color: var(--green); }

/* --------------------------------------------------------------- checkout bar */
.checkout-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--ink);
  border-top: 3px solid var(--green);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .5);
  z-index: 10;
}
.checkout-bar[hidden] { display: none; }
.checkout-summary { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.checkout-summary strong { font-size: 26px; color: var(--green); }
.checkout-summary .muted { font-size: 12px; }
.checkout-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------------------------------------------------------------- buttons */
.btn {
  appearance: none;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter .12s ease, transform .08s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { background: var(--green); color: var(--ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .35); }
.btn-ghost:hover { border-color: var(--white); }
.btn-venmo { background: var(--venmo); color: var(--white); width: 100%; font-size: 18px; padding: 16px 20px; }
.btn-venmo:hover { filter: brightness(1.1); }

/* ---------------------------------------------------------------- dialogs */
dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  width: min(92vw, 460px);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0, 0, 0, .7); }
dialog form, dialog .success { padding: 22px; }
dialog h2 { margin: 0 0 8px; font-size: 22px; font-weight: 900; }
.dialog-summary { margin: 0 0 16px; padding: 12px; background: var(--green-pale); border-radius: 8px; }
.dialog-summary strong { font-size: 20px; }
dialog label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
dialog label .muted { font-weight: 400; }
dialog input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  font: inherit;
  font-size: 16px;
  border: 2px solid #ccc;
  border-radius: 8px;
}
dialog input:focus { outline: 0; border-color: var(--green-dark); }
.req { color: var(--red); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
dialog .btn-ghost { color: var(--ink); border-color: #ccc; }

.success { text-align: center; }
.big-total { margin: 4px 0 10px; }
.big-total strong { font-size: 40px; color: var(--green-dark); font-weight: 900; }
.success p { margin: 0 0 14px; }
.venmo-fallback { font-size: 14px; }
.venmo-fallback[hidden] { display: none; }
.note-hint { font-size: 13px; color: #555; }
.note-hint code { display: inline-block; margin-top: 4px; padding: 6px 8px; background: var(--gray-light); border-radius: 6px; font-size: 12px; word-break: break-word; }
.success .btn-ghost { margin-top: 4px; }

.muted { color: #777; }
.small { font-size: 13px; }
.error { color: var(--red); font-weight: 600; margin: 0 0 12px; }
.error[hidden] { display: none; }
main .error { background: #2a0e10; padding: 12px; border-radius: 8px; color: #ffb4b7; }

footer { text-align: center; color: #666; font-size: 12px; padding: 24px 16px; }
