#rooms-open {
  min-height: 44px;
  grid-column: 7;
  grid-row: 1;
}

.rooms-notice {
  margin: 16px 0 0;
  padding: 7px 12px;
  border: 1px solid #a995735c;
  border-radius: 12px;
  background: #faf4e6ed;
  color: #85432f;
  font-size: .83rem;
}

.rooms-dialog {
  width: min(460px, calc(100% - 24px));
  max-height: min(85dvh, 680px);
  padding: 20px;
  overflow-y: auto;
}

.rooms-dialog h2 {
  font: 600 1.5rem/1.15 var(--serif);
  text-align: left;
  letter-spacing: -.02em;
}

.rooms-heading { display: flex; align-items: center; gap: 11px; }
.rooms-kicker { margin: 0 0 3px; color: var(--muted); font-size: .77rem; font-weight: 650; }

.in-lobby .game {
  background:
    radial-gradient(ellipse 125% 87% at 17% 110%, #593b29ab 46%, transparent 47%),
    radial-gradient(ellipse 107% 88% at 97% 114%, #a57a4ce3 53%, transparent 54%),
    linear-gradient(151deg, #342f2c86 3%, #362c2970 68%),
    url('/sprites/material-0.webp') repeat #b28c5d;
}
.in-lobby .game > * { visibility: hidden; }

.rooms-dialog.is-lobby {
  width: min(510px, calc(100% - 24px));
  padding: clamp(20px, 5.5vw, 33px);
}
.rooms-dialog.is-lobby h2 { font-size: clamp(2.1rem, 7.5vw, 3rem); }
.rooms-dialog.is-lobby .compass-mark { width: 44px; height: 44px; font-size: 25px; }
.rooms-dialog.is-lobby #room-join-form {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #dfcbae;
}
.rooms-dialog.is-lobby #room-create {
  width: 100%;
  background-color: #684f35;
  border-color: #684f35;
  color: #fff9ec;
}
.rooms-dialog.is-lobby #room-join { background: #f4e7cf; border-color: #c5b294; color: #604c38; }

#room-join-form { margin-top: 18px; }

.room-controls, .room-share, .rooms-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.room-share {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #dfcbae;
  border-radius: 12px;
  background: #fff9ec;
}

.room-share a { flex: 1 1 auto; }
.rooms-actions { margin-top: 16px; }

.rooms-dialog input {
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #c6b693;
  border-radius: 9px;
  color: var(--ink);
  background: #fffcf4;
  font: inherit;
  font-size: 16px;
}

#room-join-link { flex: 1 1 152px; }
#room-copy-value { width: 100%; }

.rooms-dialog button:not(.shop-close), .rooms-dialog a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid #c5b294;
  border-radius: 9px;
  color: #604c38;
  background: #f4e7cf;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.rooms-dialog button.room-primary {
  background: #684f35;
  color: #fff9ec;
  border-color: #684f35;
}

.rooms-dialog button:disabled { opacity: .6; cursor: default; }
.rooms-feedback { margin: 8px 0 0; color: var(--ink); font-size: .85rem; }

@media (min-width: 901px) {
  .hud-top { grid-template-columns: auto 1fr auto auto auto auto auto; }
}

@media (max-width: 900px) {
  .hud-top { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .hud-top .wordmark { grid-area: 1 / 1 / auto / span 2; }
  #rooms-open { grid-area: 1 / 3; justify-self: end; }
  .hud-top .health { grid-area: 2 / 1; max-width: 100%; }
  .hud-top .health-track { min-width: 16px; }
  .hud-top .shop-open { grid-area: 2 / 2; min-height: 44px; }
  .hud-top .look-button { grid-area: 2 / 3; min-height: 44px; justify-self: end; }
  .hud-top .shop-status { grid-area: 3 / 1; }
  .hud-top .presence, .hud-top[data-ready='true'] .presence {
    grid-area: 3 / 2 / auto / span 2;
    justify-self: end;
  }
}

@media (max-width: 620px) {
  .rooms-dialog { padding: 16px; }
}

@media (pointer: coarse) and (min-height: 501px), (max-width: 555px) and (min-height: 501px) {
  .game:has(#rooms-open:not([hidden])) .locator {
    top: max(145px, calc(env(safe-area-inset-top) + 133px));
  }
}

@media (max-width: 370px) {
  .hud-top .look-icon { display: none; }
  .hud-top .world-button { padding-inline: 8px; }
}
