/* ==========================================================================
   THE COACH & HORSES — pool table booking (/pool, /pool/confirm, /pool-admin)
   Loaded AFTER styles.css. Tokens only — no new colours, nothing here restyles
   an existing class. Added 2 Sept 2026 for the 8 Sept launch.
   ========================================================================== */

/* ---------- /pool: the picker band ----------
   Everything in this band sits in one readable column: a 7-day strip, the
   hour grid for the chosen day, then a status line. Capped at 56rem so the
   hour cells don't stretch to 300px wide on a 1200px screen. */
.pool-picker { max-width: 56rem; }

/* ---------- /pool: day strip ----------
   A range label with ‹ › either side, then seven <button class="day-chip">
   underneath. Seven always fit the row (flex: 1 1 0), so a phone never has to
   scroll sideways to find Saturday. Chosen day = aria-pressed="true" (amber
   fill, same as .chip-track a.is-active on the menus). Days before the
   launch date are [disabled]; the reason is a single line under the strip
   (.pool-days-note) rather than a label crammed into a 41px chip. */
.pool-days { margin-top: var(--s2); }
.pool-days[hidden] { display: none; }
.pool-days-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.pool-days-range {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.pool-days-arrow { /* copies .step-btn: same size, same faint fill */
  flex: none;
  width: 2.9rem;
  height: 2.9rem;
  border: 1px solid rgba(237, 231, 218, .18);
  border-radius: 10px;
  background: rgba(237, 231, 218, .08);
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.pool-days-arrow:hover { background: rgba(237, 231, 218, .16); border-color: rgba(237, 231, 218, .35); }
.pool-days-arrow[disabled] { opacity: .35; cursor: not-allowed; }
.pool-days-track {
  display: flex;
  gap: .4rem;
  margin-top: .75rem;
  padding-block: .25rem;
}
.day-chip {
  flex: 1 1 0;
  min-width: 0;
  min-height: 3.6rem;                     /* comfortably over the 44px touch target */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .5rem .25rem;
  background: var(--ink-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.day-chip .dc-dow { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); }
.day-chip .dc-date { font-family: var(--font-mono); font-size: 1.05rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.day-chip .dc-mon { display: none; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
@media (min-width: 560px) { .day-chip .dc-mon { display: block; } }   /* phones: the month lives in the range label */
.day-chip[aria-pressed="true"] .dc-mon { color: var(--on-amber); }
.day-chip:hover { border-color: var(--amber); color: var(--amber-soft); }
.day-chip[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--on-amber); }
.day-chip[aria-pressed="true"] .dc-dow { color: var(--on-amber); }
.day-chip[disabled] { opacity: .45; cursor: not-allowed; }
.day-chip[disabled]:hover { border-color: var(--line); color: var(--text); }
.day-chip[disabled] .dc-date { text-decoration: line-through; }   /* colour is never the only signal */
.day-chip.is-today .dc-dow { color: var(--amber); }
.day-chip.is-full:not([aria-pressed="true"]) .dc-date { color: var(--text-dim); } /* nothing free that day; label says so too */
.day-chip[aria-pressed="true"].is-today .dc-dow { color: var(--on-amber); }
.pool-days-note { margin-top: .6rem; font-size: .8rem; color: var(--text-dim); }
.pool-days-note strong { color: var(--amber); font-weight: 600; }
.pool-days-note[hidden] { display: none; }

/* ---------- /pool: hour grid ----------
   <li><button class="slot slot--free" data-key="2026-09-08T19:00"> per hour.
   Free is the only clickable state. The others are real [disabled] buttons
   (so the tab order skips them) and each carries a .slot-state word, so the
   grid reads without colour: booked/blocked/pending are struck through and
   dim, past is just dim. */
.pool-day-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .25rem 1rem; margin-top: var(--s2); }
.pool-day-head[hidden] { display: none; }
.pool-day-head h3 { font-size: var(--step-1); }
.pool-day-hours {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); /* room for "AVAILABLE" beside the time */
  gap: .6rem;
  margin-top: var(--s0);
  list-style: none;
  padding: 0;
}
.slot-grid[hidden] { display: none; }
.slot {
  width: 100%;
  min-height: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .2rem .5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .7rem .85rem;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.slot--free { border-color: rgba(228, 169, 60, .55); }                    /* amber outline */
.slot--free:hover { border-color: var(--amber); color: var(--amber-soft); }
.slot--free[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--on-amber); }
.slot--free[aria-pressed="true"] .slot-state { color: var(--on-amber); }
.slot--booked, .slot--blocked, .slot--pending { color: var(--text-dim); opacity: .55; cursor: not-allowed; }
.slot--booked .slot-time, .slot--blocked .slot-time, .slot--pending .slot-time { text-decoration: line-through; }
.slot--past { color: var(--text-dim); opacity: .35; cursor: default; }
.slot .slot-state {
  font-family: var(--font-body);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--amber-soft);
}
.slot--booked .slot-state, .slot--blocked .slot-state, .slot--pending .slot-state, .slot--past .slot-state { color: var(--text-dim); }
.pool-closed {
  margin-top: var(--s0);
  padding: var(--s0) 1.25rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text-dim);
}
.pool-closed[hidden] { display: none; }
.pool-closed strong { color: var(--text); }
/* while the availability request is in flight the old grid stays put but
   goes quiet, so a slow connection never shows an empty band */
.pool-picker.is-loading .slot-grid { opacity: .5; pointer-events: none; }

