/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    color: white;
    overflow: hidden;
}

/* ADD THIS NEW RULE to prevent blur from affecting content: */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    right: -10%;
    bottom: -10%;
    background-image: url('https://cdn.dmwithme.com/static/videos_frag/enter1-poster.jpg');
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.4); /* ADD brightness(0.5) */
    z-index: -1;
}

.version-badge {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 149; /* Just below tap-to-chat */
    padding: 8px 20px;
    background: linear-gradient(135deg, rgba(255, 0, 80, 0.3), rgba(255, 64, 129, 0.3));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 107, 157, 0.4);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
    color: white;
    text-shadow: 0 0 10px rgba(255, 107, 157, 0.8);
    box-shadow: 
        0 4px 15px rgba(255, 0, 80, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.version-shimmer {
    display: inline-block;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(255, 182, 193, 1) 25%,
        rgba(255, 255, 255, 0.8) 50%,
        rgba(255, 182, 193, 1) 75%,
        rgba(255, 255, 255, 0.8) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hide version badge when authenticated (same logic as tap-to-chat) */
body.authenticated .version-badge {
    display: none;
}

.blurred-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(5px);
    opacity: 0.7;
    z-index: 1;
}

.disclaimer {
    font-size: 8px;
    padding: 0;
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
}

/* Hide blurred preview when authenticated */
body.authenticated .blurred-preview {
    display: none;
}

/* Hide main videos when not authenticated */
body:not(.authenticated) #mainVideo,
body:not(.authenticated) #bufferVideo {
    display: none;
}

body:not(.authenticated) .level-widget {
    display: none;
}

body:not(.authenticated) .video-container video {
    filter: blur(10px);
    transform: scale(1.1); /* Slightly scale to hide blur edges */
}

body.authenticated .video-container video {
    filter: none;
    transform: none;
}

#verification-message {
    font-size: 14px;
    display: block;
    text-align: center;
    margin-bottom: 10px;
}

.verification-code-input {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.code-digit {
    width: 45px !important;
    height: 55px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: white;
    padding: 0 !important;
    margin: 0 !important;
    transition: all 0.2s;
}

.code-digit:focus {
    border-color: #ff0050;
    background: rgba(255,255,255,0.15);
    outline: none;
}

.verification-actions {
    display: flex;
    gap: 8px;
    margin-top: 40px;
}

.verification-actions button {
    flex: 1;
    padding: 10px;
    font-size: 13px;
}

#resend-code:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#resend-code, #resend-timer {
    color: #fff;
    display: block;
    text-align: center;
}

/* Main Container - Full Screen Video Style */
.app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-width: 430px;
    margin: 0 auto;
    background: transparent;
    overflow: hidden;
    z-index: 1;
}

/* Video Container - Full Screen */
#mainVideo, #bufferVideo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

#mainVideo {
    opacity: 1;
    z-index: 2;
}

/* The bufferVideo is hidden by default */
#bufferVideo {
    opacity: 0;
    z-index: 1;
}

.status-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 12px;
    font-size: 16px;
    text-align: center;
    backdrop-filter: blur(10px);
    z-index: 15;
    display: none;
}

/* Update right-actions to include new action buttons */
.action-btn.queued {
    border: 2px solid #ff6b6b;
    background: rgba(255, 107, 107, 0.3);
}

.video-placeholder {
    text-align: center;
    z-index: 1;
}

.video-placeholder h2 {
    font-size: 4rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

.video-placeholder p {
    font-size: 1.2rem;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

/* Top Bar */
.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(60, 0, 30, 0.7) 0%, rgba(60, 0, 30,0) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    padding-top: max(20px, env(safe-area-inset-top, 20px));
}

.top-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
}

