/* PocketPlay table kit: lobby seats, sheets and in-game seat plates. Loads after pp.css; uses only kit tokens.
   Markup comes from table.js (window.PPTable); spec in TABLE.md. */

.ppt-i { width: 20px; height: 20px; flex: none; }

/* ── Faces (main-site avatars) ── */
.ppt-face { --size: 64px; position: relative; width: var(--size); height: var(--size); flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-3); }
.ppt-face img { width: 100%; height: 100%; border-radius: inherit; display: block; }
.ppt-face--blank { border: 1px solid var(--line-2); }
.ppt-face--blank .ppt-i { width: 52%; height: 52%; stroke-width: 1.5; }
.ppt-face--open { background: transparent; border: 1.5px dashed var(--line-3); color: var(--ink-3); transition: border-color .15s, background .15s, color .15s; }
.ppt-face--open .ppt-i { width: 40%; height: 40%; stroke-width: 1.6; }
.ppt-face__edit { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-1), 0 0 0 1px var(--line-2); }
.ppt-face__edit .ppt-i { width: 13px; height: 13px; }

.ppt-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; margin-left: 6px; border-radius: var(--r-pill); background: var(--bg-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 11px; font-weight: 650; letter-spacing: .02em; vertical-align: 2px; white-space: nowrap; }
.ppt-tag--soft { background: var(--accent-tint); color: var(--accent-text); box-shadow: none; }

/* ── Lobby ── */
.ppt-lobby { position: relative; display: grid; gap: 22px; justify-items: center; width: min(100%, 520px); margin-inline: auto; padding: 36px 28px 28px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.ppt-lobby__gear { position: absolute; top: 12px; right: 12px; }
.ppt-seats { display: flex; justify-content: center; gap: clamp(14px, 5vw, 44px); width: 100%; }
.ppt-seats[data-count="4"] { gap: clamp(8px, 3vw, 24px); }
.ppt-seat { position: relative; display: grid; justify-items: center; }
.ppt-seat__main { display: grid; justify-items: center; align-content: start; gap: 8px; min-width: 76px; padding: 4px; border: 0; border-radius: var(--r-l); background: none; color: var(--ink); font: inherit; }
button.ppt-seat__main { cursor: pointer; }
button.ppt-seat__main:focus-visible { outline: none; box-shadow: var(--ring); }
.ppt-seat__name { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.ppt-seat__main .ppt-tag { margin: -4px 0 0; }
.ppt-seat.is-empty .ppt-seat__name, .ppt-seat.is-invited .ppt-seat__name, .ppt-seat.is-matching .ppt-seat__name { color: var(--ink-3); font-weight: 550; }
.ppt-seat.is-empty .ppt-seat__main:hover .ppt-face--open { border-color: var(--accent); border-style: solid; background: var(--accent-tint); color: var(--accent-text); }
.ppt-seat.is-empty .ppt-seat__main:hover .ppt-seat__name { color: var(--accent-text); }
.ppt-seat.is-you .ppt-seat__main:hover .ppt-face__edit { color: var(--accent-text); }
.ppt-seat.is-invited .ppt-face--open { border-style: solid; border-color: var(--accent-line); color: var(--accent-text); background: var(--accent-tint); animation: ppt-breathe 1.8s var(--ease) infinite; }
.ppt-seat.is-matching .ppt-face--open { border: 2px solid var(--line-2); border-top-color: var(--accent); animation: pp-spin 1s linear infinite; }
.ppt-seat__cancel { position: absolute; top: 0; right: 4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; padding: 0; border: 0; background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-1), 0 0 0 1px var(--line-2); cursor: pointer; }
.ppt-seat__cancel .ppt-i { width: 13px; height: 13px; }
.ppt-seat__cancel:hover { color: var(--err); }
@keyframes ppt-breathe { 50% { box-shadow: 0 0 0 7px var(--accent-tint); } }

.ppt-hint { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; min-height: 30px; margin: 0; color: var(--ink-3); font-size: 13.5px; text-align: center; }
.ppt-chip { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-2); font: 550 13px/1 var(--font-sans); cursor: pointer; }
.ppt-chip:hover { border-color: var(--line-3); color: var(--ink); }
.ppt-chip .ppt-i { width: 15px; height: 15px; }
.ppt-start { max-width: 360px; }
.ppt-sub { margin: -10px 0 0; color: var(--ink-3); font-size: 13px; text-align: center; }

