/* SUWE: phone layout first, a roomier layout from 768px, the web layout from 1024px.
   All colours come from theme.css. Rounded corners are only for buttons, chips, pills, cards and avatars. */
@font-face {
  font-family: "Baloo 2";
  src: url("../fonts/baloo2-latin.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
}
* {
  box-sizing: border-box;
}
button {
  font-family: var(--text);
  cursor: pointer;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--text);
  font-weight: 600;
  line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
}
kbd {
  display: none;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.28);
  font: 800 13px var(--text);
}
.soft {
  color: var(--soft);
}
.kicker {
  color: var(--soft);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ico {
  display: inline-flex;
  flex: none;
  vertical-align: middle;
}

/* ---- backdrop: the 3D scene, and on the home screen a sun and a hill ---- */
#stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
}
body:not([data-mode="play"]) #stage {
  pointer-events: none;
}
#art {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: none;
  overflow: hidden;
}
body[data-mode="menu"] #art {
  display: block;
}
#art .sun {
  position: absolute;
  top: 7vh;
  right: -24vw;
  width: min(86vw, 520px);
  height: min(86vw, 520px);
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, var(--sky));
}
#art .hill {
  position: absolute;
  left: -30%;
  right: -30%;
  top: 36%;
  bottom: -2px;
  border-radius: 50% 50% 0 0 / 70px 70px 0 0;
  background: var(--bg);
}

/* ---- shared pieces ---- */
.card {
  background: var(--white);
  border-radius: 26px;
}
.round-btn {
  display: inline-flex;
  width: 56px;
  height: 56px;
  flex: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
}
.round-btn:active {
  transform: scale(0.95);
}
.big {
  display: inline-flex;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 40px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: var(--accent-ink);
  font: 700 30px var(--display);
  text-decoration: none;
  box-shadow: 0 6px 0 var(--shade);
}
.big.go::after {
  content: "";
  border-left: 14px solid currentColor;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}
.big.small {
  min-height: 48px;
  padding: 6px 22px;
  font: 800 19px var(--text);
  box-shadow: 0 4px 0 var(--shade);
}
.big:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--shade);
}
.big:disabled {
  opacity: 0.6;
  cursor: default;
}
.link {
  border: 0;
  background: none;
  color: var(--ink);
  font: 800 16px var(--text);
}
.ghost-btn,
.outline-btn {
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 800 20px var(--text);
}
.ghost-btn {
  padding: 8px 24px;
}
.outline-btn {
  display: inline-flex;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 20px;
  white-space: nowrap;
}
.new {
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.countdown {
  width: 120px;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}
.countdown i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 99px;
  background: var(--primary);
}

/* switches (pause menu and settings) */
.toggles {
  display: flex;
  flex-direction: column;
}
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  color: var(--ink);
  text-align: left;
}
.toggle:first-child {
  border-top: 0;
}
.toggle b {
  display: block;
  font-size: 22px;
  font-weight: 800;
}
.toggle small {
  display: block;
  margin-top: 2px;
  color: var(--soft);
  font-size: 15px;
  font-weight: 600;
}
.toggle .ico {
  display: none;
}
.switch {
  position: relative;
  width: 64px;
  height: 38px;
  flex: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--soft) 22%, var(--sky));
  transition: background 0.18s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(59, 29, 18, 0.25);
  transition: transform 0.18s;
}
.toggle[aria-checked="true"] .switch {
  background: var(--accent);
}
.toggle[aria-checked="true"] .switch::after {
  transform: translateX(26px);
}

/* ---- the wordmark: big letters with a stacked edge ---- */
.wide-only {
  display: none;
}
.wordmark {
  font: 800 clamp(96px, 30vw, 150px) / 0.95 var(--display);
  letter-spacing: 0.04em;
  color: var(--primary);
  text-shadow: 0 6px 0 var(--shade);
}

