/* AnyFPS Enhanced – 3D-style, animations, floating icons, immersive GUI */

/* ---- 3D perspective & tilt ---- */
.page-3d {
    perspective: 1200px;
    min-height: 100vh;
}

.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    will-change: transform;
}

.card-3d:hover {
    transform: rotateY(-6deg) rotateX(4deg) translateZ(12px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 30px rgba(255,255,255,0.08);
}

.btn-3d {
    transform-style: preserve-3d;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-3d:hover {
    transform: translateY(-4px) translateZ(8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.btn-3d:active {
    transform: translateY(-1px) translateZ(4px);
}

/* ---- Keyframe animations ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(3deg); }
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0) translateX(0) scale(1) rotate(0deg); }
    25% { transform: translateY(-10px) translateX(6px) scale(1.03) rotate(2deg); }
    50% { transform: translateY(-6px) translateX(-4px) scale(1.02) rotate(-1deg); }
    75% { transform: translateY(-12px) translateX(3px) scale(1.04) rotate(1deg); }
}

@keyframes floatDrift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(8px, -15px) rotate(4deg); }
    66% { transform: translate(-6px, -8px) rotate(-3deg); }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; filter: blur(20px); }
    50% { opacity: 1; filter: blur(24px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ---- Staggered entrance ---- */
.stagger-1 { animation: fadeInUp 0.5s ease forwards; opacity: 0; }
.stagger-2 { animation: fadeInUp 0.5s ease 0.08s forwards; opacity: 0; }
.stagger-3 { animation: fadeInUp 0.5s ease 0.16s forwards; opacity: 0; }
.stagger-4 { animation: fadeInUp 0.5s ease 0.24s forwards; opacity: 0; }
.stagger-5 { animation: fadeInUp 0.5s ease 0.32s forwards; opacity: 0; }
.stagger-6 { animation: fadeInUp 0.5s ease 0.4s forwards; opacity: 0; }

/* ---- Floating icons (decorative) ---- */
.float-icons {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.float-icon {
    position: absolute;
    font-size: 2rem;
    opacity: 0.14;
    animation: floatSlow 6s ease-in-out infinite;
    will-change: transform;
}
.float-icon:nth-child(odd) { animation: floatDrift 7s ease-in-out infinite; }

.float-icon:nth-child(1) { top: 15%; left: 8%; animation-delay: 0s; }
.float-icon:nth-child(2) { top: 25%; right: 12%; animation-delay: 1s; }
.float-icon:nth-child(3) { bottom: 30%; left: 15%; animation-delay: 2s; }
.float-icon:nth-child(4) { bottom: 20%; right: 10%; animation-delay: 0.5s; }
.float-icon:nth-child(5) { top: 50%; left: 5%; animation-delay: 1.5s; }
.float-icon:nth-child(6) { top: 60%; right: 8%; animation-delay: 2.5s; }
.float-icon:nth-child(7) { top: 40%; right: 25%; animation-delay: 0.8s; }
.float-icon:nth-child(8) { bottom: 40%; left: 25%; animation-delay: 1.8s; }

/* ---- Hero / content above float layer ---- */
.content-above {
    position: relative;
    z-index: 1;
}

/* ---- Enhanced nav buttons (home hub) ---- */
.hub-card {
    position: relative;
    padding: 24px 32px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255,255,255,0.15);
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.hub-card:hover {
    transform: rotateY(-5deg) translateY(-6px) translateZ(10px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.4), 0 0 24px rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
    background: linear-gradient(145deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 100%);
}

.hub-card .hub-icon {
    font-size: 1.8rem;
    transition: transform 0.3s ease;
}

.hub-card:hover .hub-icon {
    animation: iconBounce 0.6s ease;
}

/* ---- Section panels (play / lobby) ---- */
.section-3d {
    transform-style: preserve-3d;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.section-3d:hover {
    transform: translateZ(8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 20px rgba(255,255,255,0.05);
}

/* ---- Lobby / Library cards ---- */
.lobby-card-3d,
.library-card-3d {
    transform-style: preserve-3d;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.lobby-card-3d:hover,
.library-card-3d:hover {
    transform: rotateY(-4deg) rotateX(2deg) translateZ(10px);
    box-shadow: 0 16px 36px rgba(0,0,0,0.45), 0 0 24px rgba(255,255,255,0.08);
}

/* ---- Header icon buttons (Friends, Settings, Logout – hover shows tooltip) ---- */
#user-info .header-icon-btn,
.header-icon-btn {
    background: #000;
    color: #fff;
    border: 2px solid #000;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 16px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    min-width: 40px;
}
#user-info .header-icon-btn:hover,
.header-icon-btn:hover {
    background: #333;
    border-color: #333;
}

/* Header avatar (profile picture: colour + first letter) */
.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    margin-right: 8px;
    flex-shrink: 0;
}
