/************************************
**********LOGIN PAGES**************
*************************************/

/* --- CRITICAL: HIDE OLD INTERFACE ELEMENTS --- */
/* Ensure body has the correct background */
body {
    background: rgba(20, 20, 30, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background-image: url('../../img/background.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
    color: white !important;
    margin: 0 !important;
    overflow-x: hidden;

}
.
/* This hides standard 2Moons headers, footers, and menus so they don't conflict */
#header, #footer, #menu, #top, #topnav, .header, .footer, .top-bar, #navbar, .navigation {
    display: none !important; 
}

/* --- RESET PARENT CONTAINERS --- */
/* Forces the main content area to be full width and removes padding/borders from the theme */
#content, #page, .content-box, .container, main, #wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
}

.glass-panel {
    background-color: rgba(20, 20, 30, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

/* Efecto de brillo superior */
.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.5), transparent);
}
.neon-text {
    text-shadow: 0 0 5px hsl(190 100% 50%), 0 0 10px hsl(190 100% 50%);
}

/* Fix for potential parent container constraints */
main.container {
    max-width: 100% !important;
    padding: 0 !important;
}
.glow-text {
  text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}


 /* Estilización del contenido de las reglas (que viene del backend) */
.rules-content {
    font-size: 15px;
    line-height: 1.6;
    color: #cbd5e1;
}

.rules-content h1, .rules-content h2, .rules-content h3 {
    font-family: 'Orbitron', sans-serif;
    color: #22d3ee;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.rules-content strong {
    color: #e879f9; /* Purple accent */
}

.rules-content ol, .rules-content ul {
    padding-left: 20px;
    margin-bottom: 1em;
}

.rules-content li {
    margin-bottom: 0.5em;
}


 /* Estilos Base ntenido de las disclamer (que viene del backend) */
.disclaimer-page-container {
    font-family: 'Rajdhani', sans-serif;
    color: white;
    min-height: 100vh;
    padding: 20px;
    background: transparent;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cards internas */
.info-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.info-card:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(34, 211, 238, 0.3);
    transform: translateY(-2px);
}

/* Form Inputs */
.glass-input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
}
.glass-input:focus {
    border-color: #22d3ee;
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.2);
    outline: none;
}

/* Animación Fade In */
.animated-fade-in {
    animation: fadeIn 0.8s ease-out;
}

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


/* Animación de carga/redirección */
.loading-bar {
    height: 2px;
    width: 100%;
    background: rgba(255,255,255,0.1);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.loading-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, transparent, #22d3ee, transparent);
    animation: loading 1.5s infinite ease-in-out;
}

@keyframes loading {
    0% { left: -40%; }
    100% { left: 100%; }
}
    
/************************************
**********CONTENT PAGES**************
*************************************/
/* Estilos Base contenido del overvie */
/* Section Headers */
.tech-header {
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.1), transparent);
    border-bottom: 1px solid rgba(34, 211, 238, 0.2);
    border-top: 1px solid rgba(34, 211, 238, 0.2);
    text-align: center;
    padding: 4px 0;
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #22d3ee;
    text-shadow: 0 0 5px rgba(34, 211, 238, 0.5);
    font-size: 0.85rem;
    position: relative;
}

.tech-header::before, .tech-header::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #22d3ee;
    box-shadow: 0 0 8px #22d3ee;
}
.tech-header::before { left: 0; }
.tech-header::after { right: 0; }

/* Planet Image Effect */
.planet-glow {
    border-radius: 50%;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8) inset, 0 0 20px rgba(34, 211, 238, 0.1);
    transition: transform 0.5s ease;
}
.planet-glow:hover {
    transform: scale(1.02);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8) inset, 0 0 30px rgba(34, 211, 238, 0.2);
}

/* Rank Circle */
.rank-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
    position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