/* ---- who is playing: home only ---- */
.profile {
  position: fixed;
  z-index: 6;
  top: max(16px, env(safe-area-inset-top));
  left: 16px;
  display: none;
  max-width: calc(100vw - 96px);
  align-items: center;
  gap: 10px;
  padding: 5px 20px 5px 5px;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
}
.settings-btn .btn-text {
  display: none;
}
.settings-btn {
  position: fixed;
  z-index: 6;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  display: none;
  width: 52px;
  height: 52px;
}
body[data-mode="menu"] .profile {
  display: flex;
}
body[data-mode="menu"] .settings-btn {
  display: inline-flex;
}
.avatar {
  display: flex;
  width: 52px;
  height: 52px;
  flex: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar b {
  font-size: 17px;
}
.who {
  min-width: 0;
}
.who b {
  display: block;
  overflow: hidden;
  font: 700 21px var(--display);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who span {
  display: block;
  color: var(--soft);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
.who span:empty {
  display: none;
}
.lives-line {
  display: flex !important;
  align-items: center;
  gap: 5px;
}
.lives-line .ico {
  color: var(--danger);
}
.profile .signin {
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

/* ---- screens ---- */
.screen {
  position: fixed;
  z-index: 3;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(18px, env(safe-area-inset-top)) 20px 28px;
  overflow-y: auto;
  background: var(--sky);
  color: var(--ink);
}
.screen > * {
  position: relative;
  z-index: 1;
}
.screen[hidden] {
  display: none;
}
.screen-head {
  display: flex;
  width: 100%;
  max-width: 1180px;
  align-items: center;
  gap: 16px;
  padding-bottom: 22px;
}
.setup-title {
  font-size: 36px;
  line-height: 1;
  white-space: nowrap;
}
.setup-sub {
  margin-top: 2px;
  color: var(--soft);
  font-size: 18px;
  font-weight: 700;
}
.setup-back {
  position: absolute !important;
  top: max(18px, env(safe-area-inset-top));
  left: 20px;
  z-index: 5;
  display: flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: transparent;
  font-size: 0;
}
.setup-back::before {
  content: "";
  width: 12px;
  height: 12px;
  margin-left: 5px;
  border-left: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  border-radius: 2px;
  transform: rotate(45deg);
}

/* ---- home ---- */
#menu {
  z-index: 3;
  justify-content: space-between;
  padding: 0;
  overflow: hidden;
  background: none;
  pointer-events: none;
}
.menu-copy {
  width: 100%;
  padding-top: calc(max(16px, env(safe-area-inset-top)) + 84px);
  text-align: center;
}
.tagline {
  margin-top: 18px;
  color: var(--soft);
  font: 700 24px var(--display);
}
.menu-actions {
  display: flex;
  width: 100%;
  max-width: 560px;
  flex-direction: column;
  gap: 12px;
  padding: 0 20px max(26px, env(safe-area-inset-bottom));
  pointer-events: auto;
}
.menu-actions .big {
  width: 100%;
  min-height: 70px;
  font-size: 32px;
}
.saved {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 12px 20px;
}
.saved-text {
  min-width: 0;
  flex: 1;
}
.saved-text .kicker {
  white-space: nowrap;
}
.saved-text b {
  display: block;
  margin-top: 2px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.15;
}
.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tile {
  position: relative;
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: 24px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
}
.tile b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}
.tile small {
  display: none;
  color: var(--soft);
  font-size: 14px;
  font-weight: 700;
}
.tile-ico {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
}
.saved-dots {
  display: none;
  gap: 4px;
}
.saved-dots i {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}
.tile .new {
  position: absolute;
  top: -12px;
  right: 8px;
}

/* ---- in a match: top bar and player chips ---- */
.play-only {
  display: none;
}
body[data-mode="play"] .play-only {
  display: block;
}
#hud {
  position: fixed;
  z-index: 4;
  top: 0;
  left: 0;
  right: 0;
  padding: max(12px, env(safe-area-inset-top)) 12px 12px;
  background: var(--sky);
}
body[data-mode="play"] #hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
#topbar {
  display: flex;
  width: 100%;
  max-width: 640px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
#banner {
  display: flex;
  height: 52px;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--white);
  font: 700 25px var(--display);
  white-space: nowrap;
}
#banner i {
  display: block;
  width: 17px;
  height: 17px;
  flex: none;
  border-radius: 50%;
  background: var(--c, var(--primary));
}
#board {
  display: flex;
  width: 100%;
  max-width: 640px;
  gap: 10px;
}
.pcard {
  display: flex;
  min-width: 0;
  flex: 1 1 0;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 4px;
  border: 3px solid transparent;
  border-radius: 22px;
  background: color-mix(in srgb, var(--white) 55%, transparent);
}
.pcard.now {
  border-color: var(--c);
  background: var(--white);
}
.pcard.out {
  opacity: 0.45;
}
.pcard .face {
  display: flex;
  width: 36px;
  height: 36px;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: var(--c);
}
.pcard .face canvas {
  width: 100%;
  height: 100%;
}
.pinfo {
  min-width: 0;
}
.pname {
  overflow: hidden;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pstats {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--soft);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}
