html,
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    background: black;
}

/* CANVAS */
#gameCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* UI */
.ui {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Permitir interacción en panel derecho */
#bottomRight,
#bottomRight *,
#infoModal,
#infoModal * {
    pointer-events: auto;
}

.panel {
    position: absolute;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px;
    font-family: Arial;
    border: 1px solid #444;
}

/* POSICIONES */
#topLeft {
    top: 10px;
    left: 10px;
    width: 500px;
    height: 100px;
}

#bottomLeft {
    bottom: 10px;
    left: 10px;
    width: 590px;
    height: 25px;
}

#topBannerRight {
    position: absolute;
    right: 15px;
    top: 8px;
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 10005;
    pointer-events: auto;
}

/* RELOJ EN BARRA SUPERIOR */
#userClock {
    margin-right: 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    font-family: monospace;
    line-height: 1.2;
    cursor: help;
    pointer-events: auto;
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.2s ease;
}

#userClock:hover {
    transform: scale(1.1);
    filter: brightness(1.25);
}

#clockTime {
    font-size: 15px;
    font-weight: bold;
    color: #ffffff;
}

#clockCountdown {
    font-size: 12px;
    color: #2ecc71;
    font-weight: bold;
}

#configBtn,
#logoutBtn {
    background: #2b7dc0;
    color: white;
    border: none;
    width: 105px;
    height: 29px;
    line-height: 29px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    box-sizing: border-box;
    padding: 0;
    vertical-align: middle;
}

#configBtn:hover,
#logoutBtn:hover {
    background: #3a74a3;
}

/* PANEL DERECHO */
#bottomRight {
    top: 60px; /* Posicionar justo debajo del banner superior */
    bottom: 10px;
    right: 10px;
    width: 250px;
    font-size: 16px;
    padding: 14px;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-sizing: border-box; /* Asegurar cálculo correcto de dimensiones */
    overflow: visible !important; /* Permitir que el botón colapsador flote hacia afuera */
}

/* Panel del usuario interno scrollable */
.userPanel {
    height: 100%;
    overflow-y: auto;
    padding-right: 4px;
    box-sizing: border-box;
}

/* Scrollbar premium para el panel de usuario */
.userPanel::-webkit-scrollbar {
    width: 6px;
}
.userPanel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
.userPanel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}
.userPanel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

#bottomRight.collapsed {
    right: -250px;
}

/* BOTÓN DE COLAPSAR/EXPANDIR */
.toggle-sidebar-btn {
    position: absolute;
    left: -32px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 64px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid #444;
    border-right: none;
    border-radius: 8px 0 0 8px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, color 0.3s;
    outline: none;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    padding: 0;
    z-index: 1001;
}

.toggle-sidebar-btn:hover {
    background: rgb(0, 62, 119);
    color: #3498db;
}

.toggle-sidebar-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#bottomRight.collapsed .toggle-sidebar-btn svg {
    transform: rotate(180deg);
}

/* USUARIO */
.userHeaderCenter {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.userHeaderCenter img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.userHeaderCenter img:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

.userName {
    font-weight: bold;
}

.userLevel {
    font-size: 12px;
    color: #aaa;
}

/* STATS */
.stat {
    margin: 6px 0;
}

.userPanel.actions-maxed .stat[data-type="vida"],
.userPanel.actions-maxed .stat[data-type="energia"],
.userPanel.actions-maxed .stat[data-type="alimentacion"],
.userPanel.actions-maxed .stat[data-type="sueño"],
.userPanel.actions-maxed .stat[data-type="social"] {
    opacity: 0.5;
    filter: grayscale(100%);
    cursor: not-allowed;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.fill {
    height: 100%;
}

.life {
    width: 85%;
    background: #2ecc71;
}

.energy {
    width: 60%;
    background: #3498db;
}

.food {
    width: 45%;
    background: #f1c40f;
}

.sleep {
    width: 50%;
    background: #3f51b5;
}

.social {
    width: 30%;
    background: #9b59b6;
}

/* INVENTARIO */
.inventory {
    margin-top: 10px;
}

/* DINERO */
.money {
    margin-top: 10px;
    text-align: center;
    font-weight: bold;
}

/* MENU DE CONSTRUCCION PREMIUM */
#menu {
    position: absolute;
    display: none;
    background: rgba(18, 22, 33, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px;
    min-width: 380px;
    max-width: 460px;
    z-index: 10000;
    pointer-events: auto;
    font-family: Arial, sans-serif;
}

.construccion-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.construccion-menu-header h4 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.close-menu-btn {
    cursor: pointer;
    color: #aaa;
    font-size: 20px;
    font-weight: bold;
    transition: color 0.2s;
    line-height: 1;
}

.close-menu-btn:hover {
    color: #f39c12;
}

.construccion-menu-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Custom Scrollbar for list */
.construccion-menu-list::-webkit-scrollbar {
    width: 6px;
}

.construccion-menu-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.construccion-menu-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.construccion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}

.construccion-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(243, 156, 18, 0.5);
    transform: translateX(2px);
}

