/* OpenMic Watch — TikTok-style layout with OpenMic design tokens (see /styles.css) */
:root {
    --primary-color: #00a8ff;
    --primary-bright: #00d4ff;
    --accent: #7b5cff;
    --dark-bg: #0a0e27;
    --darker-bg: #050814;
    --text-light: #ffffff;
    --text-gray: #9aa3c0;
    --card-bg: rgba(26, 31, 58, 0.55);
    --card-border: rgba(0, 168, 255, 0.18);
    --radius: 18px;
    --sidebar-width: 240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* `hidden` must win over any explicit display rule (e.g. .modal-backdrop's flex) */
[hidden] { display: none !important; }

html, body {
    height: 100%;
    background: var(--darker-bg);
    color: var(--text-light);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overscroll-behavior: none;
}

button { font-family: inherit; }

.app { display: flex; height: 100dvh; }

/* ================= Sidebar ================= */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--dark-bg);
    z-index: 10;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 800;
    font-size: 1.25rem;
    padding: 4px 10px 18px;
}
.sidebar-logo img { width: 38px; height: 38px; border-radius: 9px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-radius: 12px;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: background 0.2s ease;
    position: relative;
}
.nav-item svg { width: 24px; height: 24px; fill: currentColor; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); }
.nav-item.active { color: var(--primary-bright); }

.live-dot-nav {
    width: 8px; height: 8px;
    background: #ff4d6d;
    border-radius: 50%;
    margin-left: auto;
    animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.6); }
    100% { box-shadow: 0 0 0 10px rgba(255, 77, 109, 0); }
}

.sidebar-auth { margin-top: 18px; padding: 0 4px; }
.sidebar-auth .btn-block { width: 100%; }

.profile-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}
.profile-chip .chip-link {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}
.profile-chip img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #1a1f3a; }
.profile-chip .chip-name { font-weight: 700; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.profile-chip .chip-logout {
    background: none; border: none; color: var(--text-gray);
    cursor: pointer; font-size: 0.8rem; font-weight: 600;
}
.profile-chip .chip-logout:hover { color: var(--text-light); }

.sidebar-footer {
    margin-top: auto;
    padding: 14px 10px 4px;
    font-size: 0.78rem;
    color: var(--text-gray);
}
.sidebar-footer a { color: var(--text-gray); text-decoration: none; margin-right: 10px; }
.sidebar-footer a:hover { color: var(--text-light); }
.sidebar-footer p { margin-top: 8px; opacity: 0.7; }

/* ================= Buttons ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 999px;
    padding: 12px 22px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, opacity 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn-primary {
    background: linear-gradient(120deg, var(--primary-color), var(--accent));
    color: #fff;
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.14);
}
.btn-small { padding: 8px 16px; font-size: 0.85rem; }
.btn-block { width: 100%; }

.link-btn {
    background: none; border: none;
    color: var(--primary-bright);
    font-weight: 600; cursor: pointer;
    font-size: 0.9rem;
}
.link-btn:hover { text-decoration: underline; }

/* ================= Main / views ================= */
.main { flex: 1; position: relative; overflow: hidden; }
.view { display: none; height: 100%; }
.view.active { display: block; }

.view-scroll {
    height: 100%;
    overflow-y: auto;
    padding: 28px 32px 60px;
}
.view-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 20px; }

