/* ============================================================
   Kancha Go -- the Lobby: who is online, friends, chat, challenges.
   CSS only, no new art; same wooden/gold look as Watch Live and Solo Challenge.
   Everything the player typed (names, messages) is set with textContent in src/lobby.js.
   ============================================================ */

#lobby {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #fff;
  font-family: "Fredoka", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* the blue of the supplied Lobby design: a soft glow in the middle, darker at the edges */
  background: radial-gradient(ellipse 95% 70% at 50% 42%, #003c8e 0%, #012a6e 62%, #002666 100%);
}
#lobby > * { width: 100%; max-width: 460px; margin-left: auto; margin-right: auto; flex: none; }
/* the direct children above are centred in a 460px column; these ones inset themselves or take the free height */
#lobby > .lobby__pane { flex: 1 1 auto; }
#lobby > .lobby__status,
#lobby > .lobby__challenge { width: calc(100% - 28px); }

.lobby__top {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: max(10px, var(--safe-area-inset-top, env(safe-area-inset-top))) 12px 4px;
}
#lobby-back {
  flex: none;
  width: 44px;
  height: 49px;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: url("assets/lobby-hdr-back.png") center / 100% 100% no-repeat;
}
.lobby__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  aspect-ratio: 474 / 134;
  font-size: 0; /* the word "Lobby" is painted into the picture; the text stays for screen readers */
  color: transparent;
  background: url("assets/lobby-hdr-title.png") center / 100% 100% no-repeat;
}
.lobby__icon {
  position: relative;
  flex: none;
  width: 50px;
  height: 55px;
  padding: 0;
  font-size: 0;
  color: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
}
#lobby-inbox { background-image: url("assets/lobby-hdr-mail.png"); }
#lobby-refresh { background-image: url("assets/lobby-hdr-refresh.png"); }
.lobby__icon:active { transform: scale(0.94); }
.lobby__icon b {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 21px;
  text-align: center;
  color: #fff;
  background: url("assets/lobby-badge.webp") center / contain no-repeat;
}

.lobby__status {
  margin: 4px 14px 0;
  padding: 6px 12px;
  text-align: center;
  font-size: 13px;
  color: #ffe9a8;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
}