/* ---------- /pool: price badge + the form card ---------- */
.price-badge {
  display: inline-flex;
  align-items: baseline;
  gap: .4rem;
  margin-top: var(--s0);
  padding: .35rem .8rem;
  border: 1px solid rgba(228, 169, 60, .5);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.price-badge strong { font-size: 1.05rem; font-weight: 700; letter-spacing: .01em; color: var(--amber); }
/* the chosen-slot readout is .hero-status verbatim (it is not hero-scoped);
   the status line is .bk-status verbatim. Only the form's own grid is new —
   styles.css binds that to #booking-form, which script.js hijacks. */
/* Same column as the picker, directly under it. It used to sit in its own
   raised band, which put two section paddings between choosing an hour and
   typing your name - a screen and a half of empty bar on a laptop - and set
   it 16rem narrower, so nothing lined up. One band, one width, one grid. */
.pool-card { max-width: 56rem; margin-top: var(--s2); }
.pool-form { margin-top: var(--s1); display: grid; gap: var(--s0); }
.pool-form[hidden] { display: none; }
/* the mono readout sits directly under the card title; when nothing is
   chosen yet it speaks in the dim voice so the amber means "chosen" */
.pool-chosen.is-empty { color: var(--text-dim); border-left-color: rgba(237, 231, 218, .3); }
.pool-chosen[hidden] { display: none; }

/* ---------- /pool: house rules ---------- */
.pool-rules { margin-top: var(--s2); list-style: none; padding: 0; max-width: 58ch; }
.pool-rules li { padding-block: .6rem; color: var(--text-dim); }
.pool-rules li + li { border-top: 1px solid var(--line); }
.pool-rules li strong { color: var(--text); font-weight: 600; }
.pool-rules a { color: var(--amber-soft); }

/* ---------- /pool/confirm ----------
   Reuses the 404's .lost shell. One state block is un-hidden at a time. */
.pool-confirm-state[hidden] { display: none; }
.pool-confirm .bk-done { text-align: left; max-width: 34rem; margin-inline: auto; }
.pool-confirm .bk-done p + p { color: var(--text); font-size: var(--step-0); }
.pool-order { font-family: var(--font-mono); font-size: .85rem; color: var(--text-dim); word-break: break-all; margin-top: .5rem; }
.pool-confirm .bk-status { text-align: center; }
.pool-confirm .bk-status.is-error { font-size: var(--step-0); font-weight: 400; max-width: 40ch; margin-inline: auto; }
.pool-confirm-when {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.15;
  color: var(--text);
  margin-top: .25rem;
}
/* the polling dot: a quiet pulse while we wait on Square. Reduced motion
   kills the animation globally (styles.css), which is fine — the text says
   "checking" on its own. */
.pool-wait::after {
  content: "";
  display: inline-block;
  width: .5rem; height: .5rem;
  margin-left: .5rem;
  border-radius: 50%;
  background: var(--amber);
  vertical-align: middle;
  animation: pool-pulse 1.4s ease-in-out infinite;
}
@keyframes pool-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- /pool-admin: week table ----------
   Utilitarian. Rows = hours, columns = the seven days; each cell carries a
   state class and the booking's name. Scrolls sideways inside its own
   wrapper on phones. Shared here so the admin page links the same file. */
.admin-week-wrap { overflow-x: auto; margin-top: var(--s1); -webkit-overflow-scrolling: touch; }
.admin-week { border-collapse: collapse; min-width: 56rem; width: 100%; font-size: .85rem; }
.admin-week th, .admin-week td { border: 1px solid var(--line); padding: .45rem .5rem; vertical-align: top; text-align: left; }
.admin-week thead th {
  background: var(--ink-2);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  position: sticky;
  top: 4.5rem;
}
.admin-week tbody th { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-dim); white-space: nowrap; width: 5rem; }
.admin-week td.is-free { background: transparent; }
.admin-week td.is-booked { background: rgba(228, 169, 60, .14); box-shadow: inset 3px 0 0 var(--amber); }
.admin-week td.is-manual { background: rgba(228, 169, 60, .08); box-shadow: inset 3px 0 0 rgba(228, 169, 60, .5); }
.admin-week td.is-pending { background: rgba(237, 231, 218, .05); box-shadow: inset 3px 0 0 var(--text-dim); }
.admin-week td.is-blocked { background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(237, 231, 218, .06) 6px 12px); color: var(--text-dim); }
.admin-week td.is-closed { background: var(--ink-2); color: var(--text-dim); }
.admin-week td.is-past { opacity: .4; }
.admin-week .cell-name { display: block; font-weight: 600; color: var(--text); }
.admin-week .cell-meta { display: block; font-size: .72rem; color: var(--text-dim); }
.admin-week .cell-act { margin-top: .3rem; display: flex; gap: .3rem; flex-wrap: wrap; }
.btn--small { padding: .45rem .8rem; font-size: .78rem; }
.btn--danger { background: transparent; color: var(--error); border-color: rgba(242, 162, 155, .5); }
.btn--danger:hover { border-color: var(--error); color: var(--text); }
.admin-today { list-style: none; padding: 0; margin-top: var(--s1); }
.admin-today li { display: flex; gap: 1rem; align-items: baseline; padding-block: .8rem; border-top: 1px solid var(--line); font-size: var(--step-1); }
.admin-today .fx-when { font-family: var(--font-mono); font-size: var(--step-2); color: var(--amber-soft); min-width: 7rem; }
.admin-login { max-width: 22rem; margin: var(--s3) auto; }   /* passcode prompt uses .book-card + .field */
.admin-tabs { display: flex; gap: .5rem; margin-top: var(--s1); }
.admin-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .42rem .95rem;
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.admin-tab:hover { border-color: var(--amber); color: var(--amber-soft); }
.admin-tab[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--on-amber); }
