@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

@font-face {
    font-family: 'Syncopate Cyr';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('https://fonts.cdnfonts.com/s/16082/Syncopate-Regular.woff') format('woff');
}

@font-face {
    font-family: 'Syncopate Cyr';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('https://fonts.cdnfonts.com/s/16082/Syncopate-Bold.woff') format('woff');
}

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

.favorite-wrapper {
    margin-left: auto;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    width: 130px;
    min-height: 90px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.content-wrapper {
    position: relative;
}

.mode-content {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.mode-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.modal-content {
    background: rgba(4, 10, 25, 0.95);
    border-radius: 24px;
    max-width: 720px;
    width: 100%;
    padding: 2.25rem;
    box-shadow: 0 35px 90px rgba(3, 5, 10, 0.75);
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(99, 183, 255, 0.18);
    color: var(--text);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    line-height: 1;
}

.modal-close:hover {
    color: var(--primary);
}

#ai-modal-body {
    line-height: 1.65;
    color: var(--text);
}

#ai-modal-body h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
    color: var(--primary);
}

#ai-modal-body p {
    margin-bottom: 0.85rem;
}

#ai-modal-body ul {
    margin: 0.5rem 0 1.1rem 1.25rem;
    padding-left: 1rem;
    display: grid;
    gap: 0.45rem;
}

#ai-modal-body li {
    list-style: disc;
}

:root {
    --primary: #63b7ff;
    --primary-hover: #8dd0ff;
    --accent: #5d5fee;
    --accent-strong: #2b3fef;
    --success: #4ad7a8;
    --error: #ff5f5f;
    --warning: #f7b955;
    --bg: #030712;
    --card-bg: rgba(9, 14, 30, 0.8);
    --card-border: rgba(148, 163, 184, 0.15);
    --text: #e5edff;
    --text-secondary: #9fb4d7;
    --border: rgba(148, 163, 184, 0.2);
    --shadow: rgba(8, 35, 73, 0.55);
    --shadow-hover: rgba(38, 82, 149, 0.7);
}

body {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    background: radial-gradient(circle at 20% 20%, #122449 0%, #050914 55%, #03050a 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    scrollbar-gutter: stable both-edges;
}

html {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 183, 255, 0.6) rgba(4, 10, 25, 0.65);
    overflow-y: scroll;
}

body::-webkit-scrollbar {
    width: 12px;
}

body::-webkit-scrollbar-track {
    background: rgba(4, 10, 25, 0.7);
    border-radius: 999px;
    border: 1px solid rgba(99, 183, 255, 0.12);
    box-shadow: inset 0 0 12px rgba(3, 5, 10, 0.85);
}

body::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(99, 183, 255, 0.95), rgba(45, 58, 135, 0.95));
    border: 2px solid rgba(4, 10, 25, 0.85);
    box-shadow: 0 6px 18px rgba(99, 183, 255, 0.35), inset 0 0 14px rgba(141, 208, 255, 0.4);
}

body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(141, 208, 255, 1), rgba(93, 95, 238, 0.95));
    box-shadow: 0 8px 20px rgba(141, 208, 255, 0.5), inset 0 0 18px rgba(93, 95, 238, 0.45);
}

.cosmic-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: -2;
    background: radial-gradient(circle at 30% 20%, rgba(73, 157, 255, 0.3), transparent 45%),
                radial-gradient(circle at 70% 80%, rgba(91, 93, 238, 0.25), transparent 50%);
}

.stars-layer {
    position: absolute;
    inset: -40vh;
    background-image:
        radial-gradient(1.5px 1.5px at 20px 30px, rgba(255, 255, 255, 0.6), transparent 70%),
        radial-gradient(1px 1px at 140px 90px, rgba(255, 255, 255, 0.35), transparent 70%),
        radial-gradient(1px 1px at 80px 140px, rgba(255, 255, 255, 0.35), transparent 70%),
        radial-gradient(2px 2px at 60px 170px, rgba(255, 255, 255, 0.45), transparent 70%),
        radial-gradient(1.8px 1.8px at 110px 30px, rgba(255, 255, 255, 0.55), transparent 70%);
    background-size: 160px 160px, 220px 220px, 260px 260px;
    animation: star-drift 55s linear infinite;
    opacity: 0.5;
}