.construccion-name {
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.construccion-receta {
    color: #eee;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* TOOLTIP */
#tooltip {
    position: fixed;
    display: none;
    background: rgba(0, 0, 0, 0.9);
    color: white;

    padding: 10px 14px;
    /* 👈 más grande */
    font-size: 20px;
    /* 👈 letra más grande */

    max-width: 220px;
    /* 👈 evita que sea muy ancho */
    border-radius: 6px;

    z-index: 9999;
    pointer-events: none;
}

.uiButton {
    width: 100%;
    margin-top: 6px;
    padding: 8px;
    cursor: pointer;
    font-size: 16px;
}

#userAvatar {
    cursor: pointer;
}

#infoModal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
}

#infoModalContent {
    position: relative;
    width: 500px;
    max-width: 90%;
    background: #222;
    color: white;
    padding: 25px 20px;
    border: 1px solid #555;
    border-radius: 8px;
}

#modalTitle {
    margin-top: 0;
    margin-bottom: 20px;
    padding-right: 35px;
    /* Evita que el título se encime con la X */
    font-size: 22px;
}

.close-modal-btn {
    position: absolute;
    top: 12px;
    right: 18px;
    cursor: pointer;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
    z-index: 1000;
}

.close-modal-btn:hover {
    color: #f39c12;
    transform: scale(1.1);
}

.uiButton {
    width: 100%;
    margin-top: 6px;
    padding: 8px;
    cursor: pointer;
    font-size: 16px;
    background: #333;
    color: white;
    border: 1px solid #666;
}

.uiButton:hover {
    background: #555;
}

.bankButtons {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.bankButtons .uiButton {
    flex: 1;
    padding: 6px;
    font-size: 16px;
}

.top-left-container {
    position: absolute;
    top: 55px;
    left: 15px;
    width: 440px;
    /* 400px width + 40px padding of #topLeft */
    z-index: 1000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#topLeft {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    width: 400px;
    height: 75px;
    /* collapsed height */
    padding: 15px 20px;

    background: rgba(0, 0, 0, 0.6);

    border: 2px solid rgba(255, 255, 255, 0.15);

    border-radius: 12px;

    box-shadow:
        0 0 15px rgba(0, 0, 0, 0.05),
        inset 0 0 10px rgba(255, 255, 255, 0.05);

    color: white;

    text-align: left;
    pointer-events: auto;
    overflow: hidden;
    transition: height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.3s, border-color 0.3s;
}

#topLeft:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow:
        0 0 15px rgba(0, 0, 0, 0.05),
        inset 0 0 10px rgba(255, 255, 255, 0.05);
}

#topLeft.expanded {
    height: 260px;
    /* expanded height */
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* TOGGLE BUTTON AT THE BOTTOM */
.toggle-topleft-btn {
    pointer-events: auto;
    width: 64px;
    height: 22px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid #444;
    border-top: none;
    border-radius: 0 0 8px 8px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
    outline: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    padding: 0;
    margin-top: -2px;
    /* seamless join */
    z-index: 1001;
}

.toggle-topleft-btn:hover {
    background: rgb(0, 62, 119);
    color: #3498db;
    border-color: rgba(52, 152, 219, 0.5);
}

