/* UniRally next: tokens and components, ported from the approved prototype. Glass is used on bars, headers and hero cards only; data screens stay flat. */
:root {
  --bg: #eaf2fb;
  --ink: #0b1d3f;
  --mute: #42557a;
  --faint: #566a8e;
  --glass: rgba(255, 255, 255, 0.62);
  --bar: rgba(255, 255, 255, 0.76);
  --border: rgba(255, 255, 255, 0.92);
  --hair: rgba(30, 76, 154, 0.16);
  --shadow: 0 10px 30px rgba(13, 42, 92, 0.16);
  --accent: #1e4c9a;
  --field: rgba(255, 255, 255, 0.8);
  --glow: rgba(141, 180, 240, 0.95);
  --glow2: rgba(207, 226, 243, 0.95);
  --lines: rgba(30, 76, 154, 0.1);
  --ok: #1b6b3a;
  --bad: #b3261e;
  --pend-bg: rgba(239, 214, 70, 0.38);
  --pend-fg: #5b4a00;
  --ok-bg: rgba(27, 107, 58, 0.12);
  --bad-bg: rgba(179, 38, 30, 0.1);
  --chip: rgba(30, 76, 154, 0.1);
  --tint: rgba(239, 214, 70, 0.35);
  --me: rgba(30, 76, 154, 0.08);
  --surface: #fff;
  --ball: #efd646;
  --onball: #0d2a5c;
  --court: #1e4c9a;
  --courtd: #173b78;
  --deep: #0d2a5c;
  --blur: blur(22px) saturate(1.5);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #081428;
    --ink: #e8f0fa;
    --mute: #b4c6e2;
    --faint: #93a9cc;
    --glass: rgba(255, 255, 255, 0.09);
    --bar: rgba(14, 29, 58, 0.66);
    --border: rgba(255, 255, 255, 0.18);
    --hair: rgba(255, 255, 255, 0.14);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
    --accent: #8db4f0;
    --field: rgba(255, 255, 255, 0.08);
    --glow: rgba(30, 76, 154, 0.8);
    --glow2: rgba(23, 59, 120, 0.55);
    --lines: rgba(255, 255, 255, 0.1);
    --ok: #7bd99a;
    --bad: #ff9b94;
    --pend-bg: rgba(239, 214, 70, 0.16);
    --pend-fg: #f3df6e;
    --ok-bg: rgba(123, 217, 154, 0.16);
    --bad-bg: rgba(255, 155, 148, 0.16);
    --chip: rgba(255, 255, 255, 0.12);
    --tint: rgba(239, 214, 70, 0.14);
    --me: rgba(141, 180, 240, 0.13);
    --surface: #0e1d3a;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #081428;
  --ink: #e8f0fa;
  --mute: #b4c6e2;
  --faint: #93a9cc;
  --glass: rgba(255, 255, 255, 0.09);
  --bar: rgba(14, 29, 58, 0.66);
  --border: rgba(255, 255, 255, 0.18);
  --hair: rgba(255, 255, 255, 0.14);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
  --accent: #8db4f0;
  --field: rgba(255, 255, 255, 0.08);
  --glow: rgba(30, 76, 154, 0.8);
  --glow2: rgba(23, 59, 120, 0.55);
  --lines: rgba(255, 255, 255, 0.1);
  --ok: #7bd99a;
  --bad: #ff9b94;
  --pend-bg: rgba(239, 214, 70, 0.16);
  --pend-fg: #f3df6e;
  --ok-bg: rgba(123, 217, 154, 0.16);
  --bad-bg: rgba(255, 155, 148, 0.16);
  --chip: rgba(255, 255, 255, 0.12);
  --tint: rgba(239, 214, 70, 0.14);
  --me: rgba(141, 180, 240, 0.13);
  --surface: #0e1d3a;
  color-scheme: dark;
}
/* where the browser cannot blur, or the person asks for less transparency, glass becomes a solid surface */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --blur: none;
    --glass: var(--surface);
    --bar: var(--surface);
  }
}
@media (prefers-reduced-transparency: reduce) {
  :root {
    --blur: none;
    --glass: var(--surface);
    --bar: var(--surface);
  }
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family:
    'Archivo',
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
body {
  overscroll-behavior: none;
}
a {
  color: inherit;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* the app column: one phone-width column, centred on a large screen */
.app {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  overflow: clip;
  background: var(--bg);
} /* clip, not just hidden: the column itself must never scroll (a focused input or a scrollIntoView would shove the floating bars around) */
.bd-glow {
  position: absolute;
  left: -90px;
  top: -150px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, transparent 66%);
  pointer-events: none;
}
.bd-glow2 {
  position: absolute;
  left: -60px;
  top: 560px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow2) 0%, transparent 66%);
  pointer-events: none;
}
.bd-court {
  position: absolute;
  right: -90px;
  top: 70px;
  width: 340px;
  height: 544px;
  transform: rotate(-8deg);
  color: var(--lines);
  pointer-events: none;
}
.scroller {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(76px + max(env(safe-area-inset-top), 12px)) 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
}
.scroller > * {
  flex-shrink: 0;
} /* a column that overflows must scroll, never squash its children (a squashed pills row once showed as a sliver) */
/* a screen with its own bar of buttons reserves exactly the bar's real height (main.js measures it into --cta-h), plus a gap, so the last card is never tucked under it. The fallback is generous. */
.scroller.no-tabs {
  padding-bottom: 16px;
}
.scroller.no-top {
  padding-top: calc(40px + max(env(safe-area-inset-top), 12px));
}
.scroller.flat {
  padding-top: calc(76px + max(env(safe-area-inset-top), 12px));
}