.pstats .ico {
  color: var(--danger);
}
.pcard.many .pstats {
  font-size: 12.5px;
}
.pcard.many .face {
  display: none;
}

/* ---- in a match: the bottom of the screen ---- */
.dock {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  width: max-content;
  max-width: calc(100vw - 28px);
  align-items: center;
  gap: 14px;
  padding: 9px 26px 9px 9px;
  border-radius: 999px;
  transform: translateX(-50%);
}
body[data-mode="play"] .dock.play-only:not([hidden]) {
  display: flex;
}
.dock.dark {
  background: var(--ink);
  color: var(--card);
}
.dock.light {
  background: var(--white);
  color: var(--ink);
}
.dock-ico {
  display: flex;
  width: 56px;
  height: 56px;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}
.dock-ico.red {
  background: var(--danger);
}
.dock-text b {
  display: block;
  font: 700 27px var(--display);
  line-height: 1.05;
}
.dock-text small {
  display: block;
  margin-top: 2px;
  color: color-mix(in srgb, var(--card) 70%, var(--ink));
  font-size: 15px;
  font-weight: 700;
}
.dock.light .dock-text small {
  color: var(--soft);
}
#pill {
  z-index: 8;
}
body.pill #pill {
  display: flex;
}
#watchbar {
  width: calc(100vw - 28px);
  max-width: 640px;
  gap: 10px;
  padding: 8px 10px 8px 20px;
}
#watchbar b {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font: 800 18px var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
#watchbar .ghost-btn {
  flex: none;
  padding: 7px 14px;
  border-width: 2px;
  font-size: 16px;
  white-space: nowrap;
}
#watchbar .big.small {
  flex: none;
  min-height: 42px;
  padding: 4px 18px;
  font-size: 16px;
}
#watchbar .ghost-btn.on {
  background: var(--ink);
  color: var(--card);
}
#meterwrap {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + 84px);
  width: min(86vw, 380px);
  transform: translateX(-50%);
}
#meter {
  position: relative;
  height: 24px;
  overflow: hidden;
  border: 4px solid var(--white);
  border-radius: 14px;
  background: var(--danger);
}
#meter.locked {
  opacity: 0.45;
}
#zone {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  transform: translateX(-50%);
  background: var(--accent);
}
#needle {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 50%;
  width: 6px;
  margin-left: -3px;
  border-radius: 3px;
  background: var(--ink);
}
#pickup {
  width: 100%;
  margin-top: 10px;
}
#turncard {
  position: fixed;
  z-index: 6;
  left: 50%;
  top: 36%;
  display: flex;
  width: min(86vw, 520px);
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 30px 24px;
  border-radius: 32px;
  background: var(--white);
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 18px 50px rgba(59, 29, 18, 0.22);
}
#turncard .kicker {
  color: var(--primary);
  font-size: 15px;
}
#turncard h2 {
  font-size: 42px;
  line-height: 1;
}
#turncard p {
  color: var(--soft);
  font-size: 20px;
  font-weight: 700;
}
#turncard .countdown {
  margin-top: 8px;
}
#toast {
  display: none;
}

/* ---- pause: a sheet on the phone ---- */
#pause-scrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(59, 29, 18, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
#pause-menu {
  position: fixed;
  z-index: 21;
  left: 50%;
  bottom: 0;
  display: flex;
  width: 100%;
  max-width: 640px;
  max-height: 94vh;
  flex-direction: column;
  gap: 16px;
  padding: 12px 20px max(26px, env(safe-area-inset-bottom));
  overflow-y: auto;
  border-radius: 40px 40px 0 0;
  background: var(--card);
  color: var(--ink);
  transform: translate(-50%, 105%);
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0.3s;
}
#pause-menu .grab {
  align-self: center;
  width: 56px;
  height: 6px;
  border-radius: 99px;
  background: var(--line);
}
#pause-menu .close-x {
  display: none;
}
.pause-head h2 {
  font-size: 46px;
  line-height: 1;
}
.pause-head .soft {
  margin-top: 4px;
  font-size: 19px;
  font-weight: 700;
}
#pause-menu .big {
  width: 100%;
  min-height: 64px;
  font-size: 27px;
}
.pause-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
body.paused #pause-scrim {
  opacity: 1;
  pointer-events: auto;
}
body.paused #pause-menu {
  transform: translate(-50%, 0);
  visibility: visible;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
}
body:not([data-mode="play"]) #pause-menu,
body:not([data-mode="play"]) #pause-scrim {
  display: none;
}

