html, body {
    margin: 0;
    padding: 0;
    background: #0f0f0f;
    color: #fff;
    font-family: Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
}

html {
    scroll-snap-type: y proximity;
}

* {
    box-sizing: border-box;
}

/* ===============================
   FEED — MOBILE FIRST (edge-to-edge, Instagram-like)
================================ */
.feed {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding-top: calc(50px + env(safe-area-inset-top));
    padding-bottom: env(safe-area-inset-bottom);
}

.card {
    background: #1a1a1a;
    margin-bottom: 12px;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    scroll-snap-align: start;
    scroll-margin-top: calc(50px + env(safe-area-inset-top));
}

.card.no-snap {
    scroll-snap-align: none;
}

/* On wider screens the feed becomes a centered card column */
@media (min-width: 560px) {
    .card {
        margin-bottom: 20px;
        border-radius: 10px;
    }
}

.media {
    position: relative;
}

.media img, .media video {
    width: 100%;
    display: block;
}

.blur {
    filter: blur(12px);
    transition: filter 0.3s ease;
}

.media-wrapper {
    position: relative;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlay button {
    padding: 10px 20px;
    background: #ff2f7a;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

.blur-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    color: #fff;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    border-radius: 10px;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    animation: pulse 1.5s infinite;
}

    .blur-layer:hover {
        transform: scale(1.05);
        box-shadow: 0 0 20px #ff2f7a;
    }

@keyframes pulse {
    0% {
        box-shadow: 0 0 5px #ff2f7a;
    }

    50% {
        box-shadow: 0 0 25px #ff2f7a;
    }

    100% {
        box-shadow: 0 0 5px #ff2f7a;
    }
}

/* ===============================
   SIDE ACTIONS — like/share sobre a mídia (estilo TikTok)
================================ */
.side-actions {
    position: absolute;
    right: 10px;
    bottom: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    z-index: 5;
}

.side-action {
    background: none;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.side-icon {
    font-size: 28px;
    line-height: 1;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
    transition: transform 0.15s ease;
}

.side-action:active .side-icon {
    transform: scale(1.25);
}

.side-icon.liked {
    animation: like-pop 0.3s ease;
}

@keyframes like-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.side-count {
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.chat {
    padding: 12px 14px;
    border-top: 1px solid #333;
    word-wrap: break-word;
}

/* confetes */
.confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

    .confetti.active::before,
    .confetti.active::after {
        content: "🎉🎊✨";
        position: absolute;
        top: 50%;
        left: 50%;
        font-size: 24px;
        animation: confetti-fall 2s ease forwards;
    }

@keyframes confetti-fall {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, 200px) scale(0.5) rotate(360deg);
        opacity: 0;
    }
}

/* ===============================
   TOP BAR — FIXED, SAFE-AREA AWARE
================================ */
#topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(50px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 16px;
    padding-right: 16px;
    background: rgba(15, 15, 15, 0.95);
    border-bottom: 1px solid rgba(255, 47, 122, 0.35);
    backdrop-filter: blur(6px);
    z-index: 1000;
}

#topbar-title {
    font-weight: bold;
    letter-spacing: 0.5px;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#open-chat-button {
    flex-shrink: 0;
    background: rgba(255, 47, 122, 0.18);
    border: 1px solid rgba(255, 47, 122, 0.5);
    color: #ff2f7a;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
}

#open-chat-button:hover,
#open-chat-button:active {
    background: rgba(255, 47, 122, 0.35);
}

/* ===============================
   CHAT OVERLAY — TRUE FULLSCREEN (mobile + desktop)
================================ */
#chat-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 2000;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
                visibility 0s linear 0.32s;
    will-change: transform;
    visibility: hidden;
}

#chat-overlay.active {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
                visibility 0s linear 0s;
}

#chat-frame {
    width: 100%;
    height: 100%;
    height: 100dvh;
    border: none;
    display: block;
}

/* ===============================
   NATIVE-APP FEEL — trava o scroll de fundo
================================ */
html.chat-open,
body.chat-open {
    overflow: hidden;
}