/* glass */
.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}
.topbar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  padding: max(env(safe-area-inset-top), 12px) 16px 12px;
  background: var(--bar);
  border-bottom: 1px solid var(--border);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  z-index: 5;
}
.topbar .row {
  height: 48px;
}
.tabbar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  height: 68px;
  display: flex;
  border-radius: 34px;
  background: var(--bar);
  border: 1px solid var(--border);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
  z-index: 5;
}
.tab {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 68px;
  text-decoration: none;
  color: var(--mute);
  font-size: 12px;
  font-weight: 600;
}
.tab[aria-current='page'] {
  color: var(--ink);
  font-weight: 800;
}
.tab[aria-current='page']::before {
  content: '';
  position: absolute;
  top: -9px;
  left: 50%;
  margin-left: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ball);
  box-shadow: 0 0 0 3px rgba(239, 214, 70, 0.3);
}
.tab .badge {
  position: absolute;
  top: 6px;
  left: 50%;
  margin-left: 6px;
}
.badge {
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--ball);
  color: var(--onball);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.ctabar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--bar);
  border-top: 1px solid var(--border);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 5;
}

/* layout helpers */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* a word too long for its box (a long name with no spaces) breaks instead of running off the edge or over its neighbour. Only acts when a word really does not fit, so numbers and buttons are untouched. */
#app {
  overflow-wrap: break-word;
}
.grow {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
} /* a long name with no spaces breaks inside its box instead of running over whatever is beside it */
.wrap {
  flex-wrap: wrap;
}
.center {
  text-align: center;
  align-items: center;
}
.gap6 {
  gap: 6px;
}
.gap8 {
  gap: 8px;
}
.gap10 {
  gap: 10px;
}
.gap16 {
  gap: 16px;
}
.gap4 {
  gap: 4px;
}
.gap2 {
  gap: 2px;
}