/* ---- who's playing ---- */
#setup {
  align-items: center;
  padding-bottom: 170px;
}
#setup .setup-head,
.setup-head {
  display: flex;
  width: 100%;
  max-width: 1180px;
  align-items: center;
  gap: 16px;
  padding: 0 0 18px 72px;
  min-height: 56px;
}
.setup-head .setup-title {
  font-size: 36px;
}
.setup-label {
  width: 100%;
  max-width: 1180px;
  margin: 10px 0 10px;
  color: var(--soft);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.tabs {
  display: flex;
  width: 100%;
  max-width: 1180px;
  gap: 8px;
}
.chip {
  flex: 1;
  min-height: 48px;
  padding: 8px 6px;
  border: 0;
  border-radius: 16px;
  background: var(--white);
  color: var(--ink);
  font: 800 16px var(--text);
  white-space: nowrap;
}
.chip.on {
  background: var(--ink);
  color: var(--card);
}
.seats {
  display: flex;
  width: 100%;
  max-width: 1180px;
  flex-direction: column;
  margin-top: 22px;
}
.seat {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.seat:first-child {
  border-top: 0;
}
.seat-head {
  width: 72px;
  height: 88px;
  flex: none;
  overflow: hidden;
  border-radius: 20px;
  background: color-mix(in srgb, var(--c) 18%, var(--sky));
}
.seat-face {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  object-fit: cover;
  object-position: 50% 78%;
  transform: scale(1.18);
  transform-origin: 50% 70%;
}
.seat-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.seat-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
}
.cname {
  min-width: 0;
  overflow: hidden;
  font: 700 23px var(--display);
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seat .tag {
  margin-left: 6px;
  color: var(--accent);
  font: 800 17px var(--text);
  letter-spacing: 1px;
}
.you {
  color: var(--soft);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.name {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 3px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  color: var(--ink);
  font: 800 21px var(--text);
}
.name::placeholder {
  color: color-mix(in srgb, var(--soft) 55%, var(--white));
}
.name:focus {
  border-color: var(--soft);
  outline: none;
}
.seg {
  display: flex;
  gap: 4px;
}
.seg.track {
  flex: none;
  padding: 4px;
  border-radius: 14px;
  background: var(--white);
}
.seg.track button {
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--soft);
  font: 800 15px var(--text);
}
.seg.track button.on {
  background: var(--ink);
  color: var(--card);
}
.seg.levels {
  gap: 8px;
}
.seg.levels button {
  flex: 1;
  padding: 10px 4px;
  border: 2px solid color-mix(in srgb, var(--soft) 35%, var(--sky));
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  font: 800 18px var(--text);
}
.seg.levels button.on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--card);
}
.dots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.dot {
  display: block;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
}
.dot.on {
  box-shadow: 0 0 0 3px var(--sky), 0 0 0 6px var(--ink);
}
.dot.taken {
  background: color-mix(in srgb, var(--cc) 32%, var(--sky)) !important;
  cursor: not-allowed;
}
.setup-bar {
  position: fixed;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 20px max(22px, env(safe-area-inset-bottom));
  background: var(--sky);
}
.ready {
  color: var(--soft);
  font-size: 19px;
  font-weight: 700;
  text-align: center;
}
.setup-bar .big {
  width: 100%;
  max-width: 640px;
  min-height: 66px;
  font-size: 30px;
}

