/* v1.8.39 — public player profiles and full-card iPhone archive rendering. */
.public-profile-dialog{
  width:min(680px,calc(100vw - 28px));
  max-height:min(88dvh,850px);
  padding:0;
  overflow:hidden;
  border:1px solid var(--line-bright);
  border-radius:18px;
  background:var(--panel,#17130f);
  color:var(--text,#f7eee0);
  box-shadow:0 30px 90px rgba(0,0,0,.58);
}
.public-profile-dialog::backdrop{background:rgba(0,0,0,.72);backdrop-filter:blur(5px)}
.public-profile-dialog>.dialog-close{position:absolute;z-index:3;top:12px;right:12px}
.public-profile-content{max-height:min(88dvh,850px);padding:26px;overflow:auto;-webkit-overflow-scrolling:touch}
.public-profile-loading,.public-profile-error{min-height:260px;display:grid;place-items:center;text-align:center;color:var(--muted)}
.public-profile-error{align-content:center}.public-profile-error h2{margin:0;color:var(--text)}
.public-profile-hero{display:grid;grid-template-columns:112px minmax(0,1fr);align-items:center;gap:20px;padding:8px 42px 22px 0;border-bottom:1px solid var(--line)}
.public-profile-avatar{display:block;width:112px;height:112px;object-fit:cover;border:2px solid var(--line-bright);border-radius:50%;background:var(--panel-2)}
.public-profile-avatar-fallback{display:grid;place-items:center;color:var(--gold-bright);font-family:Georgia,serif;font-size:2.15rem;font-weight:800;background:linear-gradient(145deg,var(--panel-3),var(--panel-2))}
.public-profile-identity h2{margin:0;font-family:Georgia,serif;font-size:clamp(1.8rem,5vw,2.6rem);line-height:1.04}
.public-profile-username{margin:7px 0;color:var(--muted)}
.public-profile-presence{display:inline-flex;align-items:center;gap:7px;margin-top:7px;color:var(--muted);font-size:.82rem;font-weight:800}
.public-profile-presence::before{content:"";width:9px;height:9px;border-radius:50%;background:#756b61;box-shadow:0 0 0 3px rgba(117,107,97,.16)}
.public-profile-presence.online{color:#8fe5b4}.public-profile-presence.online::before{background:#53d68b;box-shadow:0 0 0 3px rgba(83,214,139,.18)}
.public-profile-presence.self{color:var(--gold)}.public-profile-presence.self::before{background:var(--gold)}
.public-profile-facts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:18px 0}
.public-profile-facts article{display:grid;align-content:center;min-height:84px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--panel-2);text-align:center}
.public-profile-facts strong{font-size:1.05rem;color:var(--gold-bright);overflow-wrap:anywhere}.public-profile-facts span{margin-top:4px;color:var(--muted);font-size:.68rem;text-transform:uppercase;letter-spacing:.08em}
.public-profile-actions{display:flex;flex-wrap:wrap;gap:9px;margin-bottom:22px}
.public-profile-section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.public-profile-section-heading h3{margin:0}.public-profile-section-heading span{color:var(--muted)}
.public-profile-decks{display:grid;gap:9px}.public-profile-deck{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:14px;width:100%;padding:13px;border:1px solid var(--line);border-radius:12px;background:var(--panel-2);color:var(--text);text-align:left;cursor:pointer}.public-profile-deck:hover{border-color:var(--gold)}
.public-profile-deck strong,.public-profile-deck small{display:block}.public-profile-deck small{margin-top:4px;color:var(--muted)}.public-profile-deck-stats{text-align:right;color:var(--muted);font-size:.72rem;line-height:1.5;white-space:nowrap}
.public-profile-open-button{white-space:nowrap}.friend-dropdown-item>.public-profile-open-button{margin-left:auto}.friend-dropdown-item>.friend-dropdown-message{margin-left:0}
.message-thread-profile-button{width:max-content;margin-top:5px;padding:4px 9px!important;min-height:30px!important;font-size:.72rem!important}
.friend-request-form{align-items:end}.friend-request-form #viewSelectedUserProfile{white-space:nowrap}

@media(max-width:620px){
  .public-profile-dialog{width:100vw;max-width:none;height:100dvh;max-height:none;border:0;border-radius:0;margin:0}
  .public-profile-content{max-height:100dvh;padding:calc(env(safe-area-inset-top,0px) + 24px) 16px calc(env(safe-area-inset-bottom,0px) + 28px)}
  .public-profile-dialog>.dialog-close{top:calc(env(safe-area-inset-top,0px) + 10px);right:12px}
  .public-profile-hero{grid-template-columns:82px minmax(0,1fr);gap:14px;padding-right:40px}.public-profile-avatar{width:82px;height:82px}.public-profile-identity h2{font-size:1.75rem}
  .public-profile-facts{grid-template-columns:repeat(2,minmax(0,1fr))}.public-profile-facts article{min-height:72px}
  .public-profile-actions .button{flex:1 1 140px}.public-profile-deck{grid-template-columns:1fr}.public-profile-deck-stats{text-align:left}
}

/* Safari can stretch a button's aspect-ratio box while its image is height:100%,
   which makes object-fit:cover remove the left and right edges. Let the intrinsic
   907×1306 card image establish its own height so every printed edge stays visible. */
@supports (-webkit-touch-callout:none){
  html.pftcg-ios.mobile-device-layout #cardGrid .card-image-button,
  html.pftcg-ios.mobile-device-layout #favouritesPageGrid .card-image-button,
  html.pftcg-ios.mobile-device-layout #recentPageGrid .card-image-button{
    display:block!important;
    width:var(--mobile-image-size,100%)!important;
    height:auto!important;
    min-height:0!important;
    aspect-ratio:auto!important;
    overflow:hidden!important;
    line-height:0!important;
  }
  html.pftcg-ios.mobile-device-layout #cardGrid .card-image-button img,
  html.pftcg-ios.mobile-device-layout #favouritesPageGrid .card-image-button img,
  html.pftcg-ios.mobile-device-layout #recentPageGrid .card-image-button img{
    display:block!important;
    width:100%!important;
    height:auto!important;
    max-width:100%!important;
    max-height:none!important;
    object-fit:contain!important;
    object-position:center!important;
    transform:none!important;
  }
}