/* type */
.h1 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.h1.sm {
  font-size: 28px;
}
.h1.xl {
  font-size: 40px;
}
.h2 {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}
.p {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--mute);
}
.p.lg {
  font-size: 17px;
}
.p.sm {
  font-size: 14px;
}
.p.xs {
  font-size: 13px;
}
.ink {
  color: var(--ink);
}
.faint {
  color: var(--faint);
}
.lab {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.num {
  font-weight: 900;
  font-stretch: 62%;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ok {
  color: var(--ok);
}
.bad {
  color: var(--bad);
}
.nw {
  white-space: nowrap;
}
.ell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* components */
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 24px;
}
.card.tight {
  padding: 12px;
  gap: 12px;
}
.card.pad14 {
  padding: 14px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-radius: 14px;
  background: var(--chip);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.chip.ball {
  background: var(--ball);
  color: var(--onball);
}
.chip.court {
  background: var(--court);
  color: #fff;
}
.chip.pend {
  background: var(--pend-bg);
  color: var(--pend-fg);
}
.chip.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.chip.bad {
  background: var(--bad-bg);
  color: var(--bad);
}
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 20px;
  border-radius: 26px;
  border: 0;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  width: 100%;
}
.btn.sm {
  height: 44px;
  border-radius: 22px;
  padding: 0 22px;
  width: auto;
  font-size: 15px;
}
.btn.primary {
  background: var(--ball);
  color: var(--onball);
  box-shadow: 0 6px 18px rgba(239, 214, 70, 0.25);
}
.btn.glassy {
  background: var(--chip);
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn.danger {
  background: var(--bad-bg);
  color: var(--bad);
}
.btn.court {
  background: var(--court);
  color: #fff;
}
.btn.text {
  background: transparent;
  color: var(--accent);
  width: auto;
  min-height: 44px;
  height: auto;
  padding: 0 8px;
}
/* a text-only button inside a row lines up with the text above it instead of sitting 8px in */
.row .btn.text {
  padding: 0;
}
.btn.text[style*='flex-start'] {
  margin-left: -8px;
}
.btn[disabled] {
  opacity: 0.55;
  cursor: default;
}
.circle {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--chip);
  border: 1px solid var(--border);
  color: var(--ink);
  text-decoration: none;
  position: relative;
}
.circle .badge {
  position: absolute;
  top: -3px;
  right: -3px;
}
.tile {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--chip);
  color: var(--ink);
}
.tile.ball {
  background: var(--ball);
  color: var(--onball);
}
.tile.court {
  background: var(--court);
  color: #fff;
}
.avatar {
  width: 52px;
  height: 52px;
  border-radius: 26px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--court);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
}
.crest {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--chip);
  border: 1px solid var(--border);
}
.crest img {
  width: 66%;
  height: 66%;
  object-fit: contain;
}
.crest.lg {
  width: 96px;
  height: 96px;
  border-radius: 32px;
}
.bdot {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ball);
  box-shadow: 0 0 0 3px rgba(239, 214, 70, 0.3);
}
.progress {
  height: 8px;
  border-radius: 4px;
  background: var(--chip);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--ball);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--mute);
}
.input {
  height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--field);
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  outline: none;
}
.input:focus {
  border-color: var(--accent);
}
textarea.input {
  height: auto;
  padding: 14px 16px;
  font-weight: 500;
  line-height: 1.4;
  resize: none;
}
.input.code {
  letter-spacing: 0.28em;
  font-size: 24px;
  text-align: center;
}
.hint {
  font-size: 13px;
  font-weight: 500;
  color: var(--faint);
}
.err {
  font-size: 14px;
  font-weight: 700;
  color: var(--bad);
}
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 26px;
  background: var(--chip);
  border: 1px solid var(--border);
}
.seg button {
  flex: 1;
  height: 44px;
  border-radius: 22px;
  border: 0;
  background: transparent;
  color: var(--mute);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.seg button[aria-pressed='true'] {
  background: var(--court);
  color: #fff;
  font-weight: 800;
}
.clr {
  flex: none;
  min-height: 44px; /* a full-size tap area, pulled back with negative margins so it does not make the card taller */
  margin: -14px -8px -14px 0;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--mute);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.seg.grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* the choices wrap onto rows instead of running off the side of the sheet */
  border-radius: 24px;
}
.seg.grid button {
  height: auto;
  min-height: 44px;
  padding: 8px 10px;
  line-height: 1.2;
}
.seg.grid button:first-child {
  grid-column: 1 / -1;
}
.pill {
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--chip);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.pill[aria-pressed='true'] {
  background: var(--court);
  color: #fff;
  border-color: transparent;
  font-weight: 800;
}
.switch {
  border: 0;
  background: transparent;
  padding: 6px 0;
  cursor: pointer;
  display: flex;
}
.switch i {
  width: 52px;
  height: 32px;
  border-radius: 16px;
  background: var(--chip);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 2px;
  justify-content: flex-start;
}
.switch i b {
  width: 26px;
  height: 26px;
  border-radius: 13px;
  background: var(--mute);
  display: block;
}
.switch[aria-checked='true'] i {
  background: var(--court);
  justify-content: flex-end;
}
.switch[aria-checked='true'] i b {
  background: #fff;
}
.listrow {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 0;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--hair);
  width: 100%;
  background: none;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  text-align: left;
  cursor: pointer;
}
.listrow:first-child {
  border-top: 0;
}
.listrow .tile {
  width: 40px;
  height: 40px;
  border-radius: 20px;
}
.listrow.danger {
  color: var(--bad);
}
.listrow.danger .tile {
  background: var(--bad-bg);
  color: var(--bad);
}
.listrow .t {
  font-size: 16px;
  font-weight: 700;
}
.listrow .s {
  font-size: 13px;
  font-weight: 500;
  color: var(--mute);
}
.banner {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(155deg, var(--court) 0%, var(--courtd) 100%);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  min-height: 160px;
}
.banner svg.lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.banner .on {
  position: relative;
}
.banner .t {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.banner .s {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  margin-top: 4px;
}
.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  text-decoration: none;
  color: var(--ink);
  border: 2px solid var(--border);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.opt[aria-pressed='true'] {
  border-color: var(--ball);
}
.opt .n {
  width: 56px;
  flex: none;
  font-size: 36px;
}
.opt[aria-pressed='true'] .n {
  color: var(--accent);
}
.steps {
  display: flex;
  gap: 6px;
}
.steps i {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--chip);
}
.steps i.on {
  background: var(--ball);
}
.item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
}
.item .dot {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background: var(--ball);
}
.timeline .step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.timeline .mk {
  width: 28px;
  height: 28px;
  border-radius: 14px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--hair);
}
.timeline .mk.done {
  background: var(--court);
  color: #fff;
  border: 0;
}
.timeline .mk.now {
  background: var(--chip);
  border: 1px solid var(--border);
}
.pb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--faint);
}
.pb img {
  height: 18px;
  width: auto;
}
.pb-light {
  display: inline;
}
.pb-dark {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .pb-light {
    display: none;
  }
  :root:not([data-theme='light']) .pb-dark {
    display: inline;
  }
}
:root[data-theme='dark'] .pb-light {
  display: none;
}
:root[data-theme='dark'] .pb-dark {
  display: inline;
}
/* the message at the bottom: a navy capsule like the tab bar and the website's top bar, with a yellow ball for a marker and a yellow Undo button */
.toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(
    var(--end-room, 88px) + 8px
  ); /* just above the tab bar (or the action bar), wherever it is */
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px 13px 14px;
  border-radius: 24px;
  background: linear-gradient(160deg, #11306b, var(--deep));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  z-index: 30; /* above a sheet too, so a message made while one is open is not hidden behind it */
  box-shadow:
    0 14px 34px rgba(8, 20, 40, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  touch-action: pan-y;
  cursor: pointer;
}
/* the marker: a small padel ball */
.toast::before {
  content: '';
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ball);
  box-shadow: 0 0 0 4px rgba(239, 214, 70, 0.22);
}
/* in the dark theme the capsule is the same glass as the tab bar, so it sits in the page instead of glowing */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .toast {
    background: rgba(18, 38, 78, 0.82);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border-color: var(--border);
  }
}
:root[data-theme='dark'] .toast {
  background: rgba(18, 38, 78, 0.82);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-color: var(--border);
}
/* a message with an Undo button: the button on the right, and a thin yellow bar underneath that drains while there is still time */
.toast.has-undo {
  padding: 6px 8px 10px 14px;
  overflow: hidden;
  cursor: default;
}
.toast-msg {
  flex: 1;
  min-width: 0;
}
.toast-undo {
  flex: none;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ball);
  color: var(--onball);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.toast-undo:active {
  transform: scale(0.96);
}
.toast-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--ball);
  opacity: 0.85;
  transform-origin: left;
  animation: toastdrain linear forwards;
}
@keyframes toastdrain {
  to {
    transform: scaleX(0);
  }
}
/* with a sheet open the bottom belongs to the sheet, so the message goes to the top instead */
#app:has(.sheet:not(.closing)) .toast {
  bottom: auto;
  top: calc(12px + env(safe-area-inset-top));
}
.splash {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--deep), var(--court));
}
.splash img {
  width: 200px;
  height: auto;
}
.empty .h3 + .p {
  margin-top: 6px;
}
.empty {
  border: 2px dashed var(--hair);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
}
@media (prefers-reduced-motion: no-preference) {
  .scroller {
    scroll-behavior: smooth;
  }
}