.stars-layer.layer-2 {
    opacity: 0.3;
    animation-duration: 80s;
    transform: scale(1.6);
}

.shooting-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.shooting-stars span {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 1), transparent);
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
    opacity: 0;
    animation: shooting 9s linear infinite;
}

.shooting-stars span:nth-child(1) {
    top: 15%;
    left: 80%;
    animation-delay: 1s;
}

.shooting-stars span:nth-child(2) {
    top: 35%;
    left: 65%;
    animation-delay: 3s;
}

.shooting-stars span:nth-child(3) {
    top: 60%;
    left: 90%;
    animation-delay: 5s;
}

.shooting-stars span:nth-child(4) {
    top: 10%;
    left: 40%;
    animation-delay: 7s;
}

.shooting-stars span:nth-child(5) {
    top: 70%;
    left: 55%;
    animation-delay: 9s;
}

.shooting-stars span:nth-child(6) {
    top: 25%;
    left: 20%;
    animation-delay: 11s;
}

.shooting-stars span:nth-child(7) {
    top: 50%;
    left: 10%;
    animation-delay: 13s;
}

.shooting-stars span:nth-child(8) {
    top: 5%;
    left: 55%;
    animation-delay: 15s;
}

.shooting-stars span:nth-child(9) {
    top: 85%;
    left: 75%;
    animation-delay: 17s;
}

.shooting-stars span:nth-child(10) {
    top: 45%;
    left: 35%;
    animation-delay: 19s;
}

@keyframes star-drift {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-200px, -200px, 0); }
}

@keyframes shooting {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scaleX(0.4);
    }
    10% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate3d(-700px, 280px, 0) scaleX(1);
    }
}

.zoom-shell {
    display: flex;
    justify-content: center;
    padding: 2rem 0 3rem;
}

.zoom-wrapper {
    transform: scale(0.8);
    transform-origin: top center;
    width: 100%;
    max-width: 1400px;
}

.confirm-modal {
    max-width: 480px;
    text-align: center;
}

.confirm-modal .modal-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
    position: relative;
    z-index: 1;
}

header {
    margin-bottom: 3.5rem;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.header-copy {
    flex: 1;
    min-width: 240px;
}

.lang-switch {
    display: inline-flex;
    background: rgba(6, 14, 33, 0.75);
    border: 1px solid rgba(99, 183, 255, 0.25);
    border-radius: 999px;
    padding: 0.2rem;
    gap: 0.25rem;
    box-shadow: 0 12px 30px rgba(3, 5, 10, 0.4);
    backdrop-filter: blur(12px);
}

.lang-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    color: var(--text);
}

.lang-btn.active {
    background: linear-gradient(120deg, var(--primary), var(--accent));
    color: #041024;
    box-shadow: 0 12px 30px rgba(43, 63, 239, 0.35);
}

header h1 {
    font-size: clamp(2.4rem, 4vw, 3.1rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text);
    letter-spacing: 0.04em;
    font-family: 'Syncopate Cyr', 'Space Grotesk', 'Segoe UI', sans-serif;
}

header h1 span {
    background: linear-gradient(120deg, #63b7ff, #6f74ff, #8dd0ff);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.subtitle {
    color: rgba(159, 180, 215, 0.9);
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mode-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.25rem;
    padding: 0.75rem;
    border-radius: 20px;
    background: rgba(4, 10, 25, 0.8);
    border: 1px solid rgba(99, 183, 255, 0.15);
    backdrop-filter: blur(18px);
    box-shadow: 0 25px 60px rgba(6, 20, 45, 0.45);
}

.mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.1rem 1.25rem;
    border: none;
    background: transparent;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.35s ease;
}

.mode-btn .icon {
    font-size: 1.35rem;
}

.mode-btn:hover {
    color: var(--text);
    background: rgba(99, 183, 255, 0.08);
    box-shadow: 0 15px 25px rgba(8, 35, 73, 0.35);
}

