/* === 17yotk.net visual effects v4 === */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    z-index: 10001;
    background: linear-gradient(90deg, var(--primary), var(--primary-2), var(--accent));
    box-shadow: 0 0 16px var(--glow);
    pointer-events: none;
    transition: width 0.08s linear;
}

.cursor-glow {
    position: fixed;
    width: 420px;
    height: 420px;
    margin: -210px 0 0 -210px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(circle, rgba(94, 231, 255, 0.12) 0%, transparent 65%);
    opacity: 0;
    transition: opacity 0.35s ease;
    mix-blend-mode: screen;
}

body.fx-cursor-on .cursor-glow {
    opacity: 1;
}

/* Animated gradient border cards */
.shine-card {
    position: relative;
    isolation: isolate;
}

.shine-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        120deg,
        transparent 30%,
        var(--primary) 45%,
        var(--accent) 55%,
        transparent 70%
    );
    background-size: 250% 250%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.45;
    animation: borderShine 6s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes borderShine {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.shine-card:hover::before {
    opacity: 0.85;
    animation-duration: 2.5s;
}

/* Hero scene — воксели вместо большой аватарки */
.hero-scene {
    position: relative;
    width: min(340px, 100%);
    height: 340px;
    margin: 0 auto;
    border-radius: 28px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    overflow: hidden;
    animation: sceneFloat 6s ease-in-out infinite;
}

@keyframes sceneFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.scene-orbit {
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    border: 1px dashed rgba(94, 231, 255, 0.2);
    animation: orbitSpin 24s linear infinite;
}

.scene-orbit::after {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    width: 8px;
    height: 8px;
    margin-left: -4px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 12px var(--glow);
}

@keyframes orbitSpin {
    to { transform: rotate(360deg); }
}

.scene-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(94, 231, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(94, 231, 255, 0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 55%, black 20%, transparent 75%);
    opacity: 0.6;
}

.hero-scene .minecraft-world {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
}

.hero-scene .minecraft-world::before {
    inset: 20%;
    opacity: 0.9;
}

.scene-center {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 5;
    transform: translate(-50%, -52%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.scene-logo-wrap {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(94, 231, 255, 0.2), rgba(43, 140, 255, 0.12));
    border: 1px solid rgba(94, 231, 255, 0.4);
    box-shadow: 0 12px 32px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    font-size: 2rem;
    color: var(--primary);
}

.scene-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Voxels */
.hero-scene .voxel,
.hero-scene .cube {
    position: absolute;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    animation: voxelFloat 5s ease-in-out infinite;
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.35),
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        inset 0 -4px 0 rgba(0, 0, 0, 0.15);
}

@keyframes voxelFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-14px) rotate(6deg); }
}

