* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    color: #fff;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 166, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 150, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    animation: particleFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Header moderno */
h1 {
    color: #ffffff;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    padding: 2rem 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-size: 2rem;
    margin: 0 0 1rem 0;
    text-align: center;
    width: 100%;
    max-width: 1200px;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid #ffa600;
    text-transform: none;
    font-weight: 400;
    letter-spacing: 0;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grid menu moderno */
.menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Menu item - Hero card style */
.menu-item {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 2px solid rgba(255, 166, 0, 0.3);
    border-radius: 20px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(255, 166, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: cardSlideUp 0.6s ease-out backwards;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    -webkit-tap-highlight-color: rgba(255, 166, 0, 0.2);
    touch-action: manipulation;
}

/* Stagger animation */
.menu-item:nth-child(1) { animation-delay: 0.1s; }
.menu-item:nth-child(2) { animation-delay: 0.15s; }
.menu-item:nth-child(3) { animation-delay: 0.2s; }
.menu-item:nth-child(4) { animation-delay: 0.25s; }
.menu-item:nth-child(5) { animation-delay: 0.3s; }
.menu-item:nth-child(6) { animation-delay: 0.35s; }

@keyframes cardSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gradient rotante background */
.menu-item::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(255, 166, 0, 0.15) 0%,
        rgba(0, 150, 255, 0.1) 40%,
        transparent 70%
    );
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Hover effects */
.menu-item:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 166, 0, 0.6);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(255, 166, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.menu-item:active {
    transform: translateY(-4px) scale(0.98);
}

/* Button styling */
.menu-item button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 800;
    cursor: pointer;
    width: 100%;
    text-align: left;
    padding: 0;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffa600 0%, #ffcc00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    line-height: 1.3;
    -webkit-user-select: none;
    user-select: none;
}

.menu-item:hover button {
    transform: translateX(5px);
    filter: brightness(1.2);
}

/* Description styling */
.description {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.menu-item:hover .description {
    color: rgba(255, 255, 255, 0.9);
}

/* Icon per ogni card */
.menu-item::after {
    content: '→';
    position: absolute;
    bottom: 25px;
    right: 25px;
    font-size: 2rem;
    color: #ffa600;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    z-index: 1;
}

.menu-item:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* Popup moderno */
.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
    backdrop-filter: blur(30px);
    padding: 40px;
    border-radius: 24px;
    border: 2px solid rgba(255, 166, 0, 0.4);
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.8),
        0 0 60px rgba(255, 166, 0, 0.3);
    text-align: center;
    color: white;
    z-index: 9999;
    max-width: 400px;
    width: 90%;
    animation: popupSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popupSlide {
    from {
        opacity: 0;
        transform: translate(-50%, -40%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.popup img {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 4px 12px rgba(255, 166, 0, 0.5));
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.popup p {
    margin: 20px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.popup button {
    margin-top: 10px;
    background: linear-gradient(135deg, #ffa600 0%, #ff8800 100%);
    border: none;
    color: #000;
    padding: 14px 32px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow:
        0 8px 25px rgba(255, 166, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    min-height: 48px;
    min-width: 120px;
}

.popup button:hover {
    transform: translateY(-3px);
    box-shadow:
        0 12px 40px rgba(255, 166, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.popup button:active {
    transform: translateY(-1px);
}

/* Overlay per popup */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9998;
}

.popup-overlay.active,
.popup.active {
    display: block;
}

/* ============================================
    RESPONSIVE MOBILE - OTTIMIZZATO
    ============================================ */

@media (max-width: 768px) {
    body {
        padding: 15px 12px;
    }

    h1 {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }

    .menu {
        grid-template-columns: 1fr;
        gap: 16px;
        max-width: 100%;
    }

    .menu-item {
        padding: 26px 22px;
        min-height: 130px;
        border-radius: 18px;
    }

    .menu-item button {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }

    .description {
        font-size: 0.92rem;
        line-height: 1.5;
    }

    /* Arrow più piccola ma visibile */
    .menu-item::after {
        font-size: 1.6rem;
        bottom: 22px;
        right: 22px;
    }

    .popup {
        padding: 35px 25px;
        border-radius: 20px;
        max-width: calc(100% - 40px);
    }

    .popup img {
        width: 55px;
        height: 55px;
    }

    .popup p {
        font-size: 1.1rem;
        margin: 18px 0;
    }

    .popup button {
        padding: 16px 28px;
        font-size: 1rem;
        width: 100%;
        max-width: 280px;
    }
}

/* Extra small mobile (iPhone SE, small Android) */
@media (max-width: 375px) {
    body {
        padding: 12px 10px;
    }

    h1 {
        font-size: 1.6rem;
        margin-bottom: 25px;
    }

    .menu {
        gap: 14px;
    }

    .menu-item {
        padding: 24px 20px;
        min-height: 120px;
        border-radius: 16px;
    }

    .menu-item button {
        font-size: 1.15rem;
    }

    .description {
        font-size: 0.88rem;
    }

    .menu-item::after {
        font-size: 1.4rem;
        bottom: 20px;
        right: 20px;
    }

    .popup {
        padding: 30px 20px;
    }

    .popup p {
        font-size: 1.05rem;
    }
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse) {
    /* Aumenta area touch su dispositivi touch */
    .menu-item {
        min-height: 136px;
    }

    /* Touch feedback più evidente */
    .menu-item:active {
        background: linear-gradient(135deg, rgba(255, 166, 0, 0.2) 0%, rgba(255, 204, 0, 0.15) 100%);
        transform: scale(0.98);
    }

    /* Nascondi hover effects su touch */
    .menu-item::after {
        opacity: 0.3;
        transform: translateX(0);
    }

    .popup button {
        min-height: 52px;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding: 15px 20px;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }

    .menu {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .menu-item {
        min-height: 110px;
        padding: 22px 18px;
    }

    .menu-item button {
        font-size: 1.1rem;
    }

    .description {
        font-size: 0.85rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Prevent text selection on all interactive elements */
.menu-item,
.menu-item button,
.description {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}