::-webkit-scrollbar-thumb { background: rgba(34, 211, 238, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(34, 211, 238, 0.6); }

/* Tooltip Custom */
.tooltip-content {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    border: 1px solid #22d3ee;
    padding: 8px;
    border-radius: 4px;
    width: max-content;
    max-width: 300px;
    z-index: 50;
    font-size: 0.75rem;
    white-space: normal;
}
.group:hover .tooltip-content { display: block; }

/* Table Styles */
.fleet-table-wrapper table { width: 100%; border-collapse: collapse; }
.fleet-table-wrapper th { text-align: left; color: #22d3ee; padding: 8px; text-transform: uppercase; font-size: 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.fleet-table-wrapper td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.85rem; }
.fleet-table-wrapper tr:hover td { background: rgba(255,255,255,0.05); }
.fleet-table-wrapper a { color: white; }
.fleet-table-wrapper .ownattack { color:  oklch(63.7% 0.237 25.331);}
.fleet-table-wrapper .attack { color: oklch(50.5% 0.213 27.518); }
.fleet-table-wrapper .ownespionage { color: oklch(79.5% 0.184 86.047); }
.fleet-table-wrapper .espionage { color: oklch(68.1% 0.162 75.834); }
.fleet-table-wrapper .owntransport { color: #22c55e; }
.fleet-table-wrapper .ownmissile { color: oklch(64.6% 0.222 41.116); }
.fleet-table-wrapper .missile { color: oklch(70.5% 0.213 47.604); }
.fleet-table-wrapper .owndestroy { color: oklch(88.5% 0.062 18.334); }
.fleet-table-wrapper .destroy { color: oklch(70.4% 0.191 22.216); }

/* Evitar conflictos con tooltips antiguos */
.tip {
    z-index: 3000 !important; /* Asegurar que los tooltips se vean sobre la barra */
}

.tooltip, .tooltip_sticky {
    cursor: pointer;
}

#tooltip{
    color:#05c3f1;
    background: rgba(0,0,0,0.80);
    text-align: center;
    display:none;
    border-radius: 5px; 
    z-index:1000;
    width: auto;
    max-width: 500px;
}

.tip {
    display:none;
    padding:7px;
    position:absolute;
    z-index:1000;
    max-width: 500px;
}


/* Asegurar que los inputs no rompan el diseño */
input, select, textarea {
    font-family: 'Rajdhani', sans-serif;
}


 

/* Colores por recurso */
.res-metal .res-name { color: #a5a5a5; }
.res-metal .rn-block-count { color: #a5a5a5; }
.res-metal .res-progress-fill-storage { background: #a5a5a5; color: #a5a5a5; }

.res-crystal .res-name { color: #a0c4ff; }
.res-crystal .rn-block-count { color: #a0c4ff; }
.res-crystal .res-progress-fill-storage { background: #3b82f6; color: #3b82f6; }

.res-deuterium .res-name { color: #4ade80; }
.res-deuterium .rn-block-count { color: #4ade80; }
.res-deuterium .res-progress-fill-storage { background: #22c55e; color: #22c55e; }

.res-energy .res-name { color: #facc15; }
.res-energy .rn-block-count { color: #facc15; }
.res-energy .res-progress-fill-storage { background: #eab308; color: #eab308; }

.res-darkmatter .res-name { color: #d8b4fe; }
.res-darkmatter .rn-block-count { color: #d8b4fe; }


.c-901 { color: #a5a5a5 !important; }
.c-902 { color: #a0c4ff !important; }
.c-903 { color: #4ade80 !important; }
.c-911 { color: #facc15 !important; }
.c-921 { color: #d8b4fe !important; }
/* Oficiales */
.rn-block-officer {
    min-width: auto;
    padding: 0;
    gap: 0;
    align-items: center;
    flex-direction: column;
    justify-content: center;
}

.rn-block-officer .rn-block-img {
    width: 28px;
    height: 28px;
    margin: 0;
    filter: grayscale(0.3) drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    transition: all 0.3s;
}

.rn-block-officer:hover .rn-block-img {
    filter: grayscale(0) drop-shadow(0 0 8px rgba(255,255,255,0.4));
    transform: scale(1.1);
}

.rn-block-officer .rn-block-count {
    font-size: 10px;
    margin-top: 2px;
    color: #aaa;
}

/* 3. RESPONSIVE */
.hamburger { display: none; font-size: 18px; color: #22d3ee; cursor: pointer; }
#toggle-menu { display: none; }

/* 3. RESPONSIVE */
.hamburger1 { display: none; font-size: 18px; color: #22d3ee; cursor: pointer; }
#toggle-menu1 { display: none; }


 /* --- BUILDING Page Layout --- */
.page-content {
    background: rgba(20, 20, 30, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

#buildings-page {
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.page-header-shop {
    /* display: flex; */
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.page-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.6);
    margin: 0;
    background: linear-gradient(to right, #fff, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.queue-status a {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #22d3ee;
    text-decoration: none;
    background: rgba(34, 211, 238, 0.1);
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid rgba(34, 211, 238, 0.3);
    transition: all 0.3s ease;
}

.queue-status a:hover {
    background: rgba(34, 211, 238, 0.2);
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.3);
}

/* --- Grid System --- */
.buildings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    width: 100%;
}

/* --- Glassmorphism Card --- */
.building-card {
    position: relative;
    background: rgba(15, 20, 30, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.building-card:hover {
    transform: translateY(-5px);
    border-color: rgba(34, 211, 238, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(34, 211, 238, 0.1);
}

.building-card.locked {
    filter: grayscale(0.8);
    opacity: 0.8;
}

.building-card.locked:hover {
    filter: grayscale(0.5);
    opacity: 1;
}

/* --- Card Header --- */
.card-header {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-level {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    color: #22d3ee;
    background: rgba(34, 211, 238, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.info-btn {
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}
.info-btn:hover { color: #fff; }

/* --- Visual Area --- */
.card-visual {
    position: relative;
    height: 140px;
    width: 100%;
    overflow: hidden;
}

.building-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.building-card:hover .building-img {
    transform: scale(1.1);
}

/* Overlay Actions (Destroy) */
.card-actions-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
}

.action-icon {
    width: 30px;
    height: 30px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    cursor: pointer;
    transition: all 0.2s;
}
.action-icon:hover {
    background: #ef4444;
    color: #fff;
}

/* --- Content Body --- */
.card-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0, 0, 0, 0.1);
}

/* Requirements */
.requirements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 5px;
    margin-bottom: 10px;
}
.req-item {
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 2px;
    text-align: center;
    background: rgba(0,0,0,0.3);
}
.req-item img {
    width: 30px;
    height: 30px;
    display: block;
    margin: 0 auto;
}
.req-status {
    font-size: 0.7rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
}
.req-ok { color: #4ade80; }
.req-bad { color: #ef4444; }

/* Prices */
.price-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.price-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.05);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.05);
}
.res-icon {
    width: 16px;
    height: 16px;
    background-size: cover;
}
.price-val {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    color: #ccc;
    font-size: 0.9rem;
}
.price-val.no-res { color: #ef4444; }
.i-901{background-image:url(../../img/game/resources/metal.png);}
.i-902{background-image:url(../../img/game/resources/crystal.png);}
.i-903{background-image:url(../../img/game/resources/deuterium.png);}
.i-911{background-image:url(../../img/game/resources/energy.png);}
.i-921{background-image:url(../../img/game/resources/dark_matter.png);}
.i-922{background-image:url(../../img/game/resources/922.png);}
.i-924{background-image:url(../../img/game/resources/924.png);}

/* Construction Mode */
.construction-active {
    padding: 10px;
    background: rgba(34, 211, 238, 0.05);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 8px;
    text-align: center;
}
.progress-container {
    height: 6px;
    background: rgba(0,0,0,0.5);
    border-radius: 3px;
    margin: 8px 0;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #22d3ee, #e879f9);
    width: 0%;
    transition: width 1s linear;
}

.ui-progressbar-value{
    position:absolute;
    height: 10px !important;
    border:1px solid #00699c;
    background: #62cbff;
    line-height:17px;
    z-index:1;
    padding:0;
    margin:0;
    bottom: 0;
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
    border-radius: 2px;
}

.timer {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: #fff;
}

/* --- Footer Buttons --- */
.card-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}

.btn-modern {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-build {
    background: linear-gradient(45deg, #22d3ee, #0ea5e9);
    color: #000;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.3);
}
.btn-build:hover {
    box-shadow: 0 0 25px rgba(34, 211, 238, 0.5);
    transform: scale(1.02);
}

.btn-research {
    background: linear-gradient(45deg, #e879f9, #d946ef);
    color: #fff;
    box-shadow: 0 0 15px rgba(232, 121, 249, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.btn-research:hover {
    box-shadow: 0 0 25px rgba(232, 121, 249, 0.5);
    transform: scale(1.02);
}

.btn-disabled {
    background: rgba(255,255,255,0.1);
    color: #666;
    cursor: not-allowed;
}

.btn-cancel {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-cancel:hover {
    background: rgba(239, 68, 68, 0.4);
    color: #fff;
}

.btn-finish {
    background: rgba(232, 121, 249, 0.2);
    color: #e879f9;
    border: 1px solid rgba(232, 121, 249, 0.3);
    margin-top: 8px;
}
.btn-finish:hover {
    background: rgba(232, 121, 249, 0.4);
    color: #fff;
}

.build-duration {
    text-align: center;
    margin-bottom: 5px;
    font-family: 'Rajdhani', sans-serif;
    color: #888;
    font-size: 0.9rem;
}


/* --- RESEARCHS Page Layout --- */
#research-page {
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.page-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(232, 121, 249, 0.6); /* Purple glow for research */
    margin: 0;
    background: linear-gradient(to right, #fff, #e879f9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lab-alert {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/* --- Grid System --- */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    width: 100%;
}


/* Research Mode (Active) */
.research-active {
    padding: 10px;
    background: rgba(232, 121, 249, 0.05);
    border: 1px solid rgba(232, 121, 249, 0.2);
    border-radius: 8px;
    text-align: center;
}

.tech-duration {
    text-align: center;
    margin-bottom: 5px;
    font-family: 'Rajdhani', sans-serif;
    color: #888;
    font-size: 0.9rem;
}



/* --- Page DEFENSE Layout --- */
#defenses-page {
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.page-header, .page-header-shop h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.6); /* Red glow for combat */
    margin: 0;
    background: linear-gradient(to right, #fff, #ef4444, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Grid System --- */
.defenses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 10px;
    width: 100%;
}

/* --- Glassmorphism Card --- */
.def-card {
    position: relative;
    background: rgba(15, 20, 30, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.def-card:hover {
    transform: translateY(-5px);
    border-color: rgba(249, 115, 22, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(249, 115, 22, 0.1);
}

.def-card.locked {
    filter: grayscale(0.8);
    opacity: 0.8;
}

.def-card.locked:hover {
    filter: grayscale(0.5);
    opacity: 1;
}

.def-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.def-card:hover .def-img {
    transform: scale(1.1);
}

.btn-def {
    background: linear-gradient(45deg, #ef4444, #f97316);
    color: #fff;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.btn-def:hover {
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.5);
    transform: scale(1.02);
}

 .def-duration {
    text-align: center;
    margin-bottom: 10px;
    font-family: 'Rajdhani', sans-serif;
    color: #888;
    font-size: 0.9rem;
}

/* --- Page MISTIC Layout --- */
#mistic-page {
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* --- Grid System --- */
.mistic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    width: 100%;
}

/* --- Glassmorphism Card --- */
.mistic-card {
    position: relative;
    background: rgba(20, 10, 20, 0.6); /* Slightly purple/dark background */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.mistic-card:hover {
    transform: translateY(-5px);
    border-color: rgba(236, 72, 153, 0.4);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(236, 72, 153, 0.2);
}

.mistic-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Contain ensures the full artifact/icon is seen */
    object-position: center;
    transition: transform 0.5s ease;
    padding: 10px;
}

.mistic-card:hover .mistic-img {
    transform: scale(1.1) rotate(2deg);
}

.btn-mistic {
    background: linear-gradient(45deg, #ec4899, #db2777);
    color: #fff;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.btn-mistic:hover {
    box-shadow: 0 0 25px rgba(236, 72, 153, 0.6);
    transform: scale(1.02);
    background: linear-gradient(45deg, #f472b6, #e11d48);
}


@media (max-width: 1024px) {
    /*.main_list_left, .main_list_right { display: none; }*/
    .hamburger { display: block; }
    
    /*.n-d-n { display: flex !important; width: 100%; justify-content: space-between; align-items: center; }*/
    /*.d-n { display: none !important; }*/

    #leftmenu-container { top: 35px; left: -300px; }
    #toggle-menu:checked ~ #leftmenu-container { left: 0; }
    
    .rn-block { min-width: auto; flex-shrink: 0; }
    .res-container, .officers-container { border: none; padding: 0; margin: 0; }
    .res-name { display: none; }
    .res-bar-container { display: none; } /* Ocultar barra en móvil para espacio */
    .rn-block-img { width: 24px; height: 24px; }
    
    /* Cuando el checkbox toggle-menu está activo */
    #toggle-menu:checked ~ #leftmenu {
        transform: translateX(240px);
    }
}


@media (min-width: 1025px) and (max-width: 1775px) {
    .hamburger { display: block; }
    #leftmenu-container { top: 35px; left: -300px; }
    #toggle-menu:checked ~ #leftmenu-container { left: 0; }
    #toggle-menu:checked ~ #leftmenu {
        transform: translateX(295px);
    }
}


@keyframes pulse-alert {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* BOTONES DE PESTAÑAS */
.menu-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 3px;
    border-radius: 8px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #888;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    padding: 8px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: rgba(34, 211, 238, 0.15);
    color: #22d3ee;
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.1);
}

/* CONTENIDO DEL MENÚ (GRID) */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: auto; /* Empuja el footer hacia abajo */
    padding-bottom: 10px;
}

.menu-item {
    background: rgba(10, 15, 30, 0.6);
    border: 1px solid rgba(34, 211, 238, 0.1);
    border-radius: 6px;
    height: 32px; /* Botones más finos */
    display: flex;
    flex-direction: row; /* Icono al lado del texto */
    align-items: center;
    justify-content: flex-start; /* Alineado a la izquierda para mejor lectura */
    padding-left: 10px;
    text-decoration: none !important;
    color: #a0a0a0; /* Color unificado para ambos menús (MC.1 y MODS) */
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    gap: 8px; /* Espacio entre icono y texto */
}

.menu-item i {
    font-size: 14px;
    color: #555;
    transition: all 0.3s;
    width: 16px; /* Ancho fijo para alinear iconos */
    text-align: center;
}

.menu-item:hover {
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.15), rgba(10, 15, 30, 0.8));
    border-color: rgba(34, 211, 238, 0.5);
    color: #ffffff;
    text-shadow: 0 0 5px #22d3ee, 0 0 10px #22d3ee; /* Efecto neón intenso al hover */
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.menu-item:hover i {
    color: #22d3ee;
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.8)); /* Glow también para el icono */
}

/* Estilo especial para item activo si fuera necesario */
.menu-item.active {
    background: rgba(34, 211, 238, 0.1);
    border-color: #22d3ee;
    color: #22d3ee;
}


.menu-item span {
    z-index: 1;
}

.menu-item.showme {
    display: none;
}

/* BOTONES INFERIORES */
.bottom-menu {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bottom-btn {
    width: 100%;
    padding: 3px 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: #ccc;
    font-family: 'Rajdhani', sans-serif;
    font-size: 10px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 24px;
}

.bottom-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-donate {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
}
.btn-donate:hover {
    background: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.btn-admin {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* FOOTER DEL MENÚ */
.menu-footer {
    margin-top: 15px;
    text-align: center;
    font-size: 10px;
    color: #555;
    font-family: 'Orbitron', sans-serif;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
}

.server-time {
    color: #22d3ee;
    font-weight: bold;
    margin-bottom: 3px;
    display: block;
}

/* OCULTAR/MOSTRAR TABS */
.tab-content {
    display: none;
}

.inactive {
    display: none;
}

.tab-content.active-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.active-tab {
    background: rgba(34, 211, 238, 0.15);
    color: #22d3ee;
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.1);
}

.active-tab:hover {
    background: rgba(34, 211, 238, 0.25);
    color: #22d3ee;
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.3);
}

.inactive-tab {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}



/*-- ESTILOS PÁGINA LOGOUT - ULTROM MODERN */
#logout-page {
    position: fixed; /* Fijar a la pantalla completa para centrado perfecto */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000; /* Por encima de todo */
    padding: 20px; /* Espacio seguro en móviles */
    box-sizing: border-box;
}

.logout-card {
    background: rgba(5, 8, 15, 0.75); /* Un poco más oscuro para legibilidad */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(34, 211, 238, 0.15);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 
                inset 0 0 20px rgba(34, 211, 238, 0.05);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* RESPONSIVE PARA MÓVILES */
@media (max-width: 480px) {

    .main_list_left, .main_list_right { display: none; }
    .n-d-n { display: flex !important; width: 100%; justify-content: space-between; align-items: center; }
    .d-n { display: none !important; }

    .building-card {
        flex-direction: column;
    }
    .card-visual {
        width: 100%;
        height: 120px;
    }
    .card-header {
        width: 100%;
    }

    .tech-card {
        flex-direction: column;
    }

     .ship-card {
        flex-direction: column;
    }

    .def-card {
        flex-direction: column;
    }

    .officer-card {
        flex-direction: column;
    }

    .mistic-card {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .logout-card {
        padding: 30px 20px;
        max-width: 90%; /* Ocupar más ancho en móviles */
    }

    .icon-wrapper {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }

    .icon-wrapper i {
        font-size: 24px;
    }

    h1.logout-title {
        font-size: 18px;
        letter-spacing: 1px;
    }

    p.logout-message {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .countdown-number {
        font-size: 24px;
    }

    /*Building*/
    .buildings-grid {
        grid-template-columns: 1fr; 
    }
    .building-card {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .card-visual {
        width: 100px;
        height: 100px;
        flex-shrink: 0;
    }
    .card-header {
        width: calc(100% - 100px);
        border-bottom: none;
        padding: 10px;
    }
    .card-content {
        width: 100%;
        padding: 10px;
    }
    .card-footer {
        width: 100%;
    }

    /*RESEARCH*/
    .research-grid {
        grid-template-columns: 1fr; 
    }
    .tech-card {
        flex-direction: row;
        flex-wrap: wrap;
    }

    /*SHIPS*/

    .shipyard-grid {
        grid-template-columns: 1fr; 
    }
    .ship-card {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .construction-controls {
        width: 100%;
    }

    /*DEFENSE*/
    .defenses-grid {
        grid-template-columns: 1fr; 
    }
    .def-card {
        flex-direction: row;
        flex-wrap: wrap;
    }

    /*OFFICIER*/
    .tab-content-officier.active {
        grid-template-columns: 1fr; 
    }
    .officer-card {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 10px 15px;
        min-width: auto;
        flex: 1;
        font-size: 0.8rem;
    }

    /*MISTIC*/

    .mistic-grid {
        grid-template-columns: 1fr; 
    }
    .mistic-card {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .menu-item.showme {
        display: flex;
    }

}

/* Efecto de brillo superior */
.logout-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #22d3ee, transparent);
    opacity: 0.8;
}

.icon-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(34, 211, 238, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    border: 1px solid rgba(34, 211, 238, 0.3);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
}

.icon-wrapper i {
    font-size: 32px;
    color: #22d3ee;
    animation: pulse-icon 2s infinite;
}

h1.logout-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px; /* Reducido ligeramente */
    line-height: 1.5; /* Aumentado para evitar solapamiento */
    color: #fff;
    margin: 0 0 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
    display: block; /* Asegurar comportamiento de bloque */
    width: 100%;
}

p.logout-message {
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    color: #aaa;
    margin: 0 0 30px;
    line-height: 1.5;
}

.redirect-box {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.redirect-text {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    color: #22d3ee;
    margin-bottom: 5px;
    display: block;
}

.countdown-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    font-weight: bold;
    color: #fff;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(34, 211, 238, 0.05));
    border: 1px solid rgba(34, 211, 238, 0.4);
    color: #22d3ee;
    padding: 12px 30px;
    border-radius: 30px;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-home:hover {
    background: #22d3ee;
    color: #000;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.6);
    transform: translateY(-2px);
}

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

@keyframes pulse-icon {
    0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(34, 211, 238, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}

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

.progress-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        #22d3ee 0% var(--progress),
        rgba(255, 255, 255, 0.1) var(--progress) 100%
    );
    mask: radial-gradient(transparent 65%, black 66%);
    -webkit-mask: radial-gradient(transparent 65%, black 66%);
    z-index: 1;
}

/* Para navegadores que no soportan conic-gradient */
@supports not (background: conic-gradient(#000, #fff)) {
    .progress-ring::before {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        border: 8px solid #4ade80;
        border-left-color: transparent;
        border-bottom-color: transparent;
        transform: rotate(calc(3.6deg * var(--progress-percent, 0)));
        clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 0 100%, 0 50%);
    }
}


/* ================================
   OVERVIEW - NEWS TICKER ALIGNMENT
   Makes the "noticias" bar match the same width as the overview cards container.
   ================================ */
#overview-news-ticker{
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    width: calc(100% - 16px);  /* ~ left-2/right-2 */
    max-width: 1200px;         /* match overview container width */
}

@media (min-width: 768px){
  #overview-news-ticker{
      width: calc(100% - 32px); /* ~ md:left-4/right-4 */
      bottom: 16px;             /* keep same as md:bottom-4 */
  }
}

