/* The shared lobby (D-0152): one racer select for the whole room, every member's cursor live on the
   roster, the party along the bottom, the room code at the top. The screen sizes itself from its
   own box (a container), so it lays out the same in the site and in the journal's mock. */
.party-select {
  position:relative;
  container:lobby / size;
  height:var(--lobby-height,100svh);
  min-height:0;
  overflow:hidden;
}
.party-select .ps {
  position:absolute;
  inset:0;
}

/* The room code, top centre. */
.party-select .ps-room {
  position:absolute;
  top:12px;
  left:50%;
  transform:translateX(-50%);
  width:440px;
  max-width:calc(100% - 24px);
  padding:0 12px 4px;
  text-align:center;
  z-index:4;
}
.ps-room-head {
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:12px;
}
.ps-eyebrow {
  color:#ffd100;
  font-size:13px;
  letter-spacing:.14em;
  text-transform:uppercase;
}
.ps-course {
  color:#bbb;
  font-size:12px;
}
/* The party leader's course button on the plaque (D-0192). */
.ps-course-pick {
  display:flex;
  align-items:center;
  gap:6px;
  padding:0;
  border:0;
  background:none;
  color:#ffd100;
  font:inherit;
  font-size:12px;
  text-shadow:inherit;
  cursor:pointer;
}
.ps-course-pick:hover,.ps-course-pick:focus-visible {
  color:#fff;
}
.ps-room-body {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:16px;
  margin-top:6px;
}
.ps-code {
  display:flex;
  gap:6px;
  perspective:300px;
}
.ps-code span {
  width:50px;
  height:60px;
  display:grid;
  place-items:center;
  font-size:40px;
  line-height:1;
  padding-top:4px;
  color:#fff;
  background:#000000cc;
  border:1px solid #6f5d3a;
  box-shadow:inset 0 0 10px #000,0 0 0 1px #000;
  text-shadow:0 0 10px #ffd10077,1px 2px #000;
}
.ps-code.pending span {
  background:linear-gradient(100deg,#000c 35%,#4a3d24 50%,#000c 65%) 0 0/300% 100%;
  animation:ps-shimmer 1.1s linear infinite;
}
.ps-code span.flip {
  animation:ps-flip .45s cubic-bezier(.2,.9,.3,1.25) backwards;
  animation-delay:calc(var(--i) * 80ms);
}
@keyframes ps-shimmer {
  to { background-position:-150% 0; }
}
@keyframes ps-flip {
  from { transform:rotateX(90deg); opacity:0; }
  to { transform:none; opacity:1; }
}
.ps-share {
  display:grid;
  gap:4px;
}
.party-select .ps-share .small {
  min-width:112px;
  min-height:30px;
  padding:7px 12px 9px;
}
.ps-link {
  margin-top:4px;
  color:#bbb;
  font-size:12px;
  user-select:all;
  overflow-wrap:anywhere;
}
.ps-link:empty {
  display:none;
}
.ps-qr {
  display:grid;
  justify-items:center;
  gap:6px;
  margin:8px 0 4px;
}
.ps-qr canvas {
  width:148px;
  height:148px;
  image-rendering:pixelated;
  box-shadow:0 0 0 1px #000,0 0 0 3px #6f5d3a;
  background:#fff;
}
.ps-qr p {
  color:#ddd;
  font-size:12px;
}

/* Solo's plaque (D-0210): the CPU rivals' count, in the code's tiles, a step either way. */
.party-select .ps-solo {
  width:360px;
}
.ps-solo .ps-room-body {
  gap:14px;
}
.ps-cpus {
  display:grid;
  justify-items:center;
  gap:2px;
  min-width:96px;
}
.ps-cpu-count {
  min-width:64px;
  height:60px;
  display:grid;
  place-items:center;
  padding:4px 8px 0;
  font-size:40px;
  line-height:1;
  color:#fff;
  background:#000000cc;
  border:1px solid #6f5d3a;
  box-shadow:inset 0 0 10px #000,0 0 0 1px #000;
  text-shadow:0 0 10px #ffd10077,1px 2px #000;
}
.ps-cpu-label {
  color:#e8e0c8;
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.party-select .ps-step {
  width:40px;
  height:40px;
  min-width:0;
  padding:0 0 3px;
  border-radius:50%;
  border:2px solid #6f5d3a;
  background:radial-gradient(circle at 40% 35%,#3a2d18,#0c0a07);
  box-shadow:0 0 0 1px #000,0 2px 6px #000a;
  color:#ffd100;
  font:28px/1 WoW,Georgia,serif;
  text-shadow:1px 1px 0 #000;
  cursor:pointer;
}
.party-select .ps-step:hover:not(:disabled),.party-select .ps-step:focus-visible {
  border-color:#ffd100;
  color:#fff;
}
.party-select .ps-step:disabled {
  opacity:.35;
  cursor:default;
}
/* A CPU rival's plate: a hostile unit frame's red bar, no colour of its own. */
.ps-card.ps-cpu {
  --c:#7a6a48;
  border-color:#3e3220;
  background:linear-gradient(180deg,#0f0c08e0,#050403e0);
}
.ps-cpu .ps-avatar {
  box-shadow:0 0 0 2px #7a6a48,0 0 0 3px #000,inset 0 0 8px #000;
  filter:saturate(.85);
}
.ps-cpu .ps-name {
  color:#ffd100;
}
.ps-cpu .ps-bar:before {
  width:100%;
  background:linear-gradient(180deg,#d42a2a,#7a0b0b);
}
.ps-cpu .ps-bar span {
  color:#fff;
}
/* The plaque's course once the leader has called it for the next race (D-0210). */
.ps-course-pick.ps-called {
  color:#fff;
}

/* The roster, left: WoW's character list, with a lane at each row's end for the party's coins. */
.party-select .ps-roster {
  position:absolute;
  left:12px;
  top:130px;
  width:312px;
  height:min(560px,calc(100% - 352px));
  padding:0 4px;
  display:flex;
  flex-direction:column;
  z-index:2;
}
.party-select .ps-roster .realm-name {
  margin:0 0 4px;
}
.ps-rows {
  flex:1;
  min-height:0;
  display:grid;
  grid-auto-rows:minmax(42px,1fr);
  overflow-y:auto;
  overflow-x:hidden;
}
.party-select .ps-racer {
  min-height:0;
  padding:4px 6px 4px 10px;
  gap:10px;
}
.party-select .ps-racer .portrait {
  width:44px;
  height:44px;
}
.party-select .ps-racer .racer-text {
  flex:1;
  min-width:0;
}
.party-select .ps-racer .racer-text strong {
  font-size:15px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.party-select .ps-short {
  display:none;
}
.party-select .ps-lane {
  display:flex;
  margin:0;
  align-items:center;
  flex:none;
  padding-left:6px;
}

/* A member's coin: their colour, their initial; yours is ringed in gold. */
.party-select .ps-coin {
  --c:#fff;
  margin-top:0 !important;
  --t:#000;
  position:relative;
  width:22px;
  height:22px;
  margin-left:-7px;
  border-radius:50%;
  display:grid;
  place-items:center;
  padding-top:2px;
  font-size:12px;
  line-height:1;
  color:var(--t);
  text-shadow:none;
  background:radial-gradient(circle at 35% 30%,color-mix(in srgb,var(--c) 55%,#fff),var(--c) 55%,color-mix(in srgb,var(--c) 65%,#000));
  box-shadow:0 0 0 1.5px #000,0 1px 4px #000;
}
.party-select .ps-coin:first-child {
  margin-left:0;
}
.party-select .ps-coin.ps-coin-you {
  width:26px;
  height:26px;
  font-size:14px;
  z-index:1;
  box-shadow:0 0 0 1.5px #000,0 0 0 3px #ffd100,0 0 10px #ffd100aa;
}
.party-select .ps-coin.ps-coin-locked:after {
  content:'';
  position:absolute;
  right:-6px;
  bottom:-5px;
  width:12px;
  height:14px;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 14'%3E%3Cpath d='M3 6V4.2a3 3 0 0 1 6 0V6' fill='none' stroke='%23000' stroke-width='3'/%3E%3Cpath d='M3 6V4.2a3 3 0 0 1 6 0V6' fill='none' stroke='%23ffd100' stroke-width='1.6'/%3E%3Crect x='1' y='5.5' width='10' height='7.5' rx='1.2' fill='%23ffd100' stroke='%23000'/%3E%3C/svg%3E") center/contain no-repeat;
}
.party-select .ps-coin.ps-just-locked {
  animation:ps-coin-lock .7s ease-out;
}
@keyframes ps-coin-lock {
  0% { box-shadow:0 0 0 1.5px #000,0 0 0 2px #ffd100,0 0 0 2px #ffd10000; transform:scale(1.4); }
  60% { box-shadow:0 0 0 1.5px #000,0 0 0 3px #ffd100,0 0 0 14px #ffd10000; }
  100% { transform:none; }
}

/* The browsed racer's kit, right. */
.party-select .ps-kit {
  position:absolute;
  right:12px;
  left:auto;
  top:15px;
  bottom:auto;
  width:340px;
  height:calc(100% - 237px);
  margin:0;
  z-index:2;
}
.ps-kit-close,.ps-hero {
  display:none;
}

/* The party, along the bottom: one plate a member, like WoW's party frames. */
.party-select .ps-party {
  position:absolute;
  left:16px;
  right:16px;
  bottom:104px;
  height:84px;
  display:flex;
  justify-content:center;
  gap:10px;
  margin:0;
  padding:0;
  list-style:none;
  z-index:3;
}
.ps-card {
  --c:#fff;
  --t:#000;
  position:relative;
  flex:0 1 214px;
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 12px 8px 10px;
  background:linear-gradient(180deg,#14100be8,#060504e8);
  border:1px solid #5a4a2a;
  border-radius:3px;
  box-shadow:inset 0 0 0 1px #000,0 3px 10px #000a;
  isolation:isolate;
}
.ps-card.ps-you {
  border-color:#c9a227;
  box-shadow:inset 0 0 0 1px #000,0 0 12px #ffd10044,0 3px 10px #000a;
}
.party-select .ps-avatar {
  position:relative;
  width:58px;
  height:58px;
  transition:background-image .2s;
  box-shadow:0 0 0 3px var(--c),0 0 0 4px #000,inset 0 0 8px #000;
}
.ps-crown {
  position:absolute;
  left:-9px;
  top:-11px;
  width:24px;
  height:18px;
  transform:rotate(-18deg);
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 18'%3E%3Cpath d='M2 15 L1 4 L7 9 L12 1 L17 9 L23 4 L22 15 Z' fill='%23ffd100' stroke='%23000' stroke-width='1.5' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='11' r='1.8' fill='%23c41f3b'/%3E%3C/svg%3E") center/contain no-repeat;
  filter:drop-shadow(0 1px 1px #000);
}
.ps-who {
  display:grid;
  gap:3px;
  min-width:0;
  flex:1;
}
.ps-name {
  color:#fff;
  font-size:15px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.ps-rename {
  display:flex;
  align-items:center;
  gap:6px;
  max-width:100%;
  padding:0;
  border:0;
  background:none;
  color:#fff;
  font:inherit;
  font-size:15px;
  text-align:left;
  text-shadow:inherit;
}
.ps-rename:hover {
  color:#ffd100;
}
.ps-pen {
  flex:none;
  width:12px;
  height:12px;
  opacity:.75;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1 11 L1.6 8.2 L8.4 1.4 L10.6 3.6 L3.8 10.4 Z' fill='%23ffd100' stroke='%23000' stroke-width='.8'/%3E%3C/svg%3E") center/contain no-repeat;
}
.ps-name-input {
  width:100%;
  height:24px;
  padding:2px 6px;
  font:15px WoW,Georgia,serif;
  color:#fff;
  background:#000;
  border:1px solid #c9a227;
}
.ps-pick {
  color:#ffd100;
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
/* The state bar, as a unit frame's: dark while choosing, mana blue while loading, health green
   once locked in. */
.ps-bar {
  position:relative;
  height:14px;
  background:#000;
  border:1px solid #3a3020;
  overflow:hidden;
}
.ps-bar:before {
  content:'';
  position:absolute;
  inset:0;
  width:0;
  background:linear-gradient(180deg,#2bd62b,#0a8a0a);
  transition:width .35s ease-out;
}
.ps-bar span {
  position:relative;
  display:block;
  text-align:center;
  font-size:10px;
  line-height:13px;
  color:#ddd;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.ps-locked .ps-bar:before {
  width:100%;
}
.ps-locked .ps-bar span {
  color:#fff;
}
.ps-loading.ps-browsing .ps-bar:before {
  width:100%;
  background:linear-gradient(90deg,#0b2a8f,#3a6fff 50%,#0b2a8f) 0 0/200% 100%;
  animation:ps-shimmer 1.4s linear infinite;
}
.ps-loading .ps-avatar:after {
  content:'';
  position:absolute;
  inset:-7px;
  border-radius:50%;
  border:2px solid transparent;
  border-top-color:#5d9bff;
  border-right-color:#5d9bff;
  filter:drop-shadow(0 0 3px #3a6fff);
  animation:ps-spin 1.1s linear infinite;
}
@keyframes ps-spin {
  to { transform:rotate(1turn); }
}
.ps-browsing .ps-bar span,.ps-waiting .ps-bar span {
  color:#999;
}
.ps-you-tag {
  position:absolute;
  right:6px;
  top:4px;
  color:#c9a227;
  font-size:10px;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.ps-card.ps-just-locked:after {
  content:'';
  position:absolute;
  inset:-1px;
  z-index:-1;
  border-radius:3px;
  background:radial-gradient(ellipse at 30% 50%,#ffd100aa,transparent 70%);
  animation:ps-card-lock .9s ease-out forwards;
}
.ps-card.ps-just-locked .ps-avatar {
  animation:ps-avatar-lock .6s ease-out;
}
@keyframes ps-card-lock {
  from { opacity:1; }
  to { opacity:0; }
}
@keyframes ps-avatar-lock {
  0% { transform:scale(1); }
  35% { transform:scale(1.14); box-shadow:0 0 0 3px #ffd100,0 0 0 4px #000,0 0 18px #ffd100; }
  100% { transform:scale(1); }
}
.ps-invite button {
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  height:100%;
  padding:0;
  border:0;
  background:none;
  font:inherit;
  text-align:left;
  text-shadow:inherit;
}
.ps-card.ps-invite {
  border-style:dashed;
  border-color:#6f5d3a;
  background:#000a;
}
.ps-invite:hover {
  border-color:#ffd100;
}
.ps-plus {
  flex:none;
  width:58px;
  height:58px;
  border-radius:50%;
  border:2px dashed #6f5d3a;
  background:radial-gradient(#2a2216,#0c0a07);
  display:grid;
  place-items:center;
}
.ps-plus:before {
  content:'+';
  color:#ffd100;
  font-size:30px;
  line-height:1;
}
.ps-alone {
  flex-basis:280px;
}
.ps-alone .ps-plus {
  animation:ps-beckon 2.4s ease-in-out infinite;
}
@keyframes ps-beckon {
  50% { border-color:#ffd100; box-shadow:0 0 14px #ffd10055; }
}
/* Seven or more: smaller plates, the racer name dropped. */
.ps-party.ps-crowded .ps-card {
  flex-basis:120px;
  gap:6px;
  padding:6px 6px;
}
.ps-party.ps-crowded .ps-avatar,.ps-party.ps-crowded .ps-plus {
  width:40px;
  height:40px;
}
.ps-party.ps-crowded .ps-pick,.ps-party.ps-crowded .ps-you-tag {
  display:none;
}
.ps-party.ps-crowded .ps-name,.ps-party.ps-crowded .ps-rename {
  font-size:13px;
}
.ps-party.ps-crowded .ps-bar span {
  font-size:9px;
  letter-spacing:0;
}
.ps-party.ps-crowded .ps-card.ps-invite {
  flex-basis:64px;
  justify-content:center;
}
.ps-party.ps-crowded .ps-invite .ps-who {
  display:none;
}
.ps-party.ps-crowded .ps-invite button {
  justify-content:center;
}

/* WoW's system messages: "Kobold joins the party." */
.ps-log {
  position:absolute;
  left:340px;
  right:370px;
  bottom:200px;
  display:grid;
  justify-items:center;
  gap:2px;
  z-index:3;
  pointer-events:none;
}
.ps-log p {
  color:#ffff00;
  font-size:15px;
  text-shadow:1px 1px 0 #000,0 0 4px #000;
  animation:ps-log 6s linear forwards;
}
@keyframes ps-log {
  0%,80% { opacity:1; }
  100% { opacity:0; }
}

/* The buttons: Leave, the main button with its status line, Controls. */
.party-select .ps-actions {
  position:absolute;
  left:0;
  right:0;
  bottom:18px;
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:end;
  padding:0 20px;
  z-index:3;
}
.ps-left {
  justify-self:start;
}
.ps-right {
  justify-self:end;
}
.ps-main {
  display:grid;
  justify-items:center;
  gap:2px;
}
.ps-buttons {
  display:flex;
  align-items:center;
  gap:10px;
}
.ps-status {
  color:#e8e0c8;
  font-size:13px;
  min-height:19px;
  text-align:center;
}
.party-select .ps-go.ps-ready {
  animation:ps-ready 1.8s ease-in-out infinite;
}
@keyframes ps-ready {
  50% { filter:brightness(1.25) drop-shadow(0 0 10px #ffd10088); }
}

/* Laptops: everything tighter, the vehicle line dropped. */
@container lobby (max-height:820px) {
  .party-select .ps-roster {
    top:124px;
    height:calc(100% - 320px);
  }
  .party-select .ps-kit {
    height:calc(100% - 210px);
  }
  .party-select .ps-racer small {
    display:none;
  }
  .party-select .ps-racer .portrait {
    width:36px;
    height:36px;
  }
  .party-select .ps-party {
    bottom:94px;
    height:68px;
  }
  .ps-card {
    padding:5px 10px 5px 8px;
  }
  .party-select .ps-avatar,.ps-plus {
    width:46px;
    height:46px;
  }
  .ps-pick {
    display:none;
  }
  .ps-log {
    bottom:168px;
  }
}
@container lobby (max-width:1100px) {
  .party-select .ps-roster {
    width:260px;
  }
  .party-select .ps-kit {
    width:280px;
  }
  .ps-log {
    left:280px;
    right:300px;
  }
}

/* Phones: one column. The code and share buttons on top, the racer standing in the scene, the
   party as a row of portraits, the roster as a grid of tiles, the button at the bottom. */
@container lobby (max-width:700px) {
  .party-select .ps {
    display:flex;
    flex-direction:column;
    gap:8px;
    padding:8px 10px 10px;
    overflow-y:auto;
  }
  .party-select .ps-room,.party-select .ps-roster,.party-select .ps-party,.party-select .ps-actions,.ps-log {
    position:static;
    transform:none;
    inset:auto;
    width:auto;
    height:auto;
    max-width:none;
  }
  .party-select .ps-room {
    order:1;
    flex:none;
    display:grid;
    grid-template-columns:auto 1fr;
    align-items:center;
    gap:2px 10px;
    padding:0 8px 2px;
    border-width:12px;
    text-align:left;
  }
  .ps-room-head {
    display:contents;
  }
  .ps-eyebrow {
    grid-column:1;
    grid-row:1;
    font-size:11px;
  }
  .ps-course,.ps-link {
    display:none;
  }
  .ps-room-body {
    display:contents;
  }
  .ps-code {
    grid-column:1;
    grid-row:2;
    gap:4px;
  }
  .ps-code span {
    width:34px;
    height:42px;
    font-size:28px;
  }
  .ps-share {
    grid-column:2;
    grid-row:1 / 3;
    grid-auto-flow:column;
    justify-content:end;
    gap:6px;
  }
  .party-select .ps-share .small {
    min-width:0;
    padding:8px 10px 10px;
  }
  .ps-qr {
    grid-column:1 / -1;
  }
  .party-select .ps-room .ps-share button[data-action=copy-link] {
    display:none;
  }
  .party-select .ps-room:not(:has(.ps-share-button)) .ps-share button[data-action=copy-link] {
    display:inline-block;
  }
  .ps-hero {
    order:2;
    flex:1 0 120px;
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:10px;
    padding:0 2px;
  }
  .ps-hero-name {
    display:grid;
    min-width:0;
  }
  .ps-hero-name strong {
    color:#ffd100;
    font-size:20px;
    font-weight:400;
    line-height:1.15;
  }
  .ps-hero-name span {
    color:#fff;
    font-size:12px;
  }
  .ps-kit-button {
    flex:none;
    display:flex;
    align-items:center;
    gap:4px;
    padding:6px 8px;
    border:1px solid #6f5d3a;
    background:#000b;
    font:inherit;
    font-size:12px;
    color:#ffd100;
  }
  .ps-kit-button .spell-icon {
    width:26px;
    height:26px;
  }
  .party-select .ps-party {
    order:3;
    flex:none;
    display:flex;
    justify-content:flex-start;
    gap:6px;
    overflow-x:auto;
    padding:6px 2px 2px;
    scrollbar-width:none;
  }
  .ps-card,.ps-party.ps-crowded .ps-card {
    flex:0 0 66px;
    flex-direction:column;
    gap:5px;
    padding:0;
    background:none;
    border:0;
    box-shadow:none;
  }
  .ps-card.ps-you {
    box-shadow:none;
  }
  .party-select .ps-avatar,.ps-plus,.ps-party.ps-crowded .ps-avatar,.ps-party.ps-crowded .ps-plus {
    width:48px;
    height:48px;
  }
  .ps-card.ps-you .ps-avatar {
    box-shadow:0 0 0 3px var(--c),0 0 0 4px #000,0 0 0 6px #ffd100,inset 0 0 8px #000;
  }
  .ps-who {
    width:100%;
    justify-items:center;
    gap:3px;
  }
  .ps-name,.ps-rename,.ps-party.ps-crowded .ps-name {
    font-size:12px;
    max-width:66px;
  }
  .ps-pen {
    display:none;
  }
  .ps-pick,.ps-you-tag,.ps-invite .ps-who .ps-pick {
    display:none;
  }
  .ps-bar {
    width:44px;
    height:5px;
    border:0;
  }
  .ps-bar span {
    display:none;
  }
  .ps-card.ps-invite,.ps-alone {
    flex:0 0 66px;
    border:0;
    background:none;
  }
  .ps-invite button {
    flex-direction:column;
    gap:5px;
  }
  .ps-invite .ps-name {
    font-size:11px;
    color:#ccc;
    white-space:normal;
    text-align:center;
  }
  .ps-crown {
    left:-6px;
    top:-9px;
    width:20px;
    height:15px;
  }
  .party-select .ps-roster {
    order:4;
    flex:none;
    padding:0 2px;
    border-width:10px;
  }
  .party-select .ps-roster .realm-name {
    display:none;
  }
  .ps-rows {
    grid-template-columns:repeat(4,1fr);
    grid-auto-rows:auto;
    gap:2px;
    overflow:visible;
  }
  .party-select .ps-racer {
    position:relative;
    flex-direction:column;
    justify-content:flex-start;
    gap:4px;
    min-height:0;
    padding:6px 2px 5px;
    text-align:center;
  }
  .party-select .ps-racer .portrait,.party-select .ps-racer .portrait {
    width:52px;
    height:52px;
  }
  .party-select .ps-racer .racer-text {
    display:none;
  }
  .party-select .ps-short {
    display:block;
    color:#ffd100;
    font-size:12px;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .party-select .ps-lane {
    position:absolute;
    top:2px;
    right:2px;
    padding:0;
    flex-direction:row-reverse;
  }
  .party-select .ps-coin {
    width:17px;
    height:17px;
    margin:0 0 0 -8px;
    font-size:10px;
  }
  .party-select .ps-coin:first-child {
    margin-left:-8px;
  }
  .party-select .ps-coin:last-child {
    margin-left:0;
  }
  .party-select .ps-coin.ps-coin-you {
    width:19px;
    height:19px;
    font-size:11px;
    box-shadow:0 0 0 1.5px #000,0 0 0 2.5px #ffd100,0 0 6px #ffd100aa;
  }
  .party-select .ps-coin.ps-coin-locked:after {
    right:-4px;
    bottom:-4px;
    width:9px;
    height:11px;
  }
  .party-select .ps-kit {
    display:none;
  }
  .party-select.ps-kit-open .ps-kit {
    display:block;
    position:absolute;
    inset:auto 8px 8px;
    top:18%;
    width:auto;
    height:auto;
    z-index:10;
    overflow-y:auto;
    background-color:#090906f8;
    box-shadow:0 0 0 100vmax #000b;
  }
  .party-select.ps-kit-open .ps-kit-close {
    display:block;
    float:right;
    min-width:0;
  }
  .party-select .ps-actions {
    order:5;
    flex:none;
    grid-template-columns:auto minmax(0,1fr);
    gap:8px;
    padding:0;
    align-items:start;
  }
  .party-select .ps-left {
    margin-top:9px;
  }
  .ps-right {
    display:none;
  }
  .party-select .ps-leave {
    min-width:0;
    font-size:12px;
    padding:8px 9px 10px;
  }
  .ps-main {
    justify-items:stretch;
    min-width:0;
  }
  .ps-status {
    order:2;
    font-size:12px;
    min-height:0;
  }
  /* The leader, locked in, has Leave, Change Racer and Start Race on one row: the last takes
     what is left. */
  .ps-buttons {
    justify-content:center;
    gap:6px;
    min-width:0;
  }
  .party-select .ps-go {
    flex:1 1 0;
    width:auto;
    min-width:0;
    max-width:260px;
    height:52px;
    padding-left:8px;
    padding-right:8px;
  }
  .party-select .ps-change {
    flex:none;
    min-width:0;
    font-size:12px;
    padding:8px 9px 10px;
  }
  .ps-log {
    position:absolute;
    left:0;
    right:0;
    top:96px;
    bottom:auto;
  }
  .ps-log p {
    font-size:13px;
  }
}

/* In the site: on a phone the wordmark gives the lobby (and solo's racer screen) its room, and the
   racer stands below the plaque. */
@media (max-width:620px) {
  #shell:is([data-screen=lobby],[data-screen=racer],[data-screen=course],[data-screen=loading]) .masthead {
    display:none;
  }
  #shell:is([data-screen=lobby],[data-screen=racer],[data-screen=course],[data-screen=loading]) #content {
    min-height:100svh;
  }
  #shell:is([data-screen=lobby],[data-screen=racer],[data-screen=course]).racer-scene {
    background-position:50% 56px;
  }
  #shell:is([data-screen=lobby],[data-screen=racer],[data-screen=course]) #scene-video {
    top:56px;
  }
}

/* The course panel (D-0198): the zone's map with the course marked, the courses, the route. It
   opens over the racer screen's stage, solo's and the room's (after Lock In, or from the plaque),
   sized from its slot: the map as tall as the slot allows, the list beside it. */
.course-slot {
  position:absolute;
  z-index:6;
  display:grid;
  justify-items:center;
  align-items:start;
  container:course / size;
  pointer-events:none;
}
.course-panel {
  pointer-events:auto;
  width:fit-content;
  max-width:100%;
  max-height:100cqh;
  display:flex;
  flex-direction:column;
  padding:0 4px 2px;
  background-color:#090906f6;
  box-shadow:0 8px 30px #000c;
}
.cp-head {
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:16px;
  padding:0 4px 7px;
  margin-bottom:10px;
  border-bottom:1px solid #786947;
}
.cp-head h2 {
  color:#ffd100;
  font-size:20px;
  outline:none;
}
.cp-head span {
  color:#ccc;
  font-size:13px;
}
.cp-body {
  flex:1;
  min-height:0;
  display:grid;
  grid-template-columns:minmax(0,min(720px,calc((100cqh - 130px) * 1.5))) 230px;
  grid-template-rows:minmax(0,1fr);
  gap:12px;
}
.cp-map {
  position:relative;
  align-self:start;
  aspect-ratio:3 / 2;
  line-height:0;
  box-shadow:0 0 0 1px #000,0 0 0 2px #6f5d3a;
}
.cp-map img {
  width:100%;
  height:100%;
  display:block;
}
/* The marker: its diamond on the course's start, the name beside it. */
.cp-map .map-location {
  transform:translate(-13px,-50%);
  pointer-events:none;
}
.cp-map .map-location.west {
  transform:translate(calc(-100% + 13px),-50%);
}
.cp-map .map-location.west:before {
  content:none;
}
.cp-map .map-location.west:after {
  content:'◆';
  color:#ffcf00;
  margin-left:5px;
}
.cp-side {
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:8px;
  overflow-y:auto;
  scrollbar-width:thin;
  scrollbar-color:#6f5d3a transparent;
}
.cp-rows {
  display:grid;
  gap:2px;
}
.course-panel .cp-row {
  min-height:0;
  padding:6px 8px 7px 12px;
}
.course-panel .cp-row strong {
  font-size:16px;
}
.course-panel .cp-row span,.course-panel .cp-row small {
  margin-top:2px;
  font-size:11px;
}
.cp-route {
  flex:none;
  display:block;
  width:100%;
  height:auto;
  padding:4px;
  background:#ccb57a;
  border:1px solid #927644;
}
.cp-blurb {
  color:#eee;
  font-size:13px;
  line-height:1.4;
}
.cp-foot {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 2px 2px;
}
.cp-hint {
  flex:1;
  text-align:center;
  color:#bbb;
  font-size:12px;
}
.course-panel .cp-foot button {
  min-width:130px;
}
/* Narrow slots: one column, the map over the courses, the panel scrolls. */
@container course (max-width:620px) {
  .course-panel {
    width:100%;
  }
  .cp-head {
    flex-wrap:wrap;
    gap:2px 12px;
  }
  .cp-body {
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:none;
    overflow-y:auto;
  }
  .cp-side {
    overflow:visible;
  }
  .cp-rows {
    grid-template-columns:1fr 1fr;
  }
  .cp-route {
    max-width:340px;
    margin:0 auto;
  }
  .course-panel .cp-foot button {
    min-width:0;
    padding-left:14px;
    padding-right:14px;
  }
  .cp-map .map-location {
    font-size:10px;
  }
}

/* In the lobby: under the plaque, over the party, in place of the roster and the kit. */
.party-select .ps-course-slot {
  left:12px;
  right:12px;
  top:152px;
  bottom:198px;
}
.party-select.ps-course-open .ps-roster,.party-select.ps-course-open .ps-kit {
  visibility:hidden;
}
/* The plaque's course button for members who don't pick: an eye, not a pen. */
.ps-look {
  flex:none;
  width:14px;
  height:10px;
  opacity:.75;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 10'%3E%3Cpath d='M1 5 Q7 -2 13 5 Q7 12 1 5 Z' fill='none' stroke='%23ffd100' stroke-width='1.4'/%3E%3Ccircle cx='7' cy='5' r='2' fill='%23ffd100'/%3E%3C/svg%3E") center/contain no-repeat;
}
@container lobby (max-height:820px) {
  .party-select .ps-course-slot {
    top:140px;
    bottom:168px;
  }
}
/* Phones: a sheet over the lobby, its course on a line of the plaque. */
@container lobby (max-width:700px) {
  .party-select .ps-course-slot {
    inset:0;
    padding:8px;
    background:#000c;
    pointer-events:auto;
    z-index:12;
  }
  .party-select .ps-room .ps-course {
    display:flex;
    grid-column:1 / -1;
    grid-row:3;
    justify-self:start;
    margin-top:2px;
  }
}

/* The lineup (D-0210): the course called and the grid, over the zone's loading screen, while every
   game fetches the course. It covers the whole screen; the race starts once everyone has it. */
.ps-lineup {
  position:absolute;
  inset:0;
  z-index:20;
  background:#000 var(--loading-art,url('glue/loading.png')) center/cover no-repeat;
  animation:lu-in .35s ease-out;
}
.ps-lineup:before {
  content:'';
  position:absolute;
  inset:0;
  background:linear-gradient(180deg,#000c,#0006 30%,#0004 55%,#000d);
}
@keyframes lu-in {
  from { opacity:0; }
}
.party-select.ps-lineup-open .ps > :not(.ps-lineup) {
  visibility:hidden;
}
.lu {
  position:relative;
  height:100%;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto auto;
  justify-items:center;
  gap:18px;
  padding:48px 24px 28px;
}
.lu-head {
  text-align:center;
}
.lu-eyebrow {
  color:#f5e3b6;
  font-size:14px;
  letter-spacing:.3em;
  text-transform:uppercase;
}
.lu-name {
  margin-top:6px;
  color:#ffd100;
  font-size:52px;
  font-weight:400;
  line-height:1.05;
  outline:none;
  text-shadow:0 0 18px #000,2px 3px 0 #000;
  animation:lu-name .6s cubic-bezier(.2,.8,.2,1) .1s backwards;
}
@keyframes lu-name {
  from { opacity:0; transform:scale(1.15); letter-spacing:.08em; }
}
.lu-place {
  margin-top:6px;
  color:#eee;
  font-size:15px;
}
.lu-route {
  align-self:center;
  max-width:min(440px,100%);
  max-height:100%;
  min-height:0;
  padding:6px;
  background:#ccb57ae6;
  border:1px solid #927644;
  box-shadow:0 0 0 1px #000,0 8px 30px #000c;
  animation:lu-in .5s ease-out .2s backwards;
}
.lu-grid {
  display:grid;
  grid-template-columns:repeat(var(--cols,4),auto);
  justify-content:center;
  gap:10px;
  margin:0;
  padding:0;
  list-style:none;
}
.lu-plate {
  --c:#7a6a48;
  --t:#000;
  display:flex;
  align-items:center;
  gap:10px;
  width:184px;
  padding:8px 10px;
  background:linear-gradient(180deg,#14100bee,#060504ee);
  border:1px solid #5a4a2a;
  border-radius:3px;
  box-shadow:inset 0 0 0 1px #000,0 3px 10px #000a;
  animation:lu-plate .45s cubic-bezier(.2,.9,.3,1.2) backwards;
}
.lu-plate:nth-child(2) { animation-delay:.06s; }
.lu-plate:nth-child(3) { animation-delay:.12s; }
.lu-plate:nth-child(4) { animation-delay:.18s; }
.lu-plate:nth-child(5) { animation-delay:.24s; }
.lu-plate:nth-child(6) { animation-delay:.3s; }
.lu-plate:nth-child(n+7) { animation-delay:.36s; }
@keyframes lu-plate {
  from { opacity:0; transform:translateY(16px); }
}
.lu-plate.lu-you {
  border-color:#c9a227;
  box-shadow:inset 0 0 0 1px #000,0 0 12px #ffd10044,0 3px 10px #000a;
}
.party-select .lu-avatar {
  position:relative;
  flex:none;
  width:48px;
  height:48px;
  box-shadow:0 0 0 3px var(--c),0 0 0 4px #000,inset 0 0 8px #000;
}
.lu-plate:not(.lu-ready) .lu-avatar:after {
  content:'';
  position:absolute;
  inset:-7px;
  border-radius:50%;
  border:2px solid transparent;
  border-top-color:#5d9bff;
  border-right-color:#5d9bff;
  filter:drop-shadow(0 0 3px #3a6fff);
  animation:ps-spin 1.1s linear infinite;
}
.lu-who {
  display:grid;
  min-width:0;
  flex:1;
}
.lu-who strong {
  color:#fff;
  font-size:14px;
  font-weight:400;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.lu-who span {
  color:#ffd100;
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.lu-cpu .lu-who strong {
  color:#ffd100;
}
.lu-cpu .lu-who span {
  color:#d42a2a;
}
.lu-state {
  flex:none;
  color:#8fb3ff;
  font-size:10px;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.lu-ready .lu-state {
  color:#2bd62b;
}
.lu-grid.lu-crowded .lu-plate {
  width:150px;
  gap:8px;
  padding:6px 8px;
}
.lu-grid.lu-crowded .lu-avatar {
  width:38px;
  height:38px;
}
.lu-grid.lu-crowded .lu-state {
  display:none;
}
.lu-foot {
  width:min(600px,100%);
  text-align:center;
}
.lu-status {
  color:#eee;
  font-size:13px;
}
.lu .load-frame {
  margin:10px 0 8px;
}
.lu-tip {
  color:#ddd;
  font-size:13px;
}
.lu-buttons:not(:empty) {
  margin-top:10px;
}
@container lobby (max-height:820px) {
  .lu {
    padding:28px 20px 20px;
    gap:12px;
  }
  .lu-name {
    font-size:42px;
  }
}
/* Phones: the plates two by two, the route smaller. */
@container lobby (max-width:700px) {
  .lu {
    padding:20px 12px 16px;
    gap:10px;
  }
  .lu-name {
    font-size:30px;
  }
  .lu-place {
    font-size:13px;
  }
  .lu-route {
    max-width:300px;
  }
  .lu-grid,.lu-grid.lu-crowded {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:6px;
    width:100%;
  }
  .lu-plate,.lu-grid.lu-crowded .lu-plate {
    width:auto;
    gap:6px;
    padding:5px 6px;
  }
  .party-select .lu-avatar,.lu-grid.lu-crowded .lu-avatar {
    width:32px;
    height:32px;
  }
  .lu-state,.lu-grid.lu-crowded .lu-state {
    display:none;
  }
  .lu-who strong {
    font-size:12px;
  }
  .lu-who span {
    font-size:11px;
  }
}
/* Phones: solo's plaque on one row, the count and its steps at the right. */
@container lobby (max-width:700px) {
  .party-select .ps-room.ps-solo {
    width:auto;
    grid-template-columns:1fr auto;
    padding:4px 8px 6px;
  }
  .party-select .ps-room.ps-solo .ps-field-line {
    display:block;
    grid-column:1;
    grid-row:2;
    margin:0;
    font-size:13px;
    color:#e8e0c8;
  }
  .ps-solo .ps-room-body {
    display:flex;
    grid-column:2;
    grid-row:1 / 3;
    gap:8px;
    margin:0;
  }
  .ps-cpus {
    min-width:0;
  }
  .ps-cpu-count {
    min-width:40px;
    height:40px;
    font-size:26px;
  }
  .ps-cpu-label {
    font-size:9px;
  }
  .party-select .ps-step {
    width:36px;
    height:36px;
    font-size:24px;
  }
  .ps-card.ps-cpu .ps-bar:before {
    width:100%;
  }
}
/* The course panel carries its own Back and Race Here: the buttons under it step aside, and so do
   the system messages, which would show between the panel and the party. */
.party-select.ps-course-open .ps-buttons,.party-select.ps-course-open .ps-log {
  visibility:hidden;
}
/* A plate whose game has just got the course: a flash of green round its portrait. */
.lu-plate.lu-ready:not(.lu-cpu) .lu-avatar {
  animation:lu-ready .6s ease-out;
}
@keyframes lu-ready {
  35% { box-shadow:0 0 0 3px #2bd62b,0 0 0 4px #000,0 0 16px #2bd62b; }
}
