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

body {
    font-family: 'Roboto', sans-serif;
    color: #fff;
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    background: 
        radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%) fixed,
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><filter id="stars-filter"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="4" seed="1"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.4 0"/></filter><rect width="100%" height="100%" filter="url(%23stars-filter)"/></svg>') fixed;
    background-blend-mode: overlay;
}

h1, h2, h3 {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

.planet {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #3a1c71, #160d2e);
    box-shadow: 0 0 80px #3a1c71;
    right: -100px;
    bottom: -100px;
    z-index: -1;
    opacity: 0.6;
}

/* Contenedor principal */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 25px;
    position: relative;
    background-color: rgba(15, 15, 25, 0.85);
    border-radius: 15px;
    box-shadow: 0 0 40px rgba(106, 76, 230, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1;
}

/* Cabecera */
header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo {
    height: 100px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(138, 43, 226, 0.7));
}

.header-text {
    text-align: left;
}

header h1 {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 0 15px rgba(138, 43, 226, 0.7);
    margin-bottom: 5px;
    background: linear-gradient(to right, #8a2be2, #6a5acd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tagline {
    color: #b8b8d2;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* Barra de búsqueda */
.search-container {
    display: flex;
    justify-content: center;
    margin: 25px 0;
    width: 100%;
}

.search-container input {
    padding: 14px 20px;
    width: 70%;
    max-width: 600px;
    border: 2px solid #3a3a5a;
    border-radius: 30px 0 0 30px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
    background: rgba(20, 20, 40, 0.8);
    color: #fff;
}

.search-container input:focus {
    border-color: #6e45e2;
    box-shadow: 0 0 15px rgba(110, 69, 226, 0.5);
}

.search-container button {
    padding: 14px 25px;
    border: none;
    border-radius: 0 30px 30px 0;
    background: linear-gradient(135deg, #6e45e2 0%, #88d3ce 100%);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-container button:hover {
    background: linear-gradient(135deg, #5d35d1 0%, #6ec3b8 100%);
    transform: scale(1.02);
}

/* Categorías */
.categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 25px 0;
}

.category-btn {
    padding: 10px 20px;
    background: rgba(50, 40, 80, 0.6);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
    color: #d1c4e9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-btn:hover {
    background: rgba(90, 70, 140, 0.8);
}

.category-btn.active {
    background: #7c4dff;
    color: white;
    box-shadow: 0 0 15px rgba(124, 77, 255, 0.5);
}

/* Contenedor de juegos */
.games-container {
    background: rgba(30, 30, 50, 0.4);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.games-container h2 {
    color: #fff;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(110, 69, 226, 0.3);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Grid de juegos */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 25px;
}

.game-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s;
    padding: 15px;
    border-radius: 12px;
    background: rgba(40, 35, 70, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.game-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(110, 69, 226, 0.1) 0%, transparent 70%);
    transform: rotate(30deg);
    z-index: -1;
}

.game-icon:hover {
    transform: translateY(-8px);
    background: rgba(70, 50, 120, 0.6);
    box-shadow: 0 10px 30px rgba(110, 69, 226, 0.3);
    border-color: rgba(110, 69, 226, 0.2);
}

.game-icon:hover::before {
    animation: shine 1.5s;
}

@keyframes shine {
    to {
        transform: rotate(30deg) translate(50%, 50%);
    }
}

.game-icon img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    margin-bottom: 15px;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-icon:hover img {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(110, 69, 226, 0.4);
}

.game-icon span {
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s;
}

.game-icon:hover span {
    color: #b388ff;
}

.no-games {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #b8b8d2;
    font-size: 1.1rem;
}

/* Footer */
.copyright {
    text-align: center;
    padding: 30px 0;
    color: #7f8c8d;
    font-size: 0.9rem;
    position: relative;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.social-links a {
    color: #b8b8d2;
    font-size: 1.3rem;
    transition: all 0.3s;
}

.social-links a:hover {
    color: #7c4dff;
    transform: translateY(-3px);
}

/* Botones flotantes */
#panicButton, #quickRedirect, #suggestButton {
    position: fixed;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    transition: all 0.3s;
    color: white;
    font-size: 1.3rem;
    border: none;
}

#panicButton {
    top: 25px;
    right: 160px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

#quickRedirect {
    top: 25px;
    right: 25px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

#suggestButton {
    top: 25px;
    right: 92px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

#panicButton:hover, #quickRedirect:hover, #suggestButton:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

/* Modales */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: rgba(20, 15, 40, 0.95);
    animation: slideUp 0.4s ease-out;
    border: 1px solid rgba(110, 69, 226, 0.3);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #6e45e2, #5d35d1);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

.modal-header span {
    font-weight: 500;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-controls button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-controls button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.close-btn {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-btn:hover {
    color: #ffeb3b;
    transform: rotate(90deg);
}

.modal-body {
    flex: 1;
    position: relative;
    padding: 10px;
    animation: fadeIn 0.5s ease-out;
}

#gameFrame {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    background: #121212;
    border: none;
    border-radius: 8px;
    animation: zoomIn 0.4s ease-out;
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Modal de pánico */
#panicModal {
    z-index: 10000;
}

.panic-modal-content {
    background: rgba(30, 25, 60, 0.95);
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
    border: 1px solid rgba(110, 69, 226, 0.3);
}

.panic-modal-content h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #ff6b6b;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.panic-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.panic-options button {
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.panic-options button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.2);
}

.panic-custom {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.panic-custom input {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 10px;
    outline: none;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.panic-custom input:focus {
    border-color: #6e45e2;
    box-shadow: 0 0 0 3px rgba(110, 69, 226, 0.3);
}

.panic-buttons {
    display: flex;
    gap: 15px;
}

.panic-buttons button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#saveUrl {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

#saveUrl:hover {
    background: linear-gradient(135deg, #27ae60, #219653);
    transform: translateY(-3px);
}

#setRedirect {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

#setRedirect:hover {
    background: linear-gradient(135deg, #2980b9, #1a6ca3);
    transform: translateY(-3px);
}

#cancelPanic {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#cancelPanic:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Modal de sugerencias */
#suggestModal {
    z-index: 10000;
}

.suggest-modal-content {
    background: rgba(30, 25, 60, 0.95);
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
    position: relative;
    border: 1px solid rgba(110, 69, 226, 0.3);
}

.suggest-modal-content h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #f39c12;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#closeSuggest {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #6e45e2, #5d35d1);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#closeSuggest:hover {
    background: linear-gradient(135deg, #5d35d1, #4c25c0);
    transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        margin: 15px;
        padding: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .logo {
        height: 60px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }
    
    .game-icon img {
        height: 100px;
    }
    
    #panicButton, #quickRedirect, #suggestButton {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    #panicButton { right: 110px; top: 15px; }
    #quickRedirect { right: 15px; top: 15px; }
    #suggestButton { right: 65px; top: 15px; }
    
    .panic-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 15px;
    }
    
    .logo-container {
        flex-direction: column;
        text-align: center;
    }
    
    .header-text {
        text-align: center;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .search-container {
        flex-direction: column;
        align-items: center;
    }
    
    .search-container input {
        width: 100%;
        border-radius: 30px;
        margin-bottom: 10px;
    }
    
    .search-container button {
        width: 100%;
        border-radius: 30px;
        justify-content: center;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }
    
    .game-icon {
        padding: 10px;
    }
    
    .game-icon img {
        height: 80px;
    }
    
    .panic-modal-content, .suggest-modal-content {
        padding: 20px;
    }
    
    #panicButton, #quickRedirect, #suggestButton {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    #panicButton { right: 100px; top: 10px; }
    #quickRedirect { right: 10px; top: 10px; }
    #suggestButton { right: 55px; top: 10px; }
}

@media (max-width: 400px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    }
    
    .game-icon span {
        font-size: 0.85rem;
    }
    
    .categories {
        gap: 8px;
    }
    
    .category-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}