/* data screens are flat: a solid surface, no blur */
.flat {
  background: var(--surface);
  border: 1px solid var(--hair);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.seg.tabs4 a,
.seg.tabs4 button {
  font-size: 14px;
  padding: 0 4px;
}
.seg a {
  flex: 1;
  height: 44px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mute);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
.seg a[aria-current='page'] {
  background: var(--court);
  color: #fff;
  font-weight: 800;
}
.pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.pills::-webkit-scrollbar {
  display: none;
}
.pills .pill {
  flex: none;
}
.tbl {
  display: flex;
  flex-direction: column;
}
.tr {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 22px 22px 40px 46px 34px;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid var(--hair);
  font-variant-numeric: tabular-nums;
}
.tr.h {
  border-top: 0;
  padding: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
}
.tr.h .c {
  letter-spacing: 0;
  text-transform: none;
  font-size: 12px;
}
.tr .c {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}
.tr .pts {
  font-weight: 900;
  font-size: 17px;
}
.tr .pos {
  font-weight: 900;
  font-stretch: 62%;
  font-size: 18px;
}
.tr .nm {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.tr .nm span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.tr.me {
  background: var(--me);
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}
.tr.me,
.tr.me + .tr {
  border-top-color: transparent;
}
.fx {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--hair);
}
.fx:first-child {
  border-top: 0;
}
.fx .pair {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fx .pair b {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.score {
  display: flex;
  gap: 6px;
  flex: none;
}
.score .d {
  min-width: 22px;
  text-align: center;
  font-weight: 900;
  font-stretch: 62%;
  font-size: 24px;
  line-height: 1;
  color: var(--faint);
}
.score .d.w {
  color: var(--ink);
}
.fx .when {
  font-size: 13px;
  font-weight: 600;
  color: var(--mute);
}
.fx .acts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.fx.void {
  opacity: 0.72;
}
.fx.me {
  padding-left: 12px;
}
.fx.me::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 2px;
  background: var(--ball);
}
.card .fx:first-child {
  padding-top: 2px;
}
.card .fx:last-child {
  padding-bottom: 2px;
}
.card .fx:first-child.me::before {
  top: 0;
}
.card .fx:last-child.me::before {
  bottom: 0;
}
.rnd {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rnd .lab {
  flex: 1;
}
.sheet-bd {
  position: absolute;
  inset: 0;
  background: rgba(5, 12, 28, 0.5);
  z-index: 20;
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  max-height: 92%;
  overflow-y: auto;
  border-radius: 28px 28px 0 0;
  padding: 14px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bar);
  border: 1px solid var(--border);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  overscroll-behavior: contain; /* dragging a sheet never drags the page behind it */
}
.sheet:focus {
  outline: none; /* focus goes to the sheet itself when it opens, for screen readers; the buttons inside show their own focus */
}
.sheet .grab {
  position: relative;
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--hair);
  align-self: center;
  flex-shrink: 0;
  touch-action: none;
}
/* a much bigger place to grab than the little handle looks */
.sheet .grab::after {
  content: '';
  position: absolute;
  inset: -16px -60px;
}
.sb {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(var(--cols, 2), 62px);
  gap: 8px;
  align-items: center;
}
.sb .head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: center;
  white-space: nowrap;
}
.sb .nm {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.sb input {
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  font-stretch: 62%;
  padding: 0;
  border-radius: 14px;
}
.lb .tr {
  grid-template-columns: 30px minmax(0, 1fr) 56px 40px;
}

/* =========================================================================================================================================
   Motion. Ported from the league app's own animations, so the two feel the same.
   The screen is redrawn on every change, so an animation that is simply "on" would replay on every keystroke. These play only when something
   NEW appears: #app[data-enter="1"] marks a page being opened, [data-sheet-new="1"] a sheet that has just appeared, [data-toast-new="1"] a new toast.
   "Reduce motion" turns them off; html[data-motion=off] turns everything off (the tests use that).
   ========================================================================================================================================= */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes shimmer {
  to {
    background-position: -100% 0;
  }
}
@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}
@keyframes bar {
  0% {
    transform: scaleX(0);
    transform-origin: left;
  }
  50% {
    transform: scaleX(0.9);
    transform-origin: left;
  }
  51% {
    transform-origin: right;
  }
  100% {
    transform: scaleX(0);
    transform-origin: right;
  }
}
@keyframes sheetup {
  from {
    transform: translateY(46px);
    opacity: 0;
  }
}
@keyframes tabpop {
  from {
    transform: scale(0.55) rotate(-10deg);
  }
  to {
    transform: none;
  }
}
@keyframes ballpop {
  from {
    transform: translateY(8px) scale(0.3);
    opacity: 0;
  }
  60% {
    transform: translateY(-3px) scale(1.15);
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes badgepop {
  from {
    transform: scale(0.2);
  }
}
@keyframes toastin {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
@keyframes growx {
  from {
    transform: scaleX(0);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes sheetdown {
  to {
    transform: translateY(60px);
    opacity: 0;
  }
}
@keyframes fadeout {
  to {
    opacity: 0;
  }
}
@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6);
  }
  70%,
  100% {
    box-shadow: 0 0 0 8px rgba(61, 220, 132, 0);
  }
}
@keyframes chipping {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 214, 70, 0.75);
  }
  70%,
  100% {
    box-shadow: 0 0 0 9px rgba(239, 214, 70, 0);
  }
}
/* the launch splash and the society splash */
@keyframes scourt {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes sdrift {
  from {
    transform: rotate(-8deg) translateY(0);
  }
  to {
    transform: rotate(-8deg) translateY(-14px);
  }
}
@keyframes smark {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes ssrise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
@keyframes sglow {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
}
/* between pages */
@keyframes vt-push-in-right {
  from {
    transform: translateX(100%);
  }
}
@keyframes vt-push-out-left {
  to {
    transform: translateX(-100%);
  }
}
@keyframes vt-push-in-left {
  from {
    transform: translateX(-100%);
  }
}
@keyframes vt-push-out-right {
  to {
    transform: translateX(100%);
  }
}
@keyframes vt-open {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}
@keyframes vt-gone {
  to {
    opacity: 0;
  }
}
@keyframes vt-fadein {
  from {
    opacity: 0;
  }
}

/* rolling digits (NumberFlow): same look as the number they replace */
number-flow {
  font-variant-numeric: tabular-nums;
  vertical-align: top;
}

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

/* the launch splash: the court lines draw themselves, then the wordmark springs in */
#splash,
#soc-splash {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
#splash {
  z-index: 100;
  background: linear-gradient(160deg, #0d2a5c 0%, #1e4c9a 100%);
  transition:
    opacity 0.45s ease,
    visibility 0s 0.45s;
}
#splash.out,
#soc-splash.out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.s-court {
  position: absolute;
  right: -90px;
  top: 70px;
  width: 340px;
  height: 544px;
  color: rgba(255, 255, 255, 0.14);
  transform: rotate(-8deg);
  animation: sdrift 4s ease-in-out infinite alternate;
}
.s-court * {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: scourt 1.5s cubic-bezier(0.3, 0.6, 0.3, 1) both;
}
.s-court *:nth-child(2) {
  animation-delay: 0.15s;
}
.s-court *:nth-child(3) {
  animation-delay: 0.3s;
}
.s-court *:nth-child(4) {
  animation-delay: 0.45s;
}
.s-court *:nth-child(5) {
  animation-delay: 0.6s;
}
.s-mark {
  position: relative;
  width: 230px;
  max-width: 70vw;
  height: auto;
  animation: smark 0.95s cubic-bezier(0.2, 1.3, 0.4, 1) 0.35s both;
}

#soc-splash .s-court {
  color: rgba(255, 255, 255, 0.1);
}
/* the society splash: the society's own crest, name and university, shown once when the app opens */
#soc-splash {
  z-index: 99;
  background: #081428;
  color: #e8f0fa;
  cursor: pointer;
  transition:
    opacity 0.45s ease,
    visibility 0s 0.45s;
}
.ss-glow {
  position: absolute;
  border-radius: 50%;
  animation: sglow 1.2s ease-out both;
}
.ss-glow.g1 {
  left: -90px;
  top: -150px;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(30, 76, 154, 0.8) 0%, rgba(0, 0, 0, 0) 66%);
}
.ss-glow.g2 {
  left: -60px;
  bottom: -230px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(23, 59, 120, 0.55) 0%, rgba(0, 0, 0, 0) 66%);
  animation-delay: 0.2s;
}
.ss-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  text-align: center;
}
.ss-tile {
  width: 120px;
  height: 120px;
  box-sizing: border-box;
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  animation: smark 0.8s cubic-bezier(0.2, 1.4, 0.4, 1) 0.15s both;
}
.ss-tile img {
  width: 79px;
  height: 79px;
  object-fit: contain;
}
.ss-name {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  animation: ssrise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.4s both;
}
.ss-uni {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.45;
  color: #b4c6e2;
  animation: ssrise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.55s both;
}
.ss-pb {
  position: absolute;
  bottom: calc(32px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #93a9cc;
  animation: fade 0.7s 1s both;
}
.ss-pb img {
  height: 18px;
  width: auto;
  display: block;
}

/* a thin yellow line across the top while the app waits on the server */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--ball);
  z-index: 30;
  opacity: 0;
  transform: scaleX(0);
  transition: opacity 0.2s;
  pointer-events: none;
}
html.busy body::before {
  opacity: 1;
  animation: bar 1.2s ease-in-out infinite;
}