.empty-state {
    text-align: center;
    color: var(--text-gray);
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* ================= Feed ================= */
.feed-scroller {
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}
.feed-scroller::-webkit-scrollbar { display: none; }

.feed-slide {
    height: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 14px 0;
    position: relative;
}

.video-frame {
    position: relative;
    height: 100%;
    aspect-ratio: 9 / 16;
    max-width: min(62vw, 480px);
    background: #000;
    border-radius: 16px;
    overflow: hidden;
}
/* Landscape videos: let the frame grow wide instead of cropping to 9:16 */
.video-frame.landscape {
    height: auto;
    max-height: 100%;
    width: min(72vw, 960px);
    max-width: calc(100% - 150px); /* keep room for the action rail */
}
.video-frame.landscape video { object-fit: contain; }
.video-frame video {
    width: 100%; height: 100%;
    object-fit: cover;
    cursor: pointer;
    /* Positioned + z-index so the video paints above the absolutely
       positioned .thumb placeholder behind it */
    position: relative;
    z-index: 1;
}
.video-frame .thumb {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
}

.video-overlay {
    position: absolute;
    z-index: 2;
    left: 0; right: 0; bottom: 0;
    padding: 18px 16px 30px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    pointer-events: none;
}
.video-overlay .vo-user { font-weight: 800; font-size: 1rem; }
.video-overlay .vo-title { font-size: 0.92rem; margin-top: 4px; color: rgba(255,255,255,0.92); }
.video-overlay .vo-caption {
    font-size: 0.85rem; margin-top: 2px; color: rgba(255,255,255,0.75);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.play-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 76px; height: 76px;
    border-radius: 50%;
    border: none;
    background: rgba(5, 8, 20, 0.65);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 1.7rem;
    padding-left: 6px;
    cursor: pointer;
    z-index: 4;
    transition: transform 0.15s ease, background 0.2s ease;
}
.play-overlay:hover {
    transform: translate(-50%, -50%) scale(1.08);
    background: rgba(0, 168, 255, 0.5);
}

/* Scrubber / seek bar (iOS-style thin draggable progress bar) */
.scrubber {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 3;
    padding: 14px 14px 12px;
    cursor: pointer;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}
.scrubber:focus-visible { outline: none; }
.scrubber:focus-visible .scrub-track { box-shadow: 0 0 0 2px var(--primary-bright); }
.scrub-track {
    position: relative;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.3);
    transition: height 0.12s ease;
}
.scrub-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0;
    border-radius: 3px;
    background: #fff;
}
.scrub-thumb {
    position: absolute;
    top: 50%; left: 0;
    width: 13px; height: 13px;
    border-radius: 50%;
    background: #fff;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.12s ease;
}
.scrubber:hover .scrub-track,
.scrubber.dragging .scrub-track { height: 5px; }
.scrubber:hover .scrub-thumb,
.scrubber.dragging .scrub-thumb { opacity: 1; }

.mute-hint {
    position: absolute; top: 14px; left: 14px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    pointer-events: none;
}

/* Action rail (TikTok-style, right of video) */
.action-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding-bottom: 8px;
}
.action-rail .rail-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    background: #1a1f3a;
    margin-bottom: 2px;
}
.rail-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
}
.rail-btn .rail-icon {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.15s ease;
}
.rail-btn:hover .rail-icon { background: rgba(255, 255, 255, 0.16); transform: scale(1.06); }
.rail-btn svg { width: 24px; height: 24px; fill: #fff; }
.rail-btn.liked svg { fill: #ff2d55; }
.rail-btn.tip-btn svg { fill: #ffd166; }

.feed-arrows {
    position: absolute;
    right: 22px; top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.feed-arrows button {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease;
}
.feed-arrows button:hover { background: rgba(255, 255, 255, 0.2); }

.feed-loading {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    scroll-snap-align: start;
}

/* ================= LIVE grid ================= */
.live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}
.live-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.2s ease;
}
.live-card:hover { transform: translateY(-3px); border-color: var(--primary-color); }
.live-card .lc-thumb {
    aspect-ratio: 16 / 10;
    background: #10142e center/cover no-repeat;
    position: relative;
}
.live-badge {
    background: #ff4d6d;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    border-radius: 6px;
    padding: 3px 8px;
}
.lc-thumb .live-badge { position: absolute; top: 10px; left: 10px; }
.lc-thumb .lc-viewers {
    position: absolute; bottom: 10px; left: 10px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 600;
}
.lc-thumb .lc-ticket {
    position: absolute; top: 10px; right: 10px;
    background: linear-gradient(120deg, var(--primary-color), var(--accent));
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 800;
}
.live-card .lc-body { padding: 14px; display: flex; gap: 10px; align-items: center; }
.live-card .lc-body img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: #1a1f3a; }
.live-card .lc-title { font-weight: 700; font-size: 0.95rem; }
.live-card .lc-user { color: var(--text-gray); font-size: 0.82rem; margin-top: 2px; }

/* ================= LIVE player ================= */
.live-player-layout {
    display: flex;
    height: 100%;
    gap: 0;
}
.live-player-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 24px;
    min-width: 0;
}
.back-btn {
    align-self: flex-start;
    background: none;
    border: none;
    color: var(--text-gray);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 6px 0 12px;
}
.back-btn:hover { color: var(--text-light); }

.live-video-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
}
.live-video-wrap video { width: 100%; height: 100%; object-fit: contain; }
.live-badge-row {
    position: absolute; top: 14px; left: 14px;
    display: flex; gap: 8px; align-items: center;
}
.viewer-count {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.78rem;
    font-weight: 600;
}