.live-indicator {
    background: #ff0050;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.viewer-count {
    background: rgba(0,0,0,0.5);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.viewer-count img {
    width: 12px;
    height: 12px;
}

.viewer-count span {
    display: inline-block;
    transition: transform 0.2s ease-out;
}

.viewer-count.count-up span {
    animation: countUp 0.3s ease-out;
}

.viewer-count.count-down span {
    animation: countDown 0.3s ease-out;
}

[alt="Bounce!"] {
  animation-duration: 1s;
  animation-name: hover;
  animation-iteration-count: infinite;
  transition-timing-function: ease-in-out;
}

@keyframes hover {
  0%, 100% {
    transform: translateY(-2px);
  }

  50% {
    transform: translateY(-8px);
  }
}

[alt="Twerk"], [alt="Super Twerk"] {
  animation-duration: 1s;
  animation-name: idle;
  animation-iteration-count: infinite;
  transition-timing-function: ease-in-out;
  transform-style: preserve3d;
}

@keyframes idle {
  0%, 100% {
    transform: none;
    transform-origin: center bottom;
  }

  50% {
    /*transform: translate(0%, -100%);*/
    transform: perspective(20px) rotateX(-2deg) scaleY(0.85);
    transform-origin: center bottom;
  }
}

@keyframes countUp {
    0% {
        transform: translateY(8px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes countDown {
    0% {
        transform: translateY(-8px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

#floating-gifts-container {
    position: absolute;
    left: 20px;
    top: 40%;
    transform: translateY(-50%);
    z-index: 500;
    pointer-events: none;
    max-width: 300px;
}

/* Individual gift notification style */
.floating-gift {
    background: linear-gradient(90deg, rgba(254, 44, 85, 0.2), rgba(0,0,0,0.3));
    border-radius: 50px;
    padding: 8px 15px 8px 8px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
    cursor: pointer;

    /* Initially hidden and off-screen for the animation */
    opacity: 0;
    transform: translateX(-100%);
}

/* Animation classes */
.floating-gift.slide-in {
    animation: slideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.floating-gift.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

/* Text styling inside the notification */
.floating-gift-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.floating-gift-username {
    font-weight: 600;
    margin-right: 5px;
    font-size: 14px;
    color: white;
    text-shadow: 0 0 3px #000;
}

.floating-gift-name {
    font-size: 12px;
    margin-right: 5px;
    color: #aaa;
    line-height: 1.2;
    text-shadow: 0 0 1px #000;
}

.floating-gift-icon {
    font-size: 32px;
    margin-right: 10px;
}

.floating-gift-icon img {
    width: 32px;
    height: 32px;
}

/* The combo counter (e.g., "x3") */
.floating-gift-combo {
    font-size: 24px;
    font-weight: 900;
    font-style: italic;
    color: #fff;
    text-shadow:
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 15px #ff0055,
        0 0 20px #ff0055,
        0 0 25px #ff0055,
        0 0 30px #ff0055,
        0 0 35px #ff0055;
    display: none;
}

.floating-gift-combo.pop {
    animation: pop 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* KEYFRAME ANIMATIONS */

/* Animation for the notification sliding in from the left */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation for the combo number "popping" */
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* Animation for the notification fading out */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

.top-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.icon-btn svg {
    fill: #fff;
    width: 16px;
    height: 16px;
}

.icon-btn:hover {
    background: rgba(0,0,0,0.7);
}

/* Right Side Actions (TikTok Style) */
.right-actions {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 100;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
}

#gifts-btn {
    animation: giftMicroBounce 1.5s infinite ease-in-out;
    transform-origin: center bottom;
}

#gifts-btn svg {
    fill: gold;
    filter: drop-shadow(0px 0px 6px #FC768A);
    transition: fill 0.4s ease, filter 0.4s ease;
}

#gifts-btn:hover {
    animation: giftMicroBounceHover 1.5s infinite ease-in-out;
}

#gifts-btn:hover svg {
    filter: drop-shadow(0px 0px 16px #f472b6) 
            drop-shadow(0px 0px 24px #f472b6)
            drop-shadow(0px 0px 32px #f8a5d3);
}

@keyframes giftMicroBounce {
    0%   { transform: translateY(0px) scaleX(1) scaleY(1); }
    10%  { transform: translateY(-3px) scaleX(1.05) scaleY(0.95); }
    20%  { transform: translateY(2px)  scaleX(0.95) scaleY(1.05); }
    30%  { transform: translateY(-2px) scaleX(1.03) scaleY(0.97); }
    40%  { transform: translateY(1px)  scaleX(0.97) scaleY(1.03); }
    50%  { transform: translateY(-1px) scaleX(1.02) scaleY(0.98); }
    60%  { transform: translateY(1px)  scaleX(0.98) scaleY(1.02); }
    70%  { transform: translateY(-2px) scaleX(1.01) scaleY(0.99); }
    80%  { transform: translateY(2px)  scaleX(0.99) scaleY(1.01); }
    90%  { transform: translateY(-1px) scaleX(1.01) scaleY(0.99); }
    100% { transform: translateY(0px) scaleX(1) scaleY(1); }
}

@keyframes giftMicroBounceHover {
    0%   { transform: translateY(0px) scaleX(1.1) scaleY(1.1); }
    10%  { transform: translateY(-3px) scaleX(1.155) scaleY(1.045); }
    20%  { transform: translateY(2px)  scaleX(1.045) scaleY(1.155); }
    30%  { transform: translateY(-2px) scaleX(1.133) scaleY(1.067); }
    40%  { transform: translateY(1px)  scaleX(1.067) scaleY(1.133); }
    50%  { transform: translateY(-1px) scaleX(1.122) scaleY(1.078); }
    60%  { transform: translateY(1px)  scaleX(1.078) scaleY(1.122); }
    70%  { transform: translateY(-2px) scaleX(1.111) scaleY(1.089); }
    80%  { transform: translateY(2px)  scaleX(1.089) scaleY(1.111); }
    90%  { transform: translateY(-1px) scaleX(1.111) scaleY(1.089); }
    100% { transform: translateY(0px) scaleX(1.1) scaleY(1.1); }
}

.action-btn svg {
    fill: #fff;
}

.action-btn.heartactive svg {
    fill: rgba(255, 0, 80, 0.8);
}

.action-count {
    font-size: 10px;
    text-align: center;
    margin-top: 4px;
    color: rgba(255,255,255,0.8);
    text-shadow: 0 0 3px #000;
    font-weight: 900;
}

/* Bottom Section */
.bottom-section {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    padding-bottom: 0px;
    background: linear-gradient(0deg, rgba(60, 0, 30,0.7) 0%, rgba(60, 0, 30,0) 100%);
    z-index: 99;
    transition: all 0.3s ease;
}

/* Chat Section */
.chat-section {
  margin-bottom: 16px;
}

.chat-messages-wrapper {
  position: relative;
  height: 120px;
  overflow-y: auto;
  margin-bottom: 12px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 20px, black);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-image: linear-gradient(to bottom, transparent, black 20px, black);
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
  /* Apply mask to content, not scrollable container */
}

.chat-message {
    margin-bottom: 0px;
    text-shadow: 0 0 3px #000;
    padding: 2px 12px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.4;
}

.chat-message .username {
    font-weight: bold;
    color: #ff6b6b;
    margin-right: 6px;
}

.chat-message.tip-message {
    background: rgba(255, 215, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.5);
    margin-bottom: 2px;
    line-height: 1.2;
}

.chat-message.system-message {
    background: rgba(255, 0, 80, 0.2);
    font-style: italic;
    text-align: center;
}

.chat-message.ai-message {
}

.timestamp {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 8px;
}

.tier-badge {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    margin-right: 6px;
}

/* Chat Input */
.chat-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-wrapper {
    position: relative;
    flex: 1;
}

.chat-input {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 78px 10px 10px; /* top right bottom left — extra right room for mic + send */
    border-radius: 10px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* While recording: give the input a subtle "live" look */
.chat-input.is-recording {
    background-color: rgba(255, 107, 157, 0.18);
    border-color: rgba(255, 107, 157, 0.6);
}

/* Interim (not-yet-final) transcript chunk shown inline */
.chat-input.has-interim::placeholder {
    color: rgba(255, 192, 220, 0.5);
}

.chat-input::placeholder {
    color: #ffc0dc;
}

.tap-to-chat-btn {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 150;
    padding: 18px 32px;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 18px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    animation: pulsateCenter 2s ease-in-out infinite;
    transition: all 0.3s ease;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-tap-highlight-color: transparent;
}

/* New pulsate animation that maintains centering */
@keyframes pulsateCenter {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 8px 24px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .3);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        box-shadow: 0 12px 32px rgba(255, 105, 180, .4), inset 0 1px 0 rgba(255, 255, 255, .5);
    }
}

.send-btn {
    position: absolute;
    right: 5px;
    top: 2px;
    width: 32px;
    height: 32px;
    font-size: 14px;
    border: none;
    background: transparent;
}

.send-btn svg {
    fill: #fff;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
    float: right;
}

.dm-section {
    margin-bottom: 16px;
}

#dm-button-icon {
    width: 32px;
}

.dm-message.tip-message {
    background: rgba(255, 215, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.5);
}

/* buy credits */
.unlock-info {
    text-align: center;
    margin-bottom: 24px;
}

.unlock-feature {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
}

.feature-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.feature-text {
    text-align: left;
    flex-grow: 1;
}

.feature-text h3 {
    margin: 0 0 4px 0;
    color: #ff0050;
    font-size: 16px;
}

.feature-text p {
    margin: 0;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

.unlock-cost {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 215, 0, 0.2);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.unlock-cost .coin-icon {
    width: 24px;
    height: 24px;
}

.cost-amount {
    font-size: 18px;
    font-weight: bold;
    color: #ffd700;
}

.unlock-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.unlock-btn {
    background: linear-gradient(45deg, #ff0050, #ff4081);
    border: none;
    color: white;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.unlock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,0,80,0.4);
}

.cancel-btn {
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Buy Credits Modal Styles */
.buy-credits-content {
    max-width: 400px;
    width: 95%;
}

.credits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.credit-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    text-decoration: none;
    color: white;
    transition: all 0.2s;
    position: relative;
    cursor: pointer;
}

.credit-option:hover {
    background: rgba(255,255,255,0.2);
    border-color: #ff0050;
    transform: scale(1.02);
}

.credit-option.featured {
    grid-column: 1 / -1;
    background: linear-gradient(45deg, rgba(255,0,80,0.2), rgba(255,64,129,0.2));
    border-color: #ff0050;
}

.featured-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff0050;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.credit-option .coin-icon {
    width: 18px;
    height: 18px;
}

.credit-amount-container {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.credit-amount {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    line-height: 1;
}

.credit-price {
    font-size: 12px;
    font-weight: bold;
    color: #4ade80;
}

.credit-option.featured .credit-amount {
    font-size: 24px;
}

.credit-option.featured .credit-price {
    font-size: 14px;
}

#recharge-btn {
    width: 100%; margin-top: 12px; background: linear-gradient(45deg, #ff0050, #ff4081);
}

/* Gift/Tip Section */
.gift-section {
    display: flex;
    gap: 8px;
    align-items: center;
}
.gift-btn {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.2s;
}
.gift-btn:hover {
    transform: scale(1.05);
}
.gift-btn:disabled {
    background: rgba(255,255,255,0.2);
    cursor: not-allowed;
}
.gift-amount {
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
}
.gift-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 2px;
    margin-top: 16px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}
.gift-grid::-webkit-scrollbar {
    width: 2px;
}
.gift-grid::-webkit-scrollbar-track {
    background: transparent;
}
.gift-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}
.gift-item {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 8px 2px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100px;
    overflow: hidden;
}
.gift-item:hover {
    background: rgba(255,255,255,0.2);
    border-color: #ff0050;
    transform: scale(1.05);
}
.gift-icon, .gift-name, .gift-cost-container {
    transition: transform 0.3s ease-in-out;
}
.gift-item::after {
    content: 'Send';
    position: absolute;
    bottom: 0px;
    left: 50%;
    background: #ff0050;
    color: white;
    font-weight: bold;
    font-size: 12px;
    padding: 6px 28px;
    border-radius: 0 0 8px 8px;
    line-height: 0.5;
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.9);
    transition: all 0.3s 
ease-in-out;
}
.gift-item:hover .gift-icon,
.gift-item:hover .gift-name {
    transform: translateY(-5px);
}

.gift-item:hover .gift-cost-container {
    /* Kept the centering rule and added the upward movement */
    transform: translateX(-50%) translateY(-10px);
}

.gift-item:hover::after {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.gift-item.gift-locked {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.gift-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffd700;
    font-weight: bold;
    font-size: 12px;
    border-radius: 8px;
    z-index: 10;
}

.gift-item.gift-locked:hover {
    transform: none;
}

.gift-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 2px auto;
    display: block;
}
.gift-name {
    font-size: 10px;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.7);
    display: block;
    line-height: 1.2;
    flex-grow: 1;
}
.gift-cost-container {
    display: flex;
    align-items: center;
    gap: 3px;
    justify-content: center;
    position: absolute;
    bottom: 8px;
    left: 50%;
    /* This rule was being overwritten on hover */
    transform: translateX(-50%);
    width: 100%;
}
.gift-cost {
    font-size: 12px;
    color: #fff;
    font-weight: bold;
}
.gift-cost-container img.coin-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.gift-icon-wrapper {
    width: 48px;
    height: 48px;
    margin: 0 auto 2px auto;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.gift-icon-wrapper.lazy-load {
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
}

.gift-icon-wrapper.lazy-load::before {
    content: '🎁';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    opacity: 0.3;
    z-index: 1;
}

.gift-icon-wrapper.lazy-load::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 1.5s infinite;
    z-index: 2;
}

.gift-icon {
    width: 100%;
    height: 100%;
    display: block;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: #1a1a1a;
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 320px;
    color: white;
    position: relative;
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #ff0050;
}

.credit-strike {
    text-decoration: line-through;
    color: #999;
}

.black-friday {
    text-align: center;
    color: #fff !important;
    background: #000;
    border-radius: 8px;
    padding: 6px 0;
    text-transform: uppercase;
    font-size: 17px;
    margin-right: 8px;
    font-weight: 900;
}

.modal-content input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
}

.modal-content input::placeholder {
    color: rgba(255,255,255,0.6);
}

.modal-content button {
    width: 100%;
    padding: 12px;
    background: #ff0050;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.secondary-btn {
    background: #666 !important;
}

.close {
    position: absolute;
    right: 16px;
    top: 16px;
    font-size: 24px;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
}

.rose-btn {
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.rose-btn:hover {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.7);
}

.rose-btn img {
    width: 24px;
    height: 24px;
}

/* Animation for hearts */
@keyframes floatingHeart {
    0% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }
    15% {
        transform: translateY(-20px) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(0.8);
        opacity: 0;
    }
}

.floating-heart {
    position: absolute;
    font-size: 20px;
    color: #ff0050;
    pointer-events: none;
    animation: floatingHeart 2s ease-out forwards;
}

/* Scrollbar styling */
.chat-messages-wrapper::-webkit-scrollbar {
    width: 2px;
}

.chat-messages-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

/* Auth buttons when logged out */
.auth-buttons {
    display: flex;
    gap: 8px;
}

.auth-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.create-account-link {
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.7) !important;
    display: flex;
    justify-content: center;
    font-size: 14px;
}

