:root {
  color-scheme: light;
  --ink: #30392f; --mint: #b4e7ce; --peach: #ffc9ad; --lilac: #d9cefa;
  --butter: #ffe68b; --pink: #ffe2df; --cream: #fff2d9;
  --edge: 2px solid var(--ink);
  font: 550 16px/1.4 ui-rounded, "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background: #fffbef radial-gradient(#9d946c43 .8px, transparent .8px) 0 0 / 12px 12px;
}
*, *::before, *::after { box-sizing: border-box }
body { margin: 0 }
body { min-width: 280px }
a { color: inherit }
a, button, input, select, textarea, summary { -webkit-tap-highlight-color: transparent }
button, input, select, textarea { color: var(--ink); font: inherit }
button, select, summary { cursor: pointer }
button { min-height: 44px; touch-action: manipulation }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #145898; outline-offset: 3px;
}
button:disabled { cursor: default; opacity: .57 }
button:not(.cat, .slot, .queue-player, .grip) {
  border: var(--edge); border-radius: 12px; padding: 6px 11px; background: #fffaf0; font-weight: 750;
}
button:not(.cat, .slot, .queue-player, .grip):active:not(:disabled) { transform: translateY(2px) }
button.quiet { background: transparent; border-color: transparent; text-decoration: underline; text-underline-offset: 3px }
button.secondary { background: var(--butter); box-shadow: 0 2px 0 var(--ink) }
button[aria-pressed="true"]:not(.slot, .queue-player) { background: var(--butter) }
h1, h2, h3, p { margin: 0 }
h1 { font-size: clamp(2.15rem, 6vw, 2.8rem); font-weight: 875; line-height: 1.04; letter-spacing: -.055em }
h2 { font-size: 1.4rem; line-height: 1.12; font-weight: 850; letter-spacing: -.035em }
h3 { font-size: 1rem; font-weight: 800 }
h1, h2, h3, strong, p, label, li, small, dd, .quiet-copy, .word, .session-label { overflow-wrap: anywhere }
small { font-size: .81rem }
.quiet-copy { font-size: .9rem; color: #3d5347 }
[hidden] { display: none !important }

.shell {
  width: min(100% - 20px, 44rem); min-height: 24rem; margin: 14px auto 38px;
  background: #f8f8e8; border: var(--edge); border-radius: 27px;
  box-shadow: 0 5px 0 var(--ink); overflow: hidden;
}
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 9px;
  padding: 8px 14px; min-height: 56px; border-bottom: var(--edge); background: var(--pink);
}
.word {
  display: inline-flex; flex-shrink: 0; align-items: center; gap: 5px;
  min-height: 44px; font-size: 25px; font-weight: 890; letter-spacing: -.07em; text-decoration: none;
}
.word img { display: block; object-fit: contain; background: #fff7ed; border-radius: 7px; padding: 2px }
.session-label { min-width: 0; font-size: .84rem; font-weight: 750; text-align: right }
.sign-out { flex: 0 0 auto; font-size: .8rem }
.tabs, .segmented { display: flex; flex-wrap: wrap; gap: 6px }
.tabs { padding: 8px 12px; background: #f5f3df; border-bottom: var(--edge) }
.tabs button, .segmented button { flex: 1; font-size: .88rem }
.tabs button { background: #fffaf0 }
.content { display: grid; gap: 12px; padding: 15px 13px 20px }
.content > h1 + .quiet-copy { margin-top: -6px }
.panel {
  min-width: 0; padding: 12px; border: var(--edge); border-radius: 17px;
  background: #fffaf0; box-shadow: 0 2px 0 var(--ink);
}
.panel > * + * { margin-top: 9px }
.panel.cream { background: var(--cream) }
.panel.plain { background: #fffdf3 }
.groups, .session-list, .roster, .cost-lines { display: grid; gap: 8px }
.session-link { text-decoration: none; display: block }
.session-link small { white-space: nowrap }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px }
.row.between { justify-content: space-between }
.group { display: grid; grid-template-columns: 1fr; gap: 8px }
.group > * { margin: 0 }
.notice:empty, .difference:empty { display: none }
.notice, .difference { font-size: .88rem }
.alert, .connection, .control {
  padding: 7px 12px; background: var(--cream); display: flex; align-items: center;
  justify-content: space-between; gap: 8px; font-size: .85rem;
}
.alert { background: #fbd5c5; border-bottom: var(--edge) }
.connection { min-height: 34px; font-weight: 790; background: #e9f8e5 }
.connection small { font-weight: 650 }
.control { justify-content: flex-end; padding-block: 2px; background: #f5f3df }
.control span { margin-right: auto }
.login-again, .conflict, .history { margin: 10px 12px }
.conflict { background: #ffdad1 }
.history { background: var(--cream) }
.history li + li { margin-top: 7px }
details summary { min-height: 44px; align-content: center; font-weight: 770 }
form { display: grid; gap: 10px }
label { display: grid; gap: 4px; font-size: .91rem; font-weight: 740; min-width: 0 }
fieldset { min-width: 0; padding: 8px; border: 1px solid #756a59; border-radius: 12px }
legend { font-weight: 820 }
.booking-fields label + label { margin-top: 8px }
.booking-fields .segmented { margin-bottom: 8px }
.booking-text, .booking-info dd { white-space: pre-wrap; overflow-wrap: anywhere }
.booking-info { display: grid; grid-template-columns: auto 1fr; gap: 6px 9px; margin: 0 }
.booking-info dt { font-weight: 800 }
.booking-info dd { margin: 0 }
.account-picker, .auth form { margin-top: 8px }
.court-names { display: grid; gap: 7px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 136px), 1fr)) }
input:not([type="checkbox"]), select, textarea {
  width: 100%; min-width: 0; min-height: 44px; padding: 8px; background: #fffdf4;
  border: 1.5px solid var(--ink); border-radius: 9px; font-size: max(1rem, 16px);
}
textarea { resize: vertical }
.checkbox { display: flex; align-items: center; gap: 7px; min-height: 44px }
input[type="checkbox"] { width: 19px; height: 19px; accent-color: #287553 }
.pill, .count {
  display: inline-grid; place-items: center; border-radius: 999px; background: var(--pink);
  min-width: 22px; min-height: 22px; font-size: .79rem; font-weight: 800; padding-inline: 6px;
}
.organiser { display: block; color: #465745 }
.roster-player .row + .row { margin-top: 5px }
.roster-player details form { margin: 0 0 5px }
.roster-counts { width: fit-content; padding: 8px 10px; border: var(--edge); border-radius: 12px; background: var(--mint) }
.money-total { grid-template-columns: 1fr auto }
.money-total input { grid-column: 1 / -1 }
.difference { color: #872d24; font-weight: 780 }
.cost-line output { font-weight: 820 }
.cost-line small { margin: 0; color: #465745 }

.courts { display: grid; gap: 12px; padding: 10px 11px 13px }
.court-card {
  padding: 12px; min-width: 0; background: var(--mint); border: var(--edge); border-radius: 19px;
  box-shadow: 0 3px 0 var(--ink);
}
.court-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px }
.court-head h2 { font-size: clamp(1.7rem, 5vw, 2.05rem); letter-spacing: -.055em; line-height: 1.08 }
.status {
  white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
  font-size: .75rem; font-weight: 800; background: #f7fff0; border: 1.5px solid var(--ink);
  border-radius: 999px; padding: 3px 8px;
}
.status::before { content: ""; height: 8px; width: 8px; border: 1.5px solid var(--ink); border-radius: 50% }
.court-card[data-playing="true"] .status::before { background: #237650 }
.teams { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px }
.teams::before { content: ""; position: absolute; top: 5px; bottom: 3px; left: 50%; border-left: 2px dashed #53876e }
.team {
  padding: 8px 6px; background: var(--peach); border: var(--edge);
  border-radius: 16px 16px 14px 14px; box-shadow: 0 3px 0 var(--ink); min-width: 0;
}
.team + .team { background: var(--lilac) }
.team h3 { margin: 0 4px 5px; font-size: .81rem }
.slot {
  width: 100%; min-height: 44px; margin: 0 0 4px; border: 1.5px solid transparent;
  border-radius: 9px; background: #ffffff66; text-align: left; padding: 6px 7px;
  font-size: 1rem; font-weight: 760; line-height: 1.2; overflow-wrap: anywhere;
}
.slot:last-child { margin-bottom: 0 }
.slot span { display: inline-block }
.slot:disabled { opacity: 1; color: inherit }
.slot[data-drag-player] { touch-action: pan-y }
.slot[aria-pressed="true"], .slot.drop-target { border-color: var(--ink); background: #fff7cf; box-shadow: 0 2px 0 var(--ink) }
.bench { margin: 12px 0 4px; padding: 8px 9px; border: var(--edge); border-radius: 14px; background: var(--cream); box-shadow: 0 2px 0 var(--ink) }
.bench h3 { display: flex; gap: 5px; align-items: center; font-size: .89rem }
.queue { display: flex; flex-wrap: wrap; gap: 0 5px; margin-top: 2px }
.queue small { margin-top: 4px }
.queue-item { display: inline-flex; align-items: stretch; max-width: 100%; min-width: 0 }
.queue-player, .grip {
  display: inline-flex; min-width: 0; align-items: center; font-size: .85rem; gap: 4px; min-height: 44px;
  background: transparent; border: 1px solid transparent; padding: 2px 5px;
  text-align: left; border-radius: 8px; overflow-wrap: anywhere; touch-action: pan-y;
}
.queue-player[aria-pressed="true"] { background: #fff7cf; border-color: var(--ink) }
.queue-player { min-width: 44px }
.queue-player:disabled { opacity: 1 }
button.grip { min-width: 44px; padding-inline: 5px; justify-content: center; touch-action: none; color: #544331; cursor: grab; user-select: none }
.grip:active { cursor: grabbing }
.actions { padding-top: 5px }
.winner { grid-template-columns: auto 1fr; align-items: center; gap: 8px }
.draft-controls { display: flex; justify-content: space-between; align-items: center; gap: 6px }
.draft-controls small { color: #354d40 }
.draft-controls button { font-size: .81rem }
.end { padding-top: 0; justify-items: start }
.cat {
  --shape: polygon(0 35%,2% 12%,3.5% 5%,5% 4%,11% 24%,89% 24%,95% 4%,96.5% 5%,98% 12%,100% 35%,100% 80%,99% 91%,97% 98%,3% 98%,1% 91%,0 80%);
  width: 100%; height: 62px; display: block; position: relative; isolation: isolate;
  background: transparent; border: 0; padding: 0; font-size: 1.16rem; font-weight: 860; letter-spacing: -.025em;
}
.cat::before, .face, .face::before { content: ""; position: absolute; inset: 0 0 4px; clip-path: var(--shape); background: var(--ink) }
.cat::before { transform: translateY(4px) }
.face { display: grid; place-items: center; padding: 10px 8px 0; transition: transform 90ms ease-out; isolation: isolate }
.face::before { inset: 2px; background: var(--butter); z-index: -1 }
.cat:active:not(:disabled) .face { transform: translateY(4px); transition: none }

@media (min-width: 690px) {
  .content, .bar, .tabs, .connection, .control { padding-left: 19px; padding-right: 19px }
  .courts { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .court-card:only-child { grid-column: 1 / -1 }
  .group { grid-template-columns: 1fr auto; align-items: center }
}
@media (prefers-reduced-motion: no-preference) {
  .status-change { animation: tag-pop 180ms ease-out }
  @keyframes tag-pop { 0% { transform: scale(.94) } 65% { transform: scale(1.04) } 100% { transform: scale(1) } }
}
@media (prefers-reduced-motion: reduce) {
  .face { transition: none }
  .cat:active:not(:disabled) .face { transform: none; filter: brightness(.93) }
  button:not(.cat, .slot, .queue-player, .grip):active:not(:disabled) { transform: none; filter: brightness(.95) }
}

.password-row { display: grid; grid-template-columns: minmax(0,1fr) 46px; align-items: end; gap: 6px }
.eye { display: grid; place-items: center; background: var(--lilac); min-height: 44px }
.strength { color: var(--ink); font-weight: 700 }
.strength:empty { display: none }
.back-home { color: var(--ink); font-size: .88rem; min-height: 44px; display: inline-flex; align-items: center }
select {
  appearance: none; color: var(--ink); font-weight: 700; border: var(--edge);
  background-color: #f4edff; border-radius: 12px; box-shadow: 0 2px 0 var(--ink);
  padding-right: 2.3rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: right 16px center, right 11px center; background-size: 5px 5px; background-repeat: no-repeat;
}
@media (forced-colors:active) { select { appearance: auto } }

.live-booking { margin: 8px 12px; padding-block: 0 }