/* ---- gate, results ---- */
#gate,
#results {
  justify-content: center;
}
.card h2,
.card p {
  margin: 0;
}
#gate .card,
#results .card {
  display: flex;
  width: min(92vw, 420px);
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px;
  text-align: center;
}
#results .card.wide {
  width: min(92vw, 460px);
}
.winner {
  color: var(--accent);
  font: 700 34px var(--display);
}
.why {
  color: var(--soft);
  font-size: 16px;
  font-weight: 700;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}
th {
  padding: 4px 2px;
  color: var(--soft);
  font-size: 12px;
  text-align: right;
}
th:first-child,
td:first-child {
  text-align: left;
}
td {
  padding: 9px 2px;
  border-top: 1px solid var(--line);
  text-align: right;
  font-weight: 800;
}
td i {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 6px;
  border-radius: 50%;
}
tr.win td {
  background: color-mix(in srgb, var(--accent) 14%, var(--white));
}

/* ---- settings ---- */
#settings .card.wide {
  display: flex;
  width: min(100%, 560px);
  flex-direction: column;
  gap: 14px;
  padding: 10px 22px 22px;
}

/* ---- leaderboard ---- */
#leaderboard {
  padding-bottom: 130px;
}
.lb-layout {
  display: flex;
  width: 100%;
  max-width: 1100px;
  flex-direction: column;
  gap: 18px;
}
.lb-left,
.lb-right {
  display: contents;
}
.lb-tabs {
  max-width: none;
  order: 1;
}
.lb-empty {
  order: 2;
}
.lb-list {
  order: 3;
}
.lb-cta {
  order: 4;
}
.lb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 0 6px;
  text-align: center;
}
.lb-trophy {
  display: flex;
  width: 100px;
  height: 100px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}
.lb-trophy .ico svg {
  width: 48px;
  height: 48px;
}
.lb-empty h3 {
  margin-top: 8px;
  font-size: 36px;
  line-height: 1;
}
.lb-empty p {
  color: var(--soft);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}
.lb-list {
  display: flex;
  flex-direction: column;
}
.lb-list h4 {
  display: none;
}
.lb-row {
  display: grid;
  grid-template-columns: 34px 46px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 4px;
  border-top: 1px solid var(--line);
  font-weight: 800;
}
.lb-row:first-of-type {
  border-top: 0;
}
.lb-row.open {
  color: var(--soft);
}
.lb-row.open .face {
  border: 2px dashed color-mix(in srgb, var(--soft) 40%, var(--sky));
  background: none;
}
.lb-row.open:nth-of-type(n + 3) {
  opacity: 0.7;
}
.lb-row .rank {
  color: var(--soft);
  font: 700 26px var(--display);
}
.lb-row.first .rank {
  color: var(--accent);
}
.lb-row .face {
  display: flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
}
.lb-row .who-name {
  font-size: 22px;
}
.lb-row small {
  display: block;
  color: var(--soft);
  font-size: 14px;
  font-weight: 700;
}
.lb-row.me .who-name {
  color: var(--primary);
}
.lb-row .val {
  font-size: 20px;
}
.lb-cta {
  position: fixed;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 14px 20px max(22px, env(safe-area-inset-bottom));
  background: var(--sky);
}
.lb-cta .big {
  width: 100%;
  max-width: 640px;
  font-size: 28px;
}
.lb-cta[hidden] {
  display: none;
}

/* ---- how to play (tutorial.js) ---- */
#howto {
  justify-content: flex-start;
}
#howto .setup-title {
  margin-top: 10px;
  text-align: center;
}
#howto .setup-sub {
  margin-bottom: 14px;
  text-align: center;
}
.tut-canvas {
  width: min(92vw, 460px);
  aspect-ratio: 400 / 290;
  margin-top: 4px;
  border-radius: 24px;
  background: var(--court);
}
.tut-text {
  max-width: min(92vw, 460px);
  margin: 14px 0 8px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}
.tut-dots {
  display: flex;
  gap: 8px;
  margin: 6px 0 14px;
}
.tut-dots i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line);
  cursor: pointer;
}
.tut-dots i.on {
  background: var(--ink);
}
.tut-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tut-nav .big {
  min-height: 54px;
  padding: 8px 34px;
  font-size: 24px;
}
.tut-nav .opt {
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 10px 24px;
  background: none;
  color: var(--ink);
  font: 800 19px var(--text);
}

