/* Achievements card and the social cards / Players sheet (static/social.js). Colours from style.css's tokens. */
.ach-card, .social-card { margin-bottom: 14px; }
.ach-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.ach-newline { color: #ffd24a; margin: 0 0 8px; }
.ach-row { padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.ach-row:first-of-type { border-top: 0; }
.ach-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ach-label { font-weight: 600; }
.ach-count { font-variant-numeric: tabular-nums; font-weight: 700; }
.ach-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.ach-badge { min-width: 38px; padding: 2px 8px; border-radius: 999px; text-align: center; font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.18); opacity: 0.55; font-variant-numeric: tabular-nums; }
.ach-badge.is-on { opacity: 1; background: rgba(184, 230, 70, 0.18); border-color: rgba(184, 230, 70, 0.6); }
.ach-badge.is-new { box-shadow: 0 0 0 2px #ffd24a; }
.ach-strip > div { background-color: #b8e646; }
.social-eyebrow { margin-bottom: 4px; }
.soc-sub { margin-bottom: 10px; }
.soc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.soc-select, .soc-guest { min-height: 36px; max-width: 100%; flex: 1 1 140px; }
.soc-clip { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px 0; background: none; border: 0;
  color: inherit; text-align: start; font: inherit; border-top: 1px solid rgba(255, 255, 255, 0.08); }
button.soc-clip { cursor: pointer; }
.soc-clip .clip-thumb { width: 72px; height: 41px; object-fit: cover; border-radius: 6px; flex: none; }
.soc-clip-text { display: flex; flex-direction: column; min-width: 0; }
.soc-radios { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.soc-radio { display: flex; gap: 8px; align-items: center; min-height: 32px; }
.soc-friends-head { margin-top: 12px; }
.soc-friend { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 36px; }
.soc-who { display: inline-flex; gap: 6px; align-items: center; text-align: end; }
.soc-pill { font-size: 0.75rem; }
.soc-players-btn { margin: 8px 0; }
.soc-sheet { max-height: 88vh; overflow-y: auto; }
.soc-sheet-body .item { margin-bottom: 8px; }
/* Tag invite share panel, the pending-tag banner, and viewers (no Fix / Save / Story on a clip they only watch). */
.soc-share { margin-top: 10px; padding: 10px; border-radius: 10px; background: rgba(184, 230, 70, 0.08); }
.soc-wa { text-decoration: none; display: inline-flex; align-items: center; }
.soc-banner { position: fixed; inset-inline: 12px; top: 12px; z-index: 45; display: flex; gap: 8px; align-items: center;
  padding: 10px 12px; border-radius: 12px; background: #1d2a2c; border: 1px solid rgba(184, 230, 70, 0.5);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4); }
.soc-banner > span { flex: 1; }
body.soc-viewer [data-act="share"], body.soc-viewer [data-act="fix"], body.soc-viewer #storyBest,
body.soc-viewer #rallyEditButton, body.soc-viewer #hitEditButton, body.soc-viewer #fixClipButton,
body.soc-viewer #rallyLog .learn-btn, body.soc-viewer #clipCard, body.soc-viewer #clipDeleteButton,
body.soc-viewer #clipWrongCourt, body.soc-viewer #clipUnsaved, body.soc-viewer #bestFix { display: none !important; }
/* Group invite link (group_invite.js, docs/plans/group_invite.md): confirm frame, player crops, owner's link box. */
.grp-sheet { max-height: 92vh; overflow-y: auto; }
.grp-frame { display: block; width: 100%; height: auto; border-radius: 10px; margin: 8px 0 12px; }
.grp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.grp-actions .btn { flex: 1 1 140px; }
.grp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 10px 0 12px; }
.grp-player { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.grp-crop { width: 100%; aspect-ratio: 3 / 5; object-fit: cover; border-radius: 10px; background: rgba(255, 255, 255, 0.06); }
.grp-crop-none { display: flex; align-items: center; justify-content: center; font-size: 0.85rem; }
.soc-group { border-bottom: 1px solid rgba(255, 255, 255, 0.08); padding-bottom: 10px; }
.soc-claim .soc-pill { background: rgba(184, 230, 70, 0.2); }
@media (orientation: landscape) and (max-height: 500px) {
  .grp-frame { max-height: 40vh; width: auto; max-width: 100%; margin-inline: auto; }
  .grp-crop { aspect-ratio: auto; height: 34vh; }
}
/* "Who played?" Players sheet (social.js openPlayers, docs/players_sheet_report.md): a bottom sheet with a grab handle,
   the four players as a small court (far half on top, net, near half), a picker per player, an Undo toast. */
.ps-backdrop { place-items: end center; padding: 0; z-index: 42; animation: ps-fade 0.18s ease-out; }
html.ps-lock, html.ps-lock body { overflow: hidden; overscroll-behavior: none; }
.ps-sheet { position: relative; width: min(560px, 100%); max-height: 92%; display: flex; flex-direction: column; gap: 0;
  padding: 0; overflow: hidden; border-radius: 20px 20px 0 0; border-bottom: 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45); transition: transform 0.18s ease-out; animation: ps-up 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ps-sheet.is-picking { height: 92%; }
@keyframes ps-up { from { transform: translateY(40%); opacity: 0.4; } }
@keyframes ps-fade { from { background: rgba(0, 0, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .ps-backdrop, .ps-sheet { animation: none; transition: none; } }
.ps-top { flex: none; padding: 6px 16px 4px; touch-action: none; cursor: grab; }
.ps-grab { display: block; width: 44px; height: 20px; margin: 0 auto; padding: 0; border: 0; background: none; cursor: grab; position: relative; }
.ps-grab::before { content: ""; position: absolute; inset: 7px 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.28); }
.ps-head .card-title { margin: 0; font-size: 1.25rem; }
.ps-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 2px 16px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 12px; align-content: start; }
.ps-sub { margin: 0; }
.ps-status:empty { display: none; }
.ps-status { margin: 0; }
/* The court: far half, net, near half; each half two player cards side by side. */
.ps-court { display: grid; gap: 6px; padding: 10px; border-radius: 16px; background: linear-gradient(180deg, rgba(43, 98, 224, 0.16), rgba(43, 98, 224, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.08); }
.ps-half { display: grid; gap: 6px; grid-template-rows: auto 1fr; }
.ps-near { grid-template-rows: 1fr auto; }
.ps-half-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-inline: 2px; }
.ps-near .ps-half-label { order: 2; }
.ps-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ps-net { height: 2px; margin: 4px 0; border-radius: 1px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.55) 0 6px, transparent 6px 10px); }
.ps-slot { display: grid; gap: 8px; align-content: start; padding: 10px; border-radius: 14px; background: var(--surface-2, #1d2a2c);
  border: 1px solid var(--line, #2a3134); min-width: 0; }
.ps-slot.is-empty { border-style: dashed; background: rgba(255, 255, 255, 0.02); }
.ps-slot.is-claim { border-color: rgba(184, 230, 70, 0.6); box-shadow: 0 0 0 1px rgba(184, 230, 70, 0.25) inset; }
.ps-slot.is-focus { outline: 2px solid var(--accent, #c6f432); outline-offset: 2px; }
.ps-slot-main { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; width: 100%;
  padding: 0; border: 0; background: none; color: inherit; font: inherit; }
button.ps-slot-main { cursor: pointer; min-height: 44px; -webkit-tap-highlight-color: transparent; }
button.ps-slot-main:active { transform: scale(0.98); }
button.ps-slot-main:focus-visible { outline: 2px solid var(--accent, #c6f432); outline-offset: 4px; border-radius: 10px; }
.ps-face { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 3px solid; flex: none; overflow: hidden; background: #2a3134; }
.ps-face .avatar { width: 42px !important; height: 42px !important; }
.ps-plus { font-size: 1.5rem; line-height: 1; color: var(--accent, #c6f432); font-weight: 700; }
.ps-slot-text { display: grid; gap: 3px; justify-items: center; min-width: 0; max-width: 100%; }
.ps-role { font-size: 0.75rem; color: var(--muted); font-weight: 650; }
.ps-name { font-weight: 700; overflow-wrap: anywhere; line-height: 1.2; }
.ps-name.is-faint { color: var(--accent, #c6f432); font-weight: 650; font-size: 0.9rem; }
.ps-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; line-height: 1.5;
  background: rgba(255, 255, 255, 0.1); color: var(--text); white-space: nowrap; }
.ps-pill.is-ok { background: rgba(45, 212, 191, 0.18); color: #6ff0da; }
.ps-pill.is-wait { background: rgba(255, 210, 74, 0.16); color: #ffd24a; }
.ps-pill.is-off { background: rgba(255, 122, 107, 0.15); color: #ff9a8e; }
.ps-pill.is-claim { background: rgba(184, 230, 70, 0.2); color: var(--accent, #c6f432); }
.ps-pill.is-you { background: rgba(77, 163, 255, 0.18); color: #8cc4ff; }
.ps-pill.is-guest { background: rgba(255, 255, 255, 0.1); color: var(--muted); }
.ps-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ps-actions > .btn, .ps-chooser-btn { flex: 1 1 auto; min-height: 40px; }
.ps-slot .ps-actions > .btn, .ps-slot .ps-chooser-btn { min-height: 38px; padding: 0 10px; font-size: 0.88rem; box-shadow: none; }
.ps-chooser { display: grid; gap: 6px; flex: 1 1 100%; }
.ps-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ps-chip { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line, #2a3134); background: var(--surface, #142024);
  color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer; }
/* Group link: one compact row; details behind the app's fold. */
.ps-group { display: grid; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2, #1d2a2c); border: 1px solid var(--line, #2a3134); }
.ps-group-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ps-group-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: rgba(184, 230, 70, 0.14); color: var(--accent, #c6f432); }
.ps-group-text { display: grid; flex: 1 1 auto; min-width: 0; }
.ps-group-title { font-weight: 700; }
.ps-group-share { flex: none; min-height: 40px; white-space: nowrap; }
.ps-group-more > summary { min-height: 40px; font-size: 0.88rem; color: var(--muted); }
.ps-group-inner { display: grid; gap: 6px; }
.ps-group-inner p { margin: 0; }
.ps-group .soc-share { margin-top: 0; }
/* The picker for one player */
.ps-pick-head { display: flex; align-items: center; gap: 10px; }
.ps-pick-title { margin: 0; font-size: 1.05rem; min-width: 0; overflow-wrap: anywhere; }
.ps-back-arrow { font-size: 1.6rem; line-height: 1; margin-top: -3px; }
.ps-now { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--surface-2, #1d2a2c); }
.ps-now .ps-slot-text { justify-items: start; }
.ps-now .ps-actions { grid-column: 1 / -1; justify-content: flex-start; }
.ps-search { width: 100%; min-height: 48px; padding: 0 14px 0 40px; border-radius: 14px; border: 1px solid var(--line, #2a3134);
  background: var(--bg, #0a1020) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa6a3' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center / 20px;
  color: var(--text); font: 500 1rem Heebo, system-ui, sans-serif; font-size: 16px; color-scheme: dark; -webkit-appearance: none; appearance: none; }
html[dir="rtl"] .ps-search { padding: 0 40px 0 14px; background-position: calc(100% - 12px) center; }
.ps-search:focus { outline: 2px solid var(--accent, #c6f432); outline-offset: 1px; }
.ps-list { display: grid; gap: 2px; }
.ps-extra { padding-top: 6px; border-top: 1px solid var(--line, #2a3134); }
.ps-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 8px; border: 0; border-radius: 12px;
  background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ps-item:active, .ps-item:hover { background: rgba(255, 255, 255, 0.06); }
.ps-item .avatar { width: 36px !important; height: 36px !important; }
.ps-item.is-dim { opacity: 0.6; }
.ps-item-text { display: grid; min-width: 0; }
.ps-item-title { font-weight: 650; overflow-wrap: anywhere; }
.ps-item-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: rgba(184, 230, 70, 0.14);
  color: var(--accent, #c6f432); font-weight: 700; font-size: 1.15rem; }
.ps-item.is-wa .ps-item-icon { background: rgba(37, 211, 102, 0.16); color: #4fe08a; }
.ps-hint { margin: 4px 8px; }
.ps-untag { justify-self: start; }
/* Undo toast at the foot of the sheet */
.ps-toast { position: absolute; inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 14px; border-radius: 14px; background: #e9efe9; color: #10181a; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  animation: ps-toast 0.2s ease-out; }
@keyframes ps-toast { from { transform: translateY(12px); opacity: 0; } }
.ps-toast-text { flex: 1; min-width: 0; font-weight: 600; font-size: 0.92rem; }
.ps-toast-undo { flex: none; min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: #10181a; color: var(--accent, #c6f432);
  font: inherit; font-weight: 700; cursor: pointer; }
@media (orientation: landscape) and (max-height: 500px) {
  .ps-sheet { max-height: 96%; width: min(720px, 100%); }
  .ps-court { grid-template-columns: 1fr auto 1fr; align-items: stretch; }
  .ps-net { width: 2px; height: auto; margin: 0 4px; background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0 6px, transparent 6px 10px); }
  .ps-near .ps-half-label { order: 0; }
  .ps-near { grid-template-rows: auto 1fr; }
  .ps-slot { padding: 8px; }
}

/* Profile pictures (static/avatar.js) */
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: #2a3134; display: inline-block; }
.avatar-line { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.avatar-text { min-width: 0; overflow-wrap: anywhere; }
.soon-item > .avatar { margin-inline-end: 10px; }
.av-head { display: flex; gap: 14px; align-items: center; }
.av-side { display: grid; gap: 8px; min-width: 0; }
.av-big { width: 88px; height: 88px; box-shadow: 0 0 0 2px var(--accent); }
.av-label { margin: 6px 0 0; }
.av-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.av-swatch { padding: 0; border: 2px solid transparent; border-radius: 50%; background: none; line-height: 0;
  min-width: 46px; min-height: 46px; display: grid; place-items: center; cursor: pointer; }
.av-swatch.is-on { border-color: var(--accent); }
.av-swatch img { width: 40px; height: 40px; border-radius: 50%; }
.av-crop { display: grid; gap: 8px; justify-items: start; margin-top: 8px; }
.av-crop-view { width: 240px; height: 240px; max-width: 100%; border-radius: 12px; touch-action: none; cursor: grab; }
.av-zoom { width: 240px; max-width: 100%; }
/* Pairing code (profile.js): sign an installed phone app in without a link */
.acct-pair { display: grid; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line, #2a3134); }
.acct-pair-code { font-size: 1.5rem; --field-size: 1.5rem; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.acct-pair-show { font-size: 2.4rem; font-weight: 700; letter-spacing: 0.15em; text-align: center; padding: 10px;
  border-radius: 12px; background: rgba(217, 242, 74, 0.12); color: var(--accent, #d9f24a); font-variant-numeric: tabular-nums; }
.acct-pair-show.is-gone { opacity: 0.35; text-decoration: line-through; }
/* Profile: a save says what happened, next to its button (profile.js) */
.acct-status { margin: 4px 0 0; min-height: 1.2em; }
.acct-status.is-ok { color: var(--accent, #d9f24a); }
.acct-status.is-error { color: #ff7a6b; }
.acct-row-avatar { display: grid; place-items: center; background: none; }
.acct-row-avatar .avatar { width: 36px; height: 36px; }
/* Owner: test sign-ups list (profile.js drawSignups) */
.wl-row { display: grid; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line, #2a3134); }
.wl-row:first-of-type { border-top: 0; }
.wl-invited { color: var(--accent, #d9f24a); }
.acct-subhead { margin-top: 10px; }
/* Sign-in card: Google as a small link at the end (profile.js showSignIn) */
.acct-google-line { margin: 4px 0 0; text-align: center; }
.acct-google-small { color: var(--muted, #9aa6a3); text-decoration: underline; }
.acct-sheet .acct-pair { border-top: 1px solid var(--line, #2a3134); border-bottom: 0; padding-top: 10px; }
/* Tag request picture (social.js tagPicture): the tagged player zoomed + the frame with him ringed; tap = big view */
.soc-pic { display: grid; gap: 6px; margin: 8px 0 4px; }
.soc-pic-btn { display: flex; gap: 8px; align-items: stretch; padding: 0; border: 0; background: none; cursor: zoom-in;
  max-width: 100%; text-align: start; }
.soc-pic-crop { height: 132px; width: auto; max-width: 34%; object-fit: cover; border-radius: 10px;
  box-shadow: 0 0 0 2px var(--accent, #d9f24a); background: #000; }
.soc-pic-frame { height: 132px; width: auto; min-width: 0; flex: 1 1 auto; object-fit: contain; border-radius: 10px; background: #000; }
.soc-pic-ask { margin: 0; font-weight: 600; }
.soc-pic-big { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, 0.92); display: grid;
  align-content: center; justify-items: center; gap: 10px; padding: 48px 12px 16px; overflow: auto; }
.soc-pic-big-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; max-width: 100%; }
.soc-pic-big-crop { height: min(42vh, 320px); width: auto; max-width: 100%; border-radius: 12px;
  box-shadow: 0 0 0 2px var(--accent, #d9f24a); }
.soc-pic-big-frame { width: min(100%, 960px); max-height: 70vh; object-fit: contain; border-radius: 12px; }
.soc-pic-big .soc-pic-ask { color: #fff; }
.soc-pic-close { position: absolute; top: 8px; inset-inline-end: 8px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 1.2rem; cursor: pointer; }
@media (orientation: landscape) and (max-height: 500px) {
  .soc-pic-big { padding-top: 12px; }
  .soc-pic-big-row { flex-wrap: nowrap; }
  .soc-pic-big-crop { height: 70vh; }
  .soc-pic-big-frame { width: auto; max-width: 70vw; max-height: 80vh; }
}

/* Profile > Privacy (static/profile.js privacySection): training switch, delete my account */
.pv-switch { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; min-height: 44px; }
.pv-switch input { width: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--accent, #d9f24a); }
.pv-delete-box { display: grid; gap: 8px; padding: 10px; border: 1px solid #ff7a6b55; border-radius: 10px; }
.btn.pv-danger { color: #ff7a6b; border-color: #ff7a6b88; }
