/* --- VARIABLES --- */
:root {
    --bg-dark: #020203;
    --bg-alt: #08080c;
    --neon-cyan: #00f3ff;
    --neon-magenta: #ff00ff;
    --neon-amber: #ffae00;
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-dark);
    color: #e0e0e0;
    font-family: var(--font-body);
    overflow-x: hidden;
}

.cyber-grid {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(rgba(0, 243, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 243, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px; z-index: -2; pointer-events: none;
}

/* --- UI ELEMENTS --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section-title { font-family: var(--font-display); font-size: 2.5rem; text-align: center; margin-bottom: 50px; text-transform: uppercase; }
.section-desc { text-align: center; color: #888; font-size: 1.2rem; margin-bottom: 40px; }
.highlight { color: var(--neon-magenta); text-shadow: 0 0 10px var(--neon-magenta); }
.bg-alt { background-color: var(--bg-alt); border-top: 1px solid #222; border-bottom: 1px solid #222; }

/* --- NAVBAR --- */
nav { padding: 15px 20px; background: rgba(0,0,0,0.95); border-bottom: 1px solid rgba(255,255,255,0.1); position: fixed; width: 100%; z-index: 100; display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: var(--font-display); font-weight: 900; font-size: 1.5rem; color: white; display: flex; align-items: center; gap: 10px; }
.logo img { height: 40px; border-radius: 5px; }
.logo span { color: var(--neon-cyan); }
.nav-links a { margin-left: 20px; text-decoration: none; color: #aaa; font-family: var(--font-display); font-size: 0.9rem; transition: 0.3s; }
.nav-links a:hover { color: var(--neon-cyan); text-shadow: 0 0 8px var(--neon-cyan); }

/* --- HERO --- */
.hero { height: 90vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px; padding-top: 80px; }
.hero-subtitle { color: var(--neon-amber); letter-spacing: 2px; margin-bottom: 20px; font-weight: bold; }
.hero-text { max-width: 600px; margin: 0 auto; color: #ccc; font-size: 1.1rem; line-height: 1.6; margin-bottom: 40px; }
h1 { font-family: var(--font-display); font-size: 3.5rem; margin-bottom: 10px; text-transform: uppercase; line-height: 1.1; }
.btn-play { background: var(--neon-cyan); color: black; padding: 15px 40px; font-family: var(--font-display); font-weight: bold; border: none; clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%); cursor: pointer; font-size: 1.2rem; transition: 0.3s; text-decoration: none; display: inline-block; }
.btn-play:hover { box-shadow: 0 0 20px var(--neon-cyan); transform: scale(1.05); }

/* --- SECCIONES DE CONTENIDO --- */
.content-section { padding: 80px 0; }

/* LORE GRID */
.lore-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.lore-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); padding: 30px; transition: 0.3s; border-left: 3px solid var(--neon-cyan); }
.lore-card:hover { transform: translateY(-5px); border-color: var(--neon-cyan); background: rgba(0, 243, 255, 0.05); }
.lore-card h3 { font-family: var(--font-display); color: white; margin-bottom: 15px; font-size: 1.3rem; }
.lore-card p { color: #aaa; line-height: 1.6; }

/* CARD SHOWCASE */
.cards-showcase { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; }
.showcase-item { width: 220px; text-align: center; }
.showcase-item img { width: 100%; border-radius: 10px; border: 2px solid #333; transition: 0.4s; box-shadow: 0 0 15px rgba(0,0,0,0.5); }
.showcase-item:hover img { transform: scale(1.1); border-color: var(--neon-magenta); box-shadow: 0 0 30px rgba(255, 0, 255, 0.4); }
.item-info h4 { margin-top: 15px; font-family: var(--font-display); color: var(--neon-cyan); }
.item-info p { font-size: 0.9rem; color: #888; margin-top: 5px; }

/* RULES */
.rules-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; text-align: center; }
.rule-box { padding: 20px; border: 1px dashed rgba(255,255,255,0.2); border-radius: 10px; }
.rule-icon { font-size: 3rem; margin-bottom: 15px; color: var(--neon-amber); }
.phase-list { list-style: none; text-align: left; padding-left: 20px; color: #aaa; margin-top: 10px; }
.phase-list li { margin-bottom: 5px; border-bottom: 1px solid #222; padding-bottom: 5px; }

/* --- TUTORIAL (GAME BOARD) --- */
/* (Mismo CSS de antes, asegurando que las rutas de imagen sean ../img/) */
#tutorial-section { padding: 60px 20px; background: radial-gradient(circle at center, #111, #000); border-top: 1px solid var(--neon-cyan); border-bottom: 1px solid var(--neon-cyan); margin: 60px 0; }
.tutorial-container { max-width: 1000px; margin: 0 auto; min-height: 650px; position: relative; background-color: #050505; border: 2px solid #333; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.game-board { flex-grow: 1; position: relative; background: repeating-linear-gradient(0deg, transparent, transparent 49px, rgba(0, 243, 255, 0.1) 50px); background-size: 100% 50px; perspective: 1000px; }
.battle-line { position: absolute; top: 50%; left: 0; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, var(--neon-magenta), transparent); box-shadow: 0 0 15px var(--neon-magenta); z-index: 1; }
.zone { position: absolute; border: 2px dashed rgba(255,255,255,0.2); border-radius: 8px; width: 120px; height: 170px; display: flex; justify-content: center; align-items: center; color: rgba(255,255,255,0.2); font-size: 0.8rem; font-family: var(--font-display); transform: translateX(-50%); left: 50%; }
#enemy-field { top: 15%; border-color: var(--neon-magenta); }
#player-field { top: 60%; border-color: var(--neon-cyan); }
#deck-zone { bottom: 20px; right: 20px; left: auto; transform: none; border-color: #444; }

/* CARTAS DEL JUEGO */
.card { width: 120px; height: 170px; background-size: cover; background-position: center; border-radius: 8px; box-shadow: 0 0 10px rgba(0,0,0,0.5); position: absolute; transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1); cursor: pointer; border: 2px solid #444; z-index: 10; }
.card:hover { transform: scale(1.1); z-index: 20; border-color: white; }
#deck { bottom: 20px; right: 20px; }
#enemy-card { top: 15%; left: 50%; transform: translateX(-50%); opacity: 0; pointer-events: none; }
#my-card { bottom: 20px; right: 20px; opacity: 0; pointer-events: none; }

/* Rutas relativas para CSS dentro de carpeta css/ */
.card-back { background-image: url('../img/card_back.png'); } /* Asegúrate que la extensión coincida */
.card-dragon { background-image: url('../img/dragon.png'); border-color: var(--neon-amber); }
.card-enemy { background-image: url('../img/bestia.png'); border-color: var(--neon-magenta); }

.glow-deck { animation: pulseDeck 1.5s infinite; border-color: var(--neon-cyan); }
.in-hand { bottom: 20px; left: 50%; transform: translateX(-50%); }
.on-field { top: 60%; left: 50%; transform: translateX(-50%) scale(1.0); bottom: auto; }
.attacking { top: 15% !important; transform: translateX(-50%) scale(1.1) !important; z-index: 50; }
.destroyed { animation: explode 0.5s forwards; }

@keyframes pulseDeck { 0% { box-shadow: 0 0 0 var(--neon-cyan); } 50% { box-shadow: 0 0 20px var(--neon-cyan); } 100% { box-shadow: 0 0 0 var(--neon-cyan); } }
@keyframes explode { 0% { transform: translateX(-50%) scale(1); filter: brightness(1); } 50% { transform: translateX(-50%) scale(1.1); filter: brightness(5) hue-rotate(90deg); opacity: 1; } 100% { transform: translateX(-50%) scale(2); opacity: 0; } }

/* UI PANEL */
.ui-panel { height: 120px; background: rgba(0,0,0,0.9); border-top: 2px solid var(--neon-cyan); padding: 20px; display: flex; align-items: center; gap: 20px; z-index: 30; position: relative; }
.npc-avatar { width: 80px; height: 80px; border-radius: 50%; border: 2px solid var(--neon-cyan); background: url('../img/avatar.png'); background-size: cover; }
.dialog-box h4 { color: var(--neon-cyan); font-family: var(--font-display); margin-bottom: 5px; }
.dialog-box p { color: white; font-size: 1.1rem; }

footer { text-align: center; padding: 40px 0; background: #000; color: #555; border-top: 1px solid #222; }

@media (max-width: 768px) {
    .tutorial-container { height: 500px; }
    .rules-container { grid-template-columns: 1fr; }
    .nav-links { display: none; } /* Ocultar menú en móvil para simplificar */
    h1 { font-size: 2.5rem; }
    .zone, .card { width: 90px; height: 130px; }
    #enemy-field { top: 10%; }
    #player-field { top: 55%; }
    .on-field { top: 55%; }
}

/* --- SYSTEM MODAL (ALERT PERSONALIZADO) --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Fondo oscuro semitransparente */
    backdrop-filter: blur(5px); /* Efecto cristal */
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none; /* No se puede clicar si está oculto */
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: #050505;
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
    width: 90%;
    max-width: 400px;
    padding: 2px; /* Espacio para el borde interno */
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-header {
    background: rgba(0, 243, 255, 0.1);
    color: var(--neon-cyan);
    font-family: var(--font-display);
    padding: 10px 20px;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(0, 243, 255, 0.3);
    letter-spacing: 2px;
}

.modal-body {
    padding: 30px 20px;
    text-align: center;
    color: white;
    font-size: 1.1rem;
    font-family: var(--font-body);
}

.modal-box .btn-play {
    width: 100%;
    margin: 0;
    clip-path: none; /* Quitamos el corte diagonal para el botón del modal */
    border-radius: 0;
}

.blink { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* --- DOWNLOAD SECTION --- */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.platform-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(0,0,0,0.4) 100%);
    border: 1px solid #333;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Efecto Hover: Brillo según la plataforma */
.platform-card:hover { transform: translateY(-10px); }
.platform-card.pc:hover { border-color: var(--neon-cyan); box-shadow: 0 0 30px rgba(0, 243, 255, 0.2); }
.platform-card.mobile:hover { border-color: var(--neon-magenta); box-shadow: 0 0 30px rgba(255, 0, 255, 0.2); }
.platform-card.web:hover { border-color: var(--neon-amber); box-shadow: 0 0 30px rgba(255, 174, 0, 0.2); }

.platform-icon { font-size: 4rem; margin-bottom: 20px; text-shadow: 0 0 20px rgba(255,255,255,0.2); }

.platform-card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: white;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.specs-list {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
    color: #888;
    font-size: 0.9rem;
}

.specs-list li {
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 8px;
}

.version-tag {
    display: block;
    margin-top: 15px;
    font-size: 0.75rem;
    color: #555;
    font-family: monospace;
}

.download-btn {
    width: 100%;
    margin: 0; /* Override del margen original */
}

/* Etiqueta de "Recomendado" */
.platform-badge {
    position: absolute;
    top: 15px;
    right: -30px;
    background: var(--neon-magenta);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 5px 30px;
    transform: rotate(45deg);
    box-shadow: 0 0 10px var(--neon-magenta);
}

@media (max-width: 768px) {
    .download-grid { grid-template-columns: 1fr; }
}

/* --- SECCIÓN CEO --- */
.ceo-profile {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 50px;
    background: linear-gradient(90deg, rgba(0,0,0,0.8), rgba(10,10,15,0.9));
    border: 1px solid #333;
    padding: 40px;
    border-left: 5px solid var(--neon-cyan);
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

/* Avatar con efecto de escaneo */
.ceo-avatar-container {
    width: 200px;
    height: 200px;
    position: relative;
    border: 2px solid var(--neon-cyan);
    padding: 5px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
}

.ceo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.2); /* Estilo blanco y negro técnico */
    transition: 0.5s;
}

.ceo-avatar-container:hover .ceo-img {
    filter: grayscale(0%);
}

.scanner-line {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
    animation: scan 3s linear infinite;
    z-index: 2;
    opacity: 0.7;
}

@keyframes scan {
    0% { top: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Información */
.ceo-data { flex: 1; min-width: 300px; }

.data-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.data-header h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: white;
    margin: 0;
}

.rank-badge {
    background: var(--neon-cyan);
    color: black;
    font-weight: bold;
    padding: 2px 10px;
    font-size: 0.8rem;
    font-family: monospace;
}

.ceo-quote {
    font-style: italic;
    color: #bbb;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    border-left: 2px solid var(--neon-magenta);
    padding-left: 15px;
}

/* Stats Técnicos */
.tech-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    font-family: monospace;
    font-size: 0.9rem;
}

.stat { display: flex; flex-direction: column; }
.stat .label { color: #555; font-size: 0.7rem; margin-bottom: 2px; }
.stat .value { color: var(--neon-cyan); }
.stat .value.online { color: #00ff00; text-shadow: 0 0 5px #00ff00; }

/* Redes Sociales */
.ceo-socials { display: flex; gap: 15px; }

.social-link {
    border: 1px solid #444;
    padding: 8px 20px;
    text-decoration: none;
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.8rem;
    transition: 0.3s;
}

.social-link:hover {
    border-color: var(--neon-magenta);
    background: rgba(255, 0, 255, 0.1);
    color: var(--neon-magenta);
}

@media (max-width: 768px) {
    .ceo-profile { flex-direction: column; text-align: center; }
    .data-header { flex-direction: column; gap: 10px; }
    .tech-stats { justify-content: center; }
    .ceo-socials { justify-content: center; }
}

/* --- PÁGINAS LEGALES --- */
.legal-content {
    max-width: 900px;
    background: rgba(0, 0, 0, 0.4);
    padding: 40px;
    border: 1px solid #333;
    border-radius: 8px;
}

.legal-content h3 {
    font-family: var(--font-display);
    color: var(--neon-cyan);
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.5rem;
    border-left: 4px solid var(--neon-magenta);
    padding-left: 15px;
}

.legal-content p {
    color: #ccc;
    margin-bottom: 15px;
    line-height: 1.8;
}

.legal-content ul {
    margin-bottom: 20px;
    padding-left: 20px;
    color: #bbb;
}

.legal-content li {
    margin-bottom: 10px;
    list-style-type: square;
}

.legal-content strong {
    color: white;
}