/* Court Booking: phone-first. Wood hall floor, courts seen from the stands, green for actions. */
:root {
  --bg: #f2f5f3;
  --panel: #ffffff;
  --fg: #0f1f19;
  --muted: #586a62;
  --line: #d4ddd8;
  --accent: #127a52;
  --accent-ink: #0b5c3d;
  --accent-soft: rgba(18, 122, 82, 0.09);
  --on-accent: #ffffff;
  --court-line: #ffffff;
  --wood: #e3ba82;
  --wood-plank: #d5a66a;
  --wood-edge: #b4854d;
  --mat: #efcf9d;
  --mat-edge: #c2935a;
  --accent-edge: #0a4d33;
  --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --danger: #c0352b;
  --ok: #127a52;
  --warn: #9a6200;
  --shadow: rgba(15, 40, 30, 0.18);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --radius: 14px;
  --bar-h: 76px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1613;
    --panel: #15201c;
    --fg: #e6efea;
    --muted: #93a69d;
    --line: #26332e;
    --accent: #4fcf97;
    --accent-ink: #4fcf97;
    --accent-soft: rgba(79, 207, 151, 0.12);
    --on-accent: #0b1a14;
    --court-line: rgba(255, 255, 255, 0.82);
    --wood: #6e4c2c;
    --wood-plank: #5e3f23;
    --wood-edge: #3a2613;
    --mat: #86603a;
    --mat-edge: #4b3119;
    --accent-edge: #2a8f63;
    --danger: #ff8a80;
    --ok: #4fcf97;
    --warn: #f0b860;
    --shadow: rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

@view-transition {
  navigation: auto;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-optical-sizing: auto;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Top bar */
.top {
  view-transition-name: top;
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand svg {
  width: 16px;
  height: 24px;
  color: var(--accent);
}
.switch {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.switch a {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 15px;
  text-decoration: none;
  color: var(--muted);
}
.switch a[aria-current="page"] {
  background: var(--fg);
  color: var(--bg);
  font-weight: 550;
}

/* Page head */
.head {
  padding: 28px 0 8px;
}
.title {
  margin: 0;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 650;
}
.lede {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

/* Sections */
.block {
  padding: 24px 0 4px;
}
.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.block h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.block-note {
  font-size: 14px;
  color: var(--muted);
}

/* Period switch */
.periods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.choice {
  position: relative;
}
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.period {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 140ms var(--ease-out);
}
.period-time {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.period-end {
  font-size: 13px;
  color: var(--muted);
}
.choice input:checked + .period {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.choice input:checked + .period .period-time {
  color: var(--accent-ink);
}
.choice input:focus-visible + .period,
.choice input:focus-visible + .court {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.period:active {
  transform: scale(0.97);
}

/* Courts: one hall seen from the stands. The plane is rotated; the radios and
   labels inside are unchanged, so selection, focus and errors work as before. */
.courts {
  container-type: inline-size;
  margin-top: 12px;
}
.scene {
  /* One unit. Sized so the rotated hall fills the width for any court count. */
  --u: min(4.4px, calc(100cqw / (var(--n, 4) * 13.6 + 45)));
  position: relative;
  height: calc((var(--n, 4) * 19 + 58) * 0.406 * var(--u) + 22px);
}
.hall {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  gap: calc(4 * var(--u));
  padding: calc(5 * var(--u)) calc(5 * var(--u)) calc(14 * var(--u));
  border-radius: calc(1.5 * var(--u));
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 calc(3.8 * var(--u) - 1px),
      var(--wood-plank) 0 calc(3.8 * var(--u))
    ),
    var(--wood);
  /* Stacked copies straight down the screen read as the slab's thickness. */
  box-shadow:
    -2px 2px 0 var(--wood-edge),
    -4px 4px 0 var(--wood-edge),
    -6px 6px 0 var(--wood-edge),
    -8px 8px 0 var(--wood-edge),
    -18px 18px 18px var(--shadow);
  transform: translate(-50%, -50%) rotateX(55deg) rotateZ(-45deg);
  transform-style: preserve-3d;
}
.hall .choice {
  transform-style: preserve-3d;
}
.court {
  --d: 3px; /* height off the floor */
  --edge: var(--mat-edge);
  position: relative;
  display: block;
  width: calc(15 * var(--u));
  aspect-ratio: 61 / 134;
  border: 0;
  padding: 0;
  font: inherit;
  border-radius: 2px;
  background-color: var(--mat);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform: translateZ(var(--d));
  transform-style: preserve-3d;
  box-shadow:
    calc(var(--d) * -0.25) calc(var(--d) * 0.25) 0 var(--edge),
    calc(var(--d) * -0.5) calc(var(--d) * 0.5) 0 var(--edge),
    calc(var(--d) * -0.75) calc(var(--d) * 0.75) 0 var(--edge),
    calc(var(--d) * -1) calc(var(--d) * 1) 0 var(--edge),
    calc(var(--d) * -1.9) calc(var(--d) * 1.9) calc(var(--d) * 0.9) var(--shadow);
  transition:
    transform 320ms var(--ease-spring),
    box-shadow 320ms var(--ease-spring),
    background-color 180ms ease;
}
.court:active {
  --d: 0.5px;
  transition-duration: 110ms;
  transition-timing-function: var(--ease-out);
}
.court svg {
  display: block;
  width: 100%;
  height: 100%;
  color: var(--court-line);
  transition: color 180ms ease;
}
.court svg .floor {
  fill: transparent;
}
/* Someone already has this court and slot. Striped, never green: green means yours or confirmed. */
.court.is-taken {
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0 4px,
    color-mix(in srgb, var(--wood-edge) 70%, transparent) 4px 6px
  );
}
.court.is-taken .court-num {
  border-color: var(--warn);
  color: var(--warn);
}
.choice input:checked + .court,
.court.is-live {
  --edge: var(--accent-edge);
  background-color: var(--accent);
}
.choice input:checked + .court,
.court[aria-pressed="true"] {
  --d: 11px;
}
.choice input:checked + .court:active,
.court[aria-pressed="true"]:active {
  --d: 7px;
}
.choice input:checked + .court svg,
.court.is-live svg {
  color: var(--on-accent);
}
.court[aria-pressed="true"] .court-num {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}
.courts .retry,
.empty .retry {
  margin-top: 10px;
}
.taken-note {
  margin-top: 4px;
  min-height: 20px;
}
.courts.is-invalid .court {
  outline: 2px solid var(--danger);
  outline-offset: 1px;
}

/* The net stands up out of the floor. */
.net {
  position: absolute;
  left: calc(-0.8 * var(--u));
  right: calc(-0.8 * var(--u));
  bottom: 50%;
  height: calc(3.6 * var(--u));
  border-top: 1.5px solid #fff;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0 1px, transparent 0 3px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.5) 0 1px, transparent 0 3px),
    rgba(20, 40, 30, 0.16);
  transform-origin: 50% 100%;
  transform: rotateX(-90deg);
  pointer-events: none;
}

/* Upright things on the tilted floor: undo the hall's rotation. */
.court-num,
.shuttle {
  position: absolute;
}
.shuttle {
  pointer-events: none;
}
.court-num {
  left: 50%;
  top: calc(100% + 5.5 * var(--u));
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: var(--muted);
  /* The last step pulls it toward the viewer so the floor can't slice it. */
  transform: translate(-50%, -50%) rotateZ(45deg) rotateX(-55deg) translateZ(60px);
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}
.choice input:checked + .court .court-num {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* A shuttle drops onto the picked court. It leaves faster than it lands. */
.shuttle {
  left: 50%;
  top: 76%;
  width: calc(5.2 * var(--u));
  min-width: 15px;
  aspect-ratio: 1;
  opacity: 0;
  transform: translate(-50%, -100%) rotateZ(45deg) rotateX(-55deg) translateZ(60px) translateY(-34px) rotate(-30deg);
  transform-origin: 50% 100%;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}
.shuttle svg {
  display: block;
  width: 100%;
  height: 100%;
}
.choice input:checked + .court .shuttle {
  opacity: 1;
  transform: translate(-50%, -100%) rotateZ(45deg) rotateX(-55deg) translateZ(60px) translateY(0) rotate(18deg);
  transition:
    opacity 140ms ease 120ms,
    transform 420ms var(--ease-spring) 120ms;
}

/* Fields */
.fields {
  display: grid;
  gap: 10px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}
.input {
  width: 100%;
  height: 50px;
  font: 400 17px "Bricolage Grotesque", system-ui, sans-serif;
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  transition: border-color 160ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
}
.input.is-invalid {
  border-color: var(--danger);
}
.player {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.player-n {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.player .error-message {
  grid-column: 2;
}
.error-message {
  display: none;
  font-size: 13px;
  color: var(--danger);
}
.hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

/* Pill choices (degree, year) */
.opts {
  display: grid;
  gap: 6px;
}
.opts-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.opts-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.opt {
  display: grid;
  place-items: center;
  height: 44px;
  padding: 0 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 140ms var(--ease-out);
}
.opt:active {
  transform: scale(0.97);
}
.choice input:checked + .opt {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}
.choice input:focus-visible + .opt {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.opts.is-invalid .opt {
  border-color: var(--danger);
}

/* Send time */
.send {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}
.send .input {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}
.eta {
  font-size: 15px;
  line-height: 1.4;
}
.eta strong {
  display: block;
  font-weight: 600;
}
.eta span {
  color: var(--muted);
}

/* Own-name section */
.own {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.own summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  font-size: 16px;
  font-weight: 550;
}
.own summary::-webkit-details-marker {
  display: none;
}
.own summary small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.chev {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 220ms var(--ease-out);
}
.own[open] .chev {
  transform: rotate(180deg);
}
.own .fields {
  padding: 0 16px 16px;
}

/* Sticky action bar */
.has-bar {
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom) + 24px);
}
.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--bar-h);
}
.summary {
  min-width: 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--muted);
}
.summary strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  height: 50px;
  padding: 0 22px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 16px "Bricolage Grotesque", system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 140ms var(--ease-out),
    opacity 160ms ease;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-small {
  height: 40px;
  padding: 0 14px;
  font-size: 15px;
  border-radius: 10px;
}

/* Notices */
.notice {
  display: none;
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
  background: var(--panel);
  border: 1px solid var(--line);
}
.notice.success {
  border-color: var(--ok);
  color: var(--ok);
}
.notice.error {
  border-color: var(--danger);
  color: var(--danger);
}

/* Dialogs: centred card on wide screens, bottom sheet on phones */
dialog {
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  color: var(--fg);
  box-shadow: 0 30px 60px -30px var(--shadow);
}
dialog[open] {
  animation: pop 220ms var(--ease-out);
}
dialog::backdrop {
  background: rgba(6, 14, 10, 0.45);
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}
.sheet-grip {
  display: none;
}
.dialog-body {
  padding: 22px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dialog-body h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
  font-weight: 650;
}
.dialog-body p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}
.dialog-for {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}
.code-input {
  height: 60px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-align: center;
}
.dialog-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.dialog-row .btn {
  height: auto;
}
.dialog-msg {
  display: none;
  font-size: 14px;
}

/* Code entry: six cells drawn over one real input, so paste and the
   keyboard's code suggestion still work. */
.otp {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.otp input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px; /* under 16px, iOS zooms the page on focus */
  cursor: text;
}
.otp-cell {
  position: relative;
  display: grid;
  place-items: center;
  height: 58px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 26px;
  font-weight: 600;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}
.otp:focus-within .otp-cell.is-next {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.otp:focus-within .otp-cell.is-next::after {
  content: "";
  width: 2px;
  height: 24px;
  border-radius: 1px;
  background: var(--accent);
  animation: caret 1.1s steps(1) infinite;
}
@keyframes caret {
  50% {
    opacity: 0;
  }
}
.otp.is-wrong {
  animation: nope 320ms var(--ease-out);
}
.otp.is-wrong .otp-cell {
  border-color: var(--danger);
}
@keyframes nope {
  20% {
    transform: translateX(-7px);
  }
  45% {
    transform: translateX(6px);
  }
  70% {
    transform: translateX(-3px);
  }
}
.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
}
.code-row .dialog-msg {
  line-height: 1.4;
}
.code-row .btn {
  margin-left: auto;
}

/* Confirmed: a short rally over the court you booked. */
.done {
  align-items: center;
  text-align: center;
  padding-bottom: 4px;
}
.rally {
  --u: 3.4px;
  position: relative;
  width: 160px;
  height: 112px;
  animation: pop 320ms var(--ease-out);
}
.rally-court {
  position: absolute;
  left: 50%;
  top: 56%;
  width: calc(15 * var(--u));
  aspect-ratio: 61 / 134;
  border-radius: 2px;
  background: var(--accent);
  box-shadow:
    -2px 2px 0 var(--accent-edge),
    -4px 4px 0 var(--accent-edge),
    -6px 6px 0 var(--accent-edge),
    -14px 14px 12px var(--shadow);
  transform: translate(-50%, -50%) rotateX(55deg) rotateZ(-45deg);
  transform-style: preserve-3d;
}
.rally-court svg {
  display: block;
  width: 100%;
  height: 100%;
  color: var(--on-accent);
}
.rally-court svg .floor {
  fill: transparent;
}
/* The shuttle moves in a straight line across the net while a second
   element lifts it, which together draw the arc. It ends landed. */
.rally-x,
.rally-y {
  position: absolute;
  left: 50%;
  top: 56%;
}
.rally-x {
  transform: translate(20px, 11px);
  animation: rally-x 560ms linear 240ms 3 alternate both;
}
.rally-y {
  left: 0;
  top: 0;
  animation: rally-y 560ms 240ms 3 both;
}
.rally-y svg {
  display: block;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -100%) rotate(18deg);
  transform-origin: 50% 100%;
}
@keyframes rally-x {
  from {
    transform: translate(-20px, -11px);
  }
  to {
    transform: translate(20px, 11px);
  }
}
@keyframes rally-y {
  0% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1);
  }
  50% {
    transform: translateY(-44px);
    animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.3);
  }
  100% {
    transform: translateY(0);
  }
}

