:root {
    --bg-color: #050505;
    --text-main: #ffffff;
    --text-muted: #888888;
    --glass-bg: rgba(20, 20, 20, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #ffffff;
}

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

html, body { width: 100%; }
body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Montserrat', sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 24px 0 calc(24px + env(safe-area-inset-bottom, 0px)) 0;
    -webkit-tap-highlight-color: transparent;
}
body:not(:has(#tg-ticker-wrap[hidden])) { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }

/* ============== SPLASH SCREEN ============== */
.splash-screen {
    position: fixed; inset: 0; background: var(--bg-color); z-index: 99999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.7s;
}
.splash-screen.hide { opacity: 0; visibility: hidden; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.splash-text {
    font-family: 'Cinzel', serif; font-size: 36px; font-weight: 600; letter-spacing: 8px;
    color: #fff; text-shadow: 0 4px 30px rgba(255,255,255,0.4); text-transform: uppercase;
    opacity: 0; animation: splashTextIn 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    text-align: center; padding: 0 20px;
}
@keyframes splashTextIn {
    0%   { opacity: 0; transform: translateY(15px) scale(0.95); filter: blur(5px); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
.splash-hint {
    font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 3px;
    color: var(--text-muted); text-transform: uppercase; text-align: center;
    opacity: 0; animation: splashHintIn 0.8s ease forwards, splashHintPulse 1.8s ease-in-out infinite;
    animation-delay: 0.9s, 0.9s;
}
@keyframes splashHintIn { to { opacity: 1; } }
@keyframes splashHintPulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

.bg-layer { position: fixed; top: -5%; left: -5%; width: 110%; height: 110%; background: linear-gradient(135deg, #0a0a0a 0%, #000000 100%); z-index: 0; }
.noise { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; opacity: 0.04; background-image: url("noise.svg"); }
#canvas-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
#dotfield-svg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
#dotfield-glow { will-change: opacity; transition: opacity 0.05s linear; }

/* ============== ПЛАВНОЕ ПОЯВЛЕНИЕ ============== */
.glass-panel {
    position: relative; z-index: 10; width: 90%; max-width: 450px;
    padding: 50px 40px; background: var(--glass-bg);
    border: 1px solid var(--glass-border); border-radius: 24px;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex; flex-direction: column; align-items: center;
    opacity: 0; transform: translateY(30px) scale(0.98);
    margin: auto;
    will-change: transform;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

body.ready .glass-panel {
    animation: revealPanel 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes revealPanel {
    0% { opacity: 0; transform: translateY(30px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.r { opacity: 0; }

body.ready .r {
    animation: revealItem 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: var(--d, 0s);
}
@keyframes revealItem {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ============== ЭЛЕМЕНТЫ КАРТОЧКИ ============== */
.avatar-wrap { position: relative; width: 160px; height: 160px; margin-bottom: 25px; border-radius: 50%; padding: 5px; background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%); animation: float 6s ease-in-out infinite; flex-shrink: 0; }
.avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; filter: contrast(1.05); transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94); box-shadow: 0 10px 30px rgba(0,0,0,0.5); display: block; }
.avatar-wrap:hover .avatar { filter: contrast(1.1); transform: scale(1.03); }

h1 { font-family: 'Cinzel', serif; font-size: 36px; font-weight: 600; letter-spacing: 6px; margin-bottom: 8px; color: #fff; text-shadow: 0 4px 20px rgba(255,255,255,0.3); text-align: center; word-break: break-word; }
.subtitle { font-size: 12px; letter-spacing: 4px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 40px; font-weight: 300; text-align: center; }

.links { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.btn { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 18px 24px; width: 100%; background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 12px; text-decoration: none; color: var(--text-main); font-size: 13px; letter-spacing: 2px; overflow: hidden; transition: all 0.4s ease; }
.btn::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent); transform: translateX(-100%); transition: transform 0.6s ease; z-index: 0; }
.btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.3); transform: translateY(-2px); padding-left: 30px; }
.btn:hover::before { transform: translateX(100%); }
.btn span { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; }
.btn-desc { font-size: 10px; color: var(--text-muted); opacity: 0.6; transition: opacity 0.3s ease; }
.btn:hover .btn-desc { opacity: 1; color: #fff; }

.btn-ico { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-right: 2px; flex-shrink: 0; }
.btn-ico svg { width: 16px; height: 16px; fill: none; stroke: rgba(255,255,255,0.85); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.3s ease; }
.btn-ico[data-ico="telegram"] svg,
.btn-ico[data-ico="discord"] svg,
.btn-ico[data-ico="github"] svg { fill: rgba(255,255,255,0.85); stroke: none; }
.btn:hover .btn-ico svg { stroke: #fff; fill: #fff; }

.tg-ticker-wrap { position: fixed; bottom: 0; left: 0; width: 100%; background: rgba(5,5,5,0.85); border-top: 1px solid var(--glass-border); padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)) 0; z-index: 50; display: flex; align-items: center; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.tg-ticker-wrap[hidden] { display: none !important; }
.tg-label { padding: 0 20px; font-weight: bold; color: var(--text-main); border-right: 1px solid var(--glass-border); white-space: nowrap; flex-shrink: 0; }
.tg-content { overflow: hidden; white-space: nowrap; width: 100%; position: relative; padding-left: 20px; }
.tg-text { display: inline-block; animation: tickerScroll 25s linear infinite; }
.tg-text.static { animation: none; }

.cursor-dot, .cursor-outline { position: fixed; top: 0; left: 0; transform: translate(-50%, -50%); border-radius: 50%; z-index: 9999; pointer-events: none; }
.cursor-dot { width: 6px; height: 6px; background-color: var(--accent); opacity: 0; transition: opacity 0.2s ease; }
.cursor-outline { width: 40px; height: 40px; border: 1px solid rgba(255, 255, 255, 0.5); opacity: 0; transition: width 0.2s, height 0.2s, background-color 0.2s, opacity 0.2s ease; }
.cursor-dot.on, .cursor-outline.on { opacity: 1; }
.cursor-outline.hover { width: 60px; height: 60px; background-color: rgba(255,255,255,0.08); }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============== MUSIC TOGGLE ============== */
.music-toggle {
    position: fixed; top: 20px; right: 20px; z-index: 200;
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(20,20,20,0.5); border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    cursor: pointer; transition: all 0.3s ease;
    opacity: 0; animation: revealItem 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 1.7s;
}
.music-toggle:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); transform: scale(1.06); }
.music-toggle svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.music-toggle.pending { animation: revealItem 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards, musicPulse 1.4s ease-in-out infinite; animation-delay: 1.7s, 1.7s; }
@keyframes musicPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.25); }
    50% { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
}
@media (max-width: 480px) {
    .music-toggle { top: 14px; right: 14px; width: 38px; height: 38px; }
    .music-toggle svg { width: 16px; height: 16px; }
}

/* ============== STATS ============== */
.stats {
    display: flex; align-items: stretch; justify-content: center; gap: 0;
    width: 100%; margin-bottom: 28px;
}
.stat-cell { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 8px; }
.stat-val { font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 400; color: #fff; letter-spacing: 1px; }
.stat-lbl { font-size: 9px; letter-spacing: 1.5px; color: var(--text-muted); text-transform: uppercase; margin-top: 4px; }
.stat-sep { width: 1px; background: var(--glass-border); margin: 8px 0; }

/* ============== АДАПТИВ ============== */
@media (max-width: 768px) {
    body { padding: 16px 0 24px 0; }
    .glass-panel { padding: 32px 22px; border-radius: 18px; width: 92%; }
    .avatar-wrap { width: 130px; height: 130px; margin-bottom: 20px; }
    h1 { font-size: 28px; letter-spacing: 4px; }
    .subtitle { font-size: 11px; letter-spacing: 3px; margin-bottom: 30px; }
    .links { gap: 12px; }
    .btn { padding: 14px 18px; font-size: 12px; letter-spacing: 1.5px; border-radius: 10px; }
    .btn-desc { font-size: 9px; }
    .btn:hover { padding-left: 22px; }
    .tg-label { padding: 0 14px; }
    .tg-content { padding-left: 14px; }
    .stats { margin-bottom: 22px; }
    .stat-val { font-size: 14px; }
    .stat-lbl { font-size: 8px; letter-spacing: 1px; }
}

@media (max-width: 480px) {
    * { cursor: auto !important; }
    .cursor-dot, .cursor-outline { display: none !important; }
    body { padding: 12px 0 20px 0; }
    .glass-panel { padding: 28px 18px; border-radius: 16px; width: 94%; }
    .avatar-wrap { width: 110px; height: 110px; margin-bottom: 16px; padding: 3px; animation: none; }
    h1 { font-size: 22px; letter-spacing: 3px; margin-bottom: 6px; }
    .subtitle { font-size: 10px; letter-spacing: 2.5px; margin-bottom: 24px; }
    .links { gap: 10px; }
    .btn { padding: 13px 14px; font-size: 11px; letter-spacing: 1px; flex-wrap: wrap; }
    .btn span:first-child { min-width: 0; }
    .btn-desc { font-size: 9px; }
    .btn:hover { padding-left: 14px; transform: none; }
}

@media (max-width: 360px) {
    .glass-panel { padding: 22px 14px; }
    h1 { font-size: 19px; letter-spacing: 2px; }
    .subtitle { font-size: 9px; letter-spacing: 2px; }
    .btn { padding: 12px 12px; font-size: 10px; }
}

@media (hover: none) {
    .btn:hover { padding-left: 24px; transform: none; }
    .avatar-wrap:hover .avatar { filter: grayscale(100%) contrast(1.1); transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .glass-panel, .r { opacity: 1 !important; animation: none !important; transform: none !important; }
}