.voxel-grass {
    background: linear-gradient(145deg, #4ade80, #16a34a);
    border: 1px solid rgba(74, 222, 128, 0.5);
}

.voxel-stone {
    background: linear-gradient(145deg, #94a3b8, #64748b);
    border: 1px solid rgba(148, 163, 184, 0.5);
}

.voxel-water {
    background: linear-gradient(145deg, var(--primary), var(--primary-2));
    border: 1px solid rgba(94, 231, 255, 0.6);
    box-shadow: 0 12px 28px var(--glow), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.voxel-wood {
    background: linear-gradient(145deg, #d97706, #92400e);
    border: 1px solid rgba(217, 119, 6, 0.45);
}

.voxel-glow {
    width: 40px;
    height: 40px;
    background: linear-gradient(145deg, var(--accent), var(--accent-2));
    border: 1px solid rgba(167, 139, 250, 0.5);
    box-shadow: 0 8px 24px rgba(167, 139, 250, 0.35);
}

.hero-scene .v1 { top: 14%; left: 12%; animation-delay: 0s; }
.hero-scene .v2 { top: 8%; right: 14%; animation-delay: -1s; }
.hero-scene .v3 { bottom: 18%; right: 10%; animation-delay: -2s; }
.hero-scene .v4 { bottom: 22%; left: 8%; animation-delay: -3s; }
.hero-scene .v5 { top: 38%; right: 6%; animation-delay: -1.5s; }

/* Ticker */
.ticker-wrap {
    overflow: hidden;
    padding: 0.85rem 0;
    margin: -1rem 0 2rem;
    border-block: 1px solid var(--glass-border);
    background: linear-gradient(90deg, rgba(94, 231, 255, 0.06), rgba(167, 139, 250, 0.06));
    mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}

.ticker-track {
    display: flex;
    width: max-content;
    gap: 3rem;
    animation: tickerScroll 28s linear infinite;
}

.ticker-track span {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.ticker-track span strong {
    color: var(--primary);
    font-weight: 700;
}

@keyframes tickerScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Buttons upgrade */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%);
    transform: translateX(-120%);
    transition: transform 0.55s var(--ease-out);
}

.btn-primary:hover::after {
    transform: translateX(120%);
}

/* Scroll reveal */
.fx-reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.fx-reveal.fx-visible {
    opacity: 1;
    transform: translateY(0);
}

.fx-reveal.fx-delay-1 { transition-delay: 0.08s; }
.fx-reveal.fx-delay-2 { transition-delay: 0.16s; }
.fx-reveal.fx-delay-3 { transition-delay: 0.24s; }

/* Particles layer */
.fx-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.fx-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0;
    animation: particleDrift linear infinite;
}

@keyframes particleDrift {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% { opacity: 0.6; }
    90% { opacity: 0.3; }
    100% {
        opacity: 0;
        transform: translateY(-10vh) scale(1);
    }
}

/* Connect IP highlight */
.ip-highlight {
    position: relative;
    display: inline-block;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    animation: ipPulse 3s ease-in-out infinite;
}

@keyframes ipPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(94, 231, 255, 0); }
    50% { box-shadow: 0 0 20px rgba(94, 231, 255, 0.25); }
}

/* Tilt on cards */
.about-card,
.feature-item,
.news-item {
    transform-style: preserve-3d;
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    .shine-card::before,
    .hero-scene,
    .ticker-track,
    .fx-particle,
    .ip-highlight {
        animation: none !important;
    }

    .cursor-glow { display: none !important; }

    .fx-reveal {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 768px) {
    .cursor-glow { display: none; }
    .hero-scene {
        width: min(280px, 100%);
        height: 280px;
    }

    .hero-scene .voxel,
    .hero-scene .cube {
        width: 42px;
        height: 42px;
    }

    .scene-logo-wrap {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }
}

/* ========== v2 WOW pack ========== */

body.fx-loaded {
    animation: bodyFadeIn 0.85s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)) both;
}

@keyframes bodyFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.aurora-layer {
    position: fixed;
    inset: -20%;
    z-index: -2;
    pointer-events: none;
    opacity: 0.65;
    background:
        radial-gradient(ellipse 70% 55% at 15% 35%, rgba(94, 231, 255, 0.18), transparent 55%),
        radial-gradient(ellipse 55% 45% at 85% 25%, rgba(167, 139, 250, 0.14), transparent 50%),
        radial-gradient(ellipse 60% 40% at 55% 85%, rgba(52, 211, 153, 0.1), transparent 55%);
    animation: auroraShift 20s ease-in-out infinite alternate;
    filter: blur(2px);
}

@keyframes auroraShift {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    100% { transform: translate(2%, -3%) rotate(2deg) scale(1.04); }
}