/* loading placeholders: shapes that shimmer where the content will be */
.sk-l {
  display: block;
  height: 15px;
  margin: 9px 0;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--chip) 25%, var(--hair) 45%, var(--chip) 65%) 0 0/300%
    100%;
  animation: shimmer 1.3s linear infinite;
}
.sk-l.w40 {
  width: 40%;
}
.sk-l.w60 {
  width: 60%;
}
.sk-l.big {
  height: 58px;
  width: 55%;
  margin: 16px 0;
}
.hero-sk {
  background: linear-gradient(160deg, var(--court), var(--deep));
  border-radius: 28px;
  padding: 22px 20px;
  min-height: 170px;
}
.hero-sk .sk-l {
  background: rgba(255, 255, 255, 0.25);
  animation: pulse 1.4s ease-in-out infinite;
}
.sk-pills {
  display: flex;
  gap: 8px;
}
.sk-pills .sk-l {
  width: 90px;
  height: 34px;
  border-radius: 17px;
  margin: 0;
}
.sk-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.sk-row .sk-l.w20 {
  width: 20%;
}
.sk-card {
  padding: 14px 16px;
  border-radius: 24px;
}

/* a page being opened: its content rises in, one piece after another */
#app[data-enter='1'] .scroller > * {
  animation: rise 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