.create-account-link a {
    margin-left: 3px;
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 900;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 5px;
    color: white;
    z-index: 10000;
    font-weight: 500;
    font-size: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.notification-success {
    background-color: #48bb78;
}

.notification-error {
    background-color: #e53e3e;
}

.notification-warning {
    background-color: #ed8936;
}

.notification-info {
    background-color: #667eea;
}

#buy-credits-btn {
    display: flex;
    width: fit-content;
    border-radius: 8px;
    padding: 0px 4px;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    color: #ffbede;
}

/* Settings Modal Styles */
.settings-user-info {
    display: none;
    text-align: center;
}

.settings-footer {
    margin-top: 10px;
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-link {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s;
}

.footer-link:hover {
    color: rgba(255,255,255,0.8);
}

.footer-divider {
    color: rgba(255,255,255,0.3);
    margin: 0 8px;
    font-size: 12px;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

.user-info .credits {
    background: rgba(255, 215, 0, 0.3);
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.credits img {
    width: 16px;
    height: 16px;
}

#credits {
    font-size: 24px;
}

.settings-logout-btn {
    width: 100%;
    margin-top: 8px;
}

.settings-auth-buttons {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.settings-auth-btn {
    width: 100%;
}

.gift-animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Delete Account Button */
.delete-btn {
    background: transparent !important;
    width: fit-content !important;
    margin: 16px auto 0px auto;
    padding: 4px 8px !important;
    display: block;
    color: rgba(220, 38, 38, 0.8) !important;
}

.delete-btn:hover {
    text-decoration: underline;
}

/* DM Reset Button */
.reset-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    margin-left: 8px;
}

.reset-btn:hover {
    background: rgba(255,255,255,0.2);
}

.reset-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* Age Consent Notice */
.consent-notice {
    font-size: 10px;
    color: rgba(255,255,255,0.6);
    text-align: center;
    margin-bottom: 12px;
    line-height: 1.3;
}

.consent-notice a {
    color: rgba(255,255,255,0.8);
    text-decoration: underline;
}

/* Floating Hearts Animation */
.gift-animation-container.floating-hearts::before {
    content: '❤️';
    position: absolute;
    animation: float-up 3s ease-out forwards;
    font-size: 40px;
}

@keyframes float-up {
    0% { bottom: 10%; opacity: 1; transform: translateX(-50%) scale(0); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.2); }
    100% { bottom: 90%; opacity: 0; transform: translateX(-50%) scale(0.8); }
}

#auth-captcha-container {
    margin: 6px 0;
    display: flex;
    justify-content: center;
}

