.lobby, #auth-dialog {
  color-scheme: light;
  --lobby-paper: var(--pond-paper, #dfe6da);
  --lobby-sheet: var(--pond-sheet, #edf0e7);
  --lobby-ink: var(--pond-ink, #24382f);
  --lobby-muted: var(--pond-muted, #4a5d52);
  --lobby-pine: var(--pond-pine, #223a35);
  --lobby-on-pine: var(--pond-on-pine, #f4f4e9);
  --lobby-action: var(--pond-action, #315d50);
  --lobby-action-hover: var(--pond-action-hover, #24483d);
  --lobby-rule: var(--pond-rule, #b5c2af);
  --lobby-field-border: var(--pond-edge, #70816f);
  --lobby-frame: color-mix(in srgb, var(--lobby-pine) 42%, var(--lobby-field-border));
  --lobby-corners: polygon(0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0,
    calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px,
    100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px),
    calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px),
    4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px));
  --lobby-key-corners: polygon(0 3px, 3px 3px, 3px 0, calc(100% - 3px) 0, calc(100% - 3px) 3px,
    100% 3px, 100% calc(100% - 3px), calc(100% - 3px) calc(100% - 3px), calc(100% - 3px) 100%,
    3px 100%, 3px calc(100% - 3px), 0 calc(100% - 3px));
  color: var(--lobby-ink);
}

.lobby {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: flex;
  overflow: auto;
  overscroll-behavior: contain;
  padding: max(28px, env(safe-area-inset-top)) max(26px, env(safe-area-inset-right))
    max(32px, env(safe-area-inset-bottom)) max(26px, env(safe-area-inset-left));
  background: var(--lobby-pine);
}

.lobby-shell {
  width: min(100%, 1120px);
  min-width: 0;
  margin: auto;
  padding: 4px;
  clip-path: var(--lobby-corners);
  background: var(--lobby-frame);
}

.lobby-intro {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr);
  border-bottom: 4px solid var(--lobby-frame);
}

.lobby-cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(26px, 4.35vw, 64px);
  background: var(--lobby-pine);
  background: color-mix(in srgb, var(--lobby-pine) 79%, var(--lobby-action));
  color: var(--lobby-on-pine);
}
.lobby-cover::before {
  content: "";
  position: absolute;
  inset: 12px auto 12px 0;
  width: 4px;
  background: repeating-linear-gradient(to bottom,
    var(--lobby-frame) 0 3px, var(--lobby-action) 3px 6px, transparent 6px 16px);
  pointer-events: none;
}

.lobby-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.lobby-brand img { flex: none; image-rendering: pixelated; }
.lobby-brand h1 {
  margin: 0;
  color: inherit;
  font: 600 clamp(58px, 8.15vw, 114px)/.83 var(--font-display);
  letter-spacing: -.047em;
}
.lobby-brand h1 span { display: block; }
.lobby-brand h1:focus, #auth-title:focus { outline: none; }
.lobby-cover p {
  margin: 20px 0 0;
  font-size: clamp(16px, 1.6vw, 22px);
  font-weight: 550;
  line-height: 1.25;
}

.lobby-scene {
  position: relative;
  min-height: clamp(270px, 30vw, 426px);
  min-width: 0;
  background: var(--lobby-action);
}
.lobby-landscape {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 54%;
  image-rendering: pixelated;
}

.lobby-desk {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: clamp(24px, 3.65vw, 52px);
  padding: clamp(22px, 2.75vw, 40px) clamp(26px, 4.35vw, 64px);
  background: var(--lobby-paper);
}
.lobby-shell > noscript {
  position: static;
  display: block;
  padding: 22px 26px;
  transform: none;
  background: var(--lobby-paper);
  color: var(--lobby-ink);
}
.lobby-directory {
  min-width: 0;
  padding-inline-start: clamp(24px, 3.65vw, 52px);
  border-inline-start: 1px solid var(--lobby-rule);
}
.lobby-page { min-width: 0; }
.lobby h2 {
  margin: 0;
  color: var(--lobby-ink);
  font: 700 clamp(21px, 2.25vw, 26px)/1.08 var(--font-ui);
  letter-spacing: -.024em;
}
.lobby-start h2 {
  font-size: clamp(30px, 3.25vw, 46px);
  font-family: var(--font-display);
  text-wrap: balance;
}
.lobby-row, .lobby-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px 12px;
  min-width: 0;
}
.lobby-profile {
  margin-top: 12px;
  padding: 7px 10px 9px;
  background: color-mix(in srgb, var(--lobby-paper) 84%, var(--lobby-rule));
  box-shadow: inset 3px 0 var(--lobby-field-border), inset 0 -2px var(--lobby-rule);
}
.lobby-profile-row { flex-wrap: wrap; row-gap: 0; min-height: 44px; }
.lobby-person {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  min-height: 32px;
}
.lobby-person .pond-icon { flex: none; color: var(--lobby-muted); }
.lobby-person strong { font-weight: 650; overflow-wrap: anywhere; }
.lobby-account-actions, .lobby-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.lobby-actions { margin-top: 7px; }

.lobby-link, .lobby-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 44px;
  padding: 4px 9px;
  border: 0;
  color: var(--lobby-ink);
  font: 650 15px/1.15 var(--font-ui);
  text-align: start;
}

.lobby-note {
  margin: 7px 0 0;
  color: var(--lobby-muted);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.lobby-note.lobby-error {
  border-inline-start: 2px solid var(--lobby-action);
  padding-inline-start: 8px;
  color: var(--lobby-ink);
  font-weight: 650;
}
.lobby-guest-notice {
  padding-inline-start: 8px;
  border-inline-start: 2px solid var(--pond-water);
}
@media (min-width: 761px) and (min-height: 641px) {
  .lobby-directory .lobby-guest-notice { display: none; }
}
#lobby-profile-note { margin-top: 0; }
.lobby-profile form { margin-top: 8px; }
.lobby-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.lobby-input-label {
  display: block;
  width: fit-content;
  margin: 0 0 3px;
  color: var(--lobby-muted);
  font: 550 14px/1.2 var(--font-ui);
}
.lobby-field input, #auth-form input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid var(--lobby-field-border);
  border-radius: 0;
  box-shadow: inset 0 2px var(--lobby-rule);
  color: var(--lobby-ink);
  background: var(--lobby-sheet);
  font: 400 16px/1.2 var(--font-ui);
}
.lobby-field input::placeholder { color: var(--lobby-muted); opacity: 1; }
.lobby :is(button, input):focus-visible, #auth-dialog :is(button, input):focus-visible {
  outline: 2px solid var(--lobby-ink);
  outline-offset: 2px;
}
:is(.lobby, #auth-dialog) input[aria-invalid="true"] { border-color: var(--lobby-ink); }
.lobby-button {
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  color: var(--lobby-ink);
  font: 650 15px/1.2 var(--font-ui);
}
.lobby-button, .lobby-link, .lobby-shortcut, .auth-modes button, #auth-close {
  --lobby-key-face: var(--lobby-sheet);
  --lobby-key-light: color-mix(in srgb, var(--lobby-key-face) 68%, white);
  --lobby-key-shade: color-mix(in srgb, var(--lobby-key-face) 65%, var(--lobby-pine));
  position: relative;
  isolation: isolate;
  background: transparent;
}
:where(.lobby-button, .lobby-link, .lobby-shortcut, .auth-modes button, #auth-close)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: var(--lobby-key-corners);
  background: var(--lobby-key-face);
  box-shadow: inset 2px 2px var(--lobby-key-light), inset -2px -3px var(--lobby-key-shade);
}
:where(.lobby-button, .lobby-link, .lobby-shortcut, .auth-modes button, #auth-close):enabled:hover {
  --lobby-key-face: var(--lobby-paper);
}
:where(.lobby-button, .lobby-link, .lobby-shortcut, .auth-modes button, #auth-close):enabled:active::before {
  box-shadow: inset 2px 3px var(--lobby-key-shade), inset -2px -2px var(--lobby-key-light);
}
:is(.lobby-button, .lobby-link, .lobby-shortcut):is(:disabled, [aria-disabled="true"]) {
  --lobby-key-face: color-mix(in srgb, var(--lobby-paper) 84%, var(--lobby-field-border));
  color: var(--lobby-muted);
}
.lobby-play, .auth-submit {
  --lobby-key-face: var(--lobby-action);
  color: var(--lobby-on-pine);
  font-family: var(--font-display);
}
:is(.lobby-play, .auth-submit):enabled:hover { --lobby-key-face: var(--lobby-action-hover); }
.lobby-play {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 53px;
  margin-top: 12px;
  padding-inline: 15px;
  font-size: clamp(18px, 1.9vw, 25px);
  text-align: start;
}
.lobby-play .pond-icon { --icon-size: 32px; flex: none; }
.lobby-play:disabled .pond-icon { visibility: hidden; }
.lobby-guest-notice:not([hidden]) + .lobby-play { margin-top: 8px; }
.lobby-code {
  flex: none;
  padding: 3px 0;
  color: var(--lobby-muted);
  font: 550 13px/1 ui-monospace, monospace;
  letter-spacing: .045em;
}
.lobby-share-field { grid-template-columns: minmax(0, 1fr); gap: 1px; margin-top: 6px; }
#lobby-join-title { display: flex; align-items: center; gap: 5px; }
.lobby-join form { margin-top: 9px; }
.lobby-worlds { margin-top: 14px; border-top: 1px solid var(--lobby-rule); padding-top: 3px; }
.lobby-worlds > .lobby-row { min-height: 44px; }
.lobby-worlds > .lobby-note { margin-top: 0; }
.lobby-world-list {
  max-height: min(180px, 40vh);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--lobby-field-border) var(--lobby-paper);
  padding: 0;
  margin: 0;
  list-style: none;
}
.lobby-world-list li { border-top: 1px solid var(--lobby-rule); }
.lobby-world {
  display: grid;
  width: 100%;
  min-height: 44px;
  grid-template-columns: minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 10px;
  padding: 5px 2px;
  border: 0;
  background: transparent;
  color: var(--lobby-ink);
  font: 550 15px/1.2 var(--font-ui);
  text-align: start;
}
.lobby-world:enabled:hover { background: var(--lobby-sheet); }
.lobby .lobby-world:focus-visible { outline-offset: -2px; }
.lobby-world:disabled, .lobby-world .lobby-seats { color: var(--lobby-muted); }
.lobby-world code { font: 550 13px/1 ui-monospace, monospace; }
.lobby-world .lobby-seats { font-variant-numeric: tabular-nums; }
.lobby-world-arrow { justify-self: center; color: var(--lobby-action); }