.toggle-topleft-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.toggle-topleft-btn.expanded svg {
    transform: rotate(180deg);
}

/* ZONE DESCRIPTION CONTENT */
.zone-description-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
    margin-top: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#topLeft.expanded .zone-description-content {
    opacity: 1;
}

#zoneDescriptionText {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #cbd5e1;
}

.zone-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.zone-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.zone-stat-label {
    color: #94a3b8;
    font-weight: 500;
}

.zone-stat-val {
    color: #f8fafc;
    font-weight: bold;
}

/* TITULO PRINCIPAL */

.zoneTitle {
    font-size: 25px;
    font-weight: 900;


    color: #ffffff;

    text-transform: uppercase;


}

/* SUBTITULO */

.zoneSubtitle {
    margin-top: 1px;

    font-size: 15px;

    color: #ffffff;

    text-transform: uppercase;


}

/* LOTES */

.zoneLots {
    margin-top: 1px;

    display: inline-block;

    padding: 2px 6px;



    border: 1px solid rgba(16, 17, 17, 0.4);

    border-radius: 20px;

    color: #f4f8f8;

    font-size: 14px;

    font-weight: bold;
}

/* DATA DERECHA ARRIBA*/

.zoneTitleRight {
    font-size: 25px;
    font-weight: 900;


    color: #ffffff;

    text-transform: uppercase;


}

/* SUBTITULO */

.zoneSubtitleRight {
    margin-top: 1px;

    font-size: 15px;

    color: #ffffff;

    text-transform: uppercase;


}

.zoneTitle {
    font-size: 25px;
    font-weight: 900;
    text-transform: uppercase;

    margin: 5px;
    /* 👈 importante */
    line-height: 1;
    /* 👈 reduce espacio vertical */
}

.zoneSubtitle {
    margin-top: 3;
    margin-bottom: 3;
    font-size: 20px;
    text-transform: uppercase;

    line-height: 1;
}

.zoneLots {
    margin-top: 0;
    padding: 5px 6px;
    font-size: 14px;
    font-weight: bold;

    line-height: 1;
}

/* =========================
   BARRA SUPERIOR LOGO
========================= */

/* =========================
   BARRA SUPERIOR LOGO
========================= */

#topBanner {
    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 45px;

    background: rgb(0, 62, 119);

    /* BORDE INFERIOR DELGADO */
    border-bottom: 8px solid rgb(49, 101, 147);

    box-shadow:
        0 6px 30px rgba(0, 0, 0, 0.9);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 9999;
}

#gameLogo {
    height: 270px;
    width: auto;

    transform: translateY(30px);

    z-index: 10000;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease;
    cursor: pointer;
}

#gameLogo:hover {
    transform: translateY(22px) scale(1.1);
    filter: drop-shadow(0 0 25px rgba(243, 156, 18, 0.85)) brightness(1.2);
}

/* ==================================
   MODAL ANCHO Y DISEÑO DE MERCADO
================================== */
#infoModalContent {
    max-height: 85vh;
    overflow-y: auto;
}

#infoModalContent.modal-wide {
    width: 800px;
    max-width: 95%;
}

.mercado-wrapper {
    font-family: Arial, sans-serif;
    color: white;
}

.mercado-desc {
    background: rgba(156, 39, 176, 0.08);
    border-left: 4px solid rgb(156, 39, 176);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    color: #ddd;
    border-radius: 4px;
    text-align: left;
}

.mercado-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    text-align: left;
}

@media (max-width: 768px) {
    .mercado-grid {
        grid-template-columns: 1fr;
    }
}

.mercado-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mercado-col-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: bold;
    border-bottom: 2px solid #333;
    padding-bottom: 8px;
}

.title-oferta {
    color: #3498db;
}

.title-demanda {
    color: #2ecc71;
}

.mercado-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
}

.mercado-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: #555;
    transform: translateY(-2px);
}

.mercado-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mercado-item-name {
    font-size: 15px;
    font-weight: bold;
    color: #fff;
}

.mercado-item-qty {
    font-size: 12px;
    color: #aaa;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.mercado-item-desc {
    font-size: 12px;
    color: #bbb;
    line-height: 1.4;
}