#app[data-enter='1'] .scroller > *:nth-child(2) {
  animation-delay: 0.04s;
}
#app[data-enter='1'] .scroller > *:nth-child(3) {
  animation-delay: 0.08s;
}
#app[data-enter='1'] .scroller > *:nth-child(4) {
  animation-delay: 0.12s;
}
#app[data-enter='1'] .scroller > *:nth-child(5) {
  animation-delay: 0.16s;
}
#app[data-enter='1'] .scroller > *:nth-child(6) {
  animation-delay: 0.2s;
}
#app[data-enter='1'] .scroller > *:nth-child(n + 7) {
  animation-delay: 0.24s;
}
#app[data-enter='1'] .tab[aria-current='page'] svg {
  animation: tabpop 0.5s cubic-bezier(0.3, 1.7, 0.5, 1);
}
#app[data-enter='1'] .tab[aria-current='page']::before {
  animation: ballpop 0.55s cubic-bezier(0.3, 1.7, 0.5, 1);
}
#app[data-enter='1'] .tab .badge {
  animation: badgepop 0.45s cubic-bezier(0.3, 1.7, 0.5, 1) 0.3s both;
}
#app[data-enter='1'] .ok-ball {
  animation: ballpop 0.7s cubic-bezier(0.3, 1.7, 0.5, 1) 0.15s both;
}
#app[data-enter='1'] .progress > i {
  animation: growx 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both;
  transform-origin: left;
}
/* a sheet that has just appeared slides up; a toast that has just appeared rises */
#app[data-sheet-new='1'] .sheet {
  animation: sheetup 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}
#app[data-sheet-new='1'] .sheet-bd {
  animation: fade 0.25s;
}
#app[data-toast-new='1'] .toast {
  animation: toastin 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* how far a row moved on the table: a green ▲ or red ▼ that pops in and fades after four seconds */
@keyframes mvpop {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
}
@keyframes mvgone {
  to {
    opacity: 0;
    transform: scale(0.6);
  }
}
/* (on the table the chip takes no room: it sits on the seam between rows, so showing it never makes a name wrap or a row grow) */
.mv {
  display: none;
  margin-left: 8px;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  vertical-align: middle;
}
.tr {
  position: relative;
}
.tr.me {
  --mvx: 16px;
}
.tr .mv {
  position: absolute;
  left: var(--mvx, 0);
  top: -7px;
  margin: 0;
  font-size: 10px;
  padding: 1px 6px;
  line-height: 1.35;
  z-index: 1;
}
.mv.show {
  display: inline-block;
  animation:
    mvpop 0.55s cubic-bezier(0.3, 1.7, 0.5, 1),
    mvgone 0.5s 4s forwards;
}
.mv.up {
  background: #3ddc84;
  color: #073b1d;
}
.mv.dn {
  background: #ff7a7a;
  color: #4a0505;
}
/* a sheet that has just closed slides down and fades (a copy of it is kept for a moment; see main.js) */
.sheet.closing {
  animation: sheetdown 0.28s cubic-bezier(0.4, 0, 1, 1) forwards;
  pointer-events: none;
}
.sheet-bd.closing {
  animation: fadeout 0.28s ease forwards;
  pointer-events: none;
}
/* confetti, drawn over everything for a moment, never in the way of a tap */
#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
}
/* pull down at the top of a screen to refresh: a little disc follows the finger, turns into the yellow ball when the pull is long enough, and spins while it reloads */
html,
body {
  overscroll-behavior-y: contain;
}
.scroller {
  overscroll-behavior-y: contain;
}
#ptr {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  left: 50%;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bar);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translate(-50%, -48px);
  z-index: 25;
  pointer-events: none;
}
#ptr::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2.5px solid var(--ink);
  border-right-color: transparent;
  border-radius: 50%;
}
#ptr.ready {
  background: var(--ball);
}
#ptr.ready::before {
  border-color: var(--onball);
  border-right-color: transparent;
}
#ptr.spin {
  opacity: 1 !important;
  transform: translate(-50%, 10px) !important;
}
#ptr.spin::before {
  animation: spin 0.7s linear infinite;
}

/* things that react to a touch, with a little spring */
.btn {
  transition:
    transform 0.35s cubic-bezier(0.3, 1.7, 0.5, 1),
    opacity 0.2s;
}
.btn:active {
  transform: scale(0.96);
}
.tab {
  transition: transform 0.3s cubic-bezier(0.3, 1.7, 0.5, 1);
}
.tab:active {
  transform: scale(0.88);
}
a.card,
a.item {
  transition: transform 0.25s cubic-bezier(0.3, 1.5, 0.5, 1);
}
a.card:active,
a.item:active {
  transform: scale(0.985);
}
@media (hover: hover) {
  a.card:hover,
  a.item:hover {
    transform: translateY(-2px);
  }
}
.chip.live {
  animation: chipping 2s ease-out infinite;
}
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #3ddc84;
  animation: ping 2.2s infinite;
  vertical-align: middle;
}

