/* ==================== GOALQUEST - MAIN.CSS ====================
   Version: 4.1 - WITH AERIL (NO EYES)
   ============================================================ */

:root {
    --primary: #4dff91;
    --secondary: #6c63ff;
    --danger: #ff6b6b;
    --warning: #ffd166;
    --info: #4ecdc4;
    --gold: #ffd700;
    --dark: #1a1a2e;
    --darker: #0f0f1f;
    --corrupt-1: #b388ff;
    --corrupt-2: #aa00ff;
    --corrupt-3: #ff00ff;
}

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

body {
    font-family: 'Press Start 2P', cursive;
    background: var(--darker);
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.5s ease;
}

/* ==================== PARTICLES ==================== */
.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    animation: float linear infinite;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
    }
}

/* ==================== CORRUPTION OVERLAYS ==================== */
.corruption-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    transition: all 0.5s ease;
    mix-blend-mode: overlay;
}

.corruption-overlay.level-1 {
    background: rgba(180, 0, 255, 0.05);
}

.corruption-overlay.level-2 {
    background: rgba(180, 0, 255, 0.1);
}

.corruption-overlay.level-3 {
    background: rgba(255, 0, 255, 0.15);
}

.glitch-line {
    position: fixed;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--corrupt-2), transparent);
    pointer-events: none;
    z-index: 9999;
    animation: glitchMove 12s linear infinite;
    opacity: 0;
}

.glitch-line.level-1 { opacity: 0.1; }
.glitch-line.level-2 { opacity: 0.2; }
.glitch-line.level-3 { opacity: 0.3; }

@keyframes glitchMove {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

.corruption-border-effect {
    animation: borderPulse 3s infinite;
}

@keyframes borderPulse {
    0% { box-shadow: 0 0 15px var(--primary), 0 0 30px var(--primary); }
    33% { box-shadow: 0 0 15px var(--corrupt-1), 0 0 30px var(--corrupt-1); }
    66% { box-shadow: 0 0 15px var(--corrupt-2), 0 0 30px var(--corrupt-2); }
    100% { box-shadow: 0 0 15px var(--primary), 0 0 30px var(--primary); }
}

body.corruption-bg-2 {
    background: #0a0a14;
}

body.corruption-bg-3 {
    background: #05050a;
}

/* ==================== CONTENEDOR PRINCIPAL ==================== */
#game-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 10;
    transition: box-shadow 0.3s ease;
}

.game-screen {
    max-width: 1200px;
    width: 100%;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(5px);
    border: 3px solid var(--primary);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 0 30px var(--primary);
    transition: all 0.3s ease;
    position: relative;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.game-screen > * {
    width: 100%;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

/* ==================== CENTERED TYPOGRAPHY ==================== */
.game-screen h1,
.game-screen h2,
.game-screen h3,
.game-screen h4,
.game-screen p,
.game-screen div:not(.status-bar):not(.character-card):not(.region-tile):not(.mission-item):not(.daily-mission-item) {
    text-align: center;
}

.game-title {
    font-size: 48px;
    text-align: center;
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary);
    margin-bottom: 30px;
    letter-spacing: 4px;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 20px var(--primary); }
    50% { text-shadow: 0 0 40px var(--primary), 0 0 60px var(--primary); }
}

/* ==================== NOTIFICACIONES ==================== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 350px;
    padding: 15px;
    background: linear-gradient(145deg, #1a1a2e, #0f0f1f);
    border-left: 8px solid var(--primary);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(77, 255, 145, 0.3);
    z-index: 10001;
    animation: slideIn 0.3s ease forwards;
    font-family: 'Press Start 2P', cursive;
}

.corruption-notification {
    border-left-color: var(--corrupt-2);
    box-shadow: 0 0 30px rgba(170, 0, 255, 0.3);
}

.recovery-notification {
    border-left-color: var(--primary);
    box-shadow: 0 0 30px rgba(77, 255, 145, 0.5);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== MAIN MENU ==================== */
.ff-menu {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.menu-option {
    background: linear-gradient(145deg, #2a2a4a, #1a1a3a);
    border: 2px solid var(--primary);
    border-radius: 15px;
    padding: 20px;
    color: white;
    font-size: 14px;
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.menu-option:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px var(--primary);
    border-color: var(--warning);
}

.menu-option i {
    font-size: 24px;
    color: var(--primary);
    width: 30px;
}

/* ==================== STATUS BAR ==================== */
.status-bar {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--primary);
    border-radius: 15px;
    padding: 20px;
    margin: 0 auto 30px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    max-width: 1000px;
}

.stat-bar {
    width: 120px;
    height: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.hp-bar .stat-fill {
    background: var(--danger);
    height: 100%;
    transition: width 0.3s ease;
}

.mp-bar .stat-fill {
    background: var(--primary);
    height: 100%;
    transition: width 0.3s ease;
}

.exp-bar .stat-fill {
    background: var(--warning);
    height: 100%;
    transition: width 0.3s ease;
}

.stat-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    color: white;
    text-shadow: 0 0 5px black;
}

/* ==================== DAILY PROGRESS ==================== */
.daily-progress-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 30px auto;
    background: rgba(26, 26, 46, 0.95);
    border-radius: 15px;
    padding: 20px;
    border: 3px solid var(--warning);
}