/* ---- "You Don Buy House" ---- */
#celebrate {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}
#celebrate .boom {
  max-width: 84vw;
  padding: 18px 24px;
  border: 6px solid var(--c);
  border-radius: 28px;
  background: var(--white);
  text-align: center;
  animation: pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
#celebrate h2 {
  font-size: 34px;
  color: var(--c);
}
#celebrate p {
  margin-top: 6px;
  font-weight: 800;
}
#confetti i {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  animation: fall linear infinite;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.3) rotate(-6deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}
@keyframes fall {
  to {
    transform: translateY(110vh) rotate(540deg);
  }
}

/* ======================================================================================
   Tablets and small laptops: from 768px
   ====================================================================================== */
@media (min-width: 768px) {
  .menu-actions,
  .setup-bar .big,
  .lb-cta .big {
    max-width: 600px;
  }
  .tagline {
    font-size: 28px;
  }
  #hud {
    padding-left: 24px;
    padding-right: 24px;
  }
  #topbar,
  #board {
    max-width: 640px;
  }
  .pcard {
    padding-right: 14px;
  }
  .pname {
    font-size: 19px;
  }
  .pstats {
    font-size: 15px;
  }
  .setup-head {
    padding-left: 76px;
  }
  .seat-head {
    width: 84px;
    height: 100px;
  }
  .chip {
    min-height: 52px;
    font-size: 18px;
  }
  .seg.track button {
    padding: 8px 14px;
    font-size: 17px;
  }
  .cname {
    font-size: 25px;
  }
  .setup-title {
    font-size: 40px;
  }
}

/* ======================================================================================
   The web layout: from 1024px
   ====================================================================================== */
