/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000000;
    color: #ffffff;
    font-family: 'Rajdhani', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    cursor: default;
}

/* Header y Logo */
.header {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.logo-container {
    position: relative;
}

.logo {
    width: 120px;
    height: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 234, 0, 0.3);
}

.logo:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 234, 0, 0.6);
}

/* Menú desplegable */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(20, 20, 20, 0.95));
    border: 2px solid #ffea00;
    border-radius: 12px;
    padding: 20px;
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(255, 234, 0, 0.2);
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(10px);
}

.menu-section {
    margin-bottom: 20px;
}

.menu-section:last-child {
    margin-bottom: 0;
}

.menu-title {
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    font-weight: 700;
    color: #ffea00;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 1px;
}

.menu-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 400;
}

.menu-link:hover {
    background: rgba(255, 234, 0, 0.1);
    color: #ffea00;
    transform: translateX(5px);
}

.menu-link i {
    font-size: 16px;
    width: 20px;
}

/* Contenido principal */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Título central */
.title-section {
    text-align: center;
    margin-bottom: 60px;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

.main-title {
    font-family: 'Orbitron', monospace;
    font-size: 4rem;
    font-weight: 900;
    color: #ffea00;
    text-shadow: 
        0 0 10px #ffea00,
        0 0 20px #ffea00,
        0 0 30px #ffea00;
    margin-bottom: 20px;
    letter-spacing: 3px;
}

.subtitle {
    font-size: 1.5rem;
    color: #cccccc;
    font-weight: 300;
    letter-spacing: 1px;
    opacity: 0.8;
}

@keyframes titleGlow {
    0% {
        text-shadow: 
            0 0 10px #ffea00,
            0 0 20px #ffea00,
            0 0 30px #ffea00;
    }
    100% {
        text-shadow: 
            0 0 15px #ffea00,
            0 0 25px #ffea00,
            0 0 35px #ffea00,
            0 0 45px #ffea00;
    }
}

/* Contenedor de portales */
.portals-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    max-width: 1000px;
    width: 100%;
}

.portals-row {
    display: flex;
    justify-content: center;
    gap: 60px;
    width: 100%;
}

.top-row {
    /* 3 portales en la fila superior */
}

.bottom-row {
    /* 2 portales en la fila inferior */
    gap: 120px; /* Mayor separación para centrar mejor */
}

/* Portal individual */
.portal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.portal-ring {
    position: relative;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #ffea00,
        #ffd700,
        #ffea00,
        #ffd700,
        #ffea00
    );
    padding: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Halo exterior giratorio */
.portal-ring::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(255, 234, 0, 0.6),
        transparent,
        rgba(255, 234, 0, 0.6),
        transparent
    );
    animation: ringRotate 8s linear infinite;
    opacity: 0.7;
    filter: blur(2px);
}

.portal-ring:hover::before {
    animation-duration: 2s;
    opacity: 1;
    filter: blur(1px);
}

.portal-ring:hover {
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(255, 234, 0, 0.8);
}

@keyframes ringRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.portal-background {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: #000;
}

.portal-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: 50%;
}

.portal:hover .portal-bg-image {
    opacity: 0.7;
}

.portal-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(255, 234, 0, 0.2), transparent);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.runa {
    width: 60px;
    height: 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 10px #ffea00);
}

.runa:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 20px #ffea00);
}

.runa:active {
    animation: runaUnlock 0.6s ease-in-out;
}

/* Runa deshabilitada para portal próximamente */
.runa.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: drop-shadow(0 0 5px rgba(255, 234, 0, 0.3));
}

.runa.disabled:hover {
    transform: none;
    filter: drop-shadow(0 0 5px rgba(255, 234, 0, 0.3));
}

/* Portal próximamente */
.portal-coming-soon {
    opacity: 0.7;
}

.portal-coming-soon .portal-ring {
    background: conic-gradient(
        from 0deg,
        #666666,
        #888888,
        #666666,
        #888888,
        #666666
    );
}

.portal-coming-soon .portal-ring::before {
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(136, 136, 136, 0.6),
        transparent,
        rgba(136, 136, 136, 0.6),
        transparent
    );
}

.portal-coming-soon .portal-title {
    color: #888888;
    text-shadow: 0 0 10px rgba(136, 136, 136, 0.5);
}

@keyframes runaUnlock {
    0% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(-10deg) scale(1.1);
    }
    50% {
        transform: rotate(20deg) scale(1.2);
    }
    75% {
        transform: rotate(-5deg) scale(1.1);
    }
    100% {
        transform: rotate(0deg) scale(1);
    }
}

.portal-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffea00;
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 234, 0, 0.5);
}

/* Efectos especiales para cada reino */
.portal[data-kingdom="madrid"]:hover .portal-ring {
    background: conic-gradient(
        from 0deg,
        #ff6b35,
        #ffea00,
        #ff6b35,
        #ffea00,
        #ff6b35
    );
}