/* between pages. The rule that matters: two pages are never drawn on top of each other (their words would cross, which looked like a glitch).
   Going forward or back is a PUSH: the old page leaves as the new one arrives right beside it. A tapped card (one that is itself a card, like a competition) morphs into the next
   page: the rest of the old page fades out first, then the new page rises in. The header and the bottom buttons fade out and then in. All of it exists only while the transition runs. */
html.vt .scroller {
  view-transition-name: page;
}
html.vt .topbar {
  view-transition-name: topbar;
}
html.vt .tabbar {
  view-transition-name: tabbar;
}
html.vt .ctabar {
  view-transition-name: bottombar;
}
html.vt-card [data-vt='hero'] {
  view-transition-name: opencard;
}
::view-transition-image-pair(page) {
  overflow: hidden;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}
::view-transition-old(page),
::view-transition-new(page),
::view-transition-old(topbar),
::view-transition-new(topbar),
::view-transition-old(bottombar),
::view-transition-new(bottombar),
::view-transition-old(opencard),
::view-transition-new(opencard) {
  mix-blend-mode: normal;
}
html[data-dir='forward']::view-transition-old(page) {
  animation: vt-push-out-left 0.42s cubic-bezier(0.32, 0.72, 0, 1) both;
}
html[data-dir='forward']::view-transition-new(page) {
  animation: vt-push-in-right 0.42s cubic-bezier(0.32, 0.72, 0, 1) both;
}
html[data-dir='back']::view-transition-old(page) {
  animation: vt-push-out-right 0.42s cubic-bezier(0.32, 0.72, 0, 1) both;
}
html[data-dir='back']::view-transition-new(page) {
  animation: vt-push-in-left 0.42s cubic-bezier(0.32, 0.72, 0, 1) both;
}
html.vt-card::view-transition-old(page) {
  animation: vt-gone 0.14s ease-out both;
}
html.vt-card::view-transition-new(page) {
  animation: vt-open 0.38s cubic-bezier(0.2, 0.9, 0.3, 1) 0.14s both;
}
::view-transition-old(topbar),
::view-transition-old(bottombar) {
  animation: vt-gone 0.12s ease-out both;
}
::view-transition-new(topbar),
::view-transition-new(bottombar) {
  animation: vt-fadein 0.24s ease-in 0.12s both;
}
html.vt-card:not(.vt-morph)::view-transition-group(opencard),
html.vt-card:not(.vt-morph)::view-transition-old(opencard),
html.vt-card:not(.vt-morph)::view-transition-new(opencard) {
  display: none;
}
html.vt-card::view-transition-old(opencard) {
  animation: vt-gone 0.18s ease-out both;
}
html.vt-card::view-transition-new(opencard) {
  animation: vt-fadein 0.22s ease-in 0.14s both;
}
::view-transition-group(opencard) {
  animation-duration: 0.48s;
  animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
}

/* people who ask for less motion get none of the movement; the splash keeps its short hold but sits still */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .s-court,
  .s-court *,
  .s-mark,
  .ss-glow,
  .ss-tile,
  .ss-name,
  .ss-uni,
  .ss-pb {
    animation: none;
    opacity: 1;
  }
  #splash,
  #soc-splash {
    transition:
      opacity 0.2s,
      visibility 0s 0.2s;
  }
}
html[data-motion='off'] *,
html[data-motion='off'] *::before,
html[data-motion='off'] *::after {
  animation: none !important;
  transition: none !important;
}
html[data-motion='off'] #splash,
html[data-motion='off'] #soc-splash {
  display: none;
}

/* the file chooser is a button (its real box is hidden), and shows when the keyboard is on it */
.filebtn {
  position: relative;
}
.filebtn:focus-within {
  outline: 2px solid var(--ball);
  outline-offset: 2px;
}
.proof-img {
  display: block;
  max-width: 100%;
  max-height: 360px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

/* the "how to use" tour: a sheet over the page with one card at a time */
.tour {
  padding-top: 22px;
}
.tour-art {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}
.tile.big {
  width: 72px;
  height: 72px;
  border-radius: 24px;
}
.tour-step {
  text-align: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}
.tour .h2 {
  text-align: center;
}
.tour p.p {
  text-align: center;
}
.tour-where {
  color: var(--accent, #ebd13e);
  font-weight: 600;
}
.tour .dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 2px;
}
.tour .dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}
.tour .dots i.on {
  background: var(--ball);
  width: 22px;
  border-radius: 4px;
}
.tour .row {
  justify-content: center;
}
.tour .row .btn {
  flex: 1;
}

/* an organiser's statistics */
.stats-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 96px;
  padding-top: 6px;
}
.bars i {
  flex: 1;
  min-height: 3px;
  border-radius: 4px 4px 0 0;
  background: var(--ball);
  opacity: 0.92;
}

/* the QR code box: sized, and white behind the code so a phone can scan it in dark mode too (the live app left this unstyled, so the code stretched to fill its column) */
.k-follow {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 20px;
  background: var(--soft, rgba(255, 255, 255, 0.08));
}
.k-follow b {
  display: block;
  margin-bottom: 2px;
}
.k-follow p {
  margin: 0;
}
.k-qr {
  flex: 0 0 auto;
  width: clamp(116px, 14vw, 220px);
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  color: #000;
  line-height: 0;
}
.k-qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.fx.void .pair {
  opacity: 0.55;
  text-decoration: line-through;
}

