/* Public game invitations share one layout, independent of in-game score posters. */
/* The trigger tints itself from the surrounding text colour, so it reads on light and dark headers alike. */
.game-share-trigger {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-width: 44px; height: 44px; padding: 0 15px 0 12px;
    border: 1px solid color-mix(in srgb, currentColor 18%, transparent); border-radius: 999px;
    background: color-mix(in srgb, currentColor 7%, transparent);
    color: inherit; cursor: pointer; flex: 0 0 auto; white-space: nowrap;
    font: 600 14px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.game-share-trigger svg { width: 18px; height: 18px; flex: none; stroke-width: 2; }
.game-share-trigger:hover { border-color: color-mix(in srgb, currentColor 34%, transparent); background: color-mix(in srgb, currentColor 13%, transparent); }
.game-share-trigger:active { transform: scale(.97); }
.game-share-trigger:focus-visible { outline: 3px solid #36a4db; outline-offset: 3px; }
.lobby-hero-copy > .game-share-trigger { align-self: flex-start; color: #f8fafc; margin-bottom: 12px; }
@media (max-width: 560px) {
    .game-share-trigger { width: 44px; padding: 0; }
    .game-share-trigger__label { display: none; }
}
@media (prefers-reduced-motion: reduce) { .game-share-trigger { transition: none; } .game-share-trigger:active { transform: none; } }
.game-share-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.game-share-brand > .qm-brand { min-width: 0; }
.game-share-dialog {
    box-sizing: border-box; width: min(520px, calc(100vw - 32px)); max-width: none;
    max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 0; border: 1px solid #fff9; border-radius: 22px;
    background: #f8f6f1; color: #243348; box-shadow: 0 24px 100px #08132466;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow: hidden; margin: auto;
}
.game-share-dialog[open] { display: flex; flex-direction: column; }
.game-share-dialog::backdrop { background: #0b1629b8; backdrop-filter: blur(7px); }
.game-share-dialog [hidden] { display: none !important; }
.game-share-header {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px 10px 22px;
    border-bottom: 1px solid #24334814; flex: none;
}
.game-share-header h2 { margin: 0; flex: 1; min-width: 0; font: 650 17px/1.45 system-ui, sans-serif; color: #243348; }
.game-share-dialog button { font: 600 14px/1.4 system-ui, sans-serif; cursor: pointer; touch-action: manipulation; }
.game-share-dialog button:disabled { opacity: .45; cursor: wait; }
.game-share-dialog button:focus-visible, .game-share-link:focus-visible { outline: 3px solid #268ccb; outline-offset: 3px; }
.game-share-close { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #2433480a; color: #243348; }
.game-share-body { padding: 18px 22px 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; text-align: center; }
.game-share-image {
    display: block; width: auto; max-width: 100%; height: auto;
    max-height: max(260px, calc(100dvh - 310px)); margin: 0 auto;
    object-fit: contain; border-radius: 8px; box-shadow: 0 6px 24px #24334820;
    -webkit-touch-callout: default; user-select: auto;
}
.game-share-status { margin: 12px 0; color: #46566b; font-size: 13px; line-height: 1.6; }
.game-share-status:empty { margin: 0; }
.game-share-body[aria-busy="true"] { min-height: 180px; display: grid; place-items: center; }
.game-share-footer { padding: 12px 22px 20px; flex: none; }
.game-share-footer p { margin: 0 0 12px; color: #556478; font: 400 13px/1.6 system-ui, sans-serif; }
.game-share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.game-share-actions button, .game-share-retry { min-height: 44px; padding: 10px 14px; border: 1px solid #cbd1d8; border-radius: 10px; background: #fff; color: #243348; }
.game-share-actions button { flex: 1 1 auto; }
.game-share-actions .game-share-save { background: #243348; border-color: #243348; color: #fff; }
.game-share-link { display: block; margin-top: 10px; overflow-wrap: anywhere; color: #245c8d; font-size: 13px; user-select: all; }
@media (max-width: 520px) {
    .game-share-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border-radius: 18px; }
    .game-share-header { padding: 8px 10px 8px 16px; }
    .game-share-header h2 { font-size: 16px; }
    .game-share-body { padding: 12px 16px 0; }
    .game-share-footer { padding: 12px 16px max(16px, env(safe-area-inset-bottom)); }
    .game-share-actions button { flex-basis: calc(50% - 4px); }
    .game-share-actions [data-share-copy] { flex-basis: 100%; }
    .game-share-image { max-height: max(210px, calc(100dvh - 330px)); }
}
@media (max-height: 540px) {
    .game-share-dialog[open] { overflow-y: auto; }
    .game-share-body { overflow: visible; flex: none; }
}