.h-captcha {
    transform: scale(0.9);
    transform-origin: center;
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .bottom-section {
        position: fixed;
        bottom: 0;
    }
}

/* Ensure inputs stay visible above keyboard */
.chat-input-container {
    position: relative;
    z-index: 1000;
}

body.android-chrome .app-container {
    height: calc(var(--vh, 1vh) * 100);
}

body.android-chrome .top-bar {
    padding-top: 24px;
}

.level-widget {
    position: absolute;
    right: 5px;
    top: 100px;
    z-index: 150;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
    transform-style: preserve-3d; /* ADD THIS */
}

/* Pinwheel animation for level up */
.level-widget.level-up::before {
    animation: instancePinwheelSpin 3s linear forwards;
    background: url(/static/icons/pinwheel.webp);
    background-size: contain;
    content: "";
    height: 270px;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate3d(-50%, -50%, -1px);
    width: 270px;
    pointer-events: none;
    z-index: -1; /* Behind the heart */
}

@keyframes instancePinwheelSpin {
    0% {
        transform: translate3d(-50%, -50%, -1px) rotate(0deg) scale(0);
        opacity: 1;
    }
    15% {
        transform: translate3d(-50%, -50%, -1px) rotate(54deg) scale(1);
        opacity: 1;
    }
    75% {
        transform: translate3d(-50%, -50%, -1px) rotate(270deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate3d(-50%, -50%, -1px) rotate(360deg) scale(0);
        opacity: 0;
    }
}

.level-heart-container {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.level-heart-icon {
    width: 70%;
    height: 70%;
    fill: #ff4081;
    filter: drop-shadow(0 0 8px rgba(255, 64, 129, 0.6));
    transition: all 0.3s ease;
    /* ADD THIS: Make heart semi-transparent so particles show through */
    position: relative;
    z-index: 1;
}

.level-number-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 3; /* CHANGED: Higher than particles and heart */
    transition: all 0.3s ease;
    line-height: 0.7;
}

.level-progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    transform: rotate(-90deg);
    z-index: 0; /* CHANGED: Behind everything */
}

