/* 🔹 Friend Card Styles */

.friend-card {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid white;
    box-shadow: 0 0 16px white;
    animation: whitePulse 2s infinite alternate ease-in-out;
    text-align: center;
    width: 180px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.friend-row {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    width: 100%;
}

.friend-button {
    position: relative;
    background-color: white;
    color: black;
    font-weight: bold;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    cursor: pointer;
    width: 100%;
    overflow: hidden;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.friend-button .label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    text-align: center;
    padding: 0 4px;
    box-sizing: border-box;
}

.friend-button:hover {
    background-color: #00ff99;
    color: white;
}

.friend-button span {
    display: inline-block;
    transition: opacity 0.2s ease;
}

.friend-button:hover span {
    opacity: 0;
}

.friend-button .label,
.friend-button .hover-label {
    transition: opacity 0.3s ease;
    position: absolute;
}

.friend-button .hover-label {
    opacity: 0;
}

.friend-button:hover .label {
    opacity: 0;
}

.friend-button:hover .hover-label {
    opacity: 1;
}

/* 🔹 Russian Doll Image */
.doll-image {
    max-height: 160px;
    width: auto;
    margin: 0 auto 20px auto;
    display: block;
    animation: whiteGlowPulse 1.2s infinite alternate;
}

.friend-card.hover-active .doll-image {
    animation: colorGlowPulse 0.6s ease-in-out 3;
}

/* 🔹 Always-on white pulse */
@keyframes whiteGlowPulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px white) brightness(1);
    }

    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 20px white) brightness(1.4);
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px white) brightness(1);
    }
}

/* 🔹 Hover pulse (uses dynamic CSS var for color) */
@keyframes colorGlowPulse {
    0% {
        transform: scale(1);
        filter: var(--glow-filter, none) brightness(1);
    }

    50% {
        transform: scale(1.05);
        filter: var(--glow-filter, none) brightness(1.4);
    }

    100% {
        transform: scale(1);
        filter: var(--glow-filter, none) brightness(1);
    }
}

