/* ═══════════════════════════════════════════════════════════════
   Upgrade modal — tier cards, billing toggle, gift mechanic.
   Shared across lobby and any future pricing surface.
   ═══════════════════════════════════════════════════════════════ */

/* ── Backdrop overlay ── */
.upgrade-modal {
    position: fixed;
    inset: 0;
    z-index: 3500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(2, 4, 12, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: upgrade-fade 0.18s ease-out;
}
.upgrade-modal.hidden { display: none; }
@keyframes upgrade-fade { from { opacity: 0; } to { opacity: 1; } }

/* ── Modal card ── */
.upgrade-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 92vh;
    overflow-y: auto;
    background: linear-gradient(160deg, #0d0f1c 0%, #100c1a 60%, #160a10 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 60px rgba(139,92,246,0.12);
    padding: 28px 24px 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
    animation: upgrade-slide 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes upgrade-slide {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Header ── */
.upgrade-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}
.upgrade-header-text { flex: 1; min-width: 0; }
.upgrade-title {
    font-family: "Bungee", Impact, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: #fff;
    line-height: 1.1;
    margin: 0;
}
.upgrade-subtitle {
    font-size: 0.87rem;
    color: rgba(255,255,255,0.5);
    margin: 5px 0 0;
    line-height: 1.35;
}
.upgrade-subtitle strong { color: rgba(255,255,255,0.75); }

.upgrade-close {
    flex-shrink: 0;
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: rgba(255,255,255,0.5);
    font-size: 1rem; line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.upgrade-close:hover { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.2); }

/* ── Billing toggle ── */
.billing-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    padding: 4px;
    margin: 14px 0 20px;
    width: fit-content;
}
.billing-opt {
    padding: 6px 18px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}
.billing-opt.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.billing-save {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(34,197,94,0.22);
    color: #4ade80;
    border: 1px solid rgba(34,197,94,0.35);
}

/* ── Tier cards grid ── */
.tier-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.tier-card {
    position: relative;
    border-radius: 14px;
    padding: 18px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}
.tier-card.tier-highlight {
    transform: translateY(-3px);
}

/* Free */
.tier-free { border-color: rgba(255,255,255,0.12); }

/* Spark — blue */
.tier-spark {
    background: rgba(59,130,246,0.07);
    border-color: rgba(59,130,246,0.3);
}
.tier-spark.tier-highlight {
    border-color: rgba(59,130,246,0.7);
    box-shadow: 0 8px 32px rgba(59,130,246,0.25);
}

/* Wild — purple/pink */
.tier-wild {
    background: linear-gradient(160deg, rgba(139,92,246,0.1) 0%, rgba(236,72,153,0.08) 100%);
    border-color: rgba(139,92,246,0.4);
}
.tier-wild.tier-highlight {
    border-color: rgba(168,85,247,0.8);
    box-shadow: 0 8px 32px rgba(139,92,246,0.3);
}
/* Always give Wild a subtle glow — it's the recommended tier */
.tier-wild { box-shadow: 0 4px 20px rgba(139,92,246,0.15); }

/* VIP — gold */
.tier-vip {
    background: rgba(245,158,11,0.07);
    border-color: rgba(245,158,11,0.3);
}
.tier-vip.tier-highlight {
    border-color: rgba(245,158,11,0.75);
    box-shadow: 0 8px 32px rgba(245,158,11,0.25);
}

/* Popular badge on Wild */
.tier-badge {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 3px 12px;
    border-radius: 999px;
    white-space: nowrap;
}
.tier-wild .tier-badge {
    background: linear-gradient(90deg, #8b5cf6, #ec4899);
    color: #fff;
    box-shadow: 0 2px 10px rgba(139,92,246,0.5);
}

/* Card internals */
.tier-name {
    font-family: "Bungee", Impact, sans-serif;
    font-size: 1rem;
    letter-spacing: 0.04em;
    color: #fff;
}
.tier-spark  .tier-name { color: #93c5fd; }
.tier-wild   .tier-name { color: #c4b5fd; }
.tier-vip    .tier-name { color: #fcd34d; }

.tier-price {
    line-height: 1;
}
.tier-price-val {
    font-family: "Exo 2", sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
}
.tier-price-period {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    font-weight: 500;
    margin-left: 2px;
}
.tier-free .tier-price-val { color: rgba(255,255,255,0.5); }

.tier-features {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.tier-features li {
    font-size: 0.8rem;
    line-height: 1.35;
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: flex-start;
    gap: 7px;
}
.tier-features li::before {
    content: "✓";
    flex-shrink: 0;
    font-weight: 700;
    color: #4ade80;
    font-size: 0.78rem;
    margin-top: 1px;
}
.tier-features .feat-no { color: rgba(255,255,255,0.25); }
.tier-features .feat-no::before { content: "–"; color: rgba(255,255,255,0.2); }
.tier-features .feat-em { color: rgba(255,255,255,0.85); font-weight: 600; }

/* CTA buttons */
.tier-cta {
    width: 100%;
    padding: 9px 12px;
    border-radius: 9px;
    font-family: inherit;
    font-size: 0.83rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: filter 0.15s, transform 0.1s;
    margin-top: 4px;
}
.tier-cta:active:not(:disabled) { transform: scale(0.97); }
.tier-cta:hover:not(:disabled) { filter: brightness(1.1); }
.tier-cta:disabled { opacity: 0.45; cursor: default; }

.tier-free   .tier-cta { background: rgba(255,255,255,0.1);  color: rgba(255,255,255,0.6); }
.tier-spark  .tier-cta { background: #2563eb; color: #fff; }
.tier-wild   .tier-cta { background: linear-gradient(90deg, #7c3aed, #db2777); color: #fff; }
.tier-vip    .tier-cta { background: linear-gradient(90deg, #d97706, #b45309); color: #fff; }

/* ── Gift / Get a Room section ── */
.upgrade-gifting {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: rgba(139,92,246,0.07);
    border: 1px solid rgba(139,92,246,0.22);
    border-radius: 12px;
    margin-top: 4px;
}
.upgrade-gifting-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}
.upgrade-gifting-body { min-width: 0; }
.upgrade-gifting-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #c4b5fd;
    margin-bottom: 5px;
}
.upgrade-gifting-text {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.5;
    margin: 0;
}
.upgrade-gifting-text strong { color: rgba(255,255,255,0.75); }

/* ── In-call gift button (chat strip) ── */
.chat-gift-btn {
    color: #c4b5fd;
    font-size: 1.05rem;
    transition: transform 0.15s, color 0.15s;
}
.chat-gift-btn:hover { transform: scale(1.15); color: #a78bfa; }

/* ── Filter paywall badge (shown next to locked section headers) ── */
.filter-paywall-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: linear-gradient(90deg, rgba(139,92,246,0.25), rgba(236,72,153,0.25));
    color: #c4b5fd;
    border: 1px solid rgba(139,92,246,0.4);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.filter-paywall-badge:hover {
    background: linear-gradient(90deg, rgba(139,92,246,0.4), rgba(236,72,153,0.4));
    border-color: rgba(139,92,246,0.7);
}

/* Paywalled filter rows — paid options are dimmed; free "All" stays bright */
.filter-section-paywalled .radio-row,
.filter-section-paywalled .chips-input {
    opacity: 0.45;
    cursor: pointer;
    pointer-events: auto;
}
.filter-section-paywalled .radio-row:hover,
.filter-section-paywalled .chips-input:hover {
    opacity: 0.65;
}
/* The "Any / All" option is free — keep it at full opacity */
.filter-section-paywalled .radio-row:has(input[value="any"]) {
    opacity: 1;
}

/* Country slot indicator */
.country-slots {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -4px 0 8px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
}
.country-slots-dots {
    display: flex;
    gap: 4px;
}
.country-slot-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    transition: background 0.2s, border-color 0.2s;
}
.country-slot-dot.used {
    background: #4ade80;
    border-color: #22c55e;
}
.country-slots.slots-full .country-slot-dot { background: #f59e0b; border-color: #d97706; }
.country-slots-more {
    background: transparent;
    border: none;
    color: rgba(139,92,246,0.8);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.14s;
}
.country-slots-more:hover { color: #a78bfa; }

/* ── Gift-a-Room mini modal ── */
.gift-room-modal {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2,4,12,0.8);
    backdrop-filter: blur(6px);
    animation: upgrade-fade 0.15s ease-out;
}
.gift-room-modal.hidden { display: none; }

.gift-room-card {
    position: relative;
    width: 100%;
    max-width: 360px;
    background: linear-gradient(160deg, #0e1020 0%, #160c1e 100%);
    border: 1px solid rgba(139,92,246,0.4);
    border-radius: 16px;
    padding: 24px 22px 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(139,92,246,0.15);
    animation: upgrade-slide 0.2s cubic-bezier(0.2,0.8,0.3,1);
}
.gift-room-title {
    font-family: "Bungee", Impact, sans-serif;
    font-size: 1.1rem;
    color: #c4b5fd;
    margin: 0 0 4px;
    letter-spacing: 0.04em;
}
.gift-room-sub {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.45);
    margin: 0 0 18px;
}
.gift-room-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.gift-room-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    transition: background 0.14s, border-color 0.14s;
    gap: 10px;
}
.gift-room-option:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); }
.gift-room-option.selected {
    background: rgba(139,92,246,0.15);
    border-color: rgba(139,92,246,0.55);
}
.gift-option-name {
    font-size: 0.87rem;
    font-weight: 700;
    color: #fff;
}
.gift-option-desc {
    font-size: 0.74rem;
    color: rgba(255,255,255,0.45);
    margin-top: 2px;
}
.gift-option-price {
    font-size: 0.9rem;
    font-weight: 800;
    color: #c4b5fd;
    white-space: nowrap;
}
.gift-room-cta {
    width: 100%;
    padding: 11px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(90deg, #7c3aed, #db2777);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: filter 0.15s, transform 0.1s;
}
.gift-room-cta:hover { filter: brightness(1.1); }
.gift-room-cta:active { transform: scale(0.98); }
.gift-room-close {
    position: absolute;
    top: 12px; right: 12px;
    width: 28px; height: 28px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.14s, color 0.14s;
}
.gift-room-close:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ── Responsive ── */
@media (max-width: 700px) {
    .upgrade-content { padding: 20px 16px 18px; }
    .upgrade-title { font-size: 1.25rem; }

    .tier-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .tier-card { padding: 16px 13px 14px; }
    .tier-price-val { font-size: 1.35rem; }
    .tier-features li { font-size: 0.76rem; }
}

@media (max-width: 440px) {
    .tier-grid {
        grid-template-columns: 1fr;
    }
    .tier-wild { order: -1; }  /* bump popular tier to top on mobile */
}