.mercado-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.mercado-item-price {
    font-size: 14px;
    font-weight: bold;
    color: #f1c40f;
}

.price-vender {
    color: #2ecc71;
}

.mercado-btn {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: white;
}

.btn-comprar {
    background: #2980b9;
}

.btn-comprar:hover:not(:disabled) {
    background: #3498db;
}

.btn-vender {
    background: #27ae60;
}

.btn-vender:hover:not(:disabled) {
    background: #2ecc71;
}

.mercado-btn:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    opacity: 0.5;
}

.mercado-footer-balance {
    margin-top: 24px;
    border-top: 1px solid #333;
    padding-top: 15px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
}

.saldo-destacado {
    color: #f1c40f;
    font-size: 19px;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
}

/* ==================================
   DISEÑO DE INVENTARIO PREMIUM
   ================================== */
.inventario-desc {
    background: rgba(41, 128, 185, 0.08);
    border-left: 4px solid rgb(41, 128, 185);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    color: #ddd;
    border-radius: 4px;
    text-align: left;
}

.inventario-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    text-align: left;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .inventario-grid {
        grid-template-columns: 1fr;
    }
}

.inventario-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
}

.inventario-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: #555;
    transform: translateY(-1px);
}

/* ==================================
   BARRA DE HERRAMIENTAS DEL EDITOR (DEVELOPER)
   ================================== */
.editor-toolbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 15px 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.05);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    font-family: 'Outfit', sans-serif;
    color: white;
}

.editor-title {
    font-weight: bold;
    font-size: 16px;
    letter-spacing: 1px;
    color: #ffeb3b;
    text-shadow: 0 0 10px rgba(255, 235, 95, 0.3);
}

.editor-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.editor-select {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: bold;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.8);
    outline: none;
    font-family: 'Outfit', sans-serif;
    transition: border-color 0.2s, background-color 0.2s;
}

.editor-select:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(15, 23, 42, 0.95);
}

.editor-select option {
    background: #0f172a;
    color: white;
}

.editor-btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: bold;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
}

.editor-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.editor-btn:active:not(:disabled) {
    transform: translateY(0);
}

.editor-btn.add-lote {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.4);
}

.editor-btn.add-lote:hover {
    background: rgba(76, 175, 80, 0.4);
}

.editor-btn.add-farmeo {
    background: rgba(33, 150, 243, 0.2);
    border-color: rgba(33, 150, 243, 0.4);
}

.editor-btn.add-farmeo:hover {
    background: rgba(33, 150, 243, 0.4);
}

.editor-btn.add-mercado {
    background: rgba(156, 39, 176, 0.2);
    border-color: rgba(156, 39, 176, 0.4);
}

.editor-btn.add-mercado:hover {
    background: rgba(156, 39, 176, 0.4);
}

.editor-btn.add-portal {
    background: rgba(255, 152, 0, 0.2);
    border-color: rgba(255, 152, 0, 0.4);
}

.editor-btn.add-portal:hover {
    background: rgba(255, 152, 0, 0.4);
}

.editor-btn.delete-btn {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.4);
}

.editor-btn.delete-btn:hover:not(:disabled) {
    background: rgba(244, 67, 54, 0.5);
    border-color: rgba(244, 67, 54, 0.8);
}

.editor-btn.delete-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.editor-btn.export-btn {
    background: rgba(156, 39, 176, 0.3);
    border-color: rgba(156, 39, 176, 0.6);
}

.editor-btn.export-btn:hover {
    background: rgba(156, 39, 176, 0.6);
}

.editor-btn.save-btn {
    background: rgba(0, 150, 136, 0.3);
    border-color: rgba(0, 150, 136, 0.6);
}

.editor-btn.save-btn:hover {
    background: rgba(0, 150, 136, 0.6);
}

.editor-btn.reset-btn {
    background: rgba(230, 81, 0, 0.3);
    border-color: rgba(230, 81, 0, 0.6);
}

.editor-btn.reset-btn:hover {
    background: rgba(230, 81, 0, 0.6);
}

.editor-status {
    font-size: 11px;
    color: #cbd5e1;
    text-align: center;
    max-width: 450px;
}

