:root {
  color-scheme: light;
  --paper: #f7f7f3;
  --ink: #11120f;
  --muted: #73746d;
  --line: #d9d9d2;
  --court: #d8e3d3;
  --court-dark: #b9c9b2;
  --serif: Didot, "Bodoni 72", "Bodoni MT", "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

#app {
  height: 100dvh;
  overflow: hidden;
}

.screen {
  position: relative;
  width: min(100%, 560px);
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen.enter {
  animation: arrive 420ms cubic-bezier(.22, .9, .3, 1) both;
}

.language-picker {
  position: absolute;
  z-index: 30;
  top: max(22px, env(safe-area-inset-top));
  right: 22px;
  height: 36px;
  display: block;
}

.language-picker select {
  width: 96px;
  height: 36px;
  padding: 0 28px 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: 0;
  appearance: none;
  background: rgb(247 247 243 / 94%);
  color: var(--ink);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.language-picker span {
  position: absolute;
  top: 8px;
  right: 10px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1;
  pointer-events: none;
}

.screen.reverse.enter {
  animation-name: return;
}

@keyframes arrive {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes return {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

.eyebrow,
.micro,
.field-label,
.tag,
.score-caption {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.brand {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 11vw, 60px);
  font-weight: 400;
  letter-spacing: -.055em;
  line-height: .9;
}

.brand-mark {
  position: relative;
  display: inline-block;
  width: 15px;
  height: 15px;
  margin: 0 0 6px 6px;
  overflow: hidden;
  border: 1px solid #aab642;
  border-radius: 50%;
  background: #dce966;
  box-shadow: inset -3px -3px 5px rgb(86 98 22 / 20%), inset 2px 2px 3px rgb(255 255 255 / 55%);
  transform: rotate(-20deg);
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 17px;
  top: -3px;
  left: -7px;
  border: 1.4px solid rgb(255 255 239 / 90%);
  border-radius: 50%;
}

.display-title {
  margin: 10px 0 0;
  max-width: 430px;
  font-family: var(--serif);
  font-size: clamp(42px, 12vw, 68px);
  font-weight: 400;
  letter-spacing: -.055em;
  line-height: .94;
}

.display-title.small {
  font-size: clamp(36px, 10vw, 56px);
}

.muted {
  color: var(--muted);
}

.login {
  justify-content: center;
  gap: 42px;
}

.login-copy {
  display: grid;
  gap: 14px;
}

.login-copy p {
  max-width: 260px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.stack {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field input {
  width: 100%;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  appearance: none;
}

.field input::placeholder {
  color: #a5a69f;
}

.primary,
.choice,
.ghost,
.icon-button,
.text-button,
.match-card,
.profile,
.court-slot,
.point-button {
  border: 0;
  cursor: pointer;
}

.primary {
  width: 100%;
  min-height: 58px;
  padding: 16px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  transition: transform 160ms ease, opacity 160ms ease;
}

.primary:active,
.point-button:active {
  transform: scale(.975);
}

.primary:disabled,
.point-button:disabled {
  cursor: default;
  opacity: .28;
}

.ghost {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.text-button {
  padding: 8px 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.topbar {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mini-brand {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -.04em;
}

.mini-brand .brand-mark {
  width: 11px;
  height: 11px;
  margin: 0 0 3px 4px;
}

.icon-button {
  min-width: 40px;
  min-height: 40px;
  padding: 0 4px;
  background: transparent;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.home-head {
  margin: 8vh 0 40px;
}

.home-head .eyebrow {
  margin-bottom: 10px;
}

.new-game {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-radius: 2px;
}

.new-game span:last-child {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
}

.home.has-matches .home-head {
  margin: clamp(24px, 5vh, 42px) 0 22px;
}

.home.has-matches .display-title {
  font-size: clamp(40px, 10.5vw, 58px);
}

.home.has-matches .new-game {
  min-height: 76px;
}

.match-overview {
  min-height: 0;
  margin-top: 24px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.match-section-head {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.match-section .list-label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.match-section .list-label i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.match-section.finished .list-label i {
  border: 1px solid var(--muted);
  background: transparent;
}

.match-section .list-label span {
  color: var(--ink);
}

.match-pager {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .1em;
}

.match-pager button {
  width: 26px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.match-pager button:disabled {
  color: var(--line);
  cursor: default;
}

.match-section-cards {
  border-top: 1px solid var(--line);
}

.match-card {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.match-card-main {
  min-width: 0;
  min-height: 58px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.match-card strong {
  display: block;
  margin-bottom: 3px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-card-copy > span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.match-status {
  padding: 3px 6px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-style: normal;
  line-height: 1;
}

.match-status.active {
  background: var(--ink);
  color: white;
}

.match-status.paused {
  border-color: #8b342e;
  color: #8b342e;
}

.match-status.finished {
  border-color: var(--line);
  color: var(--muted);
}

.match-card .arrow {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
}

.match-card.finished .match-card-main {
  opacity: .72;
}

.match-delete {
  width: 38px;
  height: 38px;
  margin-left: 8px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: #8b342e;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1;
}

.home-foot {
  margin-top: auto;
  padding-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home.has-matches .home-foot {
  padding-top: 18px;
}

.home-foot-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-family: var(--serif);
  font-size: 14px;
  text-transform: uppercase;
  overflow: hidden;
}

.avatar-image {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.step-head {
  margin: 8vh 0 42px;
}

.step-head.compact {
  margin-bottom: clamp(28px, 6vh, 52px);
}

.choices {
  display: grid;
  gap: 12px;
}

.choice {
  min-height: 142px;
  padding: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  text-align: left;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.choice:active {
  transform: scale(.985);
}

.choice:hover {
  border-color: var(--ink);
}

.choice strong {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -.04em;
}

.choice .choice-icon {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.lobby-head {
  margin: clamp(10px, 2.5vh, 22px) 0 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.lobby-head .display-title {
  margin: 0;
}

.tag {
  padding-bottom: 5px;
  color: var(--muted);
  white-space: nowrap;
}

.court-wrap {
  margin: 4px auto 10px;
  width: clamp(190px, calc((100dvh - 330px) * .75), 330px);
  max-width: 100%;
}

.court {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background-color: var(--court);
  background-image: linear-gradient(90deg, rgb(255 255 255 / 6%) 50%, transparent 50%);
  background-size: 10px 100%;
}

.court::before,
.court::after {
  display: none;
}

.service-line {
  position: absolute;
  z-index: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: color-mix(in srgb, var(--ink) 42%, transparent);
}

.service-line.top { top: 35%; }
.service-line.bottom { bottom: 35%; }

.center-service {
  position: absolute;
  z-index: 0;
  left: 50%;
  width: 1px;
  height: 15%;
  background: color-mix(in srgb, var(--ink) 42%, transparent);
}

.center-service.top { top: 35%; }
.center-service.bottom { bottom: 35%; }

.glass-wall {
  position: absolute;
  z-index: 0;
  left: 0;
  width: 100%;
  height: 8%;
  border-color: rgb(17 18 15 / 20%);
  background: repeating-linear-gradient(90deg, rgb(255 255 255 / 22%) 0 1px, transparent 1px 36px);
}

.glass-wall.top { top: 0; border-bottom: 1px solid; }
.glass-wall.bottom { bottom: 0; border-top: 1px solid; }

.court-net {
  position: absolute;
  z-index: 2;
  top: calc(50% - 5px);
  left: -2px;
  width: calc(100% + 4px);
  height: 10px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid rgb(17 18 15 / 60%);
  background:
    repeating-linear-gradient(45deg, transparent 0 3px, rgb(17 18 15 / 45%) 3px 4px),
    repeating-linear-gradient(-45deg, transparent 0 3px, rgb(17 18 15 / 35%) 3px 4px);
  box-shadow: 0 2px 3px rgb(17 18 15 / 15%);
}

.court-net::before,
.court-net::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--ink);
}

.court-net::before { left: 0; }
.court-net::after { right: 0; }

.court-team {
  position: absolute;
  z-index: 1;
  left: 0;
  width: 100%;
  height: 35%;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
}

.court-team.a { bottom: 0; }
.court-team.b { top: 0; }

.court-side-label {
  position: absolute;
  left: 10px;
  color: color-mix(in srgb, var(--ink) 52%, transparent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.court-team.a .court-side-label { bottom: 8px; }
.court-team.b .court-side-label { top: 8px; }

.court-slot,
.profile {
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.court-slot {
  position: relative;
  width: clamp(48px, 15vw, 62px);
  height: clamp(48px, 15vw, 62px);
  border: 1px dashed color-mix(in srgb, var(--ink) 38%, transparent);
  background: color-mix(in srgb, white 24%, transparent);
}

.court-slot.filled {
  border-style: solid;
  border-color: var(--ink);
  background: var(--paper);
}

.court-slot.selected {
  box-shadow: 0 0 0 4px var(--paper), 0 0 0 6px var(--ink);
}

.court-slot .initials,
.profile .initials {
  font-family: var(--serif);
  font-size: 18px;
  text-transform: uppercase;
}

.court-slot small {
  position: absolute;
  max-width: 84px;
  margin-top: 74px;
  overflow: hidden;
  color: var(--ink);
  font-size: 9px;
  font-weight: 750;
  text-overflow: ellipsis;
  text-transform: capitalize;
  white-space: nowrap;
}

.player-pool {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.profile {
  width: 42px;
  height: 42px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.profile.selected {
  background: var(--ink);
  color: white;
}

.lobby-hint {
  min-height: 20px;
  margin: 5px 0 8px;
  color: var(--muted);
  text-align: center;
}

.lobby-actions {
  margin-top: auto;
  display: grid;
  gap: 4px;
}

.solo-option {
  min-height: 32px;
  padding: 3px 0;
}

.wait {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
}

.wait-orbit {
  width: 86px;
  height: 86px;
  margin: 0 auto 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  position: relative;
}

.wait-orbit::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 38px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  transform-origin: 5px 47px;
  animation: orbit 2s linear infinite;
}

@keyframes orbit { to { transform: rotate(360deg); } }

.ready-teams {
  margin: 38px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.ready-team strong {
  display: block;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  text-transform: capitalize;
}

.versus {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
}

.rule-note {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-align: center;
  text-transform: uppercase;
}

.game {
  padding-left: 18px;
  padding-right: 18px;
}

.game-top {
  position: relative;
  display: block;
  padding-left: 48px;
  padding-right: 104px;
}

.game-menu-button {
  position: absolute;
  top: 0;
  left: 0;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: -.08em;
}

.score-history {
  min-width: 0;
}

.score-history-line {
  margin-top: 6px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sound-button {
  min-width: 44px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}

.sound-button.off {
  color: var(--muted);
  text-decoration: line-through;
}

.live-board {
  margin: clamp(22px, 5vh, 44px) 0 12px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
}

.live-team {
  min-width: 0;
  text-align: center;
}

.live-team .team-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.live-team.local .team-name {
  color: var(--ink);
}

.live-team .live-point {
  display: block;
  margin-top: 2px;
  font-family: var(--serif);
  font-size: clamp(52px, 17vw, 86px);
  font-weight: 400;
  letter-spacing: -.05em;
  line-height: 1;
}

.score-dash {
  color: var(--line);
  font-family: var(--serif);
  font-size: 28px;
}

.game-rule {
  min-height: 16px;
  color: var(--muted);
  text-align: center;
}

.game-meta {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.point-zone {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}

.point-button {
  width: min(76vw, 41dvh, 360px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  box-shadow: 0 18px 50px rgb(17 18 15 / 16%);
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
  touch-action: manipulation;
}

.point-button span {
  font-size: clamp(13px, 4vw, 18px);
  font-weight: 850;
  letter-spacing: .3em;
  text-indent: .3em;
  text-transform: uppercase;
}

.point-button.loading {
  transform: scale(.94);
  opacity: .72;
}

.manual-point-zone {
  flex: 1;
  min-height: 0;
  padding: 16px 0 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.manual-point-button {
  min-width: 0;
  border: 1px solid var(--ink);
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease;
}

.manual-point-button:active {
  transform: scale(.975);
}

.manual-point-button.own {
  background: var(--ink);
  color: white;
}

.manual-point-button.other {
  background: var(--court);
  color: var(--ink);
}

.manual-point-button small {
  max-width: 90%;
  overflow: hidden;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.manual-point-button span {
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.manual-point-button:disabled {
  opacity: .55;
}

.undo-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.undo {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.undo:disabled,
.game.paused .point-zone,
.game.paused .manual-point-zone {
  opacity: .32;
}

.undo:disabled {
  cursor: default;
}

.game-layer {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

.game-layer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgb(17 18 15 / 42%);
  backdrop-filter: blur(7px);
  animation: layer-in 180ms ease both;
}

.game-menu-sheet,
.game-confirm {
  position: relative;
  z-index: 1;
  width: min(100%, 536px);
  border: 1px solid rgb(17 18 15 / 12%);
  background: var(--paper);
  box-shadow: 0 24px 80px rgb(17 18 15 / 24%);
  animation: sheet-in 260ms cubic-bezier(.22, .9, .3, 1) both;
}

.game-menu-sheet {
  max-height: calc(100dvh - 24px);
  padding: 20px 20px max(16px, env(safe-area-inset-bottom));
  border-radius: 30px;
  overflow: hidden;
}

.game-menu-sheet > header {
  min-height: 50px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.game-menu-sheet h2 {
  max-width: 410px;
  margin: 5px 0 0;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-menu-sheet h2 i,
.final-teams i {
  color: var(--muted);
  font-size: .7em;
  font-weight: 400;
}

.sheet-close {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1;
}

.game-menu-list {
  margin-top: 6px;
}

.game-menu-row {
  width: 100%;
  min-height: 50px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
  text-align: left;
}

.game-menu-row b {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.game-menu-row.destructive {
  color: #8b342e;
}

.game-menu-divider {
  height: 9px;
  border-bottom: 1px solid var(--ink);
}

.menu-switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  transition: background 180ms ease, border-color 180ms ease;
}

.menu-switch i {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 180ms cubic-bezier(.22, .9, .3, 1), background 180ms ease;
}

.menu-switch.on {
  border-color: var(--ink);
  background: var(--ink);
}

.menu-switch.on i {
  background: white;
  transform: translateX(16px);
}

.confirm-layer {
  align-items: center;
}

.game-confirm {
  padding: 28px;
  border-radius: 28px;
  text-align: left;
}

.game-confirm h2 {
  margin: 12px 0 10px;
  font-family: var(--serif);
  font-size: clamp(30px, 9vw, 42px);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: .98;
}

.game-confirm p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.game-confirm-actions {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.game-confirm-actions .primary,
.game-confirm-actions .secondary {
  min-height: 52px;
  padding: 12px;
}

.secondary {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.primary.danger {
  background: #8b342e;
}

@keyframes layer-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(24px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.game.score-view .score-history-line {
  font-size: clamp(22px, 2.2vw, 32px);
}

.game.score-view {
  width: 100%;
  max-width: none;
  padding-left: clamp(18px, 3vw, 56px);
  padding-right: clamp(18px, 3vw, 56px);
}

.game.score-view .live-board {
  flex: 1;
  width: 100%;
  min-height: 0;
  margin: 8px 0 4px;
  gap: clamp(12px, 2.5vw, 44px);
}

.game.score-view .live-team .team-name {
  font-size: clamp(12px, 1.7vw, 24px);
}

.game.score-view .live-team .live-point {
  font-size: clamp(128px, min(44vw, 58vh), 620px);
  letter-spacing: -.075em;
  line-height: .86;
  font-variant-numeric: tabular-nums;
}

.game.score-view .score-dash {
  font-size: clamp(38px, 6vw, 96px);
}

.game.score-view .game-meta {
  margin-bottom: 4px;
}

.finished {
  justify-content: center;
  text-align: center;
}

.winner-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--court);
  font-family: var(--serif);
  font-size: 30px;
}

.winner-mark.ended {
  background: transparent;
  border: 1px solid var(--line);
  font-size: 19px;
}

.final-score {
  margin: 28px 0 38px;
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: .04em;
}

.final-teams {
  line-height: 1.05;
}

.final-points {
  margin: -24px 0 34px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 18px;
}

.admin-list {
  margin: 36px 0;
  border-top: 1px solid var(--line);
}

.manual-screen .step-head.compact {
  margin: clamp(8px, 2vh, 18px) 0 clamp(8px, 2vh, 16px);
}

.manual-form {
  flex: 1;
  min-height: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
}

.manual-court-wrap {
  width: clamp(210px, calc((100dvh - 335px) * .75), 340px);
  margin: 0 auto;
}

.manual-court .court-team {
  padding: 18px 8px;
  gap: 7px;
}

.manual-court-player {
  width: min(46%, 132px);
  min-width: 0;
  padding: 7px 8px 8px;
  display: grid;
  gap: 3px;
  border: 1px solid rgb(17 18 15 / 32%);
  border-radius: 11px;
  background: rgb(247 247 243 / 94%);
  box-shadow: 0 5px 16px rgb(17 18 15 / 10%);
}

.manual-court-player.a {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.manual-court-player > span {
  overflow: hidden;
  font-size: 7px;
  font-weight: 850;
  letter-spacing: .12em;
  opacity: .58;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.manual-court-player input {
  width: 100%;
  min-width: 0;
  padding: 1px 0 3px;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font-family: var(--serif);
  font-size: clamp(14px, 4.2vw, 18px);
  line-height: 1.1;
  text-align: center;
}

.manual-court-player input::placeholder {
  color: currentColor;
  opacity: .45;
}

.manual-court-player input:focus-visible {
  outline: 0;
  border-bottom-width: 2px;
}

.manual-court-hint {
  max-width: 330px;
  margin: 2px auto 4px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
  text-align: center;
}

.settings-head {
  margin: clamp(18px, 5vh, 48px) 0 clamp(18px, 4vh, 38px);
  display: flex;
  align-items: center;
  gap: 22px;
}

.settings-avatar {
  position: relative;
  flex: 0 0 auto;
  width: clamp(78px, 23vw, 108px);
  height: clamp(78px, 23vw, 108px);
  padding: 0;
  overflow: visible;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--court);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 28px;
}

.settings-avatar .avatar-image {
  overflow: hidden;
}

.avatar-edit {
  position: absolute;
  right: -2px;
  bottom: 2px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-family: var(--sans);
  font-size: 17px;
}

.settings-form {
  flex: 1;
  align-content: start;
}

.profile-tool {
  width: 100%;
  min-height: 58px;
  margin-bottom: 22px;
  padding: 0 4px;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  text-align: left;
}

.profile-tool strong,
.profile-tool small {
  display: block;
}

.profile-tool strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
}

.profile-tool small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.watch-head {
  margin: clamp(28px, 7vh, 64px) 0 24px;
}

.watch-head .display-title {
  margin-top: 8px;
}

.watch-head p {
  max-width: 310px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.watch-head.setup {
  margin-bottom: 16px;
}

.watch-head.setup p {
  margin-top: 10px;
  font-size: 10px;
  line-height: 1.4;
}

.watch-status {
  margin-top: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.watch-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}

.watch-status.connected i {
  background: #72906b;
  box-shadow: 0 0 0 5px rgb(114 144 107 / 12%);
}

.watch-actions {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.shortcut-list {
  display: grid;
  gap: 10px;
}

.shortcut-card {
  min-width: 0;
  padding: 10px 12px 11px;
  border: 1px solid var(--ink);
  border-radius: 20px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.shortcut-card:first-child {
  background: var(--ink);
  color: white;
}

.shortcut-card-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.shortcut-card strong {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
}

.shortcut-card-head a {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  color: inherit;
  text-decoration: none;
}

.shortcut-card-head small {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .12em;
  opacity: .65;
  text-transform: uppercase;
}

.shortcut-card-head a span {
  font-size: 15px;
}

.shortcut-url-row {
  min-width: 0;
  height: 30px;
  margin-top: 7px;
  padding-left: 10px;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  border-radius: 999px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.shortcut-url-row input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8px;
  outline: none;
}

.shortcut-url-row button {
  align-self: stretch;
  flex: 0 0 auto;
  padding: 0 11px;
  border: 0;
  border-left: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  background: transparent;
  color: inherit;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.shortcut-card:first-child .shortcut-url-row input {
  color: white;
}

.watch-details-hint {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 13px;
  background: var(--court);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .08em;
  line-height: 1.45;
  text-align: center;
}

.watch-note {
  margin-top: 9px;
  text-align: center;
}

.admin-row {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  text-transform: capitalize;
}

.admin-pager {
  margin: -20px 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

#toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  max-width: calc(100vw - 32px);
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
  white-space: nowrap;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (orientation: portrait) and (max-height: 700px) {
  .home.has-matches .home-head {
    margin: 14px 0;
  }

  .home.has-matches .display-title {
    font-size: 42px;
  }

  .home.has-matches .new-game {
    min-height: 62px;
  }

  .home.has-matches .match-overview {
    margin-top: 12px;
    gap: 8px;
  }

  .home.has-matches .match-section-head {
    min-height: 20px;
  }

  .home.has-matches .match-card,
  .home.has-matches .match-card-main {
    min-height: 50px;
  }

  .home.has-matches .match-card strong {
    font-size: 17px;
  }

  .home.has-matches .home-foot {
    padding-top: 10px;
  }
}

@media (orientation: landscape) and (max-height: 620px) {
  .home.has-matches {
    display: grid;
    grid-template-columns: minmax(180px, .82fr) minmax(250px, 1.18fr);
    grid-template-rows: 40px minmax(0, 1fr) 56px 34px;
    column-gap: 20px;
  }

  .home.has-matches .topbar {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .home.has-matches .home-head {
    grid-column: 1;
    grid-row: 2;
    margin: 16px 0 8px;
  }

  .home.has-matches .display-title {
    font-size: 42px;
  }

  .home.has-matches .new-game {
    grid-column: 1;
    grid-row: 3;
    min-height: 52px;
  }

  .home.has-matches .match-overview {
    grid-column: 2;
    grid-row: 2 / 4;
    margin-top: 6px;
    gap: 5px;
  }

  .home.has-matches .match-section-head {
    min-height: 17px;
  }

  .home.has-matches .match-card,
  .home.has-matches .match-card-main {
    min-height: 42px;
  }

  .home.has-matches .match-card-main {
    padding: 4px 0;
  }

  .home.has-matches .match-card strong {
    font-size: 16px;
  }

  .home.has-matches .match-delete {
    width: 32px;
    height: 32px;
  }

  .home.has-matches .home-foot {
    grid-column: 1 / -1;
    grid-row: 4;
    margin: 0;
    padding: 0;
  }

  .game {
    display: grid;
    grid-template-columns: minmax(210px, 38%) 1fr;
    grid-template-rows: auto 1fr auto;
    column-gap: 24px;
  }

  .game-top,
  .live-board,
  .game-meta {
    grid-column: 1;
  }

  .game-top {
    padding-left: 48px;
    padding-right: 0;
    padding-top: 42px;
  }

  .game-menu-button {
    top: 42px;
  }

  .live-board {
    margin-top: 18px;
  }

  .point-zone,
  .manual-point-zone {
    grid-column: 2;
    grid-row: 1 / 4;
    min-height: 0;
  }

  .point-button {
    width: min(70vh, 360px);
  }

  .undo-row {
    grid-column: 1;
  }

  .game.score-view {
    display: flex;
  }

  .game.score-view .game-top {
    padding-top: 0;
    padding-right: 104px;
  }

  .game.score-view .game-menu-button {
    top: 0;
  }

  .game-menu-sheet {
    padding-top: 14px;
    padding-bottom: 10px;
  }

  .game-menu-sheet > header {
    min-height: 42px;
  }

  .game-menu-row {
    min-height: 42px;
  }

  .game-confirm {
    max-width: 520px;
    padding: 22px;
  }

  .game.score-view .live-board {
    margin: 4px 0 2px;
  }

  .game.score-view .live-team .live-point {
    font-size: clamp(120px, min(38vw, 58vh), 300px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