/* 🔹 Hover Color Overrides */
.friend-card.hover-active .doll-image.hover-glow-electric-blue {
    --glow-filter: drop-shadow(0 0 12px #00faff);
}

.friend-card.hover-active .doll-image.hover-glow-hot-pink {
    --glow-filter: drop-shadow(0 0 14px hotpink);
}

.friend-card.hover-active .doll-image.hover-glow-lime-green {
    --glow-filter: drop-shadow(0 0 12px #39ff14);
}

.friend-card.hover-active .doll-image.hover-glow-neon-red {
    --glow-filter: drop-shadow(0 0 13px #ff073a);
}

.friend-card.hover-active .doll-image.hover-glow-violet-surge {
    --glow-filter: drop-shadow(0 0 14px #c03bff);
}

.friend-card.hover-active .doll-image.hover-glow-sunset-orange {
    --glow-filter: drop-shadow(0 0 13px #ff6600);
}

.friend-card.hover-active .doll-image.hover-glow-cyber-yellow {
    --glow-filter: drop-shadow(0 0 14px #faff00);
}

.friend-card.hover-active .doll-image.hover-glow-icy-white {
    --glow-filter: drop-shadow(0 0 14px #ffffff);
}

.friend-card.hover-active .doll-image.hover-glow-mint-green {
    --glow-filter: drop-shadow(0 0 12px #00ffc8);
}

.friend-card.hover-active .doll-image.hover-glow-ultraviolet {
    --glow-filter: drop-shadow(0 0 14px #8a2be2);
}

.friend-card.hover-active .doll-image.hover-glow-laser-magenta {
    --glow-filter: drop-shadow(0 0 16px #ff00ff);
}

.friend-card.hover-active .doll-image.hover-glow-slime-green {
    --glow-filter: drop-shadow(0 0 15px #7FFF00);
}

.friend-card.hover-active .doll-image.hover-glow-sapphire {
    --glow-filter: drop-shadow(0 0 16px #00bfff);
}

.friend-card.hover-active .doll-image.hover-glow-nuclear-orange {
    --glow-filter: drop-shadow(0 0 15px #ff4500);
}

.friend-card.hover-active .doll-image.hover-glow-gamma-purple {
    --glow-filter: drop-shadow(0 0 17px #9d00ff);
}

.friend-card.hover-active .doll-image.hover-glow-volcanic-ember {
    --glow-filter: drop-shadow(0 0 15px #ff2400);
}

.friend-card.hover-active .doll-image.hover-glow-aquamarine {
    --glow-filter: drop-shadow(0 0 14px #7fffd4);
}

.friend-card.hover-active .doll-image.hover-glow-cosmic-gold {
    --glow-filter: drop-shadow(0 0 16px #ffd700);
}

.friend-card.hover-active .doll-image.hover-glow-infrared {
    --glow-filter: drop-shadow(0 0 17px #ff0033);
}

.back-arrow-icon {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    cursor: default;
}

.back-arrow-icon svg {
    animation: whitePulse 1.2s infinite ease-in-out;
    filter: drop-shadow(0 0 6px white);
}

.card-back {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 20px;
    width: 100%;
}

.card-front,
.card-back {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


.friend-card .card-back {
    display: none;
}

.friend-card.card-flipped .card-back {
    display: flex;
}

.friend-card .card-front {
    display: flex;
}

.friend-card.card-flipped .card-front {
    display: none;
}


.friend-card.card-flipped .card-front {
    display: none;
}

.friend-card.card-flipped .card-back {
    display: flex;
}


.redeem-button {
    margin-top: 10px;
    font-weight: bold;
    padding: 10px 16px;
    background-color: #00ff99;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 0 12px #00ff99;
    transition: background-color 0.3s ease;
}

.redeem-button:hover {
    background-color: #00e88b;
}

.coin-sent-confirmation {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: #00ff99;
    color: black;
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 12px;
    font-weight: bold;
    box-shadow: 0 0 10px #00ff99;
    animation: popFade 2s ease-out forwards;
    z-index: 999;
}

@keyframes popFade {
    0% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) scale(1.4);
    }
}

.remove-x-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: transparent;
    border: none;
    font-size: 14px;
    color: white;
    cursor: pointer;
    animation: whitePulse 1.2s infinite ease-in-out;
    z-index: 5;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
}

.remove-x-btn:hover {
    background-color: rgba(255, 0, 0, 0.6);
    color: white;
}

.floating-coin-popup {
    position: fixed;
    left: 50%;
    top: 60%;
    transform: translateX(-50%);
    font-size: 1.8rem;
    font-weight: bold;
    color: #39ff14;
    text-shadow: 0 0 4px white, 0 0 10px #39ff14, 0 0 20px #00ff99;
    animation: sparkleRocket 2.5s ease-out forwards;
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
}

@keyframes sparkleRocket {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }

    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(-200px) scale(1.3);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-400px) scale(0.8);
    }
}

.money-bag-icon {
    font-size: 140px;
    animation: moneyPulse 1.2s infinite ease-in-out;
    margin-bottom: 20px;
}

@keyframes moneyPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

/* Friend Feed background AI video */

body {
    background-color: #121212;
    color: #fff;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: block;
    position: relative;
}


#video-background-container {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: -1;
    overflow: hidden;
}

#background-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 🎯 Friend Feed Container Restyle */
.friend-feed-container {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    width: 85%;
    max-width: none;
    padding: 40px;
    margin: 60px auto 0 auto;
    border: 2px solid white;
    border-radius: 12px;
    animation: whitePulse 2s infinite alternate ease-in-out;
    box-shadow: 0 0 16px white;
    position: relative;
    z-index: 1;
}

/* 🔹 Input fields for auth pages */
.friend-feed-container form input {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: none;
    font-size: 1.1rem;
    text-align: center;
}

/* 🔹 Error messages (field + non-field) */
.errorlist {
    color: red;
    font-weight: bold;
    text-align: center;
    list-style-type: none;
    padding: 0;
    margin: 0 0 10px 0;
}

.form-group {
    margin-bottom: 20px;
}

#learn-more-btn,
#add-friends-btn {
    background-color: white;
    color: black;
    border: none;
    padding: 12px 20px;
    font-weight: bold;
    font-size: 16px;
    border-radius: 12px;
    cursor: pointer;
    animation: whitePulse 1.5s infinite ease-in-out;
    transition: all 0.3s ease;
}

#learn-more-btn:hover,
#add-friends-btn:hover {
    animation: whitePulse 1s infinite ease-in-out;
}

@keyframes whitePulse {
    0% {
        box-shadow: 0 0 6px white, 0 0 12px white;
    }

    50% {
        box-shadow: 0 0 14px white, 0 0 28px white;
    }

    100% {
        box-shadow: 0 0 6px white, 0 0 12px white;
    }
}

/* ✅ Invite Section */
.invite-container {
    text-align: center;
    padding-top: 20px;
}

.invite-title {
    margin-top: 2vh;
    font-size: 3.3rem;
    color: white;
    transition: opacity 0.4s ease;
}

.invite-subtext {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    margin-top: 20px;
    margin-bottom: 40px;
}

.invite-form {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.invite-input {
    font-size: 1.5rem;
    padding: 10px;
    width: 300px;
    max-width: 80%;
    border-radius: 8px;
    border: none;
    text-align: center;
    margin-bottom: 20px;
}

.invite-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* ✅ Reusable casino-style button */
.casino-button {
    font-size: 16px;
    font-weight: bold;
    background-color: white;
    color: black;
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
}

/* ✅ White pulsing buttons hover: NEON GREEN */
.casino-button.white-pulse:hover {
    background-color: #00ff99;
    color: white;
}

.white-pulse {
    animation: whitePulse 1.5s infinite ease-in-out;
}

@keyframes arrowWhitePulse {
    0% {
        fill: rgba(255, 255, 255, 0.7);
        transform: scale(1);
    }

    50% {
        fill: rgba(255, 255, 255, 1);
        transform: scale(1.12);
    }

    100% {
        fill: rgba(255, 255, 255, 0.7);
        transform: scale(1);
    }
}

.circle-back-arrow {
    animation: arrowWhitePulse 1.4s infinite;
    transform-origin: center;
    cursor: pointer;
}

#google-contacts-list div {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 10px;
}

#google-contacts-list label {
    margin-left: 10px;
    color: white;
    font-size: 1rem;
}

.google-invite-buttons-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 15px 0 25px 0;
}

.pulse-anim {
    animation: pulseFade 1.6s ease-in-out 1;
}

@keyframes pulseFade {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.07);
        opacity: 0.75;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Friend Feed Tutorial */

#friend-tutorial-wrapper,
#invite-form,
#google-contacts-container {
    margin-bottom: 2vh;
}

#friend-tutorial-container {
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
}

#friend-tutorial-video {
    width: 100%;
    max-width: 960px;
    margin: 20px auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

#friend-video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: pulseWhite 1.5s infinite;
    pointer-events: auto;
}

#friend-video-play-overlay svg {
    width: 30%;
    height: 30%;
    max-width: 240px;
    max-height: 240px;
    fill: white;
    filter: drop-shadow(0 0 12px white);
}


/* Friend feed top bar (in flow; sticks to top of viewport) */
.friend-feed-container>.feed-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    position: sticky;
    /* use 'static' if you don’t want it pinned */
    top: 0;
    z-index: 2;
    /* above feed content; video bg is -1 */
    /* background: linear-gradient(to bottom, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0)); */
    /* border-bottom: 1px solid rgba(255, 255, 255, .15); */
    background: transparent;
    /* was a gradient */
    border: 0;
    /* remove the bottom line */
    box-shadow: none;
    /* just in case */
    backdrop-filter: none;
    /* just in case */
}


.friend-feed-container .feed-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    /* graceful wrap on small widths */
}

.friend-feed-container .feed-actions .casino-button {
    white-space: nowrap;
    padding: 10px 14px;
}




/* -------------------------------------------
   📱 Friend Feed — simple portrait phones
------------------------------------------- */
@media (max-width: 768px) and (orientation: portrait) {

    /* Container: almost full width, lighter padding, clear the absolute top bar */
    .friend-feed-container {
        width: 94%;
        margin: 56px auto 0;
        /* keep a little top margin */
        padding: 16px;
        /* lighter interior padding */
        /* space for the absolute top controls */
    }

    /* Titles + subtext scale down nicely */
    .invite-title {
        font-size: clamp(1.6rem, 8vw, 2.2rem);
        margin-top: 8px;
    }

    .invite-subtext {
        font-size: clamp(1rem, 4.8vw, 1.25rem);
        margin: 8px 0 16px;
    }

    /* Tutorial video fits the screen width */
    #friend-tutorial-video {
        max-width: 100%;
        height: auto;
    }

    #friend-video-play-overlay svg {
        max-width: 160px;
        max-height: 160px;
    }

    /* Friend cards → 2-up grid that collapses gracefully */
    .friend-row {
        justify-content: center;
        gap: 12px;
        margin-bottom: 16px;
    }

    .friend-card {
        flex: 1 1 46%;
        /* ~2 per row */
        max-width: 260px;
        min-width: 160px;
        padding: 14px;
    }

    .doll-image {
        max-height: 130px;
        margin-bottom: 12px;
    }

    .friend-button {
        min-height: 44px;
        font-size: 1rem;
        padding: 8px 10px;
    }

    /* Top buttons readable but compact */
    .friend-feed-container .casino-button {
        font-size: .95rem;
        padding: 10px 14px;
        white-space: nowrap;
        /* keep single line labels */
    }

    .friend-feed-container>.feed-topbar {
        padding: 12px 14px;
    }

    .circle-back-arrow {
        width: 40px;
        height: 40px;
    }

    .friend-feed-container .feed-actions {
        gap: 8px;
    }

}