.mode-btn.active {
    color: #0c1428;
    background: linear-gradient(120deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: 0 25px 45px rgba(43, 63, 239, 0.35);
}

.input-group {
    background: rgba(5, 11, 27, 0.75);
    padding: 2.25rem;
    border-radius: 20px;
    box-shadow: 0 35px 70px rgba(3, 5, 10, 0.65);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(18px);
    margin-bottom: 2.5rem;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.input-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    margin-bottom: 1.25rem;
    background: rgba(8, 15, 34, 0.85);
    color: var(--text);
    box-shadow: inset 0 0 0 rgba(0,0,0,0);
}

.input-group input::placeholder {
    color: rgba(229, 237, 255, 0.45);
}

.input-group input:focus {
    outline: none;
    border-color: rgba(99, 183, 255, 0.85);
    box-shadow: 0 0 18px rgba(99, 183, 255, 0.2);
    background: rgba(11, 18, 41, 0.95);
}

.primary-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(130deg, var(--accent-strong), var(--primary));
    color: #051026;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 18px 35px rgba(43, 63, 239, 0.35);
    letter-spacing: 0.02em;
}

.primary-btn:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 25px 45px rgba(74, 150, 255, 0.45);
}

.primary-btn:disabled {
    background: rgba(148, 163, 184, 0.3);
    color: rgba(255, 255, 255, 0.45);
    cursor: not-allowed;
    box-shadow: none;
}

.secondary-btn {
    padding: 0.85rem 1.8rem;
    border-radius: 14px;
    background: rgba(8, 20, 48, 0.7);
    border: 1px solid rgba(99, 183, 255, 0.45);
    color: var(--primary-hover);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.secondary-btn:hover:enabled {
    background: rgba(99, 183, 255, 0.16);
    box-shadow: 0 18px 35px rgba(6, 20, 45, 0.35);
}

.secondary-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: rgba(148, 163, 184, 0.25);
    color: rgba(148, 163, 184, 0.5);
}

.tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: rgba(99, 183, 255, 0.12);
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-left: 0.4rem;
    cursor: default;
    transition: background 0.2s ease, color 0.2s ease;
}

.tooltip:hover {
    background: rgba(99, 183, 255, 0.22);
    color: var(--primary-hover);
}