.live-paywall {
    position: absolute; inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 8, 20, 0.88);
    backdrop-filter: blur(6px);
}
.paywall-card {
    text-align: center;
    max-width: 340px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.paywall-card h3 { font-size: 1.3rem; }
.paywall-card p { color: var(--text-gray); font-size: 0.92rem; }
.paywall-hint { font-size: 0.78rem !important; opacity: 0.8; }

.hearts-layer { position: absolute; right: 18px; bottom: 12px; width: 60px; height: 60%; pointer-events: none; overflow: hidden; }
.floating-heart {
    position: absolute; bottom: -30px; left: 50%;
    font-size: 24px;
    animation: floatUp 2.4s ease-out forwards;
}
@keyframes floatUp {
    0% { transform: translate(-50%, 0) scale(0.7); opacity: 1; }
    100% { transform: translate(calc(-50% + 20px), -320px) scale(1.25); opacity: 0; }
}

/* iOS-style overlay: recent comments float over the video above the action bar */
.live-comment-overlay {
    position: absolute;
    left: 12px;
    bottom: 72px;
    width: min(420px, 62%);
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 28px);
    mask-image: linear-gradient(to bottom, transparent, black 28px);
}
.live-comment-overlay::-webkit-scrollbar { display: none; }
.lco-msg {
    background: rgba(0, 0, 0, 0.45);
    border-radius: 14px;
    padding: 6px 12px;
    font-size: 0.85rem;
    line-height: 1.3;
    width: fit-content;
    max-width: 100%;
    word-break: break-word;
}
.lco-msg b { color: var(--primary-bright); margin-right: 6px; font-weight: 600; }
.lco-msg.gift { background: rgba(123, 92, 255, 0.5); }
.lco-msg.system { color: rgba(255, 255, 255, 0.75); font-style: italic; }

/* Action bar over the bottom of the video: comment input, heart, gift, share */
.live-action-bar {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
}
.live-action-bar input {
    flex: 1;
    min-width: 0;
    padding: 10px 16px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-light);
    font-family: inherit;
    font-size: 0.9rem;
}
.live-action-bar input::placeholder { color: rgba(255, 255, 255, 0.6); }
.live-action-bar input:focus { outline: none; border-color: var(--primary-color); }
.lab-btn {
    width: 42px; height: 42px;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.lab-btn svg { width: 20px; height: 20px; fill: #fff; }
.lab-btn:hover { background: rgba(255, 255, 255, 0.2); }
.lab-btn.lab-gift { background: linear-gradient(135deg, #ec4899, #a855f7); }
.lab-btn.lab-gift:hover { filter: brightness(1.15); }

/* Gift modal */
.gift-modal .gift-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 14px 0;
    max-height: 300px;
    overflow-y: auto;
}
.gift-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 10px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: var(--text-light);
    font-family: inherit;
}
.gift-item img { width: 44px; height: 44px; object-fit: contain; }
.gift-item .g-name { font-size: 0.8rem; }
.gift-item .g-cost { font-size: 0.75rem; color: #ffd75e; }
.gift-item.selected { border-color: var(--primary-color); background: rgba(0, 168, 255, 0.12); }
.gift-item.unaffordable { opacity: 0.45; }
#giftMessageInput {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-light);
    font-family: inherit;
    font-size: 0.9rem;
}
#giftMessageInput:focus { outline: none; border-color: var(--primary-color); }
.gift-hint { margin-top: 10px; font-size: 0.82rem; color: var(--text-gray); text-align: center; }
.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: var(--text-gray);
    cursor: pointer;
}
.check-row input { accent-color: var(--primary-color); }

.live-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 14px;
}
.live-meta .avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: #1a1f3a; }
.live-meta h2 { font-size: 1.05rem; }
.live-meta p { color: var(--text-gray); font-size: 0.85rem; }
.live-meta .btn { margin-left: auto; }

.live-chat {
    width: 320px;
    flex-shrink: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    padding: 18px 16px;
    background: var(--dark-bg);
}
.live-chat h3 { font-size: 1rem; padding-bottom: 12px; }
.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}
.chat-msg { display: flex; gap: 8px; font-size: 0.88rem; }
.chat-msg img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: #1a1f3a; flex-shrink: 0; }
.chat-msg .cm-user { font-weight: 700; color: var(--text-gray); margin-right: 6px; }
.chat-msg.gift-msg { color: #ffd166; }
.chat-msg.system-msg { color: var(--text-gray); font-style: italic; }
.chat-input-row { display: flex; gap: 8px; padding-top: 12px; }
.chat-input-row input {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: var(--text-light);
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.88rem;
}
.chat-input-row input:focus { outline: none; border-color: var(--primary-color); }
#chatHeartBtn {
    background: none; border: none;
    color: #ff4d6d; font-size: 1.25rem; cursor: pointer;
}
.chat-signin { padding-top: 12px; text-align: center; }