@media (min-width: 1024px) {
  kbd {
    display: inline-block;
  }
  .profile {
    top: 24px;
    left: 40px;
    max-width: 440px;
  }
  .settings-btn {
    top: 24px;
    right: 40px;
  }
  #art .sun {
    top: 12vh;
    right: 8vw;
    width: min(21vw, 300px);
    height: min(21vw, 300px);
  }
  #art .hill {
    left: 44%;
    right: -30%;
    top: 62%;
    border-radius: 50% 0 0 0 / 120px 0 0 0;
  }

  /* home: copy and buttons on the left, the court on the right */
  #menu {
    align-items: flex-start;
    justify-content: center;
    gap: 26px;
    padding: 0 0 0 clamp(40px, 11vw, 200px);
  }
  .menu-copy {
    padding: 0;
    text-align: left;
  }
  .wide-only {
    display: inline;
  }
  .wordmark {
    font-size: clamp(120px, 11vw, 168px);
  }
  .tagline {
    max-width: 520px;
    font-size: 26px;
    line-height: 1.3;
  }
  .menu-actions {
    width: min(480px, 36vw);
    max-width: none;
    padding: 0;
    gap: 18px;
  }
  .menu-actions .big {
    width: 100%;
    min-height: 80px;
    font-size: 36px;
  }
  .saved {
    padding: 16px 20px;
  }
  .saved-dots {
    display: flex;
  }
  .saved-text .kicker {
    font-size: 13px;
  }
  .saved-text b {
    font-size: 20px;
  }
  .tiles {
    gap: 20px;
  }
  .tile {
    min-height: 96px;
    gap: 14px;
    padding: 12px 16px;
  }
  .tile-ico {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--sky);
  }
  .tile b {
    font-size: 21px;
  }
  .tile small {
    display: block;
    margin-top: 2px;
  }
  .settings-btn {
    width: auto;
    gap: 10px;
    padding: 0 22px;
    border-radius: 999px;
  }
  .settings-btn .btn-text {
    display: inline;
    font-size: 17px;
    font-weight: 800;
  }

  /* match: a taller top band, the chips centred under the turn pill */
  #hud {
    padding: 28px 40px 18px;
  }
  #topbar {
    position: relative;
    max-width: none;
    justify-content: center;
  }
  #topbar #menu-btn {
    position: absolute;
    left: 0;
  }
  #topbar #sound-btn {
    position: absolute;
    right: 0;
  }
  #banner {
    height: 56px;
    font-size: 29px;
  }
  #board {
    max-width: 760px;
    gap: 14px;
  }
  .pcard {
    padding: 5px 20px 5px 6px;
  }
  .pcard .face {
    width: 46px;
    height: 46px;
  }
  .pname {
    font-size: 20px;
  }
  .pstats {
    font-size: 17px;
  }
  .dock-text b {
    font-size: 29px;
  }
  .dock-text small {
    font-size: 16px;
  }
  .dock-text small kbd {
    margin: 0 2px;
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 14px;
  }
  #watchbar {
    width: max-content;
    gap: 12px;
    padding: 10px 12px 10px 26px;
  }
  #watchbar b {
    flex: none;
    font-size: 23px;
  }
  #watchbar .ghost-btn {
    padding: 8px 18px;
    border-width: 3px;
    font-size: 19px;
  }
  #watchbar .big.small {
    min-height: 48px;
    padding: 6px 22px;
    font-size: 19px;
  }
  #skip-btn kbd {
    background: rgba(255, 255, 255, 0.25);
  }

  /* pause: a window */
  #pause-menu {
    top: 50%;
    bottom: auto;
    width: 660px;
    max-width: none;
    padding: 30px 36px 30px;
    border-radius: 40px;
    opacity: 0;
    transform: translate(-50%, -46%);
    transition: transform 0.25s, opacity 0.25s, visibility 0s 0.25s;
  }
  body.paused #pause-menu {
    opacity: 1;
    transform: translate(-50%, -50%);
    transition: transform 0.25s, opacity 0.25s, visibility 0s;
  }
  #pause-menu .grab {
    display: none;
  }
  #pause-menu .close-x {
    position: absolute;
    top: 28px;
    right: 28px;
    display: inline-flex;
    width: 54px;
    height: 54px;
    background: var(--white);
  }
  .pause-head h2 {
    font-size: 50px;
  }

  /* setup */
  #setup {
    padding: 28px 80px 140px;
  }
  .setup-head {
    padding-left: 76px;
  }
  .tabs {
    max-width: 1240px;
    justify-content: flex-start;
  }
  .tabs .chip {
    flex: 0 0 190px;
  }
  .setup-label,
  .seats {
    max-width: 1240px;
  }
  .seats {
    flex-direction: row;
    gap: 24px;
  }
  .seat {
    flex: 1 1 0;
    min-width: 0;
    padding: 18px;
    border-radius: 28px;
    background: var(--white);
    border-top: 0;
  }
  .seat-head {
    width: 120px;
    height: 150px;
    border-radius: 22px;
  }
  .seat-face {
    object-position: 50% 80%;
    transform: scale(1.1);
  }
  .seats[style*="--n: 1"] .seat {
    max-width: 580px;
    flex: 0 1 580px;
  }
  .seats[style*="--n: 3"],
  .seats[style*="--n: 4"] {
    flex-wrap: wrap;
  }
  .seats[style*="--n: 3"] .seat {
    flex: 1 1 calc(33.3% - 24px);
  }
  .seats[style*="--n: 4"] .seat {
    flex: 1 1 calc(50% - 24px);
  }
  .setup-bar {
    left: 50%;
    right: auto;
    bottom: 24px;
    width: min(1240px, calc(100% - 160px));
    transform: translateX(-50%);
    flex-direction: row;
    justify-content: space-between;
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
    background: transparent;
  }
  .setup-bar .big {
    width: 330px;
    max-width: none;
  }
  .ready {
    text-align: left;
    font-size: 21px;
  }

  /* leaderboard, settings */
  #leaderboard {
    padding-bottom: 40px;
  }
  .lb-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 80px;
  }
  .lb-left,
  .lb-right {
    display: flex;
    min-width: 0;
    flex: 1 1 0;
    flex-direction: column;
    gap: 20px;
  }
  .lb-empty {
    align-items: flex-start;
    padding-top: 0;
    text-align: left;
  }
  .lb-cta {
    position: static;
    padding: 0;
    background: none;
    justify-content: flex-start;
  }
  .lb-cta .big {
    width: auto;
    max-width: none;
    padding: 8px 56px;
  }
  .lb-empty h3 {
    font-size: 44px;
  }
  .screen-head {
    padding-left: 0;
  }
  .setup-back {
    top: 28px;
    left: 40px;
  }
}

/* the bottom pills are only for reading; the computer's controls and the miss pill can be tapped */
.dock.dark {
  pointer-events: none;
}
#watchbar,
#pill {
  pointer-events: auto;
}
