.online-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connection-badge {
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(34, 52, 47, 0.12);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.72);
  font-size: 10px;
  font-weight: 750;
}

.connection-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d5a23f;
  box-shadow: 0 0 0 3px rgba(213, 162, 63, 0.14);
}

.connection-badge[data-status="connected"] i {
  background: #3f9b6d;
  box-shadow: 0 0 0 3px rgba(63, 155, 109, 0.14);
}

.connection-badge[data-status="disconnected"] i,
.connection-badge[data-status="error"] i {
  background: #bd4d50;
  box-shadow: 0 0 0 3px rgba(189, 77, 80, 0.14);
}

.online-screen {
  min-height: calc(100vh - 73px);
  padding: clamp(30px, 5vw, 74px) clamp(20px, 6vw, 104px);
}

.online-layout {
  min-height: calc(100vh - 190px);
  display: grid;
  grid-template-columns: minmax(310px, 0.85fr) minmax(460px, 1.15fr);
  align-items: center;
  gap: clamp(42px, 8vw, 130px);
}

.online-copy {
  max-width: 660px;
}

.online-copy h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 5.2vw, 78px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.online-copy > p:not(.eyebrow) {
  max-width: 600px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.online-steps {
  margin-top: 30px;
  display: grid;
  gap: 9px;
}

.online-steps span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
}

.online-steps b {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-size: 10px;
}

.local-link {
  margin-top: 30px;
  display: inline-block;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.local-link:hover {
  text-decoration: underline;
}

.online-card {
  border: 1px solid rgba(34, 52, 47, 0.1);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.95);
  box-shadow: var(--shadow);
}

.entrance-card {
  width: 100%;
  max-width: 690px;
  justify-self: end;
  padding: clamp(24px, 3vw, 40px);
}

.online-card-heading,
.lobby-code-row,
.lobby-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.online-card h2,
.lobby-layout h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 600;
}

.online-chip {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--green);
  background: var(--mint);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.profile-fields {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 12px;
}

.profile-fields label,
.join-form label {
  display: grid;
  gap: 6px;
}

.profile-fields label > span,
.join-form label > span,
.max-player-control > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
}

.profile-fields input,
.profile-fields select,
.join-form input,
.max-player-control select {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid #d7dcd5;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
}

.room-action-block {
  margin-top: 18px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 74px auto;
  align-items: end;
  gap: 13px;
  border: 1px solid rgba(36, 92, 77, 0.14);
  border-radius: 14px;
  background: rgba(220, 234, 227, 0.46);
}

.room-action-block h3,
.room-action-block p {
  margin: 0;
}

.room-action-block h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.room-action-block p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.max-player-control {
  display: grid;
  gap: 6px;
}

.or-divider {
  margin: 17px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #98a39d;
  font-size: 9px;
  text-transform: uppercase;
}

.or-divider::before,
.or-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #e0e3dd;
}

.join-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
}

.join-form input {
  text-transform: uppercase;
  font-weight: 850;
  letter-spacing: 0.18em;
}

.lobby-layout {
  width: min(1080px, 100%);
  min-height: calc(100vh - 190px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(500px, 1.4fr) minmax(280px, 0.6fr);
  align-items: start;
  gap: 20px;
}

.lobby-main,
.lobby-side {
  padding: clamp(24px, 3vw, 40px);
}

.lobby-code-row h1 {
  margin: 0;
  color: var(--green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 5vw, 68px);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.invite-url {
  margin: 5px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  overflow: hidden;
  color: var(--muted);
  background: #f0f1eb;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-heading {
  margin-top: 32px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.lobby-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.lobby-players {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.lobby-player {
  min-width: 0;
  padding: 11px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  border: 1px solid #e0e3dc;
  border-radius: 11px;
  background: #fbfaf6;
}

.lobby-player.offline {
  opacity: 0.55;
}

.lobby-player .player-dot {
  width: 14px;
  height: 14px;
}

.lobby-player-name {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-player small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.lobby-player small.ready {
  color: #33835b;
}

.host-mark {
  color: var(--gold);
}

.lobby-side {
  position: sticky;
  top: 95px;
}

.lobby-side > p:not(.eyebrow):not(.form-error) {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.lobby-side .button-large {
  margin-top: 20px;
}

.lobby-side .button-large + .button-large {
  margin-top: 9px;
}

.text-button {
  width: 100%;
  margin-top: 14px;
  padding: 7px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.text-button:hover {
  color: var(--danger);
}

@media (max-width: 960px) {
  .online-layout {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .entrance-card {
    max-width: none;
  }

  .lobby-layout {
    grid-template-columns: 1fr;
  }

  .lobby-side {
    position: static;
  }
}

@media (max-width: 650px) {
  .connection-badge span {
    display: none;
  }

  .online-header-actions {
    gap: 5px;
  }

  .online-screen {
    padding: 28px 15px 42px;
  }

  .online-layout {
    min-height: auto;
    gap: 32px;
  }

  .online-copy h1 {
    font-size: clamp(43px, 13vw, 62px);
  }

  .online-copy > p:not(.eyebrow) {
    font-size: 15px;
  }

  .entrance-card,
  .lobby-main,
  .lobby-side {
    padding: 21px 16px;
    border-radius: 18px;
  }

  .profile-fields,
  .room-action-block,
  .join-form {
    grid-template-columns: 1fr;
  }

  .room-action-block .max-player-control {
    grid-template-columns: 1fr 80px;
    align-items: center;
  }

  .lobby-code-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .lobby-players {
    grid-template-columns: 1fr;
  }
}