/* ================= Calendar ================= */
.calendar-list { display: flex; flex-direction: column; gap: 26px; max-width: 760px; }
.cal-day h2 {
    font-size: 0.95rem;
    color: var(--primary-bright);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}
.cal-show {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 12px;
}
.cal-show img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: #1a1f3a; }
.cal-show .cs-info { flex: 1; min-width: 0; }
.cal-show .cs-title { font-weight: 700; font-size: 1rem; }
.cal-show .cs-sub { color: var(--text-gray); font-size: 0.85rem; margin-top: 3px; }
.cal-show .cs-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ticket-price {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--primary-bright);
}
.ticket-owned { font-size: 0.8rem; font-weight: 700; color: #3ddc84; }

/* ================= Modals ================= */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(3, 5, 14, 0.78);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90dvh;
    overflow-y: auto;
    background: var(--dark-bg);
    border: 1px solid var(--card-border);
    border-radius: 22px;
    padding: 34px 30px 30px;
}
.modal-close {
    position: absolute; top: 14px; right: 16px;
    background: none; border: none;
    color: var(--text-gray);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover { color: var(--text-light); }
.modal-logo { width: 54px; height: 54px; border-radius: 12px; display: block; margin: 0 auto 16px; }

.auth-pane h2, #payHeader h2 { text-align: center; font-size: 1.35rem; }
.auth-sub { text-align: center; color: var(--text-gray); font-size: 0.88rem; margin: 8px 0 18px; }
.auth-pane form { display: flex; flex-direction: column; gap: 12px; }
.auth-pane input, #tipCustomAmount, #tipMessage {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    color: var(--text-light);
    padding: 13px 15px;
    font-family: inherit;
    font-size: 0.95rem;
    width: 100%;
}
.auth-pane input:focus, #tipCustomAmount:focus, #tipMessage:focus { outline: none; border-color: var(--primary-color); }
.pw-hint { font-size: 0.76rem; color: var(--text-gray); }
.pw-hint a { color: var(--primary-bright); }
.auth-switch { text-align: center; color: var(--text-gray); font-size: 0.88rem; margin-top: 16px; }
.auth-pane > .link-btn { display: block; margin: 12px auto 0; }
.auth-error {
    margin-top: 14px;
    color: #ff6b81;
    font-size: 0.85rem;
    text-align: center;
    white-space: pre-line;
}

/* Tips */
.tip-amounts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.tip-amounts button {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: var(--text-light);
    padding: 10px 0;
    font-weight: 700;
    cursor: pointer;
}
.tip-amounts button.selected {
    border-color: var(--primary-color);
    background: rgba(0, 168, 255, 0.15);
    color: var(--primary-bright);
}
#tipCustomAmount { margin-bottom: 12px; }
#tipMessage { resize: vertical; min-height: 66px; margin-bottom: 14px; }
#payElementPane .btn { margin-top: 16px; }
#paySuccessPane { text-align: center; padding: 20px 0 8px; }
.pay-success-check {
    width: 62px; height: 62px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(120deg, #3ddc84, #00a8ff);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; font-weight: 800; color: #fff;
}

/* ================= Profile page ================= */
[data-profile-user] { cursor: pointer; }

.profile-page { max-width: 680px; margin: 0 auto; }
.profile-head { text-align: center; }
.profile-head img {
    width: 84px; height: 84px;
    border-radius: 50%;
    object-fit: cover;
    background: #1a1f3a;
    border: 2px solid var(--card-border);
    margin-bottom: 10px;
}
.profile-head h2 { font-size: 1.25rem; }
.artist-badge {
    display: inline-block;
    background: linear-gradient(120deg, var(--primary-color), var(--accent));
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 10px;
    vertical-align: middle;
    margin-left: 6px;
}
.profile-bio { color: var(--text-gray); font-size: 0.88rem; margin-top: 6px; }
.profile-stats {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin: 16px 0 20px;
}
.pstat { text-align: center; }
.pstat b { display: block; font-size: 1.05rem; }
.pstat span { color: var(--text-gray); font-size: 0.75rem; }

.profile-videos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.pvideo {
    position: relative;
    aspect-ratio: 9 / 14;
    border-radius: 10px;
    overflow: hidden;
    background: #10142e;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.pvideo:hover { transform: scale(1.03); }
.pvideo img { width: 100%; height: 100%; object-fit: cover; }
.pvideo .pv-views {
    position: absolute;
    left: 7px; bottom: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.profile-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-gray);
    padding: 26px 0;
}
.profile-meta { color: var(--text-gray); font-size: 0.85rem; margin-top: 5px; }
.profile-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}
.tag-chip {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.profile-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 16px 0 6px;
}
.pstat.clickable { cursor: pointer; }
.pstat.clickable:hover b { color: var(--primary-bright); }
.profile-section-title { font-size: 1.02rem; margin: 28px 0 12px; }
#profileMoreBtn { margin-top: 14px; }