/* Modal text area for exporter */
.export-textarea {
    width: 96%;
    height: 250px;
    background: #111;
    color: #4af50e;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    padding: 10px;
    border: 1px solid #444;
    border-radius: 4px;
    resize: vertical;
    margin-bottom: 12px;
}

.export-copy-btn {
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.export-copy-btn:hover {
    background: #2980b9;
}

/* ==================================
   DISEÑO VENTANA CONFIGURACIÓN
   ================================== */
.config-wrapper {
    font-family: Arial, sans-serif;
    color: white;
    text-align: left;
}

.config-section-title {
    font-size: 16px;
    font-weight: bold;
    color: #3498db;
    border-bottom: 1px solid #444;
    padding-bottom: 6px;
    margin: 20px 0 12px 0;
}

.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .config-grid {
        grid-template-columns: 1fr;
    }
}

.config-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s, background-color 0.2s;
}

.config-card:hover {
    border-color: rgba(52, 152, 219, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.config-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.config-name {
    font-weight: bold;
    font-size: 14px;
    color: #fff;
}

.config-desc {
    font-size: 11px;
    color: #aaa;
}

/* Switch / Toggle Premium */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #2ecc71;
}

input:checked+.slider:before {
    transform: translateX(24px);
}

/* Botón Fullscreen */
.config-btn-action {
    background: #34495e;
    color: white;
    border: 1px solid #555;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: background 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-btn-action:hover {
    background: #2ecc71;
    border-color: #2ecc71;
}

/* Help Section & Shortcuts */
.help-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.help-shortcut-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    font-size: 13px;
}

.help-shortcut-row:last-child {
    border-bottom: none;
}

.key-badge {
    background: #444;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    border-bottom: 2px solid #222;
}

.game-rule-card {
    background: rgba(52, 152, 219, 0.05);
    border-left: 4px solid #3498db;
    padding: 10px 12px;
    border-radius: 0 6px 6px 0;
    font-size: 12px;
    line-height: 1.5;
    color: #ddd;
    margin-bottom: 10px;
}

/* Fin de archivo limpio de errores */

/* ==================================
   PÁGINA DE LOGIN (MODERNA Y PREMIUM - MIXTA)
   ================================== */
body.login-page-body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, rgba(10, 15, 30, 0.45) 0%, rgba(2, 6, 12, 0.8) 100%), url('login_background.png') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-y: auto;
    color: #f8fafc;
}

.login-wrapper {
    display: flex;
    flex-direction: column; /* Cambiado a columna para apilado vertical */
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 900px; /* Incrementado para dar más espacio a las fuentes y tarjetas */
    padding: 20px;
    box-sizing: border-box;
    z-index: 10;
    margin-top: -40px; /* Mueve todo hacia arriba para evitar recortes en pantallas bajas */
}

.login-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    align-items: center;
}

/* Sección de Branding Superior (Logo, Título y Descripción Centrados) */
.login-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 15px; /* Reducido de 30px para juntar más las tarjetas */
    width: 100%;
}

.login-logo {
    max-width: 380px; /* Logo aún más grande */
    height: auto;
    margin-bottom: -80px; /* Margen negativo aumentado para juntar más el anuncio con el logo */
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
    animation: floatLogo 6s ease-in-out infinite;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease;
    cursor: pointer;
}

.login-logo:hover {
    filter: drop-shadow(0 0 25px rgba(243, 156, 18, 0.85)) brightness(1.2);
    transform: scale(1.05);
}