.tooltip::before,
.tooltip::after {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.tooltip::before {
    content: attr(data-tooltip);
    top: -0.35rem;
    left: 50%;
    transform: translate(-50%, -100%);
    background: rgba(8, 15, 34, 0.95);
    color: var(--text);
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
    font-size: 0.75rem;
    white-space: nowrap;
    border: 1px solid rgba(99, 183, 255, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 30px rgba(4, 8, 20, 0.45);
    z-index: 10;
}

.tooltip::after {
    content: '';
    top: -0.35rem;
    left: 50%;
    transform: translate(-50%, -40%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(8, 15, 34, 0.95) transparent transparent transparent;
    z-index: 9;
}

.tooltip:hover::before,
.tooltip:hover::after,
.tooltip:focus-visible::before,
.tooltip:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

.tooltip::before {
    background: rgba(8, 15, 34, 0.95);
    color: var(--text);
    border: 1px solid rgba(99, 183, 255, 0.3);
    backdrop-filter: blur(12px);
}

.tooltip::after {
    border-top-color: rgba(8, 15, 34, 0.95);
}

.channel-header {
    background: linear-gradient(145deg, rgba(6, 10, 25, 0.95), rgba(15, 25, 55, 0.85));
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 35px 90px rgba(3, 5, 10, 0.75);
    border: 1px solid rgba(99, 183, 255, 0.08);
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.channel-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08), transparent 45%);
    pointer-events: none;
}

.stat-card {
    background: rgba(6, 14, 33, 0.85);
    padding: 1.75rem;
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(3, 5, 10, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.35s ease;
    position: relative;
    overflow: visible;
    z-index: 0;
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: -40% 50% 50% -40%;
    background: rgba(99, 183, 255, 0.08);
    filter: blur(60px);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card:hover,
.stat-card:focus-within {
    z-index: 2;
}

.stat-icon {
    font-size: 2rem;
    width: 3.4rem;
    height: 3.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 183, 255, 0.15);
    border-radius: 14px;
    color: var(--primary-hover);
    box-shadow: inset 0 0 15px rgba(43, 63, 239, 0.25);
}

.recent-posts {
    background: rgba(6, 14, 33, 0.85);
    padding: 2.25rem;
    border-radius: 24px;
    box-shadow: 0 30px 65px rgba(3, 5, 10, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.post-item {
    padding: 1.25rem;
    border-left: 3px solid var(--accent);
    background: rgba(4, 10, 25, 0.85);
    border-radius: 14px;
    margin-bottom: 1rem;
    transition: all 0.25s ease;
    box-shadow: inset 0 0 0 rgba(0,0,0,0);
}

.post-item:hover {
    background: rgba(11, 18, 41, 0.95);
    transform: translateX(6px);
    box-shadow: 0 15px 25px rgba(3, 5, 10, 0.55);
}

.ai-section {
    margin-top: 1.75rem;
    background: rgba(6, 14, 33, 0.85);
    padding: 2.25rem;
    border-radius: 24px;
    box-shadow: 0 30px 65px rgba(3, 5, 10, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.ai-hint {
    color: rgba(159, 180, 215, 0.85);
    font-size: 0.95rem;
}

.ai-status {
    background: rgba(99, 183, 255, 0.12);
    color: var(--primary-hover);
    border: 1px solid rgba(99, 183, 255, 0.25);
}

.channel-card {
    background: rgba(6, 14, 33, 0.9);
    padding: 1.75rem;
    border-radius: 18px;
    box-shadow: 0 25px 55px rgba(3, 5, 10, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 1.25rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.channel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 65px rgba(3, 5, 10, 0.85);
    border-color: rgba(99, 183, 255, 0.25);
}

.loading {
    position: fixed;
    top: 4.5rem;
    right: 1.5rem;
    width: auto;
    min-width: 220px;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    border: 1px solid rgba(99, 183, 255, 0.25);
    background: rgba(5, 11, 27, 0.92);
    box-shadow: 0 30px 60px rgba(3, 5, 10, 0.6);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1100;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.loading.hidden {
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
}

.spinner {
    position: relative;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 183, 255, 0.35) 0%, rgba(99, 183, 255, 0) 65%);
    box-shadow: 0 0 45px rgba(99, 183, 255, 0.35);
    animation: spinnerPulse 1.8s ease-in-out infinite;
}

.spinner::before,
.spinner::after {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    border-right-color: rgba(141, 208, 255, 0.65);
    animation: spin 1.2s linear infinite;
}

.spinner::after {
    inset: 22px;
    border-top-color: var(--accent);
    border-right-color: rgba(125, 125, 255, 0.8);
    animation-duration: 2s;
    animation-direction: reverse;
}

.loading p {
    margin-top: 1.75rem;
    color: var(--text);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.95rem;
    text-shadow: 0 0 18px rgba(99, 183, 255, 0.55);
}

.favorite-btn {
    width: 90px;
    height: 90px;
    min-width: 90px;
    min-height: 90px;
    border: none;
    border-radius: 30px;
    font-size: 2.6rem;
    line-height: 1;
    color: #e8f4ff;
    background: linear-gradient(135deg, #69c6ff, #5d5fee 55%, #7f70ff);
    box-shadow: 0 20px 35px rgba(81, 123, 255, 0.4);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
    animation: favorite-pulse 3s ease-in-out infinite;
}

.favorite-btn::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.15);
    filter: blur(0px);
    transition: filter 0.3s ease;
}

.favorite-btn::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 40px;
    left: 14px;
    top: 12px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    transform: rotate(-25deg);
    animation: favorite-spark 2.8s ease-in-out infinite;
}

.favorite-btn:hover {
    transform: translateY(-4px) scale(1.07);
    box-shadow: 0 30px 55px rgba(74, 150, 255, 0.5);
}

.favorite-btn:hover::after {
    filter: blur(3px);
}

.favorite-btn:active {
    transform: scale(0.94);
}

.favorite-btn.active {
    background: linear-gradient(135deg, #8dd0ff, #6f74ff 60%, #a381ff);
    color: #0c1428;
    box-shadow: 0 30px 60px rgba(109, 147, 255, 0.55);
}

.favorite-btn.active::after {
    background: rgba(255, 255, 255, 0.28);
}

.favorite-btn.burst {
    animation: favorite-burst 0.45s ease;
}

.stats-section {
    margin-bottom: 2.5rem;
    background: rgba(6, 14, 33, 0.85);
    border-radius: 24px;
    padding: 2.25rem;
    box-shadow: 0 30px 65px rgba(3, 5, 10, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.stats-header h3 {
    font-size: 1.4rem;
}

.ghost-btn {
    border: 1px solid rgba(99, 183, 255, 0.35);
    background: transparent;
    color: var(--primary-hover);
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.ghost-btn:hover {
    background: rgba(99, 183, 255, 0.12);
    box-shadow: 0 15px 30px rgba(5, 10, 25, 0.5);
}

.metrics-modal {
    max-width: 680px;
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.metrics-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.metrics-group-title {
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary, #63b7ff);
    margin-bottom: 0.6rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(99, 183, 255, 0.15);
}

.metrics-group-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.metric-option {
    position: relative;
    background: rgba(4, 10, 25, 0.85);
    border: 1px solid rgba(99, 183, 255, 0.2);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
    isolation: isolate;
    cursor: pointer;
}

.metric-option input[type="checkbox"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.metric-option span {
    display: block;
}

.metric-option .metric-name {
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.metric-option .metric-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.metric-option::after {
    content: '';
    position: absolute;
    inset: -25%;
    background: radial-gradient(circle, rgba(99, 183, 255, 0.25), transparent 60%);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.25s ease;
}

.metric-option.selected {
    border-color: transparent;
    background-image:
        linear-gradient(rgba(4, 10, 25, 0.9), rgba(4, 10, 25, 0.9)),
        linear-gradient(120deg, #63b7ff, #b86bff, #ffb347, #63b7ff);
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
    background-size: auto, 220% 220%;
    animation: metricBorderRun 4s linear infinite;
    box-shadow: 0 20px 40px rgba(8, 12, 30, 0.65);
}

.metric-option.selected::after {
    opacity: 0.45;
    animation: metricGlow 3.2s ease-in-out infinite;
}

.metric-option:hover {
    border-color: rgba(99, 183, 255, 0.4);
}

@keyframes metricBorderRun {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes metricGlow {
    0% { opacity: 0.2; transform: scale(0.9); }
    50% { opacity: 0.55; transform: scale(1.05); }
    100% { opacity: 0.2; transform: scale(0.9); }
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

@keyframes favorite-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 15px 40px rgba(255, 115, 0, 0.35);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 25px 55px rgba(255, 115, 0, 0.45);
    }
}

@keyframes favorite-spark {
    0%, 100% {
        opacity: 0.35;
        transform: translateY(0) rotate(-25deg);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-6px) rotate(-25deg);
    }
}

@keyframes favorite-burst {
    0% {
        transform: scale(0.8);
        filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
    }
    50% {
        transform: scale(1.2);
        filter: drop-shadow(0 0 18px rgba(255, 215, 0, 0.85));
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
    }
}

.channel-info h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.channel-info p {
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

#channel-description {
    margin-top: 1rem;
    line-height: 1.6;
}

.badges {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.badge.verified {
    background: rgba(52, 211, 153, 0.15);
    color: #7df0c8;
    border-color: rgba(125, 240, 200, 0.4);
}

.badge.scam {
    background: rgba(255, 95, 95, 0.18);
    color: #ffaaaa;
    border-color: rgba(255, 95, 95, 0.35);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 16px var(--shadow-hover);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 10px;
}

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.recent-posts {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
}

.recent-posts h3 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.post-item {
    padding: 1rem;
    border-left: 3px solid var(--primary);
    background: var(--bg);
    border-radius: 6px;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.post-item:hover {
    background: #e8f4f8;
    transform: translateX(4px);
}

.post-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.post-text {
    color: var(--text);
    line-height: 1.5;
}

.ai-section {
    margin-top: 1.5rem;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.ai-hint {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ai-status {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: rgba(0, 136, 204, 0.08);
    color: var(--primary);
    font-size: 0.95rem;
}

.channel-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.channel-card:hover {
    box-shadow: 0 4px 16px var(--shadow-hover);
    transform: translateY(-2px);
}

.channel-card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.channel-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.channel-meta {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.error-message {
    background: var(--error);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    animation: slideIn 0.3s ease;
}

.error-message.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none !important;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#auth-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-greeting {
    color: var(--primary-hover);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.auth-modal {
    max-width: 420px;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.75rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(99, 183, 255, 0.25);
}

.auth-tab {
    flex: 1;
    padding: 0.85rem 1rem;
    border: none;
    background: rgba(4, 10, 25, 0.7);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.auth-tab:hover {
    color: var(--text);
    background: rgba(99, 183, 255, 0.08);
}

.auth-tab.active {
    background: linear-gradient(120deg, var(--primary), var(--accent));
    color: #041024;
}

.auth-field {
    margin-bottom: 1.25rem;
}

.auth-field label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: 0.95rem;
}

.auth-hint {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.auth-field input {
    width: 100%;
    padding: 0.9rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    font-size: 1rem;
    background: rgba(8, 15, 34, 0.85);
    color: var(--text);
    transition: all 0.3s ease;
}

.auth-field input:focus {
    outline: none;
    border-color: rgba(99, 183, 255, 0.85);
    box-shadow: 0 0 18px rgba(99, 183, 255, 0.2);
    background: rgba(11, 18, 41, 0.95);
}

.auth-error {
    background: rgba(255, 95, 95, 0.15);
    color: var(--error);
    border: 1px solid rgba(255, 95, 95, 0.3);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.auth-error.hidden {
    display: none;
}

/* === Profile & Rooms === */

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.rooms-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.room-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 1.5rem;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.room-card:hover {
    border-color: rgba(99, 183, 255, 0.35);
    box-shadow: 0 8px 32px var(--shadow);
}

.room-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.room-card-header h4 {
    font-size: 1.15rem;
    color: var(--text);
    margin: 0;
}

.room-card-header .room-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.room-card-actions {
    display: flex;
    gap: 0.5rem;
}

.room-card-actions button {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.room-card-actions button:hover {
    color: var(--text);
    border-color: var(--primary);
}

.room-card-actions button.danger:hover {
    color: var(--error);
    border-color: var(--error);
}

.room-channels {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.room-channel-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(8, 15, 34, 0.6);
    border: 1px solid rgba(99, 183, 255, 0.1);
    border-radius: 12px;
    padding: 0.65rem 0.9rem;
    font-size: 0.9rem;
    color: var(--text);
    transition: border-color 0.2s ease;
}

.room-channel-item:hover {
    border-color: rgba(99, 183, 255, 0.3);
}

.room-channel-item .ch-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.room-channel-item .ch-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 0.25rem;
    transition: color 0.2s ease;
}

.room-channel-item .ch-remove:hover {
    color: var(--error);
}

.room-empty-msg {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Room picker modal */

.room-picker-modal {
    max-width: 460px;
}

.room-picker-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    max-height: 300px;
    overflow-y: auto;
}

.room-picker-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    background: rgba(8, 15, 34, 0.7);
    border: 1px solid rgba(99, 183, 255, 0.15);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text);
    font-size: 0.95rem;
}

.room-picker-item:hover {
    border-color: var(--primary);
    background: rgba(99, 183, 255, 0.08);
}

.room-picker-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.room-picker-item .rp-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.danger-btn {
    background: linear-gradient(120deg, var(--error), #d44) !important;
    color: #fff !important;
}

.danger-btn:hover {
    filter: brightness(1.15);
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(4, 10, 25, 0.95);
    border: 1px solid rgba(99, 183, 255, 0.3);
    color: var(--text);
    padding: 0.75rem 1.5rem;
    border-radius: 14px;
    font-size: 0.9rem;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
    .zoom-wrapper {
        transform: none;
    }

    .zoom-shell {
        padding: 1.5rem 0 2rem;
    }

    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .mode-selector {
        flex-direction: column;
    }

    .tooltip::before {
        white-space: normal;
        max-width: 200px;
    }
}