.fx-noise {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0.04;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.gradient-text-flow {
    background-size: 280% auto;
    animation: textGradientFlow 4.5s ease-in-out infinite;
    filter: drop-shadow(0 0 28px rgba(94, 231, 255, 0.4));
}

@keyframes textGradientFlow {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

.ambient-bg .orb {
    animation: orbFloat 16s ease-in-out infinite;
}

.ambient-bg .orb-2 {
    animation-delay: -6s;
    animation-duration: 19s;
}

.ambient-bg .orb-3 {
    animation-delay: -11s;
    animation-duration: 22s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(4vw, -3vh) scale(1.1); }
    66% { transform: translate(-3vw, 2vh) scale(0.92); }
}

.shine-card {
    --spot-x: 50%;
    --spot-y: 50%;
}

.shine-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        520px circle at var(--spot-x) var(--spot-y),
        rgba(94, 231, 255, 0.16),
        transparent 42%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.shine-card:hover::after {
    opacity: 1;
}

.shine-card > * {
    position: relative;
    z-index: 1;
}

.cursor-glow-ring {
    position: fixed;
    width: 120px;
    height: 120px;
    margin: -60px 0 0 -60px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    border: 1px solid rgba(94, 231, 255, 0.25);
    box-shadow: 0 0 40px rgba(94, 231, 255, 0.15), inset 0 0 20px rgba(94, 231, 255, 0.08);
    opacity: 0;
    transition: opacity 0.35s ease;
}

body.fx-cursor-on .cursor-glow-ring {
    opacity: 1;
}

.fx-hero-burst {
    position: relative;
    overflow: visible;
}

.fx-hero-burst::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(600px, 90vw);
    height: min(400px, 50vh);
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(94, 231, 255, 0.14) 0%, transparent 62%);
    animation: heroBurst 7s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes heroBurst {
    0%, 100% { opacity: 0.35; transform: translate(-50%, -50%) scale(0.85); }
    50% { opacity: 0.9; transform: translate(-50%, -50%) scale(1.08); }
}

.page-hero .section-header h1 {
    text-shadow: 0 0 80px rgba(94, 231, 255, 0.2);
}

.section-header h2 {
    text-shadow: 0 0 50px rgba(94, 231, 255, 0.12);
}

.header.fx-scrolled {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(94, 231, 255, 0.08);
    backdrop-filter: blur(20px) saturate(1.4);
}

.rules-tab.active {
    box-shadow: 0 0 36px rgba(94, 231, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.rule-icon {
    margin-right: 0.35rem;
    color: var(--primary);
    font-size: 0.92em;
}

.rule-number {
    animation: ruleNumGlow 5s ease-in-out infinite;
}

@keyframes ruleNumGlow {
    0%, 100% { opacity: 0.85; }
    50% {
        opacity: 1;
        color: var(--primary);
        text-shadow: 0 0 24px var(--glow);
    }
}

.hero-scene {
    box-shadow:
        0 0 0 1px rgba(94, 231, 255, 0.12),
        0 24px 80px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(94, 231, 255, 0.08);
}

.hero-scene::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: conic-gradient(from 0deg, transparent, var(--primary), var(--accent), transparent);
    opacity: 0.35;
    animation: sceneRing 8s linear infinite;
    z-index: -1;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 2px;
}

@keyframes sceneRing {
    to { transform: rotate(360deg); }
}

.fx-particle:nth-child(3n) {
    background: var(--accent);
    width: 4px;
    height: 4px;
}

.fx-particle:nth-child(5n) {
    background: var(--primary-2);
}

.btn-magnetic {
    transition: transform 0.2s var(--ease-out, ease);
}

.rules-panel.fx-tab-enter .rule-card {
    animation: tabCardIn 0.55s var(--ease-out, ease) both;
}

.rules-panel.fx-tab-enter .rule-card:nth-child(1) { animation-delay: 0.05s; }
.rules-panel.fx-tab-enter .rule-card:nth-child(2) { animation-delay: 0.1s; }
.rules-panel.fx-tab-enter .rule-card:nth-child(3) { animation-delay: 0.15s; }
.rules-panel.fx-tab-enter .rule-card:nth-child(4) { animation-delay: 0.2s; }
.rules-panel.fx-tab-enter .rule-card:nth-child(5) { animation-delay: 0.25s; }
.rules-panel.fx-tab-enter .rule-card:nth-child(6) { animation-delay: 0.3s; }
.rules-panel.fx-tab-enter .rule-card:nth-child(7) { animation-delay: 0.35s; }

@keyframes tabCardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.about-card,
.feature-item,
.news-item,
.rule-card {
    transform-style: preserve-3d;
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    .aurora-layer,
    .ambient-bg .orb,
    .gradient-text-flow,
    .fx-hero-burst::before,
    .hero-scene::after,
    .rule-number {
        animation: none !important;
    }

    body.fx-loaded {
        animation: none;
    }

    .shine-card::after {
        display: none;
    }
}
