* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #0f0f0f;
    color: #ffffff;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Mobile-first Wrapper: Centers cleanly on desktop, 100% full width on mobile */
.mobile-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    background-color: #0f0f0f;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* -----------------------------------------
   Top Header (YouTube Dark Search Bar)
----------------------------------------- */
.yt-header {
    background-color: #0f0f0f;
    padding: 10px 14px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box {
    flex: 1;
    height: 38px;
    background-color: #121212;
    border: 1px solid #303030;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    cursor: default;
    user-select: none;
}

.search-placeholder {
    color: #888888;
    font-size: 14px;
    letter-spacing: -0.2px;
}

.search-icons-right {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #909090;
}

.icon-keyboard {
    width: 18px;
    height: 18px;
    opacity: 0.85;
}

.icon-search {
    width: 18px;
    height: 18px;
    opacity: 0.85;
}

.mic-button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #222222;
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.mic-button:hover {
    background-color: #2c2c2c;
}

.mic-button svg {
    width: 18px;
    height: 18px;
}

/* -----------------------------------------
   Video Player Section
----------------------------------------- */
.video-section {
    width: 100%;
}

.video-container {
    width: 100%;
    background-color: #000000;
    overflow: hidden;
    position: relative;
}

/* Video Title */
.video-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    color: #f1f1f1;
    padding: 12px 14px 10px 14px;
    margin: 0;
    letter-spacing: -0.2px;
}

/* Channel & Subscribe Row */
.channel-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px 14px 14px;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.channel-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.channel-meta {
    display: flex;
    flex-direction: column;
}

.channel-name {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.channel-subs {
    font-size: 12px;
    color: #aaaaaa;
    line-height: 1.2;
    margin-top: 2px;
}

.btn-subscribe {
    background-color: #ff0000;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.btn-subscribe:active {
    transform: scale(0.97);
}

.btn-subscribe.subscribed {
    background-color: #272727;
    color: #f1f1f1;
}

/* -----------------------------------------
   Live Chat Container (Card with Blue Border)
----------------------------------------- */
.live-chat-card {
    margin: 8px 12px 20px 12px;
    border: 1.5px solid #2563eb;
    border-radius: 12px;
    background-color: #0d0f14;
    box-shadow: 0 0 16px rgba(37, 99, 235, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.live-chat-header {
    padding: 12px 14px 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 3px;
}

.chat-subtitle {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: #8e8e8e;
    font-weight: 500;
}

.chat-live-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #8e8e8e;
}

.chat-live-count svg {
    width: 14px;
    height: 14px;
}

.chat-messages {
    padding: 12px 14px;
    max-height: 380px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 5px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #444444;
}

/* Chat Item */
.chat-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

img.avatar {
    display: block;
    object-fit: cover;
}

/* Avatar Colors matching the screenshot reference */
.avatar-blue { background-color: #1e88e5; }
.avatar-mint { background-color: #4db6ac; }
.avatar-pink { background-color: #ec407a; }
.avatar-lavender { background-color: #9575cd; }
.avatar-salmon { background-color: #ef5350; }
.avatar-gold { background-color: #fbc02d; }
.avatar-teal { background-color: #26a69a; }
.avatar-purple { background-color: #7e57c2; }

.chat-content {
    flex: 1;
    font-size: 13.5px;
    line-height: 1.35;
    word-break: break-word;
}

.chat-author {
    font-weight: 700;
    color: #ffffff;
    margin-right: 6px;
    display: inline;
}

.chat-text {
    color: #d1d5db;
    font-weight: 400;
    display: inline;
}

/* -----------------------------------------
   Chat Input Form
----------------------------------------- */
.chat-input-bar {
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #11141c;
}

.chat-input {
    flex: 1;
    background-color: #1e222d;
    border: 1px solid #2e3444;
    border-radius: 20px;
    padding: 8px 14px;
    color: #ffffff;
    font-size: 13px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.chat-input:focus {
    border-color: #3b82f6;
}

.chat-input::placeholder {
    color: #6b7280;
}

.chat-char-count {
    font-size: 11px;
    color: #71717a;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.btn-send-chat {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-send-chat:active {
    transform: scale(0.9);
}

.btn-send-chat svg {
    width: 17px;
    height: 17px;
}

/* -----------------------------------------
   Bottom Spacing (Replaces the builder note)
----------------------------------------- */
.page-spacer {
    height: 50px;
    width: 100%;
}

/* Mobile Responsiveness Fine-Tuning */
@media (max-width: 360px) {
    .video-title {
        font-size: 15px;
    }
    .channel-name {
        font-size: 13px;
    }
    .btn-subscribe {
        font-size: 12px;
        padding: 6px 14px;
    }
}

/* -----------------------------------------
   Upsell Pages Shared Styles (up1, up2, up3)
----------------------------------------- */
.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.btn-cta {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    padding: 15px;
    text-align: center;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    border-radius: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-yes {
    background: linear-gradient(80deg, #61ce70 0, #99eba4 100%);
    color: #000;
    box-shadow: 0 12px 24px -8px rgba(97, 206, 112, 0.3);
}

.btn-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -8px rgba(97, 206, 112, 0.5);
}

.btn-no {
    color: #ff3131;
    font-style: italic;
    font-size: 16px;
    font-weight: 400;
}

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

.delay-text {
    text-align: center;
    color: #a6a6a6;
    font-size: 12px;
    margin-top: 15px;
}

.cta-container button {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(5, 121, 50, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(5, 121, 50, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(5, 121, 50, 0); }
}