#auth-dialog {
  width: min(430px, calc(100vw - 2 * max(12px, env(safe-area-inset-left), env(safe-area-inset-right))));
  max-height: calc(100dvh - 2 * max(12px, env(safe-area-inset-top), env(safe-area-inset-bottom)));
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  clip-path: var(--lobby-corners);
  background: var(--lobby-frame);
}
#auth-dialog::backdrop {
  background: color-mix(in srgb, var(--pond-pine, #223a35) 70%, transparent);
  backdrop-filter: none;
}
.auth-content { padding: 13px clamp(15px, 5vw, 27px) 23px; background: var(--lobby-paper); }
.auth-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding-bottom: 4px;
}
.auth-heading h2 {
  margin: 0;
  color: var(--lobby-ink);
  font: 600 clamp(26px, 6.9vw, 36px)/1.04 var(--font-display);
  letter-spacing: -.022em;
}
#auth-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-inline-end: -6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--lobby-ink);
}
#auth-close:hover { color: var(--lobby-action); }
.auth-modes { display: flex; gap: 5px; margin-bottom: 13px; }
.auth-modes button {
  min-height: 44px;
  padding: 4px 12px;
  border: 0;
  background: transparent;
  color: var(--lobby-muted);
  font: 650 16px/1.2 var(--font-ui);
}
.auth-modes button[aria-pressed="true"] { --lobby-key-face: var(--lobby-rule); color: var(--lobby-ink); }
#auth-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; margin-top: 12px; }
#auth-form label { margin-top: 3px; color: var(--lobby-ink); font: 650 16px/1.2 var(--font-ui); }
.auth-password { display: flex; align-items: stretch; position: relative; min-width: 0; }
#auth-password { padding-inline-end: 84px; }
#auth-reveal {
  position: absolute;
  inset: 1px 1px 1px auto;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--lobby-action);
  font: 650 14px/1.2 var(--font-ui);
}
#auth-dialog #auth-reveal:focus-visible { outline-offset: -2px; }
#auth-password-hint { margin: 0; }
.auth-submit { width: 100%; margin-top: 7px; font-size: 18px; }
.auth-social { margin-top: 14px; border-top: 1px solid var(--lobby-rule); padding-top: 7px; }
.auth-social > p { margin-top: 2px; }
#auth-social-title { color: var(--lobby-ink); font-weight: 650; }
.auth-providers { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.auth-providers .lobby-button { flex: 1 1 max-content; }
.auth-legacy {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  margin-top: 8px;
  padding: 6px 9px;
  background: var(--lobby-sheet);
  color: var(--lobby-ink);
  font-size: 15px;
  line-height: 1.25;
  cursor: pointer;
}
.auth-legacy input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--lobby-action); }