/* a challenge you received or sent, pinned above whatever tab is open */
.lobby__challenge {
  position: relative;
  display: block;
  margin-top: 8px;
  aspect-ratio: 1974 / 510;
  background: url("assets/lobby-banner-incoming.webp") center / 100% 100% no-repeat;
  animation: lobby-pop 0.25s ease-out;
}
.lobby__challenge[data-kind="waiting"] { aspect-ratio: 1974 / 492; background-image: url("assets/lobby-banner-waiting.webp"); }
.lobby__challenge-text { position: absolute; left: 22%; top: 50%; width: 45%; transform: translateY(-50%); }
.lobby__challenge-text b { display: block; font-size: 16px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lobby__challenge-text small { display: block; font-size: 12px; font-weight: 500; color: #bcd8ff; }
.lobby__challenge[data-kind="waiting"] .lobby__challenge-text { left: 25%; width: 41%; font-size: 14px; font-weight: 600; line-height: 1.25; }
.lobby__challenge[data-kind="waiting"] .lobby__challenge-text b { display: inline; font-size: 14px; }
/* Accept, Decline and Cancel are painted into the banner; the real buttons sit invisibly on top of them */
.lobby__challenge .lobby-btn { position: absolute; padding: 0; font-size: 0; opacity: 0; }
.lobby__challenge [data-act="accept"] { left: 68.4%; top: 14.6%; width: 28.3%; height: 33%; }
.lobby__challenge [data-act="decline"] { left: 68.4%; top: 52%; width: 28.3%; height: 33%; }
.lobby__challenge [data-act="cancel"] { left: 67%; top: 28%; width: 29.3%; height: 41%; }
@keyframes lobby-pop { from { transform: translateY(-6px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }

/* buttons: gold = the main thing to do, plain = everything else */
.lobby-btn {
  flex: none;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #4a2a05;
  background: linear-gradient(180deg, #ffe382, #f2a11c);
  border: 2px solid #fff2c0;
  border-radius: 999px;
  box-shadow: 0 3px 0 #a86a0a;
  cursor: pointer;
}
.lobby-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.lobby-btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.5); }
.lobby-btn--plain {
  color: #fff;
  background: linear-gradient(180deg, #3b4a6e, #222c47);
  border: 2px solid #5b6c96;
  box-shadow: 0 3px 0 #131a2c;
}
.lobby-btn--danger {
  color: #fff;
  background: linear-gradient(180deg, #ef5a4c, #b3281c);
  border-color: #ffb3aa;
  box-shadow: 0 3px 0 #6e130b;
}

.lobby__tabs {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding: 0 14px;
}
.lobby__tab {
  position: relative;
  flex: 1;
  height: 46px;
  padding: 0 6px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: none;
  box-shadow: none;
  border-radius: 0;
  border: 1px solid transparent;
  /* the tab pictures are 900 x 173: the slanted ends stay as painted, the middle stretches */
  border-image: url("assets/lobby-tab-blue.webp") 60 100 60 100 fill / 17px 30px 17px 30px stretch;
  cursor: pointer;
}
.lobby__tab b { margin-left: 3px; color: #ffd869; }
.lobby__tab.is-on {
  color: #4a2a05;
  border-image-source: url("assets/lobby-tab-gold.webp");
}
.lobby__tab.is-on b { color: #7a3e00; }
.lobby__tab i {
  position: absolute;
  top: 3px;
  right: 10px;
  width: 16px;
  height: 16px;
  background: url("assets/lobby-badge.webp") center / contain no-repeat;
}

.lobby__pane { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px 16px; }
.lobby__pane[hidden] { display: none; }

.lobby-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lobby-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  text-align: left;
  color: #fff;
  border-radius: 14px;
  background: linear-gradient(180deg, #24304a, #131b2e);
  border: 2px solid #3a4a70;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.08), 0 4px 8px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}
.lobby-row:active { transform: translateY(1px); }
.lobby-row--off { opacity: 0.62; }
.lobby-row__flag { flex: none; width: 28px; height: 20px; display: grid; place-items: center; }
.lobby-row__flag img { width: 28px; height: 20px; object-fit: cover; border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
.lobby-row__flag span { font-size: 18px; filter: grayscale(0.4); }
.lobby-row__info { flex: 1; min-width: 0; }
.lobby-row__name { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lobby-row__name em { font-style: normal; color: #ffd869; margin-left: 4px; }
.lobby-row__sub { font-size: 12px; color: var(--muted, #9ab0cf); font-weight: 500; margin-top: 1px; }
.lobby-row__state { flex: none; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #c9d6ee; }
.lobby-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #3fc26b; box-shadow: 0 0 6px #3fc26b; }
.lobby-dot--busy { background: #f2a11c; box-shadow: 0 0 6px #f2a11c; }
.lobby-dot--off { background: #6b7790; box-shadow: none; }

.lobby__empty {
  margin: 28px auto 0;
  max-width: 340px;
  text-align: center;
  color: var(--muted, #9ab0cf);
  font-size: 15px;
  line-height: 1.5;
}
.lobby__hint { margin: 12px 4px 0; text-align: center; color: var(--muted, #9ab0cf); font-size: 12.5px; line-height: 1.4; }
.lobby__hint b { color: #ffd869; }

.lobby__add { margin-top: 16px; }
.lobby__add label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: #cdd8ee; }
.lobby__addrow, .lobby__chatform { display: flex; gap: 8px; }
.lobby__addrow input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 16px; /* 16px stops iOS zooming the page when it is focused */
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid #3a4a70;
  border-radius: 12px;
}
.lobby__addrow input { text-transform: uppercase; letter-spacing: 0.18em; text-align: center; font-weight: 700; }
.lobby__addrow button { flex: none; padding: 0 16px; border-radius: 12px; font-family: inherit; font-size: 15px; font-weight: 700; color: #4a2a05; background: linear-gradient(180deg, #ffe382, #f2a11c); border: 2px solid #fff2c0; box-shadow: 0 3px 0 #a86a0a; cursor: pointer; }
.lobby__mycode { margin: 16px 0 0; text-align: center; font-size: 14px; color: #cdd8ee; }
.lobby__mycode b { margin: 0 4px; font-size: 17px; letter-spacing: 0.16em; color: #ffd869; user-select: all; }
.lobby__mycode button { padding: 3px 10px; font-family: inherit; font-size: 12px; font-weight: 700; color: #fff; background: #3b4a6e; border: 1px solid #5b6c96; border-radius: 999px; cursor: pointer; }

/* chat */
.lobby__pane--chat { display: flex; flex-direction: column; }
.lobby-chatlog {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;
  margin: 0 0 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* the supplied panel: corners and rim stay as painted, the middle stretches (the art is 830 x 1288) */
  border: 10px solid transparent;
  border-image: url("assets/lobby-chat-panel.png") 90 fill / 40px / 0 stretch;
}
.lobby-line { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.lobby-line button { padding: 0; font: inherit; font-weight: 700; color: #7ab8ff; background: none; border: none; border-radius: 0; box-shadow: none; cursor: pointer; }
.lobby-line--me button { color: #ffd869; }
.lobby-line img { width: 16px; height: 12px; margin-right: 4px; vertical-align: -1px; border-radius: 2px; }
.lobby-line--sys { color: var(--muted, #9ab0cf); font-size: 12.5px; text-align: center; }

/* the one sheet: a player's card, a conversation, or the conversation list */
.lobby-sheet {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(2, 6, 16, 0.65);
  max-width: none !important;
}
.lobby-sheet__card {
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 16px 16px max(16px, var(--safe-area-inset-bottom, env(safe-area-inset-bottom)));
  background: linear-gradient(180deg, #2a3856, #131b2e);
  border: 2px solid #5b6c96;
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.55);
  animation: lobby-rise 0.22s ease-out;
}
@keyframes lobby-rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.lobby-sheet--tall .lobby-sheet__card { height: 88vh; }

.pcardx__head { display: flex; align-items: center; gap: 12px; }
.pcardx__flag img { width: 44px; height: 32px; object-fit: cover; border-radius: 4px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); }
.pcardx__flag span { font-size: 30px; }
.pcardx__who { flex: 1; min-width: 0; }
.pcardx__name { margin: 0; font-size: 22px; font-weight: 700; overflow-wrap: anywhere; }
.pcardx__sub { margin-top: 2px; font-size: 13px; color: #c9d6ee; display: flex; align-items: center; gap: 6px; }
.pcardx__x { flex: none; width: 36px; height: 36px; padding: 0; font-size: 18px; color: #fff; background: rgba(255, 255, 255, 0.1); border: none; border-radius: 50%; box-shadow: none; cursor: pointer; }
.pcardx__stats { display: flex; gap: 8px; margin: 14px 0 4px; }
.pcardx__stats div { flex: 1; padding: 8px 4px; text-align: center; background: rgba(0, 0, 0, 0.3); border-radius: 12px; }
.pcardx__stats b { display: block; font-size: 18px; color: #ffd869; }
.pcardx__stats span { font-size: 11.5px; color: #b8c6e2; }
.pcardx__code { margin: 8px 0 0; font-size: 12.5px; color: #9ab0cf; text-align: center; }
.pcardx__code b { letter-spacing: 0.14em; color: #cdd8ee; }
.pcardx__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pcardx__actions .lobby-btn { flex: 1 1 40%; padding: 11px 10px; font-size: 15px; }
.pcardx__actions .lobby-btn--wide { flex-basis: 100%; font-size: 17px; }
.pcardx__why { margin: 8px 0 0; font-size: 12.5px; color: #ffd0a0; text-align: center; }
.pcardx__more { display: flex; justify-content: center; gap: 22px; margin-top: 14px; }
.pcardx__more button { padding: 6px 4px; font-family: inherit; font-size: 13px; color: #9ab0cf; background: none; border: none; border-radius: 0; box-shadow: none; text-decoration: underline; cursor: pointer; }

/* a private conversation: the whole window is one painted panel (supplied art, 1037 x 1516). The header and the footer
   keep their painted size and the middle stretches. --k is css px per picture px, so every control below is placed
   at the spot where it is painted (back, flag frame, Profile, message bar, smiley, Send) and is invisible itself. */
.lobby-sheet--thread { align-items: center; }
.lobby-sheet__card.is-thread {
  --k: 0.36px;
  position: relative;
  box-sizing: border-box;
  height: min(92vh, 780px);
  max-height: none;
  padding: calc(240 * var(--k)) calc(50 * var(--k)) calc(224 * var(--k));
  background: none;
  border: 1px solid transparent;
  border-radius: 0;
  box-shadow: none;
  border-image: url("assets/lobby-dm-panel.webp") 236 397 222 330 fill / calc(236 * var(--k)) calc(397 * var(--k)) calc(222 * var(--k)) calc(330 * var(--k)) stretch;
}
.thread__head { position: absolute; inset: -1px -1px auto -1px; height: calc(236 * var(--k)); }
.thread__head > *, .thread__form > button { position: absolute; margin: 0; }
.thread__head > button, .thread__form > button {
  min-width: 0;
  min-height: 0;
  padding: 0;
  font-size: 0; /* the words are painted into the panel */
  color: transparent;
  background: transparent;
  border: none;
  box-shadow: none;
  text-shadow: none;
  cursor: pointer;
}
.thread__head > button:active, .thread__form > button:active { background: rgba(0, 0, 0, 0.2); transform: none; }
.thread__back { left: calc(65 * var(--k)); top: calc(80 * var(--k)); width: calc(107 * var(--k)); height: calc(107 * var(--k)); border-radius: 50%; }
.thread__avatar { left: calc(196 * var(--k)); top: calc(76 * var(--k)); width: calc(119 * var(--k)); height: calc(115 * var(--k)); display: grid; place-items: center; }
.thread__avatar img { width: calc(98 * var(--k)); height: calc(94 * var(--k)); object-fit: cover; border-radius: calc(16 * var(--k)); pointer-events: none; }
.thread__name {
  left: calc(335 * var(--k));
  right: calc(302 * var(--k) + 6px); /* stops before the painted Profile button */
  top: calc(80 * var(--k));
  height: calc(107 * var(--k));
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 19px;
  line-height: 1.1;
  color: #fff;
  overflow: hidden;
}
.thread__name .lobby-flag { width: 22px; height: 16px; }
.thread__name span:not(.lobby-flag) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread__profile { right: calc(65 * var(--k)); top: calc(84 * var(--k)); width: calc(237 * var(--k)); height: calc(93 * var(--k)); border-radius: calc(46 * var(--k)); }
.thread__form { position: absolute; left: calc(65 * var(--k) - 1px); right: calc(65 * var(--k) - 1px); bottom: calc(92 * var(--k) - 1px); height: calc(111 * var(--k)); }
.thread__form input {
  position: absolute;
  left: 0;
  top: 0;
  box-sizing: border-box;
  width: calc(690 * var(--k)); /* the painted bar */
  height: 100%;
  margin: 0;
  padding: 0 calc(106 * var(--k)) 0 calc(44 * var(--k)); /* clear of the round end and the painted smiley */
  font-family: inherit;
  font-size: 16px; /* 16px stops iOS zooming the page when it is focused */
  color: #fff;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  outline: none;
}
.thread__form input::placeholder { color: #8fb8e8; opacity: 1; }
.thread__emoji { right: calc(278.5 * var(--k) - 18px); top: 50%; width: 36px; height: 36px; transform: translateY(-50%); border-radius: 50%; }
.thread__emoji:active { transform: translateY(-50%); }
.thread__send { right: 0; top: 0; width: calc(198 * var(--k)); height: 100%; border-radius: calc(40 * var(--k)); }
.thread__log { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 4px 2px; display: flex; flex-direction: column; gap: 4px; scrollbar-width: thin; scrollbar-color: #2f86ec transparent; }
/* the bubbles are painted (supplied art): the round ends and the tail stay as drawn, the middle stretches with the words */
.bubble { max-width: 82%; box-sizing: border-box; padding: 6px 14px 11px; font-size: 14.5px; line-height: 1.3; overflow-wrap: anywhere; border: 1px solid transparent; }
.bubble--me { align-self: flex-end; color: #3a2204; font-weight: 600; border-image: url("assets/lobby-dm-bubble-me.png") 40 52 44 42 fill / 17px 22px 18px 18px stretch; }
.bubble--them { align-self: flex-start; color: #fff; border-image: url("assets/lobby-dm-bubble-them.png") 40 42 44 52 fill / 17px 18px 18px 22px stretch; }
.thread__note { align-self: center; font-size: 12.5px; color: var(--muted, #9ab0cf); text-align: center; }

.inbox__empty { margin: 30px 0; text-align: center; color: var(--muted, #9ab0cf); font-size: 15px; }
.inbox__row b.unread { color: #ffd869; }
.inbox__count { min-width: 20px; padding: 1px 6px; font-size: 12px; font-weight: 700; text-align: center; color: #fff; background: #e0392b; border-radius: 999px; }

/* the people you blocked, with a way back */
.lobby__blocked { margin-top: 18px; }
.lobby__blockedrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 4px; font-size: 14px; letter-spacing: 0.12em; color: #cdd8ee; }
.lobby__blockedrow .lobby-btn { padding: 5px 12px; font-size: 13px; letter-spacing: 0; }

/* a flag with no other rule (a conversation's title, for one) is a small flag, never the file's natural size */
.lobby-flag { flex: none; width: 28px; height: 20px; object-fit: cover; border-radius: 3px; }
span.lobby-flag { display: inline-grid; place-items: center; width: auto; font-size: 18px; }

/* the message bar, the emoji button and Send: painted (supplied design), live text on top */
.lobby__chatform { position: relative; align-items: center; gap: 6px; }
.lobby__chatform input {
  flex: 1;
  min-width: 0;
  height: 46px;
  box-sizing: border-box;
  margin: 0;
  padding: 0 4px;
  font-family: inherit;
  font-size: 16px; /* 16px stops iOS zooming the page when it is focused */
  color: #fff;
  background: none;
  border-style: solid;
  border-width: 0 56px 0 28px;
  /* left cap, stretchy middle, right cap (it holds the painted smiley); the art is 620 x 114 */
  border-image: url("assets/lobby-chat-input.png") 0 140 0 70 fill / 0 56px 0 28px / 0 stretch;
  border-radius: 0;
}
.lobby__chatform input::placeholder { color: #8fb8e8; opacity: 1; }
.lobby__chatform .lobby__emoji {
  position: absolute;
  top: 50%;
  right: 83px; /* over the painted smiley: Send is 68px wide + the 6px gap + the smiley's offset */
  width: 36px;
  height: 36px;
  padding: 0;
  transform: translateY(-50%);
  border: none;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}
.lobby__chatform .lobby__send {
  flex: none;
  width: 68px;
  height: 46px;
  padding: 0;
  font-size: 0; /* "Send" is painted into the picture */
  color: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: url("assets/lobby-chat-send.png") center / 100% 100% no-repeat;
}
.lobby__chatform .lobby__send:active { transform: translateY(2px); }
.lobby-emoji {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px;
  background: linear-gradient(180deg, #0b3a86, #062a66);
  border: 2px solid #2f86ec;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}
.lobby-emoji button { width: 34px; height: 34px; padding: 0; font-size: 20px; background: transparent; border: none; box-shadow: none; }
.lobby__pane--chat .lobby__hint { color: #8fd0ff; }

/* ---- painted player rows: the status dot is part of the picture (green online, orange in a match, grey not in the lobby) ---- */
.lobby-row[data-st] {
  position: relative;
  aspect-ratio: 734 / 140;
  height: auto;
  padding: 0 14% 0 21%;
  background: url("assets/lobby-row-green.webp") center / 100% 100% no-repeat;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.lobby-row[data-st="busy"] { background-image: url("assets/lobby-row-orange.webp"); }
.lobby-row[data-st="off"] { background-image: url("assets/lobby-row-grey.webp"); opacity: 1; }
.lobby-row[data-st] .lobby-row__flag { position: absolute; left: 11.9%; top: 50%; transform: translate(-50%, -50%); width: 30px; height: auto; }
.lobby-row[data-st] .lobby-row__flag img { width: 30px; height: auto; aspect-ratio: 7 / 5; border-radius: 2px; }
.lobby-row[data-st] .lobby-row__state { display: none; }

/* ---- painted player card: numbers, name, code and the real buttons are placed over the slots of the picture (percentages of its 1110 x 1184) ---- */
.lobby-sheet--player { align-items: center; }
.lobby-sheet__card.is-player {
  position: relative;
  width: min(92vw, 360px);
  max-height: none;
  aspect-ratio: 1110 / 1184;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  animation: none;
  background: url("assets/lobby-card-player.webp") center / 100% 100% no-repeat;
}
.is-player .pcardx__head { position: absolute; left: 7%; right: 19%; top: 5.5%; }
.is-player .pcardx__flag img { width: 36px; height: auto; aspect-ratio: 7 / 5; }
.is-player .pcardx__name { font-size: 19px; }
.is-player .pcardx__x { position: absolute; right: 6.7%; top: 4.4%; width: 10.8%; height: 10%; font-size: 0; background: transparent; border-radius: 50%; } /* the red X is painted */
.is-player .pcardx__stats { position: absolute; left: 6.2%; right: 6.2%; top: 25.5%; height: 17.7%; margin: 0; gap: 3.6%; }
.is-player .pcardx__stats div { display: flex; align-items: flex-end; justify-content: center; padding: 0 0 3.4% 0; background: none; border-radius: 0; }
.is-player .pcardx__stats b { font-size: 19px; }
.is-player .pcardx__stats span { display: none; } /* Level / Matches / Wins are painted */
.is-player .pcardx__code { position: absolute; left: 6%; right: 6%; top: 47.4%; margin: 0; font-size: 12px; }
.is-player .pcardx__why { position: absolute; left: 7%; right: 7%; top: 18.5%; margin: 0; font-size: 11px; line-height: 1.15; text-align: left; }
.is-player .pcardx__actions { position: absolute; left: 6.5%; right: 6.5%; top: 55.6%; height: 24.6%; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; align-content: center; }
.is-player .pcardx__more { position: absolute; left: 6.5%; right: 6.5%; top: 86.2%; height: 11%; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
.is-player .pcardx__actions button,
.is-player .pcardx__more button {
  width: 100%;
  padding: 0;
  flex: none;
  font-size: 0; /* the words are painted */
  color: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  text-decoration: none;
  opacity: 1;
  filter: none;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  aspect-ratio: 480 / 140;
}
.is-player .pcardx__actions [data-art="challenge"] { background-image: url("assets/lobby-btn-challenge.webp"); aspect-ratio: 330 / 100; }
.is-player .pcardx__actions [data-art="challenge"]:disabled { background-image: url("assets/lobby-btn-challenge-off.webp"); }
.is-player .pcardx__actions [data-art="message"] { background-image: url("assets/lobby-btn-message.webp"); aspect-ratio: 300 / 97; }
.is-player .pcardx__actions [data-art="message"]:disabled { background-image: url("assets/lobby-btn-message-off.webp"); }
.is-player .pcardx__actions [data-art="add"],
.is-player .pcardx__actions [data-art="remove"] { grid-column: 1 / -1; width: 52%; justify-self: center; }
.is-player .pcardx__actions [data-art="add"] { background-image: url("assets/lobby-btn-add.webp"); }
.is-player .pcardx__actions [data-art="remove"] { background-image: url("assets/lobby-btn-remove.webp"); }
.is-player [data-art="block"] { background-image: url("assets/lobby-btn-block.webp"); }
.is-player [data-art="report"] { background-image: url("assets/lobby-btn-report.webp"); }

/* ---- the pop-up message while you are in the Lobby: the painted pill, a little lower so it doesn't hide the title ---- */
body.in-lobby #toast {
  top: calc(max(14px, var(--safe-area-inset-top, env(safe-area-inset-top))) + 66px);
  width: max-content; /* a fixed, centred box would otherwise squeeze a long message into half the screen */
  max-width: 92vw;
  padding: 14px 4px;
  font-size: 14px;
  text-align: center;
  background: none;
  box-shadow: none;
  border-radius: 0;
  border-style: solid;
  border-width: 0 26px;
  border-color: transparent;
  /* the pill picture is 970 x 192: the round ends stay as painted, the middle stretches with the text */
  border-image: url("assets/lobby-toast.webp") 0 110 0 110 fill / 0 26px 0 26px stretch;
}