/* the room under the last card for the bar at the bottom (tab bar, or a screen's own bar of buttons): a real spacer at the end of the page, sized from the bar's measured height (main.js sets --end-room).
   Padding at the end of a scrolling flex column is ignored by iPhone Safari, which left the last card stuck under the bar. */
.scroller::after {
  content: '';
  display: block;
  flex: 0 0 auto;
  height: var(--end-room, 130px);
}
/* iPhone Safari gives date and time boxes a width of their own that ignores the box they are in, so they spilled out of their cards and over their neighbours: make them fit */
.input {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
/* Without their native look, iPhone Safari puts the text at the top of a box with a fixed height. So these boxes have no fixed height: equal space above and below the text puts it in the middle however Safari lays the text out. */
input[type='date'],
input[type='time'],
input[type='datetime-local'] {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
  height: auto;
  padding: 14px 16px;
  line-height: 20px;
}
input[type='date']::-webkit-date-and-time-value,
input[type='time']::-webkit-date-and-time-value {
  text-align: left;
  min-width: 0;
  margin: 0;
  line-height: 20px;
}
/* two buttons side by side, sharing the width */
.btnpair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.btnpair .btn {
  width: 100%;
  min-width: 0;
  padding: 0 6px;
  font-size: 13px;
}

/* the match detail sheet: a read-only score board, the league points each pair got, and what has happened to the match */
.sb.ro .num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-weight: 800;
  font-size: 22px;
}
.sb.ro .nm.win,
.sb.ro .num.win {
  color: var(--ball);
}
.pts2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pts2 > div {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
}
.pts2 small {
  display: block;
  opacity: 0.7;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.pts2 b {
  font-size: 15px;
}
.dtl {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dtl li {
  position: relative;
  padding-left: 18px;
}
.dtl li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ball);
}

/* the "you're offline" notice: a thin strip over the top of the screen, never in the way of the page */
#offline {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  padding: calc(6px + env(safe-area-inset-top)) 16px 6px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
#offline[hidden] {
  display: none;
}

/* match chat */
.chat {
  padding: 4px 0 8px;
}
.dayhead {
  align-self: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--faint);
  margin: 10px 0 4px;
  text-align: center;
}
.mrow {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  max-width: 86%;
  margin-top: 2px;
}
.mrow.first {
  margin-top: 10px;
}
.mrow.mine {
  align-self: flex-end;
  align-items: flex-end;
}
.mrow .who {
  font-size: 12px;
  font-weight: 700;
  color: var(--mute);
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 0 6px;
}
.mrow .bub {
  padding: 9px 12px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mrow.mine .bub {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .mrow.mine .bub {
    color: #0b1d3f;
  }
}
:root[data-theme='dark'] .mrow.mine .bub {
  color: #0b1d3f;
}
:root[data-theme='light'] .mrow.mine .bub {
  color: #fff;
}
.mrow .bub .mt {
  display: block;
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
  text-align: right;
}
.mrow .mtools {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  padding: 0 2px;
}
.mrow .mtools .btn {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
  opacity: 0.8;
}
.composer .btn {
  height: 48px; /* the same height as the message box beside it */
  padding: 0 20px;
  flex: none;
}
.composer textarea.input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  max-height: 120px;
  padding: 11px 16px;
  line-height: 1.35;
  resize: none;
}
.quote {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--chip);
  font-size: 15px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.legal {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 2px 0 14px;
  font-size: 13px;
}
.legal a {
  color: inherit;
  opacity: 0.7;
  text-decoration: underline;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

/* the "Get ready" checklist */
.gr-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gr-card .progress {
  height: 10px;
  border-radius: 5px;
}
.gr-card .progress > i {
  border-radius: 5px;
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gr-list {
  gap: 2px;
}
.gr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  min-height: 44px;
  background: none;
  border: 0;
  color: inherit;
  text-align: left;
  font: inherit;
  text-decoration: none;
  width: 100%;
}
.gr-row.go {
  cursor: pointer;
}
.gr-mark {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--hair);
  display: grid;
  place-items: center;
  color: var(--ink);
}
.gr-mark.on {
  background: var(--ball);
  border-color: var(--ball);
  color: #0b1d3f;
}
.gr-t.done {
  opacity: 0.7;
}
.gr-skip {
  align-self: flex-start;
  margin: -4px 0 6px 40px;
  padding: 8px 4px;
  min-height: 36px;
  background: none;
  border: 0;
  color: inherit;
  opacity: 0.75;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* one-time tips */
.tip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 20px;
  background: var(--chip);
  border: 1px solid var(--hair);
}
.tip.tight {
  padding: 10px 12px;
  border-radius: 16px;
}
.tip-ic {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ball);
  color: #0b1d3f;
}
.tip-t {
  font-size: 15px;
  font-weight: 700;
}
.tip .p {
  margin: 2px 0 0;
}
.tip-x {
  flex: none;
  min-height: 44px;
  padding: 0 6px;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* no scroll bar on a touch screen: it sits over the right edge, gets in the way of swipes and makes the app look like a web page */
@media (pointer: coarse) {
  * {
    scrollbar-width: none;
  }
  *::-webkit-scrollbar {
    display: none;
  }
}

/* the part under the email box changes as you type: keep room for it so the page below does not move */
.join-status {
  min-height: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.join-status > .hint {
  margin: 0;
}