/* Hall overview on the bookings page */
.overview {
  margin-top: 14px;
}
.overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.slots {
  display: flex;
  gap: 8px;
}
.overview .courts {
  margin-top: 4px;
}
.count-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.link-btn {
  flex: none;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font: 550 14px "Bricolage Grotesque", system-ui, sans-serif;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 20px 20px;
}

/* Bookings list */
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 4px 16px 2px;
}
.filters::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  font: 500 15px "Bricolage Grotesque", system-ui, sans-serif;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    transform 140ms var(--ease-out);
}
.chip:active {
  transform: scale(0.97);
}
.chip[aria-pressed="true"] {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}
.chip-n {
  font-size: 13px;
  opacity: 0.65;
}
.search {
  margin: 12px 0 4px;
}
.count {
  display: block;
  margin: 12px 0 10px;
  font-size: 14px;
  color: var(--muted);
}
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.booking {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 4px 14px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
}
.booking.is-muted {
  background: transparent;
}
.booking.is-muted .booking-court svg {
  opacity: 0.5;
}
.booking-court {
  position: relative;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
/* Same hall, same angle: a small court tile. */
.booking-court svg {
  width: 19px;
  height: auto;
  aspect-ratio: 61 / 134;
  margin: -7px 0;
  border-radius: 1px;
  color: var(--court-line);
  background: var(--mat);
  box-shadow:
    -1px 1px 0 var(--mat-edge),
    -2px 2px 0 var(--mat-edge),
    -3px 3px 0 var(--mat-edge);
  transform: rotateX(55deg) rotateZ(-45deg);
}
.booking-court svg .floor {
  fill: transparent;
}
.booking-court.is-live svg {
  color: var(--on-accent);
  background: var(--accent);
  box-shadow:
    -1px 1px 0 var(--accent-edge),
    -2px 2px 0 var(--accent-edge),
    -3px 3px 0 var(--accent-edge);
}
/* Confirmed bookings breathe: a ring spreads out from the court. */
.booking-court.is-live::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 19px;
  aspect-ratio: 61 / 134;
  margin: -7px 0 0 -9.5px;
  border-radius: 3px;
  border: 2px solid var(--accent);
  opacity: 0.3;
  transform: rotateX(55deg) rotateZ(-45deg) scale(1.25);
  animation: live-ring 2.4s var(--ease-out) infinite;
  pointer-events: none;
}
@keyframes live-ring {
  from {
    opacity: 0.55;
    transform: rotateX(55deg) rotateZ(-45deg) scale(1);
  }
  70%,
  to {
    opacity: 0;
    transform: rotateX(55deg) rotateZ(-45deg) scale(1.5);
  }
}
.booking-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.booking-names {
  min-width: 0;
}
.booking-names strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.booking-names span {
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.booking-meta {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.booking-meta b {
  font-weight: 550;
  color: var(--fg);
}
.booking-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
}
.tag {
  flex: none;
  display: inline-block;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.tag.confirmed {
  border-color: var(--accent);
  color: var(--accent-ink);
}
.tag.pending {
  border-color: var(--warn);
  color: var(--warn);
}
.tag.failed {
  border-color: var(--danger);
  color: var(--danger);
}
.failed-note {
  color: var(--danger);
}
.tag.submitted {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.empty {
  padding: 36px 0;
  text-align: center;
}
.empty p {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--muted);
}
.skeleton {
  height: 104px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  animation: breathe 1.4s ease-in-out infinite;
}
@keyframes breathe {
  50% {
    opacity: 0.5;
  }
}

.foot {
  margin-top: 40px;
  padding: 20px 0 8px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.page-foot {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

@media (hover: hover) and (pointer: fine) {
  .choice input:not(:checked) + .court:hover:not(:active) {
    --d: 6px;
  }
  .switch a:not([aria-current="page"]):hover {
    color: var(--fg);
  }
  .period:hover,
  .opt:hover,
  .chip:not([aria-pressed="true"]):hover {
    border-color: var(--accent);
  }
}

@media (max-width: 640px) {
  dialog {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    padding-bottom: env(safe-area-inset-bottom);
  }
  dialog[open] {
    animation: sheet 320ms var(--ease-drawer);
  }
  .sheet-grip {
    display: block;
    width: 40px;
    height: 5px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: var(--line);
  }
  .dialog-body {
    padding-top: 14px;
  }
}
@keyframes sheet {
  from {
    transform: translateY(100%);
  }
}

@media (max-width: 360px) {
  .send {
    grid-template-columns: 112px minmax(0, 1fr);
  }
}

@media (min-width: 641px) {
  .head {
    padding-top: 44px;
  }
  .title {
    font-size: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