.progress-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 3;
}

.progress-ring-fill {
    fill: none;
    stroke: url(#levelGradient);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 163.36;
    stroke-dashoffset: 163.36;
    transition: stroke-dashoffset 0.5s ease-out;
    filter: drop-shadow(0 0 4px rgba(255, 107, 157, 0.8));
}

/* Level Up Animation */
@keyframes levelUpPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
    }
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.15);
    }
    50% {
        transform: scale(1.05);
    }
    75% {
        transform: scale(1.2);
    }
}

@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(255, 64, 129, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 64, 129, 1))
                drop-shadow(0 0 30px rgba(255, 107, 157, 0.8));
    }
}

.level-widget.level-up .level-heart-icon {
    animation: heartBeat 0.6s ease-out, glowPulse 0.6s ease-out;
}

.level-widget.level-up .level-number-badge {
    animation: levelUpPulse 0.6s ease-out;
}

/* Levels Modal */
.levels-modal-content {
    max-width: 360px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px 16px;
}

.levels-modal-content h2 {
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.levels-journey {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.journey-item {
    display: grid;
    grid-template-columns: 7px 20px 1fr;
    position: relative;
    padding-bottom: 14px;
}

.journey-item:last-child {
    padding-bottom: 0;
}

.journey-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b9d, #ff85b3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.4);
    z-index: 2;
}

.journey-progress {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 32px;
}

.progress-line {
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, 
        rgba(255, 107, 157, 0.6) 0%, 
        rgba(255, 107, 157, 0.2) 100%);
    position: relative;
}

