/* The "Who's playing?" screen, the same in the hub and in every game */
@font-face { font-family: Lexend; font-weight: 500; src: url(/fonts/lexend-latin-500-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Lexend; font-weight: 700; src: url(/fonts/lexend-latin-700-normal.woff2) format("woff2"); font-display: swap; }
#players {
  --ink: #34123f; --accent: #7c3aed; --day: linear-gradient(#bfe0ff, #fbc6e4); --night: linear-gradient(#1b0f45, #4a1d8f);
  box-sizing: border-box; width: min(760px, calc(100vw - 24px)); max-height: calc(var(--seen, 100dvh) - 24px); padding: 24px 28px 28px; border: 0; border-radius: 26px; overflow: auto;
  background: #fff; color: var(--ink); font: 500 17px/1.4 Lexend, system-ui, sans-serif; text-align: center; box-shadow: 0 20px 60px rgba(20, 5, 50, .45);
  user-select: none; -webkit-user-select: none;
}
/* Phones and tablets: near the top, so the keyboard has nothing to push out of its way */
@media (pointer: coarse) { #players { margin-top: calc(var(--slid, 0px) + 12px); margin-bottom: auto; } }
#players::backdrop { background: rgba(30, 10, 60, .55); }
#players h2 { margin: 0 0 16px; font-size: 30px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
#players button { font: inherit; color: inherit; cursor: pointer; }
#players button:focus-visible, #players .pl-input:focus { outline: 4px solid var(--accent); outline-offset: 2px; }

.pl-cards { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.pl-card { width: 148px; display: flex; flex-direction: column; gap: 6px; }
.pl-go { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 196px; padding: 0; border: 0; border-radius: 20px; overflow: hidden; background: var(--night); }
.pl-go.princess { background: var(--day); }
.pl-face { flex: 1; min-height: 0; width: 100%; object-fit: contain; object-position: 50% 100%; }
#players .pl-name { box-sizing: border-box; width: 100%; padding: 8px 6px; background: #fff; border: 3px solid transparent; border-top: 0; border-radius: 0 0 20px 20px; box-shadow: inset 0 0 0 2px #e6dcf2; font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#players .pl-go:hover .pl-face { transform: scale(1.05); }
#players .pl-new { background: #f3ecfb; justify-content: center; }
#players .pl-new .pl-name { background: none; box-shadow: none; }
.pl-plus { font-size: 64px; line-height: 1; color: var(--accent); }
#players .pl-change, #players .pl-plain { border: 0; background: none; padding: 8px 12px; border-radius: 10px; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
#players .pl-remove { color: #b4232f; }

.pl-edit { display: flex; gap: 22px; align-items: stretch; text-align: left; }
.pl-stage { position: relative; flex: 0 0 220px; min-height: 270px; border-radius: 20px; background: var(--night); overflow: hidden; }
.pl-stage canvas { position: absolute; inset: 0; }
.pl-stage.princess { background: var(--day); }
.pl-stage canvas { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; }
.pl-form { flex: 1; min-width: 0; }
.pl-namerow { display: flex; gap: 8px; }
#players .pl-input { flex: 1; min-width: 0; box-sizing: border-box; padding: 11px 14px; border: 2px solid #cbb9e3; border-radius: 14px; font: inherit; font-size: 20px; font-weight: 700; color: inherit; background: #fff; user-select: text; -webkit-user-select: text; }
#players .pl-dice { border: 0; border-radius: 14px; padding: 0 14px; font-size: 22px; background: #efe6fb; }
.pl-note { margin: 6px 0 12px; font-size: 14px; }
.pl-note.bad { color: #b4232f; font-weight: 700; }
.pl-kinds { display: flex; gap: 8px; margin-bottom: 12px; }
#players .pl-kind { flex: 1; padding: 11px; border: 3px solid transparent; border-radius: 14px; background: #efe6fb; font-weight: 700; }
#players .pl-kind[aria-pressed=true] { background: var(--accent); color: #fff; }
.pl-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.pl-label { flex: 0 0 76px; font-size: 15px; }
.pl-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
#players .pl-swatch { width: 36px; height: 36px; padding: 0; border: 3px solid #fff; border-radius: 50%; background: #efe6fb; box-shadow: 0 0 0 1px #cbb9e3; font-size: 17px; line-height: 1; }
#players .pl-swatch[aria-pressed=true] { box-shadow: 0 0 0 4px var(--accent); }
/* Always in reach, however short the screen */
.pl-actions { position: sticky; bottom: -28px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 -28px; padding: 8px 0 28px; background: #fff; }
#players .pl-main { padding: 13px 34px; border: 0; border-radius: 999px; background: #16a34a; color: #fff; font-size: 20px; font-weight: 700; }

@media (max-width: 620px) {
  #players { padding: 18px 16px 20px; }
  #players h2 { font-size: 25px; margin-bottom: 12px; }
  .pl-card { width: calc(50% - 7px); max-width: 160px; }
  .pl-go { height: 168px; }
  .pl-edit { flex-direction: column; gap: 12px; }
  .pl-stage { flex: none; min-height: 0; height: 190px; }
  .pl-stage canvas { object-fit: contain; }
  .pl-actions { bottom: -20px; margin-bottom: -20px; padding-bottom: 20px; }
  .pl-label { flex-basis: 70px; }
}
@media (max-height: 480px) {
  #players { padding: 12px 18px 14px; }
  #players h2 { font-size: 21px; margin-bottom: 8px; }
  .pl-go { height: 132px; }
  .pl-card { width: 124px; }
  .pl-stage { flex-basis: 150px; min-height: 0; }
  .pl-note { margin: 4px 0 6px; font-size: 13px; }
  .pl-kinds { margin-bottom: 6px; }
  #players .pl-kind { padding: 7px; }
  #players .pl-swatch { width: 32px; height: 32px; }
  .pl-actions { bottom: -14px; margin: 6px 0 -14px; padding: 5px 0 14px; }
  #players .pl-main { padding: 9px 26px; }
}
