/* ==========================================================================
   PlayboxLab Unified Viral Sharing & SOS Styles (playbox-share.css)
   playboxlab.net
   ========================================================================== */

/* 1. Global Floating Toast */
.playbox-share-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 23, 42, 0.94);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 24px;
    border-radius: 9999px;
    font-size: 0.94rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.playbox-share-toast i {
    color: #10b981;
    font-size: 1.15rem;
}

.playbox-share-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* 2. SOS Viral Modal Overlay (Self-Contained Fullscreen Center) */
#playbox-sos-modal {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.72) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999999 !important;
    box-sizing: border-box !important;
    padding: 16px !important;
    margin: 0 !important;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

#playbox-sos-modal.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* 2-A. Modal Card */
.playbox-sos-card {
    position: relative !important;
    max-width: 440px !important;
    width: 100% !important;
    text-align: center;
    padding: 30px 24px 26px !important;
    background: var(--card-bg, #1e293b) !important;
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.16)) !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55) !important;
    box-sizing: border-box !important;
    animation: sosModalPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sosModalPop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 2-B. Top-Right Close Button */
.playbox-sos-close-btn {
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: var(--text-secondary, #94a3b8) !important;
    font-size: 0.95rem !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    z-index: 20 !important;
    padding: 0 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

.playbox-sos-close-btn:hover {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
    transform: scale(1.1) !important;
}

[data-theme="light"] .playbox-sos-close-btn {
    background: rgba(0, 0, 0, 0.06) !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    color: #64748b !important;
}

[data-theme="light"] .playbox-sos-close-btn:hover {
    background: rgba(0, 0, 0, 0.12) !important;
    color: #0f172a !important;
}

/* 2-C. Header & Icon */
.playbox-sos-header {
    margin-bottom: 14px;
}

.playbox-sos-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 12px rgba(245, 158, 11, 0.4));
    animation: giftBounce 2s infinite ease-in-out;
}

.playbox-sos-title {
    font-size: 1.42rem;
    font-weight: 800;
    color: var(--text-primary, #ffffff);
    margin: 0 0 6px 0;
    letter-spacing: -0.01em;
}

.playbox-sos-sub {
    font-size: 0.88rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.45;
    margin: 0;
}

/* 2-D. Reward Badge */
.playbox-sos-reward-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #f59e0b;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.84rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.playbox-share-feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #10b981;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.84rem;
    font-weight: 700;
    margin-bottom: 16px;
}

/* 2-E. Quote Box with Reroll */
.playbox-sos-msg-box {
    position: relative;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid #f59e0b;
    border-radius: 12px;
    padding: 14px 16px 10px;
    margin-bottom: 20px;
    text-align: left;
}

[data-theme="light"] .playbox-sos-msg-box {
    background: rgba(241, 245, 249, 0.7);
    border-color: rgba(0, 0, 0, 0.08);
    border-left-color: #f59e0b;
}

.playbox-sos-quote-icon {
    color: #f59e0b;
    font-size: 0.95rem;
    opacity: 0.6;
    margin-bottom: 4px;
}

.playbox-sos-quote-text {
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
    line-height: 1.5;
    margin: 0 0 8px 0;
    word-break: keep-all;
}

.playbox-sos-reroll-btn {
    background: none;
    border: none;
    color: var(--text-muted, #94a3b8);
    font-size: 0.76rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-left: auto;
}

.playbox-sos-reroll-btn:hover {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

/* 2-F. Actions */
.playbox-sos-actions {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.playbox-sos-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border-radius: 12px;
    font-size: 0.96rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    width: 100%;
    box-sizing: border-box;
}

.playbox-sos-btn.primary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.playbox-sos-btn.primary:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #b45309 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
}

.playbox-sos-btn.primary.playbox-general-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.playbox-sos-btn.primary.playbox-general-primary:hover {
    background: linear-gradient(135deg, #34d399 0%, #047857 100%);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.playbox-general-msg-box {
    border-left-color: #10b981 !important;
}

.playbox-general-msg-box .playbox-sos-quote-icon {
    color: #10b981 !important;
}

.playbox-general-msg-box .playbox-sos-reroll-btn:hover {
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.1) !important;
}

.playbox-general-icon {
    filter: drop-shadow(0 4px 12px rgba(16, 185, 129, 0.4)) !important;
    animation: generalRocket 2.2s infinite ease-in-out !important;
}

@keyframes generalRocket {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-6px) rotate(6deg);
    }
}

#btn-share:hover i {
    transform: scale(1.15);
    transition: transform 0.2s ease;
}

.playbox-sos-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #ffffff);
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.15));
}

[data-theme="light"] .playbox-sos-btn.secondary {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
}

.playbox-sos-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 3. Hint Badges & Gift Pulse Styling */
.badge-gift-pulse {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    background: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 0.65rem !important;
    border-radius: 9999px !important;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.45) !important;
    animation: giftPulse 1.8s infinite ease-in-out !important;
    line-height: 1 !important;
    letter-spacing: 0.2px !important;
}

/* Sudoku Specific #hint-badge Position in .tool-btn */
.tool-btn #hint-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-size: 0.64rem;
    box-sizing: border-box;
}

.tool-btn #hint-badge.badge-gift-pulse {
    top: 3px;
    right: 3px;
    padding: 2px 6px;
    font-size: 0.62rem;
}

/* Minesweeper Specific #mine-hint-badge Position */
#mine-hint-badge {
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 9999px;
    background: var(--card-border, rgba(255, 255, 255, 0.15));
    color: var(--text-primary, #ffffff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    margin-left: 2px;
}

#mine-hint-badge.badge-gift-pulse {
    padding: 2px 6px;
    font-size: 0.64rem;
}

/* 4. Solitaire Floating Banners */

/* 4-A. Empty Stock Slot Mini Floating */
.floating-stock-retry {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--card-width);
    height: var(--card-height);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 80;
    pointer-events: auto;
    white-space: nowrap;
}

.floating-stock-retry.hidden {
    display: none !important;
}

.btn-stock-retry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
    animation: giftPulse 1.8s infinite ease-in-out;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-stock-retry:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.6);
}

/* 4-B. No Moves Floating Banner at Bottom Center */
.floating-no-moves {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 190;
    pointer-events: auto;
    animation: floatBounceIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-no-moves.hidden {
    display: none !important;
}

.floating-no-moves-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 26px;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-radius: 9999px;
    font-family: var(--font-heading), sans-serif;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.5);
    animation: giftPulse 1.8s infinite ease-in-out;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-no-moves-btn i {
    font-size: 1.15rem;
    color: #fef08a;
}

.floating-no-moves-btn .badge-gift-icon {
    font-size: 1.1rem;
}

.floating-no-moves-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 14px 34px rgba(245, 158, 11, 0.65);
}

/* Animations */
@keyframes giftPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

@keyframes giftBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes floatBounceIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}
