.party-room, .party-dock {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 2.55rem;
  border: 1px solid #fff9e3bb;
  border-radius: 2rem;
  background: #fffbf0f7;
  color: #304333;
  box-shadow: 0 2px 12px #213f302d;
  pointer-events: auto;
}
.party-symbol { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.party-symbol svg { width: 1.05rem; height: 1.05rem; }
.party-room { position: relative; gap: 0; font-size: .84rem; font-weight: 650; line-height: 1.2; }
.party-count, .party-invite, .party-action { display: inline-flex; align-items: center; gap: .37rem; white-space: nowrap; }
.party-count { padding: .43rem .75rem; font-variant-numeric: tabular-nums; }
.party-count .party-symbol { color: #618258; }
.party-room:not([data-connection="online"]) .party-count { color: #755f48; }
.party-room:not([data-connection="online"]) .party-count .party-symbol { color: #997743; }
.party-invite, .party-action {
  position: relative;
  align-self: stretch;
  justify-content: center;
  border: 0;
  border-radius: 2rem;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.party-invite { min-height: 2.4rem; padding: .4rem .72rem; }
.party-invite .party-symbol svg { width: 1.07rem; height: 1.07rem; }
.party-invite::before, .party-action + .party-action::before {
  position: absolute;
  top: 25%;
  bottom: 25%;
  left: 0;
  width: 1px;
  background: #d9d9c9;
  content: '';
}
.party-invite:hover, .party-action:not(:disabled):hover { background: #eef0dc; }
.party-invite:focus-visible, .party-action:focus-visible { z-index: 1; outline-offset: -2px; }
.party-reader-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.party-invite-panel {
  position: absolute;
  z-index: 8;
  top: calc(100% + .46rem);
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .38rem;
  width: 15rem;
  max-width: 82vw;
  padding: .55rem .7rem .7rem;
  border: 1px solid #d8dcc8;
  border-radius: .9rem;
  background: var(--paper);
  box-shadow: 0 6px 18px #26382e30;
  font-size: .8rem;
  text-align: left;
}
.party-invite-panel input { grid-column: 1/-1; width: 100%; padding: .42rem; border: 1px solid #b9c3ad; border-radius: .35rem; color: var(--ink); background: #fffdf7; font: .88rem var(--sans); }
.party-popover-close { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; padding: 0; border: 0; border-radius: 50%; background: transparent; }
.party-popover-close:hover { background: #ebedde; }
.party-play .world-top { z-index: 4; }
.party-play .world-status { top: 4.1rem; z-index: 3; max-width: min(86%,26rem); }

.party-controls {
  position: absolute;
  z-index: 2;
  right: 1.05rem;
  bottom: 1rem;
  left: 1.05rem;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto auto;
  align-items: center;
  gap: .5rem;
  pointer-events: none;
}
.party-controls > .world-bottom { display: contents; }
.party-controls .move-hint { grid-column: 1; grid-row: 1; margin: 0; justify-self: start; }
.party-controls .context { grid-column: 3; grid-row: 1; justify-self: end; }
.party-controls #seat { grid-column: 4; grid-row: 1; justify-self: end; }
.party-dock {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  max-width: 100%;
  font-size: .86rem;
  font-weight: 650;
  line-height: 1.15;
}
.party-action { min-width: 0; min-height: 2.48rem; padding: .42rem .73rem; }
.party-action:disabled { opacity: .5; cursor: default; }
.party-wave, .party-activities, .party-kick { flex-shrink: 0; }
.party-identity { min-width: 0; }
.party-identity .party-symbol { color: #986746; }
.party-identity-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.party-avatar { flex: none; display: block; width: 1.45rem; height: 1.45rem; border-radius: 50%; object-fit: cover; }
.party-wave .party-symbol { color: #926237; }
.party-kick .party-symbol { color: #617b53; }
.party-play[data-party-seated="true"] .party-dock { grid-column: 1/3; justify-self: start; }
.party-play[data-party-seated="true"] .focus-panel { z-index: 3; }

.party-picker { width: min(48rem,calc(100vw - 2rem)); max-height: min(90svh,49rem); overflow: hidden; }
.party-picker[open] { display: flex; flex-direction: column; }
.party-picker-heading { position: relative; flex: none; padding: 1.45rem 1.55rem .9rem; }
.party-picker-heading h2 { max-width: calc(100% - 2.7rem); margin: 0; font-size: clamp(2.2rem,5vw,3.05rem); font-weight: 400; letter-spacing: -.05em; line-height: 1; }
.party-picker-heading h2:focus { outline: 0; }
.party-availability, .party-selection, .party-feedback { margin: 0; color: var(--mute); font-size: .88rem; line-height: 1.4; }
.party-availability { margin-top: .38rem; }
.party-picker-close { position: absolute; top: 1.05rem; right: 1.1rem; width: 2.25rem; height: 2.25rem; }
.party-options {
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  align-content: start;
  min-height: 0;
  gap: .8rem .64rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c9d0b8 transparent;
  scrollbar-width: thin;
  padding: .15rem 1.45rem 1rem;
  scroll-padding-block: .25rem 1rem;
}
.party-choice {
  min-width: 0;
  padding: .14rem .14rem .3rem;
  border: 1px solid transparent;
  border-radius: .8rem;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.party-choice[aria-disabled="true"] { cursor: default; }
.party-choice:focus-visible { outline-offset: -1px; }
.party-portrait { position: relative; display: block; width: 100%; aspect-ratio: 1.32; overflow: hidden; border-radius: .63rem; background: #e3e4d3; }
.party-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 32%; transition: transform .18s ease,filter .18s ease; }
.party-choice:not([aria-disabled="true"]):hover .party-portrait img { transform: scale(1.06); }
.party-choice:not([aria-disabled="true"]):hover { background: #f0f0e3; }
.party-choice[data-state="taken"] .party-portrait img { filter: saturate(.5); }
.party-choice[data-state="yours"] { border-color: #96a785; background: #edf0df; }
.party-selected-mark { position: absolute; top: .28rem; right: .28rem; display: none; place-items: center; width: 1.12rem; height: 1.12rem; border-radius: 50%; background: #38563e; color: #fffbed; }
.party-selected-mark svg { width: .8rem; height: .8rem; stroke-width: 2.5; }
.party-choice[data-state="yours"] .party-selected-mark { display: grid; }
.party-choice-name { display: block; margin: .33rem .17rem .06rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: .92rem; letter-spacing: -.035em; line-height: 1.2; }
.party-choice-status { display: flex; gap: .29rem; align-items: center; margin-inline: .18rem; color: #52694f; font-size: .76rem; line-height: 1.3; }
.party-choice-status::before { content: ''; width: .38rem; height: .38rem; flex: none; border-radius: 50%; background: #748d61; }
.party-choice[data-state="taken"] .party-choice-status { color: #7a6048; }
.party-choice[data-state="taken"] .party-choice-status::before { background: #aa805c; }
.party-choice[data-state="yours"] .party-choice-status { color: #364c35; }
.party-choice[data-state="yours"] .party-choice-status::before { background: #38563e; }
.party-feedback { flex: none; padding: .48rem 1.6rem; background: #f2eddd; color: #6e5135; }
.party-feedback:empty { display: none; }
.party-picker-footer { flex: none; display: flex; align-items: center; gap: .55rem; padding: .85rem 1.55rem; background: #f4f3e9; border-top: 1px solid var(--line); }
.party-selection { flex: 1; }
.party-release { white-space: nowrap; }
.party-done { flex: none; min-height: 2.45rem; }

@media (max-width:800px) {
  .party-controls { grid-template-columns: minmax(0,1fr) auto; }
  .party-controls .move-hint { grid-column: 1; grid-row: 1; }
  .party-controls .context { grid-column: 2; grid-row: 1; }
  .party-dock { grid-column: 1; grid-row: 2; justify-self: start; }
  .party-controls #seat { grid-column: 2; grid-row: 2; }
  .party-play[data-party-seated="true"] .party-dock { grid-column: 1; grid-row: 1; }
  .party-play[data-party-seated="true"] .focus-panel { right: 1.05rem; left: auto; bottom: 1rem; transform: none; }
  .party-options { grid-template-columns: repeat(5,minmax(0,1fr)); }
}
@media (max-width:600px) {
  .party-room, .party-dock { min-height: 2.2rem; }
  .party-room, .party-dock { font-size: .76rem; }
  .party-count, .party-invite { gap: .23rem; padding: .28rem .49rem; }
  .party-invite, .party-action { min-height: 2.17rem; }
  .party-action { gap: .32rem; padding: .32rem .55rem; }
  .party-symbol svg { width: .94rem; height: .94rem; }
  .party-invite .party-symbol svg { width: 1rem; height: 1rem; }
  .party-play .world-actions { gap: .28rem; }
  .party-play .world-status { top: 3.45rem; }
  .party-avatar { width: 1.27rem; height: 1.27rem; }
  .party-controls { left: .55rem; right: .55rem; bottom: .55rem; gap: .32rem; }
  .party-controls .context { grid-column: 1/-1; }
  .party-play[data-party-seated="true"] .party-controls { bottom: 5.2rem; }
  .party-play[data-party-seated="true"] .focus-panel { left: 50%; right: auto; bottom: .55rem; transform: translateX(-50%); }
  .party-picker { width: min(32rem,calc(100vw - 1.35rem)); max-height: 92svh; }
  .party-picker-heading { padding: 1.2rem 1.12rem .75rem; }
  .party-picker-close { right: .72rem; top: .72rem; }
  .party-options { grid-template-columns: repeat(4,minmax(0,1fr)); gap: .5rem .35rem; padding: .15rem .92rem .8rem; }
  .party-availability, .party-selection, .party-feedback { font-size: .81rem; }
  .party-picker-footer { padding: .67rem 1rem; gap: .4rem; flex-wrap: wrap; }
  .party-release, .party-done { font-size: .79rem; }
  .party-feedback { padding: .4rem 1rem; }
}
@media (max-width:470px) {
  .party-options { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width:480px) {
  .party-controls { grid-template-columns: minmax(0,1fr) auto; }
  .party-controls .context { grid-column: 1; grid-row: 1; justify-self: start; }
  .party-controls:has(.context:not([hidden])) .move-hint { display: none; }
  .party-controls #seat { grid-column: 2; grid-row: 1; }
  .party-dock { grid-column: 1/-1; grid-row: 2; justify-self: center; }
  .party-play[data-party-seated="true"] .party-dock { grid-column: 1/-1; justify-self: center; }
  .party-play .world-top #leave { gap: .22rem; padding: .38rem .5rem; }
  .party-picker-footer { column-gap: .55rem; }
  .party-release { padding-inline: 0; }
}
@media (max-width:350px) {
  .party-play .world-top #leave span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .party-invite .party-symbol { display: none; }
  .party-play .world-top #leave { width: 2.2rem; justify-content: center; }
  .party-choice-name { font-size: .84rem; }
}
@media (pointer:coarse) {
  .party-action, .party-invite, .party-done, .party-release,
  .party-play .world-control, .party-controls #seat,
  .focus-stand, .roster-toggle { min-height: 2.75rem; }
  .party-play .world-actions .world-control, .party-picker-close,
  .profile-dialog .modal-close { width: 2.75rem; height: 2.75rem; }
  .peer-label::after { content: ''; position: absolute; inset: -.4rem -.15rem; }
}
