:root {
  --court: #0b6e4f;
  --court-deep: #075038;
  --shuttle: #f2c200;
  --shuttle-shadow: #b58f00;
  --chalk: #ffffff;
  --teak: #c8952b;
  --ink: #eafff5;
  --muted: rgba(234, 255, 245, 0.72);
  --glass: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.22);
  --radius: 22px;
  color-scheme: dark;
  font-family: "Trebuchet MS", ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 12%, rgba(242, 194, 0, 0.12), transparent 24rem),
    linear-gradient(155deg, var(--court) 0%, var(--court-deep) 78%);
}

button,
input { font: inherit; }

button { color: inherit; }

a { color: inherit; }

.wrap {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 18px;
}

.court-bg {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - 36px);
  overflow: hidden;
  padding: clamp(20px, 6vw, 32px);
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(255, 255, 255, 0.075) 46px 48px),
    linear-gradient(155deg, rgba(11, 110, 79, 0.98), rgba(7, 80, 56, 0.98));
  box-shadow: 0 24px 60px rgba(0, 34, 23, 0.34);
}

.court-bg::before {
  position: absolute;
  z-index: -1;
  inset: 11px;
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-radius: 14px;
  content: "";
  pointer-events: none;
}

.court-bg::after {
  position: absolute;
  z-index: -1;
  top: -82px;
  right: -70px;
  width: 220px;
  height: 220px;
  border: 3px dashed rgba(242, 194, 0, 0.52);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.eyebrow,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 5px 12px;
  border-radius: 999px;
  color: #0a1f17;
  background: var(--shuttle);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.pill--kids {
  color: #fff;
  background: var(--teak);
}

h1 {
  max-width: 13ch;
  margin: 0.35em 0 0.18em;
  font-size: clamp(2.2rem, 11vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.lede,
.muted,
small { color: var(--muted); }

.session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  color: var(--muted);
}

.session-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.list-intro {
  margin: 0 0 20px;
  font-size: 0.95rem;
}

.slot-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

a.slotrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 15px;
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  color: #fff;
  background: var(--glass);
  text-decoration: none;
  backdrop-filter: blur(3px);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

a.slotrow:hover {
  border-color: rgba(242, 194, 0, 0.72);
  background: rgba(255, 255, 255, 0.17);
  transform: translateY(-2px);
}

.slotrow__date { font-size: 1rem; }

.slotrow__meta {
  display: block;
  margin-top: 3px;
}

.slotrow__count { text-align: right; }

.count {
  color: var(--shuttle);
  font-weight: 900;
}

.scoreline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 22px 0 4px;
}

.scoreline .count {
  font-size: 2.7rem;
  line-height: 1;
}

.court-count {
  margin-left: auto;
  color: var(--shuttle);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.82rem;
  font-weight: 700;
}

button.chip { cursor: pointer; }

.chip--active {
  border-color: var(--shuttle);
  color: #0a1f17;
  background: var(--shuttle);
}

.remove-player {
  display: inline-grid;
  width: 20px;
  height: 20px;
  margin: -2px -5px -2px 1px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  place-items: center;
  color: #fff8c7;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.registration-form { margin-top: 20px; }

.registration-hint {
  display: block;
  margin: 0 0 8px;
  line-height: 1.4;
}

.duration-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.duration-grid .chip {
  justify-content: center;
  min-width: 0;
  padding-inline: 5px;
  text-align: center;
}

.name-input {
  width: 100%;
  margin: 9px 0;
  padding: 13px 14px;
  border: 2px solid transparent;
  border-radius: 12px;
  outline: 0;
  color: #123027;
  background: #fff;
}

.name-input:focus { border-color: var(--shuttle); }

.bigbtn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  color: #0a1f17;
  background: var(--shuttle);
  box-shadow: 0 6px 0 var(--shuttle-shadow);
  font-size: 1.15rem;
  font-weight: 900;
  cursor: pointer;
}

.bigbtn:hover { filter: brightness(1.05); }

.bigbtn:active {
  box-shadow: 0 3px 0 var(--shuttle-shadow);
  transform: translateY(3px);
}

.bigbtn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.section {
  margin-top: 24px;
  padding-top: 19px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.cost-line {
  margin: 4px 0;
  color: var(--shuttle);
  font-size: 1.35rem;
  font-weight: 900;
}

.qr {
  width: 156px;
  margin-top: 11px;
  padding: 7px;
  border-radius: 10px;
  background: #fff;
}

.qr img {
  display: block;
  width: 142px;
  height: 142px;
  object-fit: contain;
  image-rendering: pixelated;
}

.status-message {
  padding: 14px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: var(--glass);
}

.back-link {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.86rem;
  text-decoration: none;
}

.back-link:hover { color: #fff; }

.confetti-piece {
  position: fixed;
  z-index: 10;
  top: -14px;
  left: var(--left);
  width: 9px;
  height: 16px;
  border-radius: 2px;
  background: var(--color);
  pointer-events: none;
  animation: confetti-fall var(--duration) ease-in forwards;
  animation-delay: var(--delay);
}

@keyframes confetti-fall {
  to { transform: translate3d(var(--drift), 105vh, 0) rotate(760deg); }
}

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

@media (max-width: 380px) {
  .wrap { padding: 10px; }
  .court-bg { min-height: calc(100vh - 20px); padding: 20px; }
  .duration-grid { grid-template-columns: 1fr; }
  .court-count { width: 100%; margin-left: 0; }
}

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