@keyframes floatLogo {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

.login-title {
    display: none; /* Oculto */
}

.login-subtitle {
    font-size: 26px; /* Letra de anuncio/descripción aún más grande */
    color: #ffffff; /* Blanco puro */
    line-height: 1.6;
    max-width: 820px; /* Más ancho para adaptarse a la letra grande */
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

/* Botón Ver Video en línea al final de la descripción */
.presale-video-inline-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(243, 156, 18, 0.18);
    border: 1px solid rgba(243, 156, 18, 0.45);
    color: #ffd700;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 16px; /* Agrandado de 14px a 16px */
    font-weight: 700;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    margin-left: 8px;
    vertical-align: middle;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.presale-video-inline-btn:hover {
    background: rgba(243, 156, 18, 0.3);
    border-color: #f39c12;
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

.presale-video-inline-btn:active {
    transform: translateY(0) scale(1);
}

/* Contenedor de Tarjetas Pareadas al mismo nivel */
.login-cards-container {
    display: flex;
    flex-direction: row;
    gap: 30px;
    width: 100%;
    justify-content: center;
    align-items: stretch; /* Ambas tarjetas tendrán exactamente la misma altura */
}

/* Estilo unificado para las dos Tarjetas Gemelas (Preventa y Login) */
.presale-container,
.login-right {
    flex: 1;
    max-width: 300px; /* Reducido el ancho/largo de los recuadros */
    padding: 15px 12px; /* Más compacto para reducir el alto notablemente */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Alinea los elementos arriba y los botones abajo */
    background: rgba(240, 242, 245, 0.88); /* Color plomo claro casi blanco */
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    box-sizing: border-box;
}

.presale-container:hover,
.login-right:hover {
    box-shadow: 0 25px 50px -8px rgba(0, 0, 0, 0.45), 0 15px 30px -12px rgba(255, 255, 255, 0.15);
}

.login-form-box {
    width: 100%;
}

.login-form-title {
    font-size: 20px; /* Título de formulario más grande */
    font-weight: 700;
    margin: 0 0 10px 0; /* Reducido para ahorrar espacio */
    color: #1e293b;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Inputs */
.login-right .input-group {
    display: flex;
    flex-direction: column;
    gap: 4px; /* Reducido */
    margin-bottom: 8px; /* Reducido para acortar la tarjeta */
}

.login-right .input-label {
    font-size: 13px; /* Letra de label más grande */
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.login-right input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    color: #0f172a;
    font-size: 15px; /* Inputs de texto más grandes */
    font-family: 'Outfit', sans-serif;
    outline: none;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.login-right input:focus {
    border-color: #d35400;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.15);
}

.login-right input::placeholder {
    color: #94a3b8;
}

/* Buttons */
.login-btn {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 15px; /* Botones de sesión más grandes */
    font-weight: 700;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-sizing: border-box;
    text-align: center;
    display: block;
}

.primary-btn {
    background: linear-gradient(135deg, #f39c12 0%, #d35400 100%);
    color: #ffffff;
    border: none;
    margin-top: 8px; /* Reducido de 15px */
    box-shadow: 0 3px 10px rgba(211, 84, 0, 0.4);
}

.primary-btn:hover {
    background: linear-gradient(135deg, #f1c40f 0%, #e67e22 100%);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 15px rgba(211, 84, 0, 0.5);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: transparent;
    color: #334155;
    border: 1px solid rgba(0, 0, 0, 0.2);
    margin-top: 6px; /* Reducido de 10px */
}

.secondary-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.4);
    color: #0f172a;
    transform: translateY(-1px);
}


.secondary-btn:active {
    transform: translateY(0);
}

/* Botón Google */
.google-btn {
    background: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    padding: 11px 12px;
}

.google-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transform: translateY(-1.5px);
    border-color: #c6c8ca;
}

.google-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.google-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Divider "o ingresa con tu correo" */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0 10px;
    color: #94a3b8;
    font-size: 13px;
    font-family: 'Outfit', sans-serif;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.15);
}

/* Link olvidé contraseña */
.forgot-password-link {
    text-align: right;
    margin-top: 6px;
    margin-bottom: 2px;
}

.forgot-password-link a {
    font-size: 13px;
    color: #d35400;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-password-link a:hover {
    color: #e67e22;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .login-left {
        padding: 20px 10px;
    }
    
    .login-right {
        padding: 40px 30px;
    }
    
    .login-logo {
        max-width: 150px;
        margin-bottom: 15px;
    }
    
    .login-title {
        font-size: 28px;
    }
}

/* ==================================
   EVENTO PREVENTA Y POPUP DE VIDEO
   ================================== */
.presale-container {
    text-align: left;
    background: rgba(0, 0, 0, 0.5) !important; /* Negro medio traslúcido */
    border: 1px solid rgba(255, 255, 255, 0.15) !important; /* Borde sutil claro */
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7);
}