@media (max-width: 760px) {
  .lobby {
    padding: max(12px, env(safe-area-inset-top)) max(11px, env(safe-area-inset-right))
      max(20px, env(safe-area-inset-bottom)) max(11px, env(safe-area-inset-left));
  }
  .lobby-shell { width: min(100%, 512px); margin-block: 0 auto; }
  .lobby-intro { grid-template-columns: minmax(0, 1fr); }
  .lobby-cover { align-items: start; padding: 15px clamp(14px, 5vw, 23px) 13px; }
  .lobby-brand { flex-direction: row; align-items: center; gap: 7px; }
  .lobby-brand img { width: 25px; height: 25px; }
  .lobby-brand h1 { font-size: clamp(38px, 10.45vw, 56px); line-height: .99; }
  .lobby-brand h1 span { display: inline; }
  .lobby-cover p { margin: 2px 0 0; padding: 0; border: 0; font-size: 15px; }
  .lobby-scene { min-height: clamp(108px, 34vw, 168px); }
  .lobby-desk { grid-template-columns: minmax(0, 1fr); gap: 17px; padding: 15px clamp(14px, 5vw, 23px) 21px; }
  .lobby-directory { border-inline-start: 0; padding: 14px 0 0; border-top: 1px solid var(--lobby-rule); }
  .lobby-start h2 { font-size: clamp(28px, 7.8vw, 34px); text-wrap: wrap; }
  .lobby-play { margin-top: 9px; min-height: 49px; }
  .lobby-play .pond-icon { --icon-size: 24px; }
  .lobby-profile { margin-top: 6px; }
  .lobby-account-actions, .lobby-actions { column-gap: 4px; }
}
@media (max-width: 375px) {
  .lobby-desk { gap: 13px; padding-block-start: 13px; }
  .lobby-directory { padding-block-start: 9px; }
  .lobby-actions .lobby-shortcut { padding-inline: 7px; font-size: 14px; }
  .lobby-account-actions .lobby-link { padding-inline: 7px; font-size: 14px; }
  .lobby-profile { padding-block: 4px 6px; }
  .lobby-profile-row { column-gap: 7px; }
  .lobby-join form { margin-top: 7px; }
  .lobby-field { gap: 6px; }
  .lobby-button { padding-inline: 10px; }
  .lobby-world { gap: 5px; font-size: 14px; }
}

@media (orientation: landscape) and (max-height: 450px) {
  .lobby {
    padding: max(8px, env(safe-area-inset-top)) max(11px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom)) max(11px, env(safe-area-inset-left));
  }
  .lobby-shell { width: min(100%, 1040px); margin-block: 0 auto; }
  .lobby-intro { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .lobby-cover { padding: 11px 15px; }
  .lobby-brand { flex-direction: row; align-items: center; gap: 6px; }
  .lobby-brand img { width: 23px; height: 23px; }
  .lobby-brand h1 { font-size: clamp(26px, 6.25vw, 50px); line-height: 1; }
  .lobby-brand h1 span { display: inline; }
  .lobby-cover p { margin: 4px 0 0; font-size: 14px; }
  .lobby-scene { min-height: clamp(86px, 24vh, 104px); }
  .lobby-desk { gap: 13px; padding: 13px 16px 18px; }
  .lobby-start h2 { font-size: clamp(27px, 4.5vw, 37px); }
}
