/* A player's face and card (player-card.js) on the live page /t/CODE and in the dashboard. Its own
   tokens, so it looks the same on both: the Apple product-page look of padelcounter.com. */
.pc-face, .pc-card { --pc-brand: #0071e3; --pc-ink: #1d1d1f; --pc-gray: #6e6e73; --pc-paper: #f5f5f7; --pc-hair: rgba(0, 0, 0, .08); --pc-navy: #001730; --pc-win: #1a7f37; --pc-loss: #ff3b30; }

/* The face: initials at once, the avatar (or photo) fades in over them. */
.pc-face { --pc-size: 28px; position: relative; flex: none; display: inline-grid; place-items: center; width: var(--pc-size); height: var(--pc-size); border-radius: 50%; overflow: hidden; background: #e1ecfb; color: var(--pc-brand); font: 700 calc(var(--pc-size) * .38)/1 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif; letter-spacing: 0; text-transform: uppercase; user-select: none; }
.pc-face.pc-linked { background: var(--pc-navy); color: #fff; }
.pc-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s ease; }
.pc-face img.pc-photo { z-index: 1; }
.pc-face img.pc-ready { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .pc-face img { transition: none; } }

/* A player's name and face as one tap target (keeps the surrounding text style). */
button.pc-player, button.pc-player:hover { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin: 0; padding: 2px 6px 2px 2px; border: 0; border-radius: 980px; background: none; color: inherit; font: inherit; text-align: left; letter-spacing: inherit; cursor: pointer; }
button.pc-player:hover .pc-name { text-decoration: underline; text-underline-offset: 2px; }
button.pc-player:focus-visible { outline: 2px solid var(--pc-brand, #0071e3); outline-offset: 2px; }
.pc-player .pc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-player .pc-name small { display: block; font-size: 14px; font-weight: 400; color: var(--pc-gray, #6e6e73); }

/* The dashboard's roster: a name with an account opens the card. */
button.roster-player { display: inline; margin: 0; padding: 0; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; text-align: left; letter-spacing: inherit; cursor: pointer; box-shadow: none; }
button.roster-player:hover { background: none; color: inherit; text-decoration: underline; text-underline-offset: 2px; }
button.roster-player:focus-visible { outline: 2px solid #0071e3; outline-offset: 2px; }

/* The card: a centred sheet on wide screens, a bottom sheet on phones. */
dialog.pc-card { width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 0; border-radius: 28px; background: #fff; color: var(--pc-ink); box-shadow: 0 18px 48px rgba(0, 0, 0, .18); overflow: auto; font: 17px/1.47 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif; letter-spacing: -.022em; overscroll-behavior: contain; }
dialog.pc-card::backdrop { background: rgba(0, 0, 0, .32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog.pc-card[open] { animation: pc-in .22s ease-out; }
@keyframes pc-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (max-width: 560px) {
  dialog.pc-card { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 24px 24px 0 0; max-height: 88dvh; padding-bottom: env(safe-area-inset-bottom); }
  dialog.pc-card[open] { animation-name: pc-up; }
  @keyframes pc-up { from { transform: translateY(40px); opacity: .6; } }
}
@media (prefers-reduced-motion: reduce) { dialog.pc-card[open] { animation: none; } }
.pc-card .pc-close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 32px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: var(--pc-paper); color: var(--pc-gray); font: 600 18px/1 -apple-system, BlinkMacSystemFont, sans-serif; cursor: pointer; }
.pc-card .pc-close:hover { background: #e8e8ed; color: var(--pc-ink); }
.pc-card .pc-close:focus-visible, .pc-card a:focus-visible { outline: 2px solid var(--pc-brand); outline-offset: 2px; }
.pc-card .pc-body { position: relative; padding: 34px 24px 24px; }
.pc-hero { display: grid; justify-items: center; gap: 4px; text-align: center; }
.pc-hero .pc-face { margin-bottom: 10px; box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--pc-hair); }
.pc-hero h2 { margin: 0; font: 700 26px/1.12 -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif; letter-spacing: -.02em; overflow-wrap: anywhere; }
.pc-handle { margin: 0; color: var(--pc-gray); font-size: 16px; display: inline-flex; align-items: center; gap: 8px; }
.pc-pro { padding: 1px 7px; border-radius: 980px; background: #d7ff3a; color: var(--pc-navy); font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.pc-bio { margin: 6px 0 0; font-size: 16px; color: var(--pc-ink); overflow-wrap: anywhere; }
.pc-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.pc-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 980px; background: var(--pc-paper); color: var(--pc-ink); font-size: 15px; font-weight: 600; }
.pc-chip svg { width: 12px; height: 12px; fill: currentColor; }
.pc-section { margin-top: 22px; }
.pc-section h3 { margin: 0 0 8px; color: var(--pc-gray); font: 600 13px/1.3 -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: .02em; text-transform: uppercase; }
.pc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; margin: 0; }
.pc-stats div { min-width: 0; padding: 10px 6px; border-radius: 14px; background: var(--pc-paper); text-align: center; }
.pc-stats dt { color: var(--pc-gray); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-stats dd { margin: 2px 0 0; font: 600 19px/1.15 -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 400px) { .pc-stats dd { font-size: 17px; } }
.pc-form { display: flex; align-items: center; gap: 5px; margin-top: 10px; color: var(--pc-gray); font-size: 15px; }
.pc-form span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 800; }
.pc-form .pc-w { background: var(--pc-win); }
.pc-form .pc-l { background: var(--pc-loss); }
.pc-members { display: grid; gap: 6px; }
.pc-members .pc-player { width: 100%; padding: 6px 10px 6px 6px; border-radius: 14px; background: var(--pc-paper); }
.pc-members .pc-player:hover { background: #ececf0; }
.pc-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-links a { padding: 6px 13px; border-radius: 980px; border: 1px solid #d2d2d7; color: var(--pc-ink); font-size: 15px; font-weight: 600; text-decoration: none; }
.pc-links a:hover { border-color: var(--pc-brand); color: var(--pc-brand); text-decoration: none; }
.pc-note { margin: 18px 0 0; color: var(--pc-gray); font-size: 15px; text-align: center; }
.pc-open { display: block; margin-top: 22px; padding: 12px 18px; border-radius: 980px; background: var(--pc-brand); color: #fff !important; font-size: 17px; font-weight: 600; text-align: center; text-decoration: none !important; }
.pc-open:hover { background: #0077ed; }
.pc-skeleton { height: 64px; border-radius: 14px; background: linear-gradient(90deg, var(--pc-paper) 25%, #ececf0 50%, var(--pc-paper) 75%); background-size: 200% 100%; animation: pc-shimmer 1.2s infinite linear; }
@keyframes pc-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .pc-skeleton { animation: none; } }
