/* bb-share-card.css
   ================================================================
   Styles for the post-game shareable battle summary image. The card
   is rendered off-screen by bb-share-card.js, captured to PNG via
   html2canvas, then shared/downloaded. NEVER appears in the live UI.

   Width is fixed at 600px (set by JS); everything inside is sized in
   px (not rem/% on this card) so html2canvas gets a predictable
   layout that doesn't reflow with the viewport.
   ================================================================ */

.bb-share-card {
    /* Hard-pin the visual variables to literal values so html2canvas
       captures the same look regardless of which universe theme is
       active in the host page when SHARE is tapped. */
    width: 600px;
    background: #0d0b08;
    color: #e8e3d8;
    font-family: 'Rajdhani', 'Segoe UI', sans-serif;
    padding: 36px 32px 28px;
    box-sizing: border-box;
    border: 2px solid #3a3226;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* -- Header (BATTLE BARGE wordmark + mission) -- */

.bb-share-header {
    display: flex;
    justify-content: center;
    margin-bottom: 6px;
}

.bb-share-wordmark {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    letter-spacing: 0.12em;
}

.bb-share-wordmark-main {
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    font-weight: 900;
    font-size: 22px;
    color: #c9b27f;
    text-transform: uppercase;
}

.bb-share-wordmark-beta {
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 10px;
    color: #8a7b5e;
    padding: 2px 6px;
    border: 1px solid #6e6147;
    border-radius: 3px;
    letter-spacing: 0.18em;
}

.bb-share-mission-line {
    text-align: center;
    margin-bottom: 20px;
    color: #b0a48d;
    font-size: 14px;
    letter-spacing: 0.04em;
}

.bb-share-mission-name {
    color: #d6c9aa;
    font-weight: 600;
    text-transform: uppercase;
}

.bb-share-mission-dot {
    margin: 0 8px;
    color: #6e6147;
}

.bb-share-mission-points {
    color: #b0a48d;
}

/* -- Result banner (huge VICTORY / DEFEAT / DRAW + scoreline) -- */

.bb-share-result {
    text-align: center;
    padding: 18px 16px;
    margin-bottom: 24px;
    border-radius: 10px;
    border: 2px solid;
}

.bb-share-result-label {
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    font-weight: 900;
    font-size: 36px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.bb-share-result-score {
    font-family: 'Rajdhani', 'Segoe UI', sans-serif;
    font-weight: 600;
    font-size: 22px;
    letter-spacing: 0.05em;
}

.bb-share-result-vp {
    color: #e8e3d8;
    font-size: 26px;
    font-weight: 700;
}

.bb-share-result-dash {
    margin: 0 12px;
    color: #6e6147;
}

.bb-share-result--win {
    background: rgba(76, 175, 80, 0.08);
    border-color: rgba(76, 175, 80, 0.5);
}
.bb-share-result--win .bb-share-result-label { color: #7fd982; }

.bb-share-result--loss {
    background: rgba(244, 67, 54, 0.08);
    border-color: rgba(244, 67, 54, 0.5);
}
.bb-share-result--loss .bb-share-result-label { color: #ef7066; }

.bb-share-result--draw {
    background: rgba(255, 193, 7, 0.08);
    border-color: rgba(255, 193, 7, 0.5);
}
.bb-share-result--draw .bb-share-result-label { color: #ffd152; }

.bb-share-result--unknown {
    background: rgba(120, 110, 90, 0.08);
    border-color: rgba(120, 110, 90, 0.5);
}
.bb-share-result--unknown .bb-share-result-label { color: #b0a48d; }

/* -- Player cards (2P side-by-side) -- */

.bb-share-players-2p {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.bb-share-players-2p .bb-share-player {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #3a3226;
    border-radius: 8px;
    padding: 16px 14px;
    text-align: center;
}

.bb-share-vs {
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #6e6147;
    letter-spacing: 0.15em;
    padding: 0 4px;
}

.bb-share-player-name {
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #e8e3d8;
    margin-bottom: 4px;
    letter-spacing: 0.04em;
}

.bb-share-player-legion {
    font-weight: 600;
    font-size: 13px;
    color: #d6c9aa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.bb-share-player-allegiance {
    font-style: italic;
    font-size: 11px;
    color: #8a7b5e;
    text-transform: lowercase;
    margin-bottom: 10px;
}

.bb-share-player-vp {
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    font-weight: 900;
    font-size: 32px;
    color: #c9b27f;
    line-height: 1;
}

/* -- Player rows (MP 3/4P stacked) -- */

.bb-share-players-mp {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 22px;
}

.bb-share-players-mp .bb-share-player {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #3a3226;
    border-radius: 8px;
    padding: 12px 14px;
    text-align: left;
}

.bb-share-players-mp .bb-share-player-rank {
    grid-column: 1;
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    font-weight: 900;
    font-size: 22px;
    color: #c9b27f;
}

.bb-share-players-mp .bb-share-player-name {
    grid-column: 2;
    grid-row: 1;
    margin-bottom: 0;
    font-size: 16px;
    text-align: left;
}

.bb-share-players-mp .bb-share-player-legion {
    grid-column: 2;
    grid-row: 2;
    margin-bottom: 0;
    font-size: 12px;
    text-align: left;
}

.bb-share-players-mp .bb-share-player-allegiance {
    /* Inline next to legion in MP mode to save vertical space. */
    display: none;
}

.bb-share-players-mp .bb-share-player-vp {
    grid-column: 3;
    grid-row: 1 / span 2;
    font-size: 26px;
}

/* -- Stats grid (Rounds / Points / Date) -- */

.bb-share-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 22px;
}

.bb-share-stat {
    background: rgba(201, 178, 127, 0.05);
    border: 1px solid #3a3226;
    border-radius: 6px;
    padding: 10px 8px;
    text-align: center;
}

.bb-share-stat-label {
    font-size: 11px;
    color: #8a7b5e;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 4px;
}

.bb-share-stat-value {
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #d6c9aa;
}

/* -- Footer -- */

.bb-share-footer {
    text-align: center;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid #3a3226;
}

.bb-share-footer-url {
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    font-size: 11px;
    color: #6e6147;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* ----------------------------------------------------------------
   Preview modal — shown to the user AFTER the PNG is generated.
   Holding the share/save buttons here means navigator.share() fires
   inside a fresh user-gesture click handler with NO async work in
   between, which is what iOS Safari needs to honor the share sheet
   (and therefore the "Save Image" → Photos path).
   ---------------------------------------------------------------- */

.bb-share-preview-modal {
    max-width: 480px;
    width: calc(100vw - 32px);
}

.bb-share-preview-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.bb-share-preview-img {
    width: 100%;
    max-width: 360px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.bb-share-preview-hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--bb-color-text-muted, #8a7b5e);
    text-align: center;
}

.bb-share-preview-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.bb-share-preview-footer .btn {
    flex: 1 1 auto;
    min-width: 100px;
}
