:root {
  font-family: "Instrument Sans", system-ui, sans-serif;
  color: #202648;
  background: #f7f6ef;
  --blue: #203e9c;
  --lime: #dcf678;
  --line: #dbdcd4;
  --gutter: 1rem;
  --content-width: 70rem;
  --nav-height: 3.75rem;
}
* { box-sizing: border-box; }
html { scroll-padding-block-start: calc(5rem + env(safe-area-inset-top)); scroll-padding-block-end: calc(var(--nav-height) + env(safe-area-inset-bottom) + 1rem); }
body { margin: 0; }
a { color: inherit; }

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-block: calc(.5rem + env(safe-area-inset-top)) .5rem;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
  background: var(--blue);
  color: white;
}
.brand { font-size: 1.5rem; font-weight: 850; letter-spacing: -.06em; text-decoration: none; white-space: nowrap; }
.brand span { color: var(--lime); }
.account { display: grid; gap: .15rem; justify-items: end; min-width: 0; font-size: .75rem; }
#account { width: min(100%, 12rem); }

nav {
  position: fixed;
  z-index: 1;
  inset: auto 0 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .25rem;
  padding: .375rem max(.375rem, env(safe-area-inset-right))
    calc(.375rem + env(safe-area-inset-bottom)) max(.375rem, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: #fff;
  color: #1e3275;
}
nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  min-height: 3rem;
  padding-inline: .15rem;
  border-radius: .55rem;
  text-align: center;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 700;
}
nav a[aria-current="page"] { background: #e9eeff; color: #162b6e; }
.nav-count {
  min-width: 1.2rem;
  padding: .1rem .22rem;
  border-radius: 1rem;
  background: var(--blue);
  color: white;
  font-size: .65rem;
  font-variant-numeric: tabular-nums;
}

main {
  max-width: var(--content-width);
  margin-inline: auto;
  padding-block: 1rem calc(var(--nav-height) + env(safe-area-inset-bottom) + 1.25rem);
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}
h1, h2, h3 { line-height: 1.15; margin-top: 0; }
h2 { margin-bottom: .8rem; }
h3 { margin-bottom: .6rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: .55rem .75rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: #fff;
  color: #1e3275;
  font: inherit;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { border-color: var(--blue); }
button.primary, .button.primary, button[aria-pressed="true"] { background: var(--lime); border-color: var(--lime); }
button:disabled { opacity: .6; cursor: wait; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
.card, .panel { background: white; border: 1px solid var(--line); border-radius: .95rem; padding: 1rem; min-width: 0; overflow-wrap: anywhere; }
.panel { margin-bottom: .75rem; }
.card p { margin: .45rem 0 .8rem; }
.card .actions { margin-top: .9rem; }
.meta { color: #505a75; }
.kicker { color: #2948a0; letter-spacing: .07em; font-size: .73rem; text-transform: uppercase; font-weight: 800; }
.badge { display: inline-block; padding: .2rem .5rem; background: #edf1ff; border-radius: .3rem; font-size: .82rem; text-transform: capitalize; }
form.fields { display: grid; gap: .8rem; max-width: 40rem; }
.fields label { display: grid; gap: .25rem; min-width: 0; }
.fields button[type="submit"], .fields button.primary { width: 100%; }
input, select, textarea {
  min-height: 2.75rem;
  min-width: 0;
  max-width: 100%;
  padding: .5rem;
  border: 1px solid #9298a8;
  border-radius: .35rem;
  background: white;
  color: #202648;
  font: inherit;
  font-size: 1rem;
}
textarea { resize: vertical; }
section.collection { margin-block: 1.65rem; }
details { margin-top: .75rem; }
summary { cursor: pointer; padding-block: .7rem; min-height: 2.75rem; }
li { margin: .35rem 0; }
:focus-visible { outline: 3px solid #4a68d8; outline-offset: 2px; }
.inbox-list { list-style: none; padding: 0; display: grid; gap: .6rem; max-width: 45rem; }
.inbox-list li { margin: 0; }
.inbox-list a { display: block; padding-block: .6rem; }
[hidden] { display: none !important; }
.chat-messages { list-style: none; padding: 0; }
.chat-message { border-bottom: 1px solid var(--line); padding: .65rem 0; }
.chat-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; margin: 0; }
.chat-meta time { color: #505a75; font-size: .85rem; }
.chat-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: .35rem 0; }
.app-page .back-link {
  gap: .45rem; margin-bottom: .75rem; min-height: 2.75rem;
  background: #edf0ff; border-color: #d8dff7; color: #213d87;
  border-radius: 999px; padding-inline: .75rem .95rem; font-size: .88rem;
}
.app-page .back-link:hover { border-color: var(--blue); background: #e3eaff; }
.back-link .ui-icon { width: 1.05rem; height: 1.05rem; }

@media (min-width: 44rem) {
  :root { --gutter: 1.5rem; }
  html { scroll-padding-block-end: 1rem; }
  .bar { padding-inline: max(var(--gutter), calc((100vw - var(--content-width)) / 2 + var(--gutter))); }
  nav { position: static; display: flex; padding: 0; background: transparent; border: 0; color: white; }
  nav a { padding-inline: .65rem; font-size: .9rem; }
  nav a[aria-current="page"] { background: #fff; color: var(--blue); }
  .nav-count { background: var(--lime); color: #202648; }
  main { padding-block-end: 3rem; }
  .grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18.5rem), 1fr)); gap: 1rem; }
  .card, .panel { padding: 1.2rem; }
  .fields button[type="submit"], .fields button.primary { width: auto; }
}
.auth-panel { max-width: 31rem; margin-inline: auto; }
.auth-switch { margin-block-start: 1rem; }

.discover-feed { width: min(100%, 31rem); margin-inline: auto; }
.feed-stack { position: relative; isolation: isolate; overflow: clip; padding-bottom: .45rem; }
.feed-stack.has-next::before {
  content: ""; position: absolute; inset: .6rem .65rem 0; border-radius: 1.2rem;
  background: #a4b4de;
}
.feed-card {
  --court: #29499d;
  --deep: #111c50;
  --ink: #f1f4ff;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(4rem, 20svh, 11rem);
  min-height: clamp(19rem, 54svh, 34rem);
  padding: clamp(1.15rem, 4vw, 1.8rem);
  overflow: hidden;
  border-radius: 1.2rem;
  background: linear-gradient(155deg, var(--court) 18%, var(--deep) 78%);
  color: var(--ink);
  touch-action: manipulation;
  user-select: none;
  cursor: grab;
  animation: feed-arrive 220ms ease-out both;
}
.feed-card:active { cursor: grabbing; }
.feed-card.swipe-pending { cursor: wait; }
.feed-player { --court: #126b63; --deep: #102f3a; }
.feed-pair { --court: #7a4999; --deep: #2d1b45; }
.feed-art { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.court-lines {
  position: absolute; inset: -12% -7% auto 15%; height: 66%;
  transform: rotate(-17deg); border: 1px solid #fff5;
  background:
    linear-gradient(90deg, transparent calc(24% - 1px), #fff5 24%, transparent calc(24% + 1px),
      transparent calc(76% - 1px), #fff5 76%, transparent calc(76% + 1px)),
    linear-gradient(transparent calc(50% - 1px), #fff5 50%, transparent calc(50% + 1px));
  mask-image: linear-gradient(#000 35%, transparent);
}
.court-ball {
  position: absolute; right: 12%; top: 13%; width: clamp(3.6rem, 16vw, 6rem); aspect-ratio: 1;
  overflow: hidden; border-radius: 50%;
  background: radial-gradient(circle at 30% 26%, #efffa2, #d9f272 54%, #95b32f);
  box-shadow: .35rem .75rem 1.4rem #0b163b42;
}
.court-ball::after {
  content: ""; position: absolute; inset: 4% -44% 4% 45%; border: 2px solid #f9ffde;
  border-radius: 50%; transform: rotate(-33deg);
}
.feed-kind {
  position: relative; align-self: flex-start; margin: 0; padding: .4rem .65rem;
  border: 1px solid #fff6; border-radius: 999px; background: var(--deep);
  color: #fff; font-size: .78rem; font-weight: 750;
}
.feed-copy { position: relative; overflow-wrap: anywhere; }
.feed-copy h2 { margin: 0 0 .55rem; font-size: clamp(1.9rem, 7vw, 3rem); line-height: 1.02; letter-spacing: -.045em; }
.feed-copy p { margin: .35rem 0 0; }
.feed-meta { color: #f4f6ff; font-weight: 650; }
.feed-detail { color: #e3e8fa; font-size: .92rem; white-space: pre-line; }
.discover-feed {
  --pass-ink: #7d1e34;
  --pass-color: #ffc0cc;
  --pass-wash: #9f2749;
  --like-ink: #213314;
  --like-color: #dcf678;
  --like-wash: #285d23;
}
.feed-card[data-direction="pass"] { --swipe-wash: var(--pass-wash); --swipe-edge: var(--pass-color); }
.feed-card[data-direction="like"] { --swipe-wash: var(--like-wash); --swipe-edge: var(--like-color); }
.feed-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 5px solid var(--swipe-edge, transparent);
  border-radius: inherit;
  background: linear-gradient(var(--swipe-wash, transparent), transparent 90%);
  opacity: var(--swipe-progress, 0);
  pointer-events: none;
}
.feed-kind, .feed-copy { z-index: 2; }
.swipe-cue {
  position: absolute;
  z-index: 3;
  inset: clamp(3.1rem, 21%, 6rem) 0 auto;
  width: max-content;
  max-width: calc(100% - 2rem);
  margin-inline: auto;
  padding: .5rem 1rem .65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  border-radius: 1rem;
  box-shadow: 0 .4rem 1.4rem #0005;
  opacity: 0;
  transform: scale(.9);
  font-size: clamp(1.25rem, 6vw, 2.2rem);
  font-weight: 850;
  line-height: 1.05;
  pointer-events: none;
  transition: transform 130ms ease-out;
}
.cue-symbol { font-size: 1.3em; }
.cue-pass { color: var(--pass-ink); background: var(--pass-color); }
.cue-like { color: var(--like-ink); background: var(--like-color); }
.feed-card[data-direction="pass"] .cue-pass,
.feed-card[data-direction="like"] .cue-like {
  opacity: clamp(0, calc(var(--swipe-progress, 0) * 2.25), 1);
  transform: scale(1);
}
.feed-card.swipe-ready[data-direction="pass"] .cue-pass,
.feed-card.swipe-ready[data-direction="like"] .cue-like { transform: scale(1.1); }
.feed-empty { margin: 0; }
.feed-settings {
  width: min(calc(100% - 2rem), 28rem); max-height: calc(100% - 2rem);
  padding: clamp(1rem, 4vw, 1.5rem); border: 1px solid var(--surface-line);
  border-radius: 1.15rem; background: var(--surface); color: var(--court-ink);
  box-shadow: 0 1rem 3rem #111c5033;
}
.feed-settings::backdrop { background: #111c507a; }
.feed-settings h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.feed-settings fieldset { display: grid; gap: .45rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.feed-settings legend { padding: 0; margin-bottom: .5rem; color: #505a75; font-size: .85rem; }
.feed-category {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: .2rem .65rem; min-height: 3.2rem; padding: .55rem .7rem; cursor: pointer;
  border: 1px solid var(--surface-line); border-radius: .75rem; font-weight: 650;
}
.feed-category:has(input:checked) { background: #eef2ff; border-color: #cbd7fa; }
.feed-category input {
  min-height: auto; width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--blue); cursor: pointer;
}
.feed-category small { grid-column: 2 / -1; color: #505a75; font-weight: 400; line-height: 1.4; }
.feed-settings-error { color: #a02b36; }
.feed-settings-error:empty { display: none; }
.feed-settings .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 1rem; }
@keyframes feed-arrive { from { opacity: .75; scale: .98; } to { opacity: 1; scale: 1; } }
@media (prefers-reduced-motion: reduce) {
  .feed-card { animation: none; }
  .swipe-cue { transition: none; transform: none !important; }
}

:root:lang(zh-CN) {
  font-family: "Instrument Sans", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}
:lang(zh-CN) .feed-copy h2 { letter-spacing: normal; }
.header-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-end;
  min-width: 0;
  gap: .4rem .65rem;
}


/* Shared components for the Games, Inbox, and Profile views. */
:root {
  --nav-height: 4.45rem;
  --surface: #fffefb;
  --surface-line: #dddfe6;
  --court-ink: #19284f;
  --lift: 0 3px 12px #1726500a, 0 16px 26px -24px #17265055;
}
.ui-icon { width: 1.2rem; height: 1.2rem; flex: none; vertical-align: middle; }
.nav-icon { display: grid; place-items: center; width: 2.75rem; height: 1.7rem; border-radius: 99px; }
nav { box-shadow: 0 -.25rem 1.25rem #19284f0a; }
nav a { flex-direction: column; position: relative; min-height: 3.6rem; gap: .25rem; color: #505a75; }
nav a[aria-current="page"] { background: transparent; color: var(--blue); }
nav a[aria-current="page"] .nav-icon { background: #e9eeff; }
.nav-count { position: absolute; top: .15rem; left: calc(50% + .55rem); }
.app-page { width: min(100%, 48rem); margin-inline: auto; }
.app-page .button { gap: .4rem; }
.app-page .button.primary, .app-page button.primary { color: #263712; }
.ui-card {
  border-color: var(--surface-line); border-radius: 1.15rem; background: var(--surface); box-shadow: var(--lift);
}
.app-page button, .app-page .button { border-radius: .72rem; }
.page-action:is(button, .button) {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: .65rem; width: 100%; min-height: 3.25rem; margin-bottom: .75rem;
  padding: .45rem .75rem; border-color: var(--surface-line); border-radius: .9rem;
  background: var(--surface); box-shadow: var(--lift); text-align: start;
}
.page-action.button.primary { background: var(--lime); border-color: #c7de67; }
.page-action:is(button, .button):hover { border-color: currentColor; }
.page-action-icon {
  display: grid; place-items: center; width: 2rem; height: 2rem;
  border-radius: .55rem; background: #e6edff; color: var(--blue);
}
.page-action.primary .page-action-icon { background: #f2ffc6; color: #334720; }
.page-action > .ui-icon { width: 1rem; height: 1rem; }
.icon-tile {
  display: inline-grid; place-items: center; width: 2.65rem; height: 2.65rem;
  flex: none; border-radius: .85rem; background: #edf0ff; color: var(--blue);
}
.panel-title { display: flex; align-items: center; gap: .65rem; font-size: 1.1rem; font-weight: 700; color: var(--court-ink); margin-bottom: .9rem; }
.empty-state {
  min-height: 12rem; display: grid; justify-items: center; align-content: center; gap: .6rem;
  border: 1px dashed #c7cddd; border-radius: 1.15rem; padding: 1.25rem;
  background: #fffdf8; color: #505a75; text-align: center;
}
.empty-state p { margin: 0; }
.empty-state .icon-tile { width: 3rem; height: 3rem; }
.segmented {
  display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .25rem;
  margin-bottom: 1rem; padding: .28rem; border: 1px solid #dfe3ee;
  border-radius: .95rem; background: #eceff7;
}
.segmented button { min-width: 0; padding-inline: .3rem; border-color: transparent; background: transparent; font-size: .9rem; }
.segmented button[aria-pressed="true"] { background: #fff; border-color: #dfe3ee; box-shadow: 0 2px 4px #19284f0c; }
.game-list { display: grid; gap: .85rem; }
.game-top { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: start; gap: .85rem; }
.date-tile {
  display: grid; justify-items: center; min-width: 3.4rem; padding: .45rem .32rem; border-radius: .75rem;
  background: #284799; color: #fff; font-size: .72rem; font-weight: 650;
}
.date-tile strong { color: var(--lime); font-size: 1.65rem; line-height: 1.1; }
.card-statuses { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .45rem; }
.type-pill, .status-pill, .unread-pill {
  display: inline-block; border-radius: 999px; padding: .18rem .5rem;
  font-size: .72rem; line-height: 1.3; font-weight: 720;
}
.type-pill { background: #edf0ff; color: #284799; }
.status-pill { background: #eceef3; color: #47536e; text-transform: capitalize; }
.status-confirmed, .status-accepted, .status-completed { background: #e7f3d9; color: #355021; }
.status-requested, .status-invited { background: #fff0cd; color: #684713; }
.status-cancelled, .status-declined { background: #fbe7eb; color: #853245; }
.game-top h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.game-card .game-meta, .game-facts > span { display: flex; align-items: flex-start; gap: .4rem; }
.game-card .game-meta { font-size: .87rem; color: #4c5875; margin-block: .28rem; }
.game-meta .ui-icon, .game-facts .ui-icon { width: 1rem; height: 1rem; }
.game-facts {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .35rem .75rem;
  border-top: 1px solid #eceef3; margin-top: .8rem; padding-top: .7rem; color: #4c5875; font-size: .82rem;
}
.game-card .game-description { white-space: pre-wrap; color: #4c5875; font-size: .9rem; }
.game-card details { border-top: 1px solid #eceef3; }
.game-card summary { color: #304c90; font-weight: 650; }
.match-card { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: start; gap: .8rem; }
.match-card .kicker { margin-top: 0; }
.identity-card {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: clamp(.45rem, 2vw, .9rem);
  margin-bottom: .95rem; padding: clamp(1rem, 4vw, 2rem); border-radius: 1.25rem;
  background: linear-gradient(130deg,#304fa4,#192c66 65%); color: #fff; overflow-wrap: anywhere;
}
.identity-card::after {
  content: ""; position: absolute; z-index: -1; inset: -3rem -4rem auto auto;
  width: 12rem; height: 12rem; border: 1px solid #fff4; transform: rotate(-24deg);
  background: linear-gradient(90deg,transparent 49%,#fff3 50%,transparent 51%);
}
.identity-avatar {
  display: grid; place-items: center; width: clamp(3.45rem,12vw,4.75rem); aspect-ratio: 1;
  border-radius: 1.05rem; background: var(--lime); color: #223817; font-size: 1.35rem; font-weight: 850;
}
.identity-card h2 { font-size: clamp(1.5rem, 4vw + .45rem, 2.65rem); font-weight: 780; line-height: 1.08; margin: .3rem 0; }
.identity-area { display: flex; align-items: center; gap: .3rem; margin: 0; color: #e1e9ff; font-size: .9rem; }
.identity-area .ui-icon { width: .95rem; }
.identity-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.identity-tags span { border-radius: 999px; padding: .22rem .55rem; background: #ffffff21; color: #fff; font-size: .78rem; }
.profile-sections { display: grid; gap: .85rem; margin-bottom: .85rem; }
.profile-page .panel { margin: 0; }
.privacy-panel p { color: #505a75; line-height: 1.55; }
.inbox-toolbar { display: flex; justify-content: flex-end; margin-bottom: .6rem; }
.inbox-page .inbox-list {
  max-width: none; margin: 0; display: block; overflow: hidden; border: 1px solid var(--surface-line);
  border-radius: 1.15rem; background: var(--surface); box-shadow: var(--lift);
}
.notification + .notification { border-top: 1px solid #e5e7ee; }
.notification.is-unread { background: #f1f4ff; }
.inbox-list .notification-link {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: start;
  gap: .7rem; padding: .85rem; text-decoration: none;
}
.notification-link:hover .notification-text { text-decoration: underline; }
.notification-link:focus-visible { outline-offset: -3px; }
.notification-link > .ui-icon { align-self: center; width: .9rem; color: #4c5875; }
.notification-copy { min-width: 0; overflow-wrap: anywhere; }
.notification-text { display: block; color: var(--court-ink); line-height: 1.4; }
.is-unread .notification-text { font-weight: 700; }
.notification-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; color: #505a75; font-size: .78rem; margin-top: .3rem; }
.unread-pill { color: #223d87; background: #dfe7ff; }
.notification-action { display: flex; justify-content: flex-end; padding: 0 .85rem .65rem; }
.notification-action button { font-size: .82rem; }
@media (min-width: 44rem) {
  nav { box-shadow: none; }
  nav a { min-height: 3rem; flex-direction: row; color: white; }
  nav a[aria-current="page"] { background: #fff; color: var(--blue); }
  nav a[aria-current="page"] .nav-icon { background: transparent; }
  .nav-icon { width: auto; }
  .nav-count { position: static; }
}
.profile-page .fields label { color: var(--court-ink); font-size: .88rem; font-weight: 650; }
.profile-page :is(input, select) { border-color: #c1c9db; border-radius: .65rem; background: #f9faff; font-weight: 400; }

.inbox-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inbox-tabs a {
  display: flex; align-items: center; justify-content: center; gap: .35rem; flex-wrap: wrap;
  min-height: 2.75rem; padding: .35rem; border-radius: .72rem;
  font-size: .9rem; font-weight: 700; color: var(--blue); text-decoration: none;
}
.inbox-tabs a[aria-current="page"] { background: #fff; box-shadow: 0 2px 4px #19284f16; }
.conversation-list {
  list-style: none; padding: 0; margin: 0; background: var(--surface);
  border: 1px solid var(--surface-line); border-radius: 1.15rem; box-shadow: var(--lift);
}
.conversation { margin: 0; }
.conversation + .conversation { border-top: 1px solid #e5e7ee; }
.conversation a {
  display: grid; grid-template-columns: auto minmax(0,1fr) minmax(0,7rem); align-items: center;
  gap: .65rem; padding: .9rem .75rem; text-decoration: none; border-radius: .85rem;
}
.conversation a:hover { background: #edf1ff; }
.conversation a:focus-visible { outline-offset: -3px; }
.conversation-avatar { border-radius: 50%; font-weight: 800; }
.conversation-copy { display: grid; gap: .25rem; min-width: 0; }
.conversation-copy > *, .conversation-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-preview, .conversation-meta { color: #505a75; font-size: .78rem; }
.conversation-meta { text-align: end; font-weight: 700; }
.conversation-meta time { display: block; margin-top: .25rem; font-size: .7rem; font-weight: 400; }
body:has(.chat-panel) { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; }
main:has(.chat-panel) {
  display: flex; flex-direction: column; width: 100%; max-width: none; margin: 0;
  min-height: 0;
  padding: 0 0 var(--chat-tab-height, calc(var(--nav-height) + env(safe-area-inset-bottom)));
}
#view:has(.chat-panel) { flex: 1; min-height: 0; display: flex; }
.chat-panel { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #f4f5fa; }
.chat-panel > .actions, .chat-panel > .meta { margin: .35rem .75rem; }
.chat-panel > .actions:not(:has(button:not([hidden]))) { display: none; }
@media (min-width: 44rem) { main:has(.chat-panel) { padding-bottom: 0; } }
.chat-heading { display: flex; gap: .7rem; align-items: center; border-bottom: 1px solid var(--surface-line); padding: .45rem .7rem; background: var(--surface); }
.chat-heading p { margin: 0 0 .15rem; font-size: .8rem; }
.chat-status:empty { display: none; }
.chat-panel .chat-messages {
  display: flex; flex-direction: column; gap: .55rem; overflow: auto;
  flex: 1; min-height: 0; overscroll-behavior: contain;
  margin: 0; padding: .55rem .6rem;
  overflow-anchor: none;
}
.chat-panel .chat-message {
  flex: none; align-self: flex-start; max-width: 88%; padding: .65rem .8rem;
  border: 0; border-radius: .25rem 1rem 1rem 1rem; margin: 0; background: #edf0fb; color: var(--court-ink);
}
.chat-panel .chat-message.is-mine { align-self: flex-end; border-radius: 1rem .25rem 1rem 1rem; background: #e5f3af; }
.chat-panel .chat-meta { font-size: .76rem; }
.chat-panel .chat-meta time { font-size: .7rem; }
.chat-panel .chat-body { margin-bottom: 0; line-height: 1.45; }
.chat-composer { display: flex; align-items: stretch; gap: .5rem; border-top: 1px solid var(--surface-line); padding: .45rem .6rem; background: var(--surface); }
.chat-composer textarea { flex: 1; border-color: #c1c9db; border-radius: .7rem; background: #f9faff; }
.chat-composer button { flex: none; font-size: 1.1rem; }
.chat-composer textarea { resize: none; }
.chat-body { min-width: 0; overflow-wrap: anywhere; }
.chat-panel .chat-message { max-width: min(88%, 38rem); }

@media (max-width: 25rem) {
  .chat-heading { gap: .4rem; }
  .chat-heading > .icon-tile { display: none; }
  .conversation a { grid-template-columns: auto minmax(0, 1fr); }
  .conversation-meta { grid-column: 2; text-align: start; }
  .conversation-meta time { display: inline; margin-inline-start: .4rem; }
}

@media (min-width: 44rem) {
  .chat-panel .chat-messages, .chat-heading, .chat-composer {
    padding-inline: max(1rem, calc((100% - 58rem) / 2));
  }
  .chat-composer { padding-block-end: max(.55rem, env(safe-area-inset-bottom)); }
}

.feed-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.feed-card.has-photo .feed-copy {
  background: #121a3de8; border-radius: .85rem; padding: .85rem;
}
.feed-card.has-photo .feed-kind { background: #121a3de8; }
.identity-avatar { overflow: hidden; }
.profile-photo { width: 100%; height: 100%; object-fit: cover; }
.game-cover { display: block; width: 100%; max-height: 13rem; aspect-ratio: 16 / 7; object-fit: cover; border-radius: .85rem; margin-bottom: .85rem; }
.location-field { margin: 0; min-width: 0; padding: .65rem; border: 1px solid var(--surface-line); border-radius: .65rem; }
.location-field p { margin: .25rem 0 .6rem; font-size: .86rem; }
.location-status:empty { display: none; }
.location-field button { gap: .35rem; }
.photo-field small { font-weight: 400; color: #505a75; }
.profile-photo-controls { margin: 0 0 1rem; border-bottom: 1px solid var(--surface-line); }
.profile-photo-controls[open] { padding-bottom: .75rem; }

/* Select buttons keep the form field as the source of truth. */
.picker-trigger {
  display: flex; justify-content: space-between; gap: .65rem; width: 100%;
  min-width: 0; min-height: 2.75rem; padding: .55rem .75rem;
  border: 1px solid #c1c9db; border-radius: .7rem; background: #f9faff;
  color: var(--court-ink); font-size: 1rem; font-weight: 550; text-align: start;
}
.picker-trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-trigger .ui-icon { width: .9rem; height: .9rem; rotate: 90deg; color: var(--blue); }
.header-controls .picker-trigger { width: auto; max-width: min(9rem, 32vw); font-size: .85rem; }
.picker-dropdown {
  position: fixed; inset: auto; margin: 0; padding: .3rem;
  overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--surface-line); border-radius: .8rem;
  background: var(--surface); color: var(--court-ink); box-shadow: 0 8px 25px #101d4a30;
}
.picker-dropdown:popover-open { display: grid; gap: .25rem; }
.picker-trigger[aria-expanded="true"] { border-color: var(--blue); }
.picker-trigger[aria-expanded="true"] .ui-icon { rotate: -90deg; }
.picker-options button { justify-content: space-between; gap: .65rem; text-align: start; overflow-wrap: anywhere; min-height: 3rem; border-color: transparent; background: #f5f6fa; }
.picker-options button[aria-pressed="true"] { background: var(--lime); color: #213314; }
.picker-options button:disabled { cursor: default; }
.fields .picker-field { display: grid; gap: .25rem; min-width: 0; }
.profile-page .fields .picker-field { color: var(--court-ink); font-size: .88rem; font-weight: 650; }

.profile-edit-link {
  justify-self: end;
  white-space: nowrap;
  background: #ffffff18;
  border-color: #ffffff55;
  color: #fff;
  font-size: .85rem;
}
.profile-edit-link:hover { background: #ffffff30; border-color: #fff; }
.profile-edit-link:focus-visible { outline-color: #fff; }
.location-field .actions { margin-block: .5rem; }
.venue-search-link { display: inline-block; margin-top: .65rem; font-size: .86rem; }
.venue-results button { justify-content: flex-start; text-align: start; overflow-wrap: anywhere; }
.edit-avatar { overflow: hidden; }

.unread-dot {
  display: inline-block; width: .55rem; height: .55rem; flex: none;
  border-radius: 50%; background: #d81740; vertical-align: middle;
}
#inbox-link .unread-dot { position: absolute; top: .22rem; left: calc(50% + .65rem); box-shadow: 0 0 0 2px white; }
.conversation-meta .unread-dot { margin-inline-end: .35rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 44rem) { #inbox-link .unread-dot { position: static; box-shadow: none; } }

.court-map {
  position: fixed; inset: 0; margin: 0; padding: 0; border: 0;
  width: 100%; max-width: none; height: 100dvh; max-height: none;
  background: var(--surface); color: var(--court-ink);
}
.court-map[open] { display: flex; flex-direction: column; }
.court-map header { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: calc(.5rem + env(safe-area-inset-top)) .75rem .5rem; }
.court-map h2 { margin: 0; font-size: 1.1rem; }
.court-map iframe { flex: 1; min-height: 0; width: 100%; border: 0; }
.location-field [data-location="map"] { gap: .4rem; margin-top: .45rem; }
.location-field .venue-search-link { margin-inline-start: .6rem; }


.game-roster > summary {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: .35rem .65rem; list-style: none;
}
.game-roster > summary::-webkit-details-marker { display: none; }
.roster-heading, .roster-counts, .roster-status { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.roster-counts > .ui-icon { width: .9rem; height: .9rem; }
.game-roster[open] .roster-counts > .ui-icon { transform: rotate(90deg); }
.roster-group { margin: .35rem 0 .85rem; }
.roster-group h4 { margin: 0 0 .4rem; color: #505a75; font-size: .8rem; }
.roster { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.roster-row { margin: 0; background: #f3f5fb; border-radius: .75rem; padding: .55rem; }
.roster-person { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.roster-person strong { flex: 1 1 5rem; min-width: 0; overflow-wrap: anywhere; font-size: .9rem; }
.roster-avatar { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; overflow: hidden;
  border-radius: 50%; background: #e3eaff; color: var(--blue); font-size: .72rem; font-weight: 750; }
.game-card .roster-review { margin-top: .45rem; justify-content: flex-end; }
.roster-review button { font-size: .83rem; }

@media (prefers-reduced-motion: no-preference) {
  .picker-dropdown:popover-open, .feed-settings[open] {
    animation: control-appear 130ms ease-out;
  }
  nav a, .segmented button, .segmented a, .button, .picker-trigger {
    transition: background-color 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out;
  }
  .game-roster .roster-counts > .ui-icon, .picker-trigger .ui-icon {
    transition: transform 150ms ease-out, rotate 150ms ease-out;
  }
}
@keyframes control-appear {
  from { opacity: .65; transform: scale(.985); }
  to { opacity: 1; transform: none; }
}

.profile-page .settings-link { display: flex; width: 100%; justify-content: space-between; }
.settings-panel .actions { margin-top: .85rem; }
.profile-page .privacy-panel { margin-top: 1rem; }
.privacy-panel summary { font-size: .9rem; color: #505a75; }

.chat-invite-link { margin-inline-start: auto; flex: none; font-size: .82rem; }
.chat-panel .chat-message.has-invitation {
  width: min(23rem, 94%); max-width: 94%; border: 0; padding: 0;
  background: transparent;
}
.has-invitation > .chat-meta { padding-inline: .2rem; margin-bottom: .35rem; }
.chat-invitation {
  overflow: hidden; border: 1px solid #d5def1; border-radius: 1rem;
  background: var(--surface); box-shadow: var(--lift); color: var(--court-ink);
}
.invite-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  padding: .55rem .7rem; background: var(--blue); color: #fff;
  font-weight: 750; font-size: .82rem;
}
.invite-type { margin-inline-start: auto; color: var(--lime); }
.chat-invitation .game-cover { max-height: 7rem; margin: 0; border-radius: 0; }
.invite-content { padding: .7rem; }
.invite-content h2 { font-size: 1.1rem; margin-bottom: .35rem; overflow-wrap: anywhere; }
.invite-facts { display: grid; gap: .4rem; list-style: none; margin: .65rem 0 0; padding: 0; }
.invite-facts li { display: flex; align-items: flex-start; gap: .4rem; margin: 0; font-size: .84rem; }
.invite-facts .ui-icon { width: 1rem; height: 1rem; color: var(--blue); }
.invite-facts span { min-width: 0; overflow-wrap: anywhere; }
.invite-description { margin: .65rem 0 0; font-size: .84rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.invite-actions { margin-top: .65rem; padding-top: .65rem; border-top: 1px solid var(--surface-line); }
.invite-actions :is(button, .button) { flex: 1 1 6rem; font-size: .8rem; padding-inline: .35rem; }
.notification-switches { display: grid; gap: .35rem; }
.notification-switch {
  justify-content: space-between; gap: .75rem; min-height: 2.9rem;
  text-align: start; background: #f8f9fd; font-size: .9rem;
}
.switch-track {
  position: relative; flex: none; width: 2.65rem; height: 1.5rem;
  border-radius: 999px; background: #77849e;
}
.switch-track::after {
  content: ""; position: absolute; inset: .18rem auto .18rem .18rem;
  width: 1.14rem; border-radius: 50%; background: white;
}
.notification-switch[aria-checked="true"] .switch-track { background: var(--blue); }
.notification-switch[aria-checked="true"] .switch-track::after { transform: translateX(1.15rem); }
@media (prefers-reduced-motion: no-preference) {
  .switch-track { transition: background-color 140ms ease-out; }
  .switch-track::after { transition: transform 140ms ease-out; }
}
.chat-mute { font-size: .8rem; }

@media (min-width: 60rem) {
  .games-page { width: min(100%, 62rem); }
  .game-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

@media (pointer: coarse) {
  :is(button, .button, nav a, .segmented a, .conversation a, summary) {
    -webkit-tap-highlight-color: transparent;
  }
  :is(button, .button, nav a, .segmented a, .conversation a, summary):active {
    filter: brightness(.92);
  }
}

.toast {
  position: fixed; z-index: 10; inset: auto max(1rem, env(safe-area-inset-right))
    calc(var(--nav-height) + env(safe-area-inset-bottom) + .65rem) max(1rem, env(safe-area-inset-left));
  width: auto; max-width: 29rem; margin-inline: auto;
  display: flex; align-items: center; gap: .65rem; padding: .45rem .55rem .45rem .85rem;
  border: 1px solid #4860a2; border-radius: .85rem; background: #202f64; color: white;
  box-shadow: 0 6px 24px #15234844;
}
.toast.error { background: #742739; border-color: #9f5263; }
.toast p { flex: 1; margin: 0; font-size: .9rem; overflow-wrap: anywhere; }
.toast button { border-color: transparent; background: #ffffff16; color: white; font-size: 1.35rem; }
@media (min-width: 44rem) { .toast { bottom: 1rem; } }
@media (prefers-reduced-motion: no-preference) {
  .toast:not([hidden]) { animation: toast-enter 150ms ease-out; }
}
@keyframes toast-enter { from { opacity: 0; translate: 0 5px; } }

.chat-settings-trigger { flex: none; padding: 0; font-size: 1.45rem; line-height: 1; }
.chat-settings {
  position: fixed; inset: 0 0 0 auto; margin: 0; border: 0; padding: 0;
  width: 100%; max-width: none; height: 100dvh; max-height: none; overflow: hidden;
  background: #f5f6fa; color: var(--court-ink);
}
.chat-settings[open] { display: flex; flex-direction: column; }
@media (min-width: 44rem) { .chat-settings { width: 27rem; } }
.chat-settings::backdrop { background: #111d4a66; }
.chat-settings-heading, .chat-settings-row {
  display: flex; justify-content: space-between; align-items: center; gap: .7rem;
}
.chat-settings-heading {
  flex: none; padding-block: calc(.5rem + env(safe-area-inset-top)) .5rem;
  padding-inline: max(.75rem, env(safe-area-inset-left)) max(.75rem, env(safe-area-inset-right));
  background: var(--blue); color: white;
}
.chat-settings-heading h2 {
  min-width: 0; font-size: clamp(1.05rem, 3vw, 1.3rem); text-align: end; overflow-wrap: anywhere;
}
.chat-settings-content {
  flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain;
  padding-block: 1rem calc(1rem + env(safe-area-inset-bottom));
  padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
}
.chat-settings-heading h2, .chat-settings-row p { margin: 0; }
.chat-settings-row p { margin-top: .25rem; font-size: .85rem; }
.chat-settings-row button { flex: none; }
.chat-settings-error { color: #852d40; }
.chat-settings-error:empty { display: none; }

.pair-members { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.pair-person {
  display: flex; gap: .5rem; align-items: center; min-width: 0;
  padding: .55rem; background: #f1f4ff; border-radius: .7rem;
}
.pair-person-copy { display: grid; gap: .12rem; min-width: 0; overflow-wrap: anywhere; }
.pair-person-copy strong { font-size: .9rem; }
.pair-person-copy small { color: #505a75; font-size: .78rem; }
.pair-discovery { margin: .65rem 0; }
.pair-invites { border-top: 1px solid var(--surface-line); margin-top: 1rem; padding-top: .85rem; }
.pair-invites h3 { font-size: .95rem; }
.pair-invites ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.pair-invite { margin: 0; padding: .55rem; border: 1px solid var(--surface-line); border-radius: .8rem; }
.pair-invite .pair-person { padding: .25rem; background: transparent; }
.pair-invite .actions { justify-content: flex-end; margin-top: .45rem; }
.pair-invite button { font-size: .82rem; }
@media (max-width: 23rem) { .pair-members { grid-template-columns: minmax(0, 1fr); } }

/* Form controls share the same surface and focus treatment as custom dropdowns. */
.fields { --field-surface: #f8f9fd; }
.fields :is(input:not([type="hidden"], [type="checkbox"], [type="radio"]), textarea, select, .picker-trigger) {
  width: 100%; border-color: #c7cfdf; border-radius: .7rem; background: var(--field-surface);
  color: var(--court-ink); padding-inline: .75rem;
}
.fields :is(input, textarea)::placeholder { color: #606d86; }
.fields :is(input, textarea, select, .picker-trigger):focus-visible { outline-offset: 1px; }
.fields textarea { min-height: 6.5rem; }
.fields input[type="file"] { padding: .35rem; }
.fields input::file-selector-button {
  min-height: 2rem; margin-inline-end: .55rem; padding: .2rem .65rem;
  border: 1px solid #d9e0f1; border-radius: .5rem; background: #e9eeff;
  color: #223d87; font: inherit; cursor: pointer;
}
.fields .location-field { min-width: 0; background: #fff; padding: .85rem; }
.fields .location-field legend { font-weight: 700; padding-inline: .25rem; }
.form-columns > div:has(> button[type="submit"], > button.primary) { grid-column: 1 / -1; }

@media (min-width: 44rem) {
  body { background: #f3f5fb; }
  .app-page { padding-block-start: .35rem; }

  .app-page .ui-card, .auth-panel { padding: clamp(1.15rem, 2.3vw, 1.65rem); }
  .fields { gap: 1rem; }
  .fields :is(label, .picker-field) { gap: .4rem; }
  .fields :is(input:not([type="hidden"], [type="checkbox"], [type="radio"]), select, .picker-trigger) { min-height: 3rem; }
  .create-page form.form-columns {
    max-width: none; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem 1.25rem;
    align-items: start;
  }
  .form-columns .form-wide { grid-column: 1 / -1; }
  .profile-page form.fields { max-width: none; }
  .inbox-page .conversation a { padding: .95rem 1.15rem; gap: .85rem; }
  .inbox-page .notification-link { padding: 1rem 1.15rem; }
  .identity-card { margin-bottom: 1.15rem; }
  .settings-page { max-width: 42rem; }
  .discover-feed { padding-block-start: .35rem; }
}
@media (min-width: 60rem) {
  main { padding-top: 1.6rem; }
  .create-page { max-width: 54rem; }
  .inbox-page { max-width: 54rem; }
}


.settings-panel h2, .pair-invites h3 {
  color: var(--court-ink); font-size: 1.05rem; font-weight: 700; margin-bottom: .75rem;
}

/* Landscape Home Screen mode can place the notch alongside full-width chat. */
:is(.chat-heading, .chat-composer, .chat-panel .chat-messages, .chat-mute-row) {
  padding-left: max(.6rem, env(safe-area-inset-left));
  padding-right: max(.6rem, env(safe-area-inset-right));
}
@media (min-width: 44rem) {
  :is(.chat-heading, .chat-composer, .chat-panel .chat-messages, .chat-mute-row) {
    padding-left: max(1rem, calc((100% - 58rem) / 2), env(safe-area-inset-left));
    padding-right: max(1rem, calc((100% - 58rem) / 2), env(safe-area-inset-right));
  }
}

.fields input[type="datetime-local"] {
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
}
.fields input[type="datetime-local"]::-webkit-date-and-time-value {
  min-width: 0;
  text-align: start;
}

.conversation-avatar { overflow: hidden; }

.chat-empty {
  align-self: center; display: grid; justify-items: center; gap: .5rem;
  width: min(100% - 1.5rem, 23rem); margin-block: auto 0;
  padding: .9rem 0; text-align: center;
}
.chat-empty:not([hidden]) + .chat-messages { flex: 0 1 auto; margin-bottom: auto; padding: 0; }
.chat-empty :is(h2, p) { margin: 0; }
.chat-empty h2 { font-size: 1.15rem; }
.chat-empty p { color: #505a75; font-size: .9rem; line-height: 1.5; }


body.chat-keyboard:has(.chat-panel) {
  position: relative;
  top: var(--chat-viewport-top, 0px);
  height: var(--chat-viewport-height, 100dvh);
}
.chat-keyboard:has(.chat-panel) nav { display: none; }
.chat-keyboard main:has(.chat-panel) { padding-bottom: 0; }
.chat-keyboard .chat-composer { padding-block-end: .45rem; }

/* Leave room for the Home indicator when the keyboard layout hides the tabs. */
@media (display-mode: standalone) {
  .chat-keyboard .chat-composer {
    padding-block-end: max(.65rem, env(safe-area-inset-bottom));
  }
}


@media (width < 44rem) {
  body.subpage nav { display: none; }
  body.subpage main { padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
  body.subpage main:has(.chat-panel) { padding-bottom: env(safe-area-inset-bottom); }
  body.subpage.chat-keyboard main:has(.chat-panel) { padding-bottom: 0; }
  body.subpage .toast { bottom: calc(.65rem + env(safe-area-inset-bottom)); }
}


.bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "brand title" "demo demo";
  gap: .35rem .65rem;
}
.header-brand-group { grid-area: brand; display: flex; align-items: center; gap: .45rem; }
.header-controls { grid-area: demo; }
@media (min-width: 44rem) {
  .bar {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "brand title" "nav nav" "demo demo";
  }
  .bar nav { grid-area: nav; }
}
@media (min-width: 64rem) {
  .bar {
    grid-template-columns: auto auto auto minmax(0, 1fr);
    grid-template-areas: "brand nav demo title";
  }
}
#header-title { grid-area: title; text-align: end; margin: 0; min-width: 0; font-size: clamp(1.12rem, 3vw, 1.45rem);
  line-height: 1.2; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-brand-group .brand { display: inline-flex; gap: .2rem; flex: none; align-items: center; }
.header-back.button { flex: none; padding: .35rem; background: #ffffff17; border-color: #ffffff55; color: white; }
.header-controls:has(.account[hidden]) { display: none; }
.auth-language { margin-top: .9rem; max-width: 12rem; }
.chat-kind { flex: 1; min-width: 0; }

.chat-composer { flex-wrap: wrap; }
.chat-attachment-selection {
  display: flex; align-items: center; justify-content: space-between; gap: .45rem;
  flex: 1 0 100%; padding-inline: .4rem; background: #edf0fb; border-radius: .55rem;
}
.chat-composer textarea { min-width: 0; }
.chat-attachment-selection strong, .chat-attachment-selection small {
  display: block; overflow-wrap: anywhere; font-size: .82rem;
}
.chat-attachment-selection small { color: var(--muted); }
.chat-attachment-selection small:empty { display: none; }
.chat-attachment-selection button { font-size: .78rem; }
.chat-media {
  display: block; width: min(100%, 20rem); height: auto; max-height: 19rem;
  margin-top: .35rem; border-radius: .65rem; object-fit: contain;
}
video.chat-media { background: #15192b; }

.usual-area {
  display: grid; gap: .55rem; min-width: 0; margin: 0; padding: .75rem;
  border: 1px solid var(--surface-line); border-radius: .85rem;
}
.usual-area legend { padding-inline: .3rem; font-weight: 700; }
.usual-area-locate { justify-self: start; gap: .35rem; color: var(--blue); background: #edf1ff; }
.usual-area-selects { display: grid; gap: .55rem; }
.usual-area-selects > * { min-width: 0; }
.usual-area p { margin: 0; font-size: .86rem; }
.usual-area-status:empty { display: none; }
.picker-search {
  position: sticky; top: 0; width: 100%; padding-inline: .65rem; border-color: #c7cfdf; border-radius: .6rem;
}
.picker-search-results { display: grid; gap: .25rem; }
.picker-no-results { margin: .5rem; }
@media (min-width: 40rem) {
  .usual-area-selects { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


.game-visibility {
  margin: 0; padding: 0; min-width: 0; border: 0;
}
.game-visibility legend { padding: 0; margin-bottom: .4rem; font-weight: 700; }
.game-visibility-options { display: grid; gap: .5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields .game-visibility-options label {
  display: flex; align-items: flex-start; gap: .45rem; padding: .65rem;
  border: 1px solid var(--surface-line); border-radius: .7rem; cursor: pointer;
}
.game-visibility-options label:has(input:checked) { border-color: #91a5e0; background: #eef2ff; }
.game-visibility-options input {
  width: 1rem; height: 1rem; min-height: 0; margin: .12rem 0 0; flex: none; accent-color: var(--blue);
}
.game-visibility-options small { display: block; margin-top: .2rem; color: #505a75; line-height: 1.35; }


.participant-picker { display: grid; align-content: end; gap: .4rem; min-width: 0; }
.participant-stepper {
  display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
  align-items: center; gap: .35rem; padding: .25rem;
  border: 1px solid #c7cfdf; border-radius: .75rem; background: #f8f9fd;
}
.participant-stepper button { padding: 0; background: #e9eeff; border-color: transparent; font-size: 1.25rem; }
.participant-stepper button:disabled { cursor: default; }
.participant-stepper output { text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.participant-error { color: #a02b36; margin: 0; }
.participant-error:empty { display: none; }


.required-mark { margin-inline-start: .22em; color: #a02b36; font-weight: 750; }
