:root {
    --tg-bg: #0e1621;
    --tg-panel: #212121;
    --tg-header: #17212b;
    --tg-message: #182533;
    --tg-blue: #2aabee;
    --tg-blue-deep: #168acd;
    --tg-text: #f5f5f5;
    --tg-muted: #8d969f;
    --tg-green: #55c862;
    --tg-line: rgba(255,255,255,.075);
}

* { box-sizing: border-box; }
html { min-width: 320px; overflow-x: hidden; background: #050807; scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 5%, rgba(44, 174, 103, .08), transparent 32%),
        #050807;
    color: var(--tg-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; -webkit-tap-highlight-color: transparent; }
img { display: block; }
.pixel-image { display: none; }

.wallpaper-symbols {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    color: rgba(61, 143, 94, .24);
    font: 300 32px/1 Georgia, serif;
}

.wallpaper-symbols span { position: absolute; transform: rotate(-18deg); }
.wallpaper-symbols span:nth-child(1) { left: 3%; top: 3%; }
.wallpaper-symbols span:nth-child(2) { left: 22%; top: 9%; transform: rotate(24deg); }
.wallpaper-symbols span:nth-child(3) { left: 46%; top: 2%; }
.wallpaper-symbols span:nth-child(4) { left: 72%; top: 12%; transform: rotate(16deg); }
.wallpaper-symbols span:nth-child(5) { right: 4%; top: 3%; }
.wallpaper-symbols span:nth-child(6) { left: 9%; top: 31%; transform: rotate(17deg); }
.wallpaper-symbols span:nth-child(7) { left: 83%; top: 28%; }
.wallpaper-symbols span:nth-child(8) { left: 31%; top: 42%; }
.wallpaper-symbols span:nth-child(9) { left: 67%; top: 48%; transform: rotate(13deg); }
.wallpaper-symbols span:nth-child(10) { left: 5%; top: 61%; }
.wallpaper-symbols span:nth-child(11) { right: 8%; top: 68%; }
.wallpaper-symbols span:nth-child(12) { left: 42%; top: 73%; }
.wallpaper-symbols span:nth-child(13) { left: 14%; top: 87%; }
.wallpaper-symbols span:nth-child(14) { left: 77%; top: 89%; }
.wallpaper-symbols span:nth-child(15) { left: 91%; top: 51%; }
.wallpaper-symbols span:nth-child(16) { left: 3%; top: 46%; }
.wallpaper-symbols span:nth-child(17) { left: 54%; top: 94%; }
.wallpaper-symbols span:nth-child(18) { left: 50%; top: 24%; }

.telegram-app {
    position: relative;
    z-index: 1;
    width: min(100%, 460px);
    margin: 10px auto 34px;
    overflow: hidden;
    background: var(--tg-bg);
    border-radius: 28px;
    box-shadow: 0 28px 90px rgba(0,0,0,.62), 0 0 0 1px rgba(255,255,255,.035);
}

.channel-preview {
    position: relative;
    min-height: 530px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px 27px 28px;
    text-align: center;
    background: var(--tg-panel);
    border-radius: 28px;
}

.channel-actions {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 3px;
}
.channel-actions span { width: 3px; height: 3px; border-radius: 50%; background: #686868; }

.channel-avatar {
    width: 112px;
    height: 112px;
    margin-top: 2px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255,255,255,.025), 0 8px 28px rgba(0,0,0,.45);
}

h1 { margin: 19px 0 0; font-size: 27px; line-height: 1.15; letter-spacing: -.025em; }
.subscribers { margin: 7px 0 0; color: #858585; font-size: 15px; }
.channel-description { max-width: 330px; margin: 25px 0 0; font-size: 16px; font-weight: 650; line-height: 1.55; }
.contact { margin: 23px 0 0; font-size: 15px; font-weight: 600; }
.contact a { color: var(--tg-blue); font-weight: 500; }

.view-telegram {
    min-width: 250px;
    min-height: 50px;
    margin-top: 35px;
    padding: 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--tg-blue);
    border-radius: 999px;
    color: white;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 8px 25px rgba(42,171,238,.13);
    transition: transform .16s ease, background .16s ease;
}
.view-telegram:hover { background: #35b7f6; transform: translateY(-1px); }
.view-telegram:active { transform: scale(.985); }
.paper-plane { font-size: 17px; transform: rotate(-20deg); }
.auto-redirect {
    position: relative;
    width: min(100%, 320px);
    margin-top: 22px;
    padding: 11px 11px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    overflow: hidden;
    color: #8d969f;
    background: rgba(0,0,0,.16);
    border-radius: 10px;
    font-size: 11px;
}
.auto-redirect[hidden] { display: none; }
.auto-redirect b { color: #bfc7cd; }
.auto-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tg-blue); box-shadow: 0 0 9px var(--tg-blue); }
.auto-redirect button { margin-left: auto; padding: 3px 7px; color: var(--tg-blue); border: 0; background: transparent; cursor: pointer; font-size: 10px; }
.auto-redirect i { position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; background: var(--tg-blue); transform: scaleX(0); transform-origin: left; }
.auto-redirect.is-cancelled .auto-dot, .auto-redirect.is-cancelled i, .auto-redirect.is-cancelled button { display: none; }

.chat-area { position: relative; background: var(--tg-bg); }
.chat-header {
    position: sticky;
    top: 0;
    z-index: 5;
    height: 66px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 14px;
    background: rgba(23,33,43,.97);
    box-shadow: 0 2px 5px rgba(0,0,0,.2);
    backdrop-filter: blur(14px);
}
.chat-header img { width: 42px; height: 42px; object-fit: cover; border-radius: 50%; }
.chat-header > div { display: flex; flex: 1; min-width: 0; flex-direction: column; text-align: left; }
.chat-header strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.chat-header span { margin-top: 2px; color: var(--tg-muted); font-size: 11px; }
.chat-header > a { width: 34px; height: 34px; display: grid; place-items: center; color: var(--tg-blue); border-radius: 50%; background: rgba(42,171,238,.08); font-size: 17px; transform: rotate(-18deg); }

.pinned-message {
    padding: 9px 15px 10px 20px;
    background: rgba(23,33,43,.98);
    border-top: 1px solid rgba(255,255,255,.025);
    border-left: 3px solid var(--tg-blue);
}
.pinned-message span { color: var(--tg-blue); font-size: 10px; font-weight: 750; letter-spacing: .03em; }
.pinned-message p { margin: 2px 0 0; overflow: hidden; color: #b4bdc5; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.day-divider { padding: 17px 0 13px; display: flex; justify-content: center; }
.day-divider span { padding: 5px 11px; border-radius: 999px; color: #d7dde1; background: rgba(34,47,58,.84); box-shadow: 0 1px 2px rgba(0,0,0,.22); font-size: 11px; font-weight: 650; }
.messages { padding: 0 9px 86px; }

.message {
    position: relative;
    width: min(91%, 390px);
    margin: 0 0 9px;
    padding: 10px 11px 8px;
    background: var(--tg-message);
    border-radius: 6px 14px 14px 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,.22);
    text-align: left;
}
.message::before { content: ""; position: absolute; left: -6px; top: 0; width: 10px; height: 12px; background: linear-gradient(135deg, var(--tg-message) 0 50%, transparent 51%); }
.message-sender { margin-bottom: 4px; color: #6ab2f2; font-size: 12px; font-weight: 750; }
.message > p { margin: 0; color: #e3e8eb; font-size: 13px; line-height: 1.45; }
.message-meta { margin-top: 5px; display: flex; align-items: center; justify-content: flex-end; gap: 5px; color: #73808a; font-size: 9px; }
.message-meta b { color: #4ba4dc; font-size: 10px; letter-spacing: -3px; padding-right: 2px; }

.signal-message { width: min(96%, 408px); padding: 11px 11px 8px; }
.signal-title { display: flex; align-items: center; gap: 10px; margin-top: 3px; padding: 8px 8px 10px; border-radius: 9px 9px 0 0; background: rgba(8,14,20,.35); }
.coin-mark { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 50%; color: #191713; background: linear-gradient(145deg, #f6cc62, #ae7920); font: 800 16px/1 Georgia, serif; }
.signal-title > div { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.signal-title strong { font-size: 14px; }
.signal-title small { margin-top: 2px; color: #89949d; font-size: 10px; }
.direction { padding: 5px 7px; border-radius: 5px; font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.direction.long { color: #6ee884; background: rgba(64,192,87,.12); }
.direction.short { color: #ff8181; background: rgba(255,95,95,.11); }
.signal-lines { padding: 4px 9px 8px; background: rgba(8,14,20,.35); border-radius: 0 0 9px 9px; }
.signal-lines p { margin: 0; padding: 7px 0; display: grid; grid-template-columns: 72px 1fr; gap: 9px; border-top: 1px solid rgba(255,255,255,.045); font-size: 11px; }
.signal-lines span { color: #75818b; }
.signal-lines strong { color: #dbe1e5; font-weight: 550; }
.signal-lines .active-status { color: #65d978; }
.message-link { margin-top: 9px; min-height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 7px; color: var(--tg-blue); background: rgba(42,171,238,.08); font-size: 11px; font-weight: 750; }
.media-message { width: min(96%, 408px); padding: 4px; overflow: hidden; }
.media-message > img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px 10px 5px 5px; background: #080b0d; }
.media-caption { padding: 8px 8px 4px; }
.media-caption .message-sender { margin-bottom: 6px; }
.media-caption > p { margin: 0; color: #e3e8eb; font-size: 13px; line-height: 1.5; }
.media-caption > p + p { margin-top: 9px; }
.media-caption a { color: var(--tg-blue); font-weight: 700; }
.profit-text { color: #55d778; }
.album-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; overflow: hidden; border-radius: 10px 10px 5px 5px; background: #080b0d; }
.album-grid img { width: 100%; height: 128px; object-fit: cover; }
.album-grid img:first-child { grid-column: 1 / -1; height: 245px; }
.album-grid img:last-child { grid-column: 1 / -1; height: 245px; }
.album-caption h3 { margin: 14px 0 7px; color: #f1f4f6; font-size: 14px; }
.album-caption > p strong:not(.profit-text) { color: #fff; }
.contact-message > img { aspect-ratio: 990 / 619; }
.contact-cta { min-height: 46px; margin-top: 13px; padding: 8px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 8px; color: #fff; background: linear-gradient(135deg, #2aabee, #168acd); box-shadow: 0 8px 22px rgba(42,171,238,.14); }
.contact-cta span { font-size: 12px; font-weight: 800; }
.contact-cta b { font-size: 10px; font-weight: 600; opacity: .82; }
.join-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    min-height: 67px;
    padding: 10px 13px calc(10px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(23,33,43,.97);
    border-top: 1px solid var(--tg-line);
    backdrop-filter: blur(14px);
}
.join-bar > div { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.join-bar strong { font-size: 13px; }
.join-bar span { margin-top: 2px; color: var(--tg-muted); font-size: 10px; }
.join-bar a { min-width: 76px; padding: 10px 14px; border-radius: 7px; color: white; background: var(--tg-blue); text-align: center; font-size: 12px; font-weight: 800; }

@media (max-width: 520px) {
    body { background: var(--tg-bg); }
    .wallpaper-symbols { opacity: .5; }
    .telegram-app { width: 100%; margin: 0; border-radius: 0; box-shadow: none; }
    .channel-preview { min-height: min(100svh, 550px); padding: max(33px, env(safe-area-inset-top)) 22px 28px; border-radius: 0 0 28px 28px; }
    .channel-avatar { width: 106px; height: 106px; }
    h1 { font-size: 25px; }
    .channel-description { max-width: 310px; font-size: 15px; }
    .view-telegram { min-width: 230px; }
    .chat-area { min-height: 100svh; }
}

@media (max-width: 360px) {
    .channel-preview { padding-inline: 16px; }
    .channel-avatar { width: 94px; height: 94px; }
    .channel-description { margin-top: 20px; }
    .contact { margin-top: 18px; }
    .view-telegram { margin-top: 27px; }
    .auto-redirect { margin-top: 17px; }
    .album-grid img, .album-grid img:first-child, .album-grid img:last-child { height: auto; aspect-ratio: 4 / 3; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; }
}
