/* Sharing-only styles. The accepted viewport, fullscreen, gesture and timer styles stay in style.css. */
#shareTournamentResultsBtn { background: linear-gradient(120deg, #0876bd, #1597e5); box-shadow: 0 5px 18px #1597e52b; }
#resultsShareDialog [hidden], #shareTournamentResultsBtn[hidden] { display: none !important; }
#resultsShareDialog {
  width: min(570px, calc(100% - 28px)); max-height: calc(100dvh - 28px);
  padding: 0; border: 1px solid #dce9f3; border-radius: 24px;
  color: var(--ink); background: white; box-shadow: 0 24px 90px #071d3f45;
  overflow-y: auto; overscroll-behavior: contain;
}
#resultsShareDialog::backdrop { background: #091d38b8; }
.share-content { padding: 28px; }
.share-brand { display: block; width: 126px; height: auto; margin-bottom: 24px; }
.share-eyebrow { font-size: 11px; letter-spacing: 1.8px; font-weight: 800; color: var(--blue-dark); margin-bottom: 8px; }
#shareDialogTitle { font-size: clamp(25px, 4vw, 32px); line-height: 1.15; letter-spacing: -.7px; }
#shareMessage { margin: 12px 0 22px; line-height: 1.55; }
#shareLoginForm { display: grid; gap: 18px; }
#shareLoginForm label { font-size: 14px; }
#shareLoginForm input { width: 100%; min-height: 48px; font-size: 16px; }
.share-login-note, .share-note { font-size: 13px; color: #667085; line-height: 1.5; }
.share-loading { display: flex; align-items: center; gap: 12px; padding: 25px 0; color: var(--blue-dark); font-weight: 700; }
.share-spinner { width: 24px; height: 24px; border: 3px solid #d9ecfa; border-top-color: #0876bd; border-radius: 50%; animation: share-spin 1s linear infinite; }
@keyframes share-spin { to { transform: rotate(360deg); } }
#sharePublishedName { font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; margin: 0 0 14px; }
.share-qr-card { background: #f0f8fd; border: 1px solid #cfe7f7; border-radius: 20px; padding: 22px; text-align: center; }
.share-ready-label { color: #0876bd; font-size: 12px; font-weight: 850; letter-spacing: 1.7px; }
.share-scan-intro { max-width: 390px; margin: 8px auto 18px; color: #173651; font-size: 17px; font-weight: 700; line-height: 1.45; }
#shareQRCode { width: min(100%, 350px); margin: 0 auto; padding: 8px; background: white; border-radius: 8px; box-shadow: 0 8px 24px #0b56821a; }
#shareQRCode svg { display: block; width: 100%; height: auto; }
.share-scan-label { margin-top: 14px; color: #48647b; font-size: 13px; font-weight: 650; }
.share-success-details { padding-top: 18px; }
.share-result-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.share-result-actions .btn { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; text-decoration: none; }
.share-link-details { margin-top: 16px; color: #667085; font-size: 13px; }
.share-link-details summary { min-height: 44px; cursor: pointer; font-weight: 700; }
.share-link-label { display: block; margin-top: 20px; font-size: 13px; font-weight: 700; }
#shareResultLink { display: block; width: 100%; min-height: 46px; margin: 8px 0 14px; font-size: 13px; background: #f8fafc; }
#shareUpdatedBtn, #shareRetryBtn, #shareSignInBtn { width: 100%; min-height: 48px; }
#shareCopyStatus { min-height: 22px; margin: 8px 0; font-size: 14px; color: #067647; font-weight: 700; }
#shareUpdatedBtn { margin-top: 12px; }
#shareUncertain, #shareRevisionNote { background: #fff8e9; color: #765311; padding: 12px; border-radius: 10px; font-size: 13px; line-height: 1.55; }
#sharePersistenceNote:empty, #shareSessionMessage:empty { display: none; }
.share-reference { font-size: 11px; color: #667085; overflow-wrap: anywhere; margin: 10px 0 0; }
.share-footer { position: sticky; bottom: 0; z-index: 1; background: white; padding: 18px 28px; border-top: 1px solid #e4edf3; display: flex; justify-content: flex-end; gap: 12px; }
#shareCloseBtn { min-width: 100px; min-height: 46px; }
#shareSessionDetails { margin-top: 24px; border-top: 1px solid #e4edf3; padding-top: 16px; font-size: 13px; }
#shareSessionDetails summary { cursor: pointer; color: #667085; }
#shareSessionEmail { overflow-wrap: anywhere; }
#shareSessionMessage { color: #667085; font-size: 13px; }
#resultsShareDialog :focus-visible { outline: 3px solid #0876bd; outline-offset: 3px; }
@media (max-width: 420px) { .share-content { padding: 22px; } .share-footer { padding: 14px 22px; } }
@media (orientation: landscape) and (min-width: 700px) {
  #resultsShareDialog { width: min(900px, calc(100% - 28px)); }
  #shareSuccessPanel { display: grid; grid-template-columns: minmax(300px, 1.15fr) minmax(240px, .85fr); gap: 22px; align-items: center; }
  .share-qr-card { grid-column: 1; grid-row: 1 / span 10; padding: 16px; }
  .share-success-details { padding-top: 0; }
  #sharePublishedName { margin-bottom: 4px; }
  .share-brand { margin-bottom: 14px; }
}
@media (orientation: landscape) and (max-height: 650px) {
  #shareQRCode { max-width: 268px; }
  .share-scan-intro { margin-bottom: 10px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .share-spinner { animation: none; } }

/* Keep the dialog anchored to the viewport even when Final Results is scrolled. */
#resultsShareDialog { position: fixed; inset: 0; margin: auto; }
#resultsShareDialog:has(#shareSuccessPanel:not([hidden])) .share-eyebrow { display: none; }