/* Extra small phones: go single column */
@media (max-width: 480px) and (orientation: portrait) {
    .friend-card {
        flex: 1 1 100%;
        max-width: 380px;
    }

    .invite-title {
        font-size: clamp(1.4rem, 9vw, 2rem);
    }
}

/* -------------------------------------------
   📟 Mobile landscape (simple + readable)
------------------------------------------- */
@media (max-width: 896px) and (orientation: landscape) {

    /* breathing room under the absolute top bar */
    .friend-feed-container {
        width: 92%;
        padding: 24px 16px;
    }

    /* keep header text compact for short viewports */
    .invite-title {
        font-size: clamp(1.6rem, 6vw, 2.2rem);
        margin-top: 0.25rem;
    }

    .invite-subtext {
        font-size: clamp(1rem, 3.2vw, 1.4rem);
        margin: 8px 0 16px;
    }

    /* top-right buttons stay on one line and don’t wrap */
    .casino-button {
        white-space: nowrap;
        padding: 10px 14px;
        font-size: clamp(0.9rem, 1.8vw, 1rem);
    }

    /* card rows: centered, tighter gaps */
    .friend-row {
        justify-content: center;
        gap: clamp(10px, 2vw, 16px);
    }

    /* cards: flexible 2–3 per row, depending on width */
    .friend-card {
        width: auto;
        /* override fixed 180px */
        flex: 1 1 clamp(160px, 28vw, 220px);
        /* ~3-up on most phones */
        padding: 14px;
    }

    /* dolls + buttons scale for short height */
    .doll-image {
        max-height: 120px;
        margin-bottom: 12px;
    }

    .friend-button {
        height: 38px;
    }

    .circle-back-arrow {
        width: 40px;
        height: 40px;
    }

    /* tutorial video stays within the short viewport */
    #friend-tutorial-video {
        max-height: 56vh;
    }

    #friend-video-play-overlay svg {
        max-width: 180px;
        max-height: 180px;
    }
}