/* ── Sheets ── */
.ppt-sheet { width: min(440px, calc(100vw - 24px)); }
.ppt-sheet .pp-dialog__body { gap: 16px; padding: 24px; }
.ppt-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px -8px -4px 0; }
.ppt-sheet__lede { margin: -8px 0 0; color: var(--ink-2); font-size: 14.5px; }
.ppt-sheet__content { display: grid; gap: 12px; }
.ppt-form { display: grid; gap: 18px; }
.ppt-check { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 14px; cursor: pointer; }
.ppt-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }
.ppt-note { margin: 0; color: var(--ink-3); font-size: 13px; }
.ppt-note a, .ppt-account a { color: var(--accent-text); }
.ppt-linkbox { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; border-radius: var(--r-m); background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink-3); }
.ppt-linkbox__url { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: 450 14px/1 var(--font-mono); outline: none; text-overflow: ellipsis; }
.ppt-copy.is-done { background: var(--ok); color: #fff; }
.ppt-or { display: flex; align-items: center; gap: 12px; color: var(--ink-4); font-size: 12.5px; }
.ppt-or::before, .ppt-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ppt-invite { display: grid; gap: 10px; }
.ppt-avatars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 8px; margin: 0; padding: 0; border: 0; }
.ppt-avatars legend { margin-bottom: 10px; }
.ppt-avatar { display: grid; justify-items: center; gap: 4px; cursor: pointer; color: var(--ink-3); font-size: 12px; }
.ppt-avatar input { position: absolute; opacity: 0; pointer-events: none; }
.ppt-avatar span { border-radius: 50%; padding: 3px; box-shadow: 0 0 0 1px transparent; transition: box-shadow .15s; }
.ppt-avatar .ppt-face { --size: 54px; }
.ppt-avatar input:checked + span { box-shadow: 0 0 0 2px var(--accent); }
.ppt-avatar input:checked ~ small { color: var(--ink); font-weight: 600; }
.ppt-avatar input:focus-visible + span { box-shadow: var(--ring); }
.ppt-account { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-m); background: var(--surface-2); color: var(--ink-2); font-size: 14px; }
.ppt-account .ppt-face { --size: 44px; }

/* ── In-game seat plate ── */
.ppt-plate { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; padding: 5px 14px 5px 5px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); color: var(--ink); transition: box-shadow .2s var(--ease); }
.ppt-plate .ppt-face { --size: 36px; }
.ppt-plate__text { display: grid; min-width: 0; line-height: 1.2; }
.ppt-plate__text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 650; }
.ppt-plate__text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font-size: 12px; }
.ppt-plate__text small:empty { display: none; }
.ppt-plate__end { margin-left: 2px; font: 600 13px/1 var(--font-mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ppt-plate.is-active { box-shadow: 0 0 0 2px var(--accent), var(--shadow-2); }
.ppt-plate.is-active .ppt-plate__text small { color: var(--accent-text); font-weight: 600; }

@media (max-width: 560px) {
  .ppt-lobby { padding: 30px 16px 20px; gap: 18px; border-radius: var(--r-l); }
  .ppt-seats[data-count="4"] .ppt-face { --size: 56px; }
  .ppt-seats[data-count="4"] .ppt-seat__main { min-width: 64px; }
  .ppt-seats[data-count="4"] .ppt-seat__name { max-width: 72px; font-size: 13px; }
  .ppt-plate { padding-right: 10px; gap: 8px; }
  .ppt-plate .ppt-face { --size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .ppt-seat.is-invited .ppt-face--open, .ppt-seat.is-matching .ppt-face--open { animation: none; }
}
/* Compact game sheets preserve their close/submit controls on short windows. */
@media(max-height:520px) {
 body[data-table=v2] .ppt-sheet { width: min(680px,calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
 body[data-table=v2] .ppt-sheet .pp-dialog__body { padding: 12px; gap: 8px; }
 body[data-table=v2] .ppt-sheet__head { margin: 0; }
 body[data-table=v2] .ppt-sheet__head h2 { font-size: 18px; }
 body[data-table=v2] .ppt-sheet__lede,body[data-table=v2] .ppt-note { font-size: 11px; line-height: 1.25; }
 body[data-table=v2] .ppt-sheet .ppt-form { gap: 8px; }
 body[data-table=v2] .ppt-avatar .ppt-face { --size: 36px; }
 body[data-table=v2] .ppt-avatars { gap: 5px; }
 body[data-table=v2] .ppt-avatars legend { margin-bottom: 4px; }
 body[data-table=v2] .ppt-sheet .pp-btn--lg { min-height: 40px; height: 40px; }
}