.daily-progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--primary);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin: 10px 0;
}

.daily-progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
    position: relative;
}

.daily-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    color: black;
    font-weight: bold;
    text-shadow: none;
}

/* ==================== GRID DE PERSONAJES ==================== */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px auto;
    width: 100%;
    justify-items: center;
}

.character-card {
    background: rgba(26, 26, 46, 0.9);
    border: 3px solid var(--primary);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 350px;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 30px var(--primary);
}

.character-card.selected {
    border-color: var(--warning);
    box-shadow: 0 0 30px var(--warning);
}

/* ==================== MAPA DE REGIONES ==================== */
.map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px auto;
    width: 100%;
    justify-items: center;
}

.region-tile {
    background: rgba(26, 26, 46, 0.9);
    border: 3px solid var(--primary);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 350px;
}

.region-tile:hover:not(.locked) {
    transform: scale(1.02);
    box-shadow: 0 0 30px var(--primary);
}

.region-tile.locked {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

/* ==================== QUESTS ==================== */
.mission-list {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(26, 26, 46, 0.95);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid var(--warning);
}

.mission-item {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--primary);
    border-radius: 10px;
    padding: 15px;
    margin: 0 auto 10px auto;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 760px;
}

.mission-item:hover:not(.completed) {
    background: rgba(77, 255, 145, 0.1);
    border-color: var(--warning);
}

.mission-item.completed {
    opacity: 0.5;
    cursor: default;
    filter: grayscale(0.5);
}

.mission-item.today {
    border-color: var(--warning);
    box-shadow: 0 0 15px var(--warning);
}

/* ==================== DAILY QUESTS ==================== */
.daily-mission-list {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(26, 26, 46, 0.95);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid var(--warning);
}

.daily-mission-item {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--primary);
    border-radius: 10px;
    padding: 15px;
    margin: 0 auto 10px auto;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 760px;
}

.daily-mission-item.available:hover {
    background: rgba(77, 255, 145, 0.1);
    border-color: var(--warning);
}

.daily-mission-item.completed {
    opacity: 0.5;
    cursor: default;
}

/* ==================== BOTONES ==================== */
.button-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px auto;
    width: 100%;
    flex-wrap: wrap;
}

.ff-button {
    background: var(--primary);
    color: black;
    border: none;
    border-radius: 10px;
    padding: 15px 30px;
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 4px solid #2a8c5e;
    text-decoration: none;
    display: inline-block;
    margin: 5px;
    min-width: 150px;
    text-align: center;
}

.ff-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 0 20px var(--primary);
}

.ff-button:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

/* ==================== POPUPS ==================== */
.task-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    backdrop-filter: blur(5px);
}

.popup-content {
    background: var(--dark);
    border: 3px solid var(--primary);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 50px var(--primary);
    margin: 0 auto;
}

.popup-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.task-textarea {
    width: 100%;
    height: 150px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--primary);
    border-radius: 10px;
    padding: 15px;
    color: white;
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    resize: none;
    margin: 20px 0;
}

.task-textarea:focus {
    outline: none;
    box-shadow: 0 0 20px var(--primary);
}

/* ==================== COMBATE ==================== */
.combat-arena {
    text-align: center;
    padding: 20px;
    width: 100%;
}

.combat-context {
    color: var(--warning);
    font-size: 14px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ==================== AERIL - PORTAL GUARDIAN (SIN OJOS) ==================== */
.aeril-guardian {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0 0 15px var(--primary));
    transition: all 0.3s ease;
    pointer-events: none;
    opacity: 0.95;
    animation: aerilFloat 6s ease-in-out infinite;
}

@keyframes aerilFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.aeril-sprite {
    width: 80px;
    height: 80px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 10px var(--primary));
}

/* Corruption states */
.aeril-guardian.corrupt-1 {
    filter: drop-shadow(0 0 10px var(--corrupt-1));
    opacity: 0.85;
}

.aeril-guardian.corrupt-2 {
    filter: drop-shadow(0 0 10px var(--corrupt-2));
    opacity: 0.75;
}

.aeril-guardian.corrupt-3 {
    filter: drop-shadow(0 0 10px var(--corrupt-3));
    opacity: 0.65;
}

.corrupt-1 .aeril-sprite,
.corrupt-2 .aeril-sprite,
.corrupt-3 .aeril-sprite {
    filter: brightness(0.7);
}

/* Brief glitch effect */
.aeril-guardian.glitch {
    animation: aerilGlitch 0.15s ease-in-out 3;
}

