/* Main CSS - Shared Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    color: #1d1d1f;
    overflow-x: hidden;
    position: relative;
}

/* Floating Navigation - Professional Playing Cards Design */
/* Only apply to navigation cards (nav element), not game buttons (div) */
nav.floating-nav {
    position: fixed !important;
    bottom: 24px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    gap: 20px !important;
    z-index: 1000 !important;
    perspective: 1000px !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    width: auto !important;
    right: auto !important;
}

/* Ensure game page floating nav (div) is not affected by nav styles */
body.game-page div.floating-nav {
    /* Game page styles are in game.css - these will take precedence */
}

.nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    text-decoration: none;
    color: #1a1a1a;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 65px;
    height: 90px;
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.15),
        0 3px 6px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    transform-style: preserve-3d;
    overflow: hidden;
}

/* Card texture pattern */
.nav-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        );
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

/* Playing card corner decoration */
.nav-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, transparent 50%);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}

/* Corner suit indicators */
.nav-card .corner-top {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 14px;
    height: 14px;
    border-top: 2px solid currentColor;
    border-left: 2px solid currentColor;
    border-radius: 2px;
    opacity: 0.25;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.nav-card .corner-bottom {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 14px;
    height: 14px;
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    border-radius: 2px;
    opacity: 0.25;
    transition: opacity 0.3s ease;
    z-index: 3;
    transform: rotate(180deg);
}

.nav-card:hover {
    transform: translateY(-10px) rotateX(8deg) rotateY(2deg);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.2),
        0 8px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    border-color: rgba(110, 86, 207, 0.4);
    background: rgba(255, 255, 255, 0.25);
}

.nav-card:hover .corner-top,
.nav-card:hover .corner-bottom {
    opacity: 0.5;
}

.nav-card.active {
    background: rgba(110, 86, 207, 0.3);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 12px 28px rgba(110, 86, 207, 0.45),
        0 5px 12px rgba(110, 86, 207, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15),
        0 0 0 2px rgba(110, 86, 207, 0.2);
    transform: translateY(-6px) scale(1.08);
}

.nav-card.active::before {
    opacity: 0.2;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.1) 2px,
            rgba(255, 255, 255, 0.1) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.1) 2px,
            rgba(255, 255, 255, 0.1) 4px
        );
}

.nav-card.active .corner-top,
.nav-card.active .corner-bottom {
    opacity: 0.6;
    border-color: rgba(255, 255, 255, 0.9);
}

.nav-card.active:hover {
    transform: translateY(-12px) scale(1.08) rotateX(8deg) rotateY(2deg);
    box-shadow: 
        0 24px 48px rgba(110, 86, 207, 0.55),
        0 10px 20px rgba(110, 86, 207, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1),
        0 0 0 2px rgba(110, 86, 207, 0.2);
}

.nav-icon {
    width: 26px;
    height: 26px;
    margin-bottom: 8px;
    stroke-width: 2;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
    z-index: 3;
    position: relative;
}

.nav-card:hover .nav-icon {
    transform: scale(1.15) translateY(-2px);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.nav-card.active .nav-icon {
    filter: drop-shadow(0 3px 10px rgba(255, 255, 255, 0.4));
    stroke-width: 2.5;
}

.nav-card.active:hover .nav-icon {
    transform: scale(1.2) translateY(-3px);
    filter: drop-shadow(0 5px 12px rgba(255, 255, 255, 0.5));
}

.nav-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    z-index: 3;
    position: relative;
    margin-top: 2px;
}

.nav-card.active .nav-label {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 800;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .floating-nav {
        bottom: 20px;
        gap: 16px;
    }
    
    .nav-card {
        width: 60px;
        height: 82px;
        padding: 10px 8px;
    }
    
    .nav-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 6px;
    }
    
    .nav-label {
        font-size: 9px;
    }
    
    .nav-card .corner-top,
    .nav-card .corner-bottom {
        width: 12px;
        height: 12px;
        top: 6px;
        left: 6px;
        bottom: 6px;
        right: 6px;
    }
}

@media (max-width: 480px) {
    .floating-nav {
        bottom: 16px;
        gap: 12px;
    }
    
    .nav-card {
        width: 55px;
        height: 75px;
        padding: 10px 6px;
    }
    
    .nav-icon {
        width: 22px;
        height: 22px;
        margin-bottom: 5px;
    }
    
    .nav-label {
        font-size: 8px;
        letter-spacing: 0.3px;
    }
    
    .nav-card .corner-top,
    .nav-card .corner-bottom {
        width: 10px;
        height: 10px;
        top: 5px;
        left: 5px;
        bottom: 5px;
        right: 5px;
    }
}