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

body {
    background-color: #000;
    color: #e0e0e0;
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.2rem 1.2rem 2rem;
    width: 100%;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #0f0; border-radius: 10px; box-shadow: 0 0 8px #0f0; }

/* Hero */
.hero { text-align: center; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid #1a4a1a; }
.domain-badge {
    display: inline-block; background: #0a0f0a; padding: 0.4rem 1.8rem; border-radius: 40px; border: 2px solid #0f0;
    box-shadow: 0 0 20px #0f0; color: #0f0; font-weight: 700; letter-spacing: 3px; margin-bottom: 1.5rem;
    font-size: 1.1rem; animation: badgeShake 0.8s infinite alternate, badgePulse 2s infinite;
    cursor: pointer; transition: 0.2s; will-change: transform, box-shadow;
}
.domain-badge i { margin-right: 8px; }
.domain-badge:hover { background: #0f0; color: #000; box-shadow: 0 0 40px #0f0; transform: scale(1.02); }
@keyframes badgeShake { 0%{transform:translateX(0)}20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}100%{transform:translateX(0)} }
@keyframes badgePulse { 0%{box-shadow:0 0 10px #0f0}100%{box-shadow:0 0 30px #39ff14} }

.neon-title {
    font-size: clamp(3rem, 12vw, 6rem); font-weight: 900; color: #000;
    text-shadow: 0 0 5px #0f0,0 0 15px #0f0,0 0 30px #0f0,0 0 60px #00ff00;
    -webkit-text-stroke: 2.5px #0f0; animation: aggressiveNeon 1.5s infinite alternate, glitchText 4s infinite, titleShake 0.3s infinite;
    margin-bottom: 0.5rem; will-change: transform, text-shadow;
}
.title-icon { color: #0f0; filter: drop-shadow(0 0 15px #0f0); margin: 0 10px; animation: iconSpinFast 3s infinite linear; }
@keyframes aggressiveNeon {
    0%{text-shadow:0 0 3px #0f0,0 0 10px #0f0,0 0 20px #0f0;-webkit-text-stroke-color:#0f0}
    50%{text-shadow:0 0 15px #39ff14,0 0 35px #39ff14,0 0 70px #39ff14;-webkit-text-stroke-color:#39ff14}
    100%{text-shadow:0 0 8px #0f0,0 0 25px #0f0,0 0 50px #0f0;-webkit-text-stroke-color:#0f0}
}
@keyframes glitchText {
    0%,100%{transform:skewX(0)} 94%{transform:skewX(0)} 95%{transform:skewX(8deg);text-shadow:4px 0 #0f0,-4px 0 #39ff14}
    96%{transform:skewX(-8deg);text-shadow:-4px 0 #0f0,4px 0 #39ff14} 97%{transform:skewX(3deg)} 98%{transform:skewX(-2deg)} 99%{transform:skewX(0)}
}
@keyframes titleShake {
    0%,100%{transform:translate(0,0)} 10%{transform:translate(-1px,-1px)} 20%{transform:translate(2px,1px)}
    30%{transform:translate(-2px,1px)} 40%{transform:translate(1px,-1px)} 50%{transform:translate(-1px,2px)} 60%{transform:translate(0,0)}
}
@keyframes iconSpinFast {
    0%{transform:rotate(0deg) scale(1)} 25%{transform:rotate(12deg) scale(1.1)} 50%{transform:rotate(-8deg) scale(0.95)}
    75%{transform:rotate(6deg) scale(1.05)} 100%{transform:rotate(0deg) scale(1)}
}
.subtitle {
    font-size: clamp(1rem, 4vw, 1.4rem); color: #b3ffb3; margin: 1rem 0; text-shadow: 0 0 10px #0f0;
    letter-spacing: 2px; animation: fadeSlideUp 0.8s, subtitleGlow 2s infinite alternate;
}
@keyframes subtitleGlow { from{text-shadow:0 0 5px #0f0} to{text-shadow:0 0 15px #39ff14,0 0 25px #0f0} }
.neon-divider { height: 3px; width: 180px; background: #0f0; margin: 20px auto; box-shadow: 0 0 25px #0f0; animation: dividerPulse 2s infinite alternate; }
@keyframes dividerPulse { 0%{width:140px;opacity:0.7} 100%{width:240px;opacity:1} }

/* Barra de categorías (menú horizontal) */
.category-bar {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem;
    margin: 0 0 2rem; padding: 0.8rem 0.5rem; background: #050805;
    border-radius: 60px; border: 1px solid #1a4a1a; box-shadow: 0 0 15px #0f0;
}
.bar-item {
    display: flex; align-items: center; gap: 8px; padding: 0.6rem 1.2rem;
    border-radius: 40px; color: #0f0; text-decoration: none; font-weight: 600;
    transition: 0.2s; border: 1px solid transparent; will-change: transform;
}
.bar-item i { font-size: 1.2rem; }
.bar-item span { font-size: 1rem; }
.bar-item:hover { background: #0f0; color: #000; box-shadow: 0 0 15px #0f0; transform: translateY(-2px); }
.bar-item.active { background: #0f0; color: #000; box-shadow: 0 0 20px #0f0; border-color: #fff; }

/* Grid de navegación (inicio) */
.category-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1.2rem; margin: 2rem 0;
}
.nav-card {
    background: #0a0a0a; border: 2px solid #1a4a1a; border-radius: 30px; padding: 1.5rem 0.8rem;
    text-align: center; text-decoration: none; color: #0f0; transition: 0.2s; box-shadow: 0 0 10px rgba(0,255,0,0.1);
}
.nav-card i { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; filter: drop-shadow(0 0 10px #0f0); }
.nav-card span { font-size: 1.2rem; font-weight: 600; display: block; }
.nav-card small { font-size: 0.8rem; color: #9f9; }
.nav-card:hover { border-color: #0f0; box-shadow: 0 0 25px #0f0; transform: translateY(-5px); background: #050505; }

/* Páginas de categoría */
.back-link {
    display: inline-block; color: #0f0; text-decoration: none; margin-bottom: 1rem;
    font-size: 1rem; padding: 0.4rem 1.2rem; border: 1px solid #0f0; border-radius: 30px;
}
.page-title {
    font-size: clamp(2.5rem, 10vw, 4rem); font-weight: 800; color: #fff;
    text-shadow: 0 0 20px #0f0, 0 0 40px #0f0; margin: 0.5rem 0 0.5rem;
    animation: pageTitleGlow 2s infinite alternate;
}
@keyframes pageTitleGlow { from{text-shadow:0 0 15px #0f0} to{text-shadow:0 0 35px #39ff14,0 0 60px #0f0} }

/* Grid enfermedades */
.disease-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem; margin: 2rem 0;
}
.disease-card {
    background: #0a0a0a; border: 2px solid #1a4a1a; border-radius: 28px; padding: 1.5rem 1.2rem 1.6rem;
    transition: all 0.2s; box-shadow: 0 0 0 transparent; display: flex; flex-direction: column;
    backdrop-filter: blur(4px); position: relative; overflow: hidden; opacity: 0;
    transform: translateY(15px); will-change: transform, opacity, box-shadow;
    animation: cardFadeIn 0.5s forwards;
}
@keyframes cardFadeIn { to { opacity: 1; transform: translateY(0); } }
.disease-card:hover { border-color: #0f0; box-shadow: 0 0 25px #0f0; transform: translateY(-6px) scale(1.01); background: #050505; }
.card-glow {
    position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0,255,0,0.08), transparent);
    transition: left 0.5s; pointer-events: none; will-change: left;
}
.disease-card:hover .card-glow { left: 100%; }
.card-image {
    width: 100%; aspect-ratio: 1/1; background: #030703; border-radius: 20px; display: flex;
    align-items: center; justify-content: center; margin-bottom: 1.2rem; border: 2px solid #0f0;
    box-shadow: inset 0 0 15px #0a2a0a, 0 0 20px rgba(0,255,0,0.2); color: #0f0; font-size: 3.5rem;
}
.disease-card:hover .card-image { box-shadow: inset 0 0 20px #0f0, 0 0 30px #0f0; border-color: #39ff14; transform: scale(1.02); }
.card-image i { filter: drop-shadow(0 0 12px #0f0); }
.disease-card:hover .card-image i { filter: drop-shadow(0 0 20px #39ff14); }
.card-title { font-size: 1.7rem; font-weight: 700; color: #fff; text-shadow: 0 0 10px #0f0; margin-bottom: 0.4rem; }
.card-desc { color: #ccc; font-size: 0.9rem; line-height: 1.5; margin-bottom: 1rem; flex-grow: 1; }
.disease-tag {
    display: inline-block; background: #0f0f0f; border-left: 6px solid #0f0; padding: 0.3rem 1rem;
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1.5px; color: #0f0; font-weight: 600;
    border-radius: 0 16px 16px 0; align-self: flex-start; box-shadow: 0 0 8px #0f0;
}
.disease-card:hover .disease-tag { background: #0f0; color: #000; box-shadow: 0 0 20px #0f0; }

/* Panel stats */
.stats-panel {
    margin: 3rem 0 1.5rem; display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-around;
    background: #020602; border-radius: 40px; padding: 1.5rem 1.5rem; border: 2px solid #0f0;
    box-shadow: 0 0 30px #0f0;
}
.stat-item { display: flex; align-items: center; gap: 15px; font-size: 1.1rem; }
.stat-item i { font-size: 2.2rem; color: #0f0; filter: drop-shadow(0 0 12px #0f0); }
.stat-item strong { color: #fff; text-shadow: 0 0 8px #0f0; font-size: 1.6rem; }
.stat-item span { color: #9f9; }

/* Navegación inferior */
.bottom-nav {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; margin-top: 2.5rem;
    padding-top: 1.5rem; border-top: 1px solid #1a4a1a;
}
.bottom-nav a {
    color: #0f0; text-decoration: none; padding: 0.5rem 1.2rem; border: 1px solid #0f0;
    border-radius: 30px; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 8px;
}
.bottom-nav a:hover { background: #0f0; color: #000; box-shadow: 0 0 15px #0f0; }

/* Footer */
.footer { margin-top: 3rem; text-align: center; color: #3a6b3a; font-size: 0.9rem; padding-top: 1.5rem; border-top: 1px solid #1a4a1a; }
.footer strong { color: #0f0; }
.footer i { color: #0f0; margin: 0 8px; animation: heartBeat 1.5s infinite; }
@keyframes heartBeat { 0%,100%{transform:scale(1)} 30%{transform:scale(1.2)} }

/* Responsive */
@media (max-width: 600px) {
    .container { padding: 0.8rem 1rem 1.5rem; }
    .category-bar { gap: 0.2rem; padding: 0.5rem; }
    .bar-item { padding: 0.5rem 0.8rem; }
    .bar-item span { display: none; } /* solo iconos en móvil */
    .bar-item i { font-size: 1.4rem; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .disease-grid { gap: 1rem; }
}

@supports (padding: max(0px)) {
    body { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
}