@keyframes aerilGlitch {
    0% { transform: translate(0) skew(0deg); filter: hue-rotate(0deg) brightness(1); }
    20% { transform: translate(-3px, 2px) skew(2deg); filter: hue-rotate(90deg) brightness(1.2); }
    40% { transform: translate(3px, -2px) skew(-2deg); filter: hue-rotate(180deg) brightness(1.2); }
    60% { transform: translate(-2px, -1px) skew(1deg); filter: hue-rotate(270deg) brightness(1.2); }
    80% { transform: translate(2px, 1px) skew(-1deg); filter: hue-rotate(360deg) brightness(1.2); }
    100% { transform: translate(0) skew(0deg); filter: hue-rotate(0deg) brightness(1); }
}

/* Ritual de entrada */
.aeril-guardian.welcome-glow {
    animation: aerilWelcome 2s ease-out;
}

@keyframes aerilWelcome {
    0% { filter: drop-shadow(0 0 20px var(--primary)); transform: scale(1) translateY(0); }
    50% { filter: drop-shadow(0 0 50px var(--primary)); transform: scale(1.15) translateY(-10px); }
    100% { filter: drop-shadow(0 0 20px var(--primary)); transform: scale(1) translateY(0); }
}

.aeril-guardian.look-up {
    animation: aerilLookUp 0.6s ease-out;
}

@keyframes aerilLookUp {
    0% { transform: translateY(0) rotate(0deg); }
    40% { transform: translateY(-12px) rotate(-3deg); }
    70% { transform: translateY(-5px) rotate(2deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* Recovery */
.aeril-guardian.recovering {
    animation: aerilRecover 1.2s ease-out;
}

@keyframes aerilRecover {
    0% { filter: drop-shadow(0 0 20px var(--corrupt-2)); transform: scale(1); }
    30% { filter: drop-shadow(0 0 60px var(--primary)); transform: scale(1.2); }
    70% { filter: drop-shadow(0 0 40px var(--primary)); transform: scale(1.1); }
    100% { filter: drop-shadow(0 0 20px var(--primary)); transform: scale(1); }
}

/* Mensaje de Aeril */
.aeril-message {
    position: fixed;
    bottom: 120px;
    left: 30px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(5px);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 15px 20px;
    font-size: 11px;
    color: var(--primary);
    max-width: 350px;
    z-index: 9998;
    box-shadow: 0 0 30px rgba(0,0,0,0.7);
    animation: aerilMessageFade 0.5s ease-out;
    font-family: 'Press Start 2P', cursive;
    line-height: 1.6;
    border: 1px solid rgba(255,255,255,0.1);
}

@keyframes aerilMessageFade {
    from {
        opacity: 0;
        transform: translateY(20px) translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

/* ==================== LOADING SCREEN ==================== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--darker);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    transition: opacity 0.5s ease;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--darker);
    border: 1px solid var(--primary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--warning);
}

/* ==================== UTILIDADES DE CENTRADO ==================== */
.text-center {
    text-align: center;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.block-center {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ==================== DAILY QUESTS HEADER ==================== */
.daily-missions-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
    flex-wrap: wrap;
}

.daily-missions-header > div {
    text-align: center;
}

.daily-progress-box {
    background: rgba(26, 26, 46, 0.95);
    border-radius: 15px;
    padding: 20px;
    border: 3px solid var(--warning);
    margin: 0 auto 30px auto;
    width: 100%;
    max-width: 800px;
    text-align: center;
}

/* ==================== MEDIA QUERIES ==================== */
@media (max-width: 768px) {
    .game-title {
        font-size: 32px;
    }
    
    .game-screen {
        padding: 20px 15px;
    }
    
    .menu-option {
        font-size: 10px;
        padding: 15px;
    }
    
    .character-grid {
        grid-template-columns: 1fr;
    }
    
    .map-grid {
        grid-template-columns: 1fr;
    }
    
    .status-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .daily-progress-bar {
        width: 100%;
    }
    
    .button-container {
        flex-direction: column;
        align-items: center;
    }
    
    .ff-button {
        width: 100%;
        max-width: 300px;
    }
    
    .aeril-guardian {
        bottom: 20px;
        left: 20px;
    }
    
    .aeril-sprite {
        width: 60px;
        height: 60px;
    }
    
    .aeril-message {
        bottom: 90px;
        left: 20px;
        right: 20px;
        max-width: none;
        font-size: 9px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .aeril-guardian {
        bottom: 10px;
        left: 10px;
    }
    
    .aeril-sprite {
        width: 48px;
        height: 48px;
    }
    
    .aeril-message {
        bottom: 70px;
        left: 10px;
        right: 10px;
        font-size: 8px;
        padding: 10px;
    }
}
/* ==================== FEEDBACK BUTTON ==================== */
.feedback-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #4a4e69;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 10px 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    border: 2px solid var(--primary); /* matches the neon border */
}

.feedback-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--primary);
    background: #5a5e79; /* a lighter shade on hover */
}

/* Responsive: smaller on mobile */
@media (max-width: 768px) {
    .feedback-button {
        bottom: 10px;
        left: 10px;
        padding: 8px 16px;
        font-size: 8px;
    }
}