.portal[data-kingdom="londres"]:hover .portal-ring {
    background: conic-gradient(
        from 0deg,
        #4a90e2,
        #ffea00,
        #4a90e2,
        #ffea00,
        #4a90e2
    );
}

.portal[data-kingdom="valencia"]:hover .portal-ring {
    background: conic-gradient(
        from 0deg,
        #ff8c42,
        #ffea00,
        #ff8c42,
        #ffea00,
        #ff8c42
    );
}

.portal[data-kingdom="alcorcon"]:hover .portal-ring {
    background: conic-gradient(
        from 0deg,
        #8e44ad,
        #ffea00,
        #8e44ad,
        #ffea00,
        #8e44ad
    );
}

/* Cursor mágico */
.portal:hover {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><circle cx="16" cy="16" r="8" fill="%23ffea00" opacity="0.8"/><circle cx="16" cy="16" r="4" fill="%23ffffff"/></svg>'), auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .portals-container {
        gap: 30px;
        max-width: 350px;
    }
    
    .portals-row {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    
    .bottom-row {
        gap: 30px; /* Reducir separación en móvil */
    }
    
    .portal-ring {
        width: 200px;
        height: 200px;
    }
    
    .logo {
        width: 100px;
    }
    
    .dropdown-menu {
        min-width: 250px;
    }
    
    .header {
        top: 15px;
        left: 15px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 2rem;
        letter-spacing: 1px;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .portal-ring {
        width: 180px;
        height: 180px;
    }
    
    .runa {
        width: 50px;
        height: 50px;
    }
    
    .portal-center {
        width: 70px;
        height: 70px;
    }
    
    .portal-title {
        font-size: 1rem;
    }
    
    .dropdown-menu {
        min-width: 220px;
        padding: 15px;
    }
}

/* Animaciones adicionales */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portal {
    animation: fadeInUp 0.8s ease-out;
}

.portal:nth-child(1) { animation-delay: 0.1s; }
.portal:nth-child(2) { animation-delay: 0.2s; }
.portal:nth-child(3) { animation-delay: 0.3s; }



/* === Overrides: Alcorcón plateado y alineación bajo Madrid === */
.portal[data-kingdom="alcorcon"] .portal-ring {
    background: conic-gradient(from 0deg, #c0c0c0, #e0e0e0, #c0c0c0, #f5f5f5, #c0c0c0);
    box-shadow: 0 0 20px rgba(192,192,192,0.45), inset 0 0 18px rgba(255,255,255,0.5);
}
.portal[data-kingdom="alcorcon"] .portal-ring::before {
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.3), transparent 60%) !important;
    filter: saturate(0.15) brightness(1.05);
}
/* Colocar la fila inferior un poco más cerca para que Alcorcón “quede bajo” Madrid visualmente */
.portals-row + .portals-row {
    margin-top: -20px;
}
/* Asegurar que Madrid quede por encima si llegan a solaparse */
.portal[data-kingdom="madrid"] .portal-ring { z-index: 2; }
.portal[data-kingdom="alcorcon"] .portal-ring { z-index: 1; }

/* 1) LOGO */
.header .logo { width: 150px; }      /* antes ~120px */
@media (max-width: 768px) {
  .header .logo { width: 120px; }    /* en móvil lo mantenemos comedido */
}

/* 2) Colocar Alcorcón bajo Madrid de forma precisa: pasamos a GRID */
.portals-container{
  display: grid;                                  /* antes era flex */
  grid-template-columns: repeat(3, minmax(0, 260px)); /* 3 columnas, cada una aprox ancho del portal */
  gap: 80px 60px;                                  /* row-gap / column-gap */
  justify-content: center;
  justify-items: center;
}
/* “Aplanamos” las filas para que los portales sean hijos del grid */
.portals-row{ display: contents; }
/* Quitamos el hack anterior de margen negativo entre filas */
.portals-row + .portals-row{ margin-top: 0 !important; }

@media (max-width: 900px){
  .portals-container{ grid-template-columns: 1fr; }  /* en tablet/móvil apilado */
}

/* 3) Halo de alcorcon */
.portal[data-kingdom="alcorcon"] .portal-ring{
  background: conic-gradient(from 0deg, #dfe2e6, #cfd3d7, #e8ebef, #cfd3d7, #dfe2e6);
  box-shadow: 0 0 24px rgba(200,200,200,.55), inset 0 0 22px rgba(255,255,255,.65);
}
.portal[data-kingdom="alcorcon"] .portal-ring::before{
  background: conic-gradient(
    from 0deg,
    transparent,
    rgba(255,255,255,0.60) 20%,
    transparent 40%,
    rgba(255,255,255,0.45) 60%,
    transparent 80%
  );
  animation: spin 6s linear infinite;
  opacity: .85;
  filter: blur(1px);
}