.presale-header {
    font-size: 15px; /* Título preventa más grande */
    font-weight: 800;
    color: #ffd700; /* Dorado brillante */
    letter-spacing: 2px;
    margin: 0 0 10px 0; /* Reducido de 14px */
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.presale-launch-info {
    text-align: center;
    font-size: 13.5px;
    color: #cbd5e1;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.presale-launch-info strong {
    color: #ffd700; /* Resalta la fecha en dorado */
    font-weight: 700;
}

.presale-stages {
    display: flex;
    gap: 8px;
    margin-bottom: 10px; /* Reducido de 16px */
}

.presale-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px; /* Reducido de 10px 4px */
    background: rgba(255, 255, 255, 0.05); /* Tonalidad clara en fondo oscuro */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0.55;
    box-sizing: border-box;
}

.presale-stage:hover {
    background: rgba(255, 255, 255, 0.15); /* Cambio de color al pasar el mouse */
    border-color: rgba(255, 255, 255, 0.3);
    opacity: 0.85;
    cursor: pointer;
}

.presale-stage.active {
    opacity: 1;
    background: rgba(243, 156, 18, 0.15);
    border-color: #f39c12;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
    transform: scale(1.03);
}

.presale-stage.active:hover {
    background: rgba(243, 156, 18, 0.25);
    border-color: #f39c12;
}

.stage-tag {
    font-size: 11.5px; /* Letra más grande */
    text-transform: uppercase;
    color: #cbd5e1; /* Gris claro */
    margin-bottom: 3px;
    font-weight: 600;
}

.presale-stage.active .stage-tag {
    color: #ffd700;
}

.stage-price {
    font-size: 22px; /* Precio más grande */
    font-weight: 800;
    color: #ffffff; /* Blanco */
    letter-spacing: 0.5px;
}

.presale-stage.active .stage-price {
    color: #ffd700;
}

.stage-duration {
    font-size: 11.5px; /* Letra más grande */
    color: #cbd5e1; /* Gris claro */
    margin-top: 3px;
    font-weight: 500;
}

.presale-stage.active .stage-duration {
    color: #ffffff;
}

/* Cronómetro */
.presale-countdown-box {
    margin-bottom: 0px; /* Ajustado para ser más compacto */
    text-align: center;
    background: rgba(255, 255, 255, 0.04); /* Tonalidad clara en fondo oscuro */
    padding: 6px 8px; /* Reducido para acortar el alto */
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.countdown-label {
    font-size: 12.5px; /* Letra más grande */
    font-weight: 600;
    text-transform: uppercase;
    color: #cbd5e1; /* Gris claro */
    letter-spacing: 1px;
    margin-bottom: 4px; /* Reducido de 8px */
}

.countdown-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.timer-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 44px;
}

.timer-value {
    font-size: 21px; /* Dígitos de reloj más grandes */
    font-weight: 800;
    color: #ffffff;
    background: #1e293b;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-family: monospace;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    letter-spacing: 0.5px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.timer-colon {
    font-size: 18px;
    font-weight: 800;
    color: #ffd700; /* Dorado para hacer juego */
    transform: translateY(-9px);
    margin: 0 2px;
    animation: blinkColon 1s infinite;
}

@keyframes blinkColon {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.timer-unit {
    font-size: 10.5px; /* Unidad de reloj más grande */
    color: #cbd5e1; /* Gris claro */
    margin-top: 4px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* MODAL DE VIDEO (AL MEDIO DE LA PANTALLA) */
.video-popup-modal {
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(10, 15, 30, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-popup-modal.show {
    opacity: 1;
}

.video-modal-content {
    position: relative;
    background-color: #0f172a;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.8), 0 0 50px rgba(243, 156, 18, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.video-popup-modal.show .video-modal-content {
    transform: scale(1);
}

.close-video-modal {
    position: absolute;
    right: 12px;
    top: -38px;
    color: #94a3b8;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
}

.close-video-modal:hover {
    color: #ffffff;
    transform: scale(1.1);
}

.video-player-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #000000;
}

.video-player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}