/* Followers / following modal */
.stats-list { max-height: 55vh; overflow-y: auto; margin-top: 14px; }
.stats-user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 8px;
    border-radius: 12px;
    cursor: pointer;
}
.stats-user-row:hover { background: rgba(255, 255, 255, 0.05); }
.stats-user-row img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: #1a1f3a; flex-shrink: 0; }
.stats-user-row .su-text { min-width: 0; }
.stats-user-row .su-name { font-weight: 700; font-size: 0.92rem; }
.stats-user-row .su-bio {
    color: var(--text-gray);
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

/* Edit profile modal */
.modal-title { text-align: center; font-size: 1.35rem; }
.ep-form { text-align: left; }
.ep-label {
    display: block;
    color: var(--text-gray);
    font-size: 0.8rem;
    font-weight: 600;
    margin: 14px 0 6px;
}
.ep-form input, .ep-form textarea {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    color: var(--text-light);
    padding: 13px 15px;
    font-family: inherit;
    font-size: 0.95rem;
    width: 100%;
    resize: vertical;
}
.ep-form input:focus, .ep-form textarea:focus { outline: none; border-color: var(--primary-color); }
.ep-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ep-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    color: var(--text-gray);
    padding: 6px 13px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.ep-chip.selected {
    background: linear-gradient(120deg, var(--primary-color), var(--accent));
    border-color: transparent;
    color: #fff;
}
.ep-tag-row { display: flex; gap: 8px; margin-top: 8px; }
.ep-tag-row input { flex: 1; }
.ep-form .btn-block { margin-top: 20px; }

/* ================= Comments drawer ================= */
.drawer-backdrop {
    position: fixed; inset: 0;
    background: rgba(3, 5, 14, 0.55);
    z-index: 90;
}
.drawer {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: min(400px, 92vw);
    background: var(--dark-bg);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
}
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 12px;
}
.drawer-header .modal-close { position: static; }
.drawer-body { flex: 1; overflow-y: auto; padding: 6px 20px; display: flex; flex-direction: column; gap: 16px; }
.comment-item { display: flex; gap: 10px; }
.comment-item img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #1a1f3a; flex-shrink: 0; }
.comment-item .ci-user { font-weight: 700; font-size: 0.85rem; color: var(--text-gray); }
.comment-item .ci-text { font-size: 0.92rem; margin-top: 2px; }
.drawer-input { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.drawer-input input {
    flex: 1;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: var(--text-light);
    padding: 11px 15px;
    font-family: inherit;
}
.drawer-input input:focus { outline: none; border-color: var(--primary-color); }
.drawer .chat-signin { padding: 14px 20px; border-top: 1px solid rgba(255, 255, 255, 0.07); }

/* ================= Toast ================= */
.toast {
    position: fixed;
    bottom: 30px; left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 20, 45, 0.95);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    padding: 12px 22px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 200;
}

/* ================= Responsive ================= */
@media (max-width: 900px) {
    .live-player-layout { flex-direction: column; }
    .live-chat { width: 100%; height: 260px; border-left: none; border-top: 1px solid rgba(255,255,255,0.06); }
    .video-frame { max-width: 92vw; }
    .feed-arrows { display: none; }
}

@media (max-width: 700px) {
    .app { flex-direction: column-reverse; }
    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    .sidebar-logo, .sidebar-footer { display: none; }
    .sidebar-nav { flex-direction: row; flex: 1; justify-content: space-around; }
    .nav-item { flex-direction: column; gap: 3px; font-size: 0.68rem; padding: 6px 10px; }
    .nav-item svg { width: 22px; height: 22px; }
    .sidebar-auth { margin-top: 0; }
    .sidebar-auth .btn { padding: 8px 14px; font-size: 0.8rem; }
    .profile-chip { padding: 4px; background: none; border: none; }
    .profile-chip .chip-name, .profile-chip .chip-logout { display: none; }
    .view-scroll { padding: 18px 16px 40px; }
    .video-frame { max-width: 100vw; border-radius: 0; height: 100%; aspect-ratio: auto; width: 100%; }
    .feed-slide { padding: 0; gap: 0; }
    .action-rail {
        position: absolute;
        right: 8px; bottom: 70px;
        z-index: 5;
    }
}