.progress-line.last {
    background: transparent;
}

.journey-details {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.journey-icon {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
}

.journey-info {
    flex: 1;
    min-width: 0;
}

.journey-info h3 {
    font-size: 16px;
    margin: 0 0 4px 0;
    color: #ff6b9d;
    font-weight: 600;
}

.journey-levels {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.journey-unlock {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.4;
}

/* Make level widget clickable */
.level-widget {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.level-widget:hover {
    transform: scale(1.05);
}

/* Scrollbar for levels modal */
.levels-modal-content::-webkit-scrollbar {
    width: 4px;
}

.levels-modal-content::-webkit-scrollbar-track {
    background: #000;
    border-radius: 2px;
}

.levels-modal-content::-webkit-scrollbar-thumb {
    background: #000;
    border-radius: 2px;
}

.levels-modal-content::-webkit-scrollbar-thumb:hover {
    background: #000;
}

.journey-item.completed .journey-details {
    border-color: #ff6b9d;
    background: rgba(255, 107, 157, 0.1);
}

.journey-item.completed .journey-number {
    background: linear-gradient(135deg, #ff6b9d, #ff85b3);
    box-shadow: 0 2px 12px rgba(255, 107, 157, 0.6);
}

.journey-item.completed .journey-info h3 {
    color: #ff85b3;
}

.journey-item.completed .progress-line {
    background: linear-gradient(180deg, 
        rgba(255, 107, 157, 0.8) 0%, 
        rgba(255, 107, 157, 0.4) 100%);
}

.settings-section {
    margin-bottom: 20px;
}

.settings-section h3 {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
    text-align: center;
}

.character-selector {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.character-option {
    flex: 1;
    max-width: 120px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.character-option:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.character-option.selected {
    background: rgba(255, 0, 80, 0.2);
    border-color: #ff0050;
}

.character-option img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
}

.character-option span {
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.character-switch-container {
    position: absolute;
    top: 68%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 149;
}

.character-switch-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.character-switch-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.02);
}

.character-switch-btn img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Hide character switcher when authenticated */
body.authenticated .character-switch-container {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 430px) {
    body {
        height: calc(var(--vh, 1vh) * 100);
    }

   .app-container {
        height: calc(var(--vh, 1vh) * 100);
    }
    
    .video-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .top-bar {
        padding-left: 12px;
        padding-right: 12px;
        /* Don't override padding-top - keep safe area handling */
    }
    
    .bottom-section {
        padding-left: 12px;
        padding-right: 12px;
        /* Don't override padding-bottom - keep safe area handling */
    }
    
    .right-actions {
        right: 8px;
        gap: 16px;
    }
    
    .action-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .action-btn:hover {
        transform: scale(1);
    }

    .gift-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3px;
        padding: 2px;
    }

    .gift-icon {
        width: 36px;
        height: 36px;
    }
    
    .gift-item {
        padding: 6px;
        min-height: 90px;
    }

    .gift-item::after {
        padding: 6px 48px;
    }

    .gift-icon-wrapper {
        width: 36px;
        height: 36px;
        margin: 0 auto 4px auto;
    }

    .levels-modal-content {
        max-width: 340px;
        padding: 16px 12px;
    }
    
    .journey-details {
        padding: 10px;
    }
    
    .journey-icon {
        font-size: 24px;
    }
    
    .journey-info h3 {
        font-size: 15px;
    }
    
    .journey-unlock {
        font-size: 12px;
    }
}
