/* ============================================
   SPACE EMPIRE GPS - ESTILOS PRINCIPALES
   ============================================ */

/* 🚀 Estilos Sci-Fi para Botones - Base */
.si-buttons-scifi__style-5__button-1 {
    /* == BUTTON SETTINGS == */
    --font-family: Jura, monospace;
    --font-size: 16px;
    --color: white;
    --background-color: #0d0a11;
    --border-color: #0bb3b3;
    --border-width: 1px;
    --border-cut: 5px;
    --button-shape: polygon(0 var(--border-cut), var(--border-cut) 0, calc(100% - var(--border-cut)) 0, 100% var(--border-cut), 100% calc(100% - var(--border-cut)), calc(100% - var(--border-cut)) 100%, calc(calc(50% - var(--border-cut) - 30px) + var(--border-cut) + 60px + var(--border-cut)) 100%, calc(calc(50% - var(--border-cut) - 30px) + var(--border-cut) + 60px) calc(100% - var(--border-cut)), calc(calc(50% - var(--border-cut) - 30px) + var(--border-cut)) calc(100% - var(--border-cut)), calc(50% - var(--border-cut) - 30px) 100%, var(--border-cut) 100%, 0% calc(100% - var(--border-cut)));
}

.si-buttons-scifi__style-5__button-1 {
    font-family: var(--font-family);
    font-size: var(--font-size);
    color: var(--color) !important;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    align-self: center;
    vertical-align: middle;
    appearance: none;
    box-sizing: border-box;
    text-decoration: none;
    position: relative;
    word-spacing: 3px;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: 0.3s;
    line-height: initial;
    min-height: 30px;
    min-width: 70px;
    white-space: nowrap;
    z-index: 1;
    user-select: none;
    outline: 0;
    padding: 15px 30px;
    background-color: transparent;
}

.si-buttons-scifi__style-5__button-1:before,
.si-buttons-scifi__style-5__button-1:after{
    content: '';
    inset: 0;
    background: var(--border-color);
    position: absolute;
    z-index: -1;
    clip-path: var(--button-shape);
    box-shadow: inset 0 0 25px -10px var(--border-color);
}

.si-buttons-scifi__style-5__button-1:after{
    inset: var(--border-width);
    background: var(--background-color);
}

.si-buttons-scifi__style-5__button-1 helper-1:before{
    content: '';
    position: absolute;
    height: calc(var(--border-cut) - 2px);
    width: 63px;
    background: var(--border-color);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    clip-path: polygon(2px 0%, calc(100% - 2px) 0%, 100% 100%, 0% 100%);
}

.si-buttons-scifi__style-5__button-1 helper-2:before,
.si-buttons-scifi__style-5__button-1 helper-2:after{
    content: '';
    position: absolute;
    height:80%;
    width: 3px;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    clip-path: polygon(0 0, 100% 3px, 100% calc(100% - 3px), 0 100%);
    background: var(--border-color);
    opacity: 0.3;
}

.si-buttons-scifi__style-5__button-1 helper-2:after{
    left: unset;
    clip-path: polygon(0 3px, 100% 0, 100% 100%, 0 calc(100% - 3px));
    right: 5px;
}

[class*='si-buttons-scifi'].disabled,
[class*='si-buttons-scifi']:disabled{
    pointer-events:none;
    opacity:0.5;
    cursor:default;
}

/* Ripple Animation */
[class*='si-buttons-scifi'] ripple {
    inset: 0;
    position: absolute;
    overflow: hidden;
    -webkit-clip-path: var(--button-shape);
            clip-path: var(--button-shape);
}

[class*='si-buttons-scifi'].disabled ripple,
[class*='si-buttons-scifi']:disabled ripple{
    display:none
}

[class*='si-buttons-scifi'] ripple:after {
    content: '';
    --ripple-gradient: rgb(255, 255, 255);
    position: absolute;
    inset: 0 auto 0 -200%;
    width: 200%;
    transform: skewX(-20deg);
    opacity: 0.5;
    background-image: linear-gradient(to right, transparent, var(--ripple-gradient), transparent);
}

[mode*='light'] ripple:after {
    --ripple-gradient: var(--border-color);
}

[class*='si-buttons-scifi']:hover ripple:after {
    left: 200%;
    transition: 1.6s ease;
}

[class*='si-buttons-scifi'] ripple:before {
    content: '';
    --ripple-color: rgb(255, 255, 255);
    position: absolute;
    inset: 50%;
    transform: skewX(-10deg);
    border-radius: 100vh;
}

[mode*='light'] ripple:before {
    --ripple-color: var(--border-color);
}

[class*='si-buttons-scifi']:focus ripple:before {
    animation: ripple-animation 0.7s ease-in-out forwards;
}

[class*='si-buttons-scifi']:active ripple:before {
    animation: unset;
}

@keyframes ripple-animation {
    0% {box-shadow: 0 0 0 0 var(--ripple-color); opacity:0.6}
    100% {box-shadow: 0 0 0 150px var(--ripple-color); opacity:0}
}

/* Shine Animation */
[class*='si-buttons-scifi'] shine {
    position: absolute;
    inset: 0;
    overflow: hidden;
    -webkit-clip-path: var(--button-shape);
            clip-path: var(--button-shape);
}

[class*='si-buttons-scifi'].disabled shine,
[class*='si-buttons-scifi']:disabled shine {
    display: none;
}

[class*='si-buttons-scifi'] shine:after {
    content: '';
    position: absolute;
    inset: 0 auto 0 -70px;
    width: 30px;
    opacity: 0.8;
    background: rgb(255, 255, 255);
    transition: all .3s linear;
    transform: skewX(-15deg) translateX(0);
    animation: shine 3.5s ease-in-out infinite;
}

[mode*='light'] shine:after {
    opacity: 0.5;
    background: var(--border-color);
}

[class*='si-buttons-scifi']:hover shine:after {
    animation: unset;
}

@keyframes shine {
    70% {left: -70px}
    100% {left: calc(100% + 70px)}
}

/* 🎮 Aplicar estilos sci-fi a botones del juego */
.build-btn,
.build-spaceship-btn,
.mobile-menu-btn,
.close-btn {
    font-family: var(--font-family);
    font-size: clamp(12px, 2.5vw, 16px);
    color: var(--color) !important;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    box-sizing: border-box;
    text-decoration: none;
    position: relative;
    word-spacing: 2px;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: 0.3s;
    line-height: initial;
    min-height: 30px;
    min-width: 70px;
    white-space: nowrap;
    z-index: 1;
    user-select: none;
    outline: 0;
    padding: clamp(8px, 2vw, 15px) clamp(15px, 3vw, 30px);
    background-color: transparent;
}

.build-btn:before,
.build-btn:after,
.build-spaceship-btn:before,
.build-spaceship-btn:after,
.mobile-menu-btn:before,
.mobile-menu-btn:after,
.close-btn:before,
.close-btn:after {
    content: '';
    inset: 0;
    background: var(--border-color);
    position: absolute;
    z-index: -1;
    clip-path: var(--button-shape);
    box-shadow: inset 0 0 25px -10px var(--border-color);
}

.build-btn:after,
.build-spaceship-btn:after,
.mobile-menu-btn:after,
.close-btn:after {
    inset: var(--border-width);
    background: var(--background-color);
}

.build-btn:hover,
.build-spaceship-btn:hover,
.mobile-menu-btn:hover,
.close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(11, 179, 179, 0.3);
}

.build-btn:disabled,
.build-spaceship-btn:disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: default;
}

/* Botones específicos del menú móvil */
.menu-btn {
    --border-color: #ff6b35;
    --background-color: #1a0a0a;
    padding: clamp(8px, 2vw, 12px);
    min-width: clamp(40px, 8vw, 60px);
    min-height: clamp(40px, 8vw, 60px);
}

.close-btn {
    --border-color: #ff4444;
    --background-color: #1a0a0a;
    padding: clamp(6px, 1.5vw, 12px) clamp(12px, 2.5vw, 24px);
    font-size: clamp(14px, 3vw, 18px);
}

.other-player-building {
    opacity: 0.7 !important;
    filter: grayscale(30%) !important;
}

.player-building {
    opacity: 1 !important;
    filter: none !important;
}

.other-player-building:hover {
    opacity: 0.9 !important;
    filter: grayscale(10%) !important;
}

/* 🗺️ Estilos para círculos de territorio de otros jugadores */
.other-player-territory {
    opacity: 0.7 !important;
    transition: opacity 0.3s ease !important;
}

.other-player-territory:hover {
    opacity: 0.9 !important;
}

/* ============================================
   ESTILOS BÁSICOS
   ============================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    color: white;
    height: 100vh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ============================================
   MAPA
   ============================================ */

.map-container {
    flex: 1;
    position: relative;
    height: calc(100vh - clamp(50px, 8vh, 80px));
}

#map {
    width: 100%;
    height: 100%;
}

/* ============================================
   MENÚ INFERIOR MÓVIL
   ============================================ */

.mobile-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: clamp(50px, 8vh, 80px);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-top: 2px solid #00d4ff;
    z-index: 1000;
    padding: clamp(4px, 1vh, 12px);
}

.menu-grid {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    height: 100%;
    width: 100%;
    gap: clamp(2px, 0.5vw, 8px);
    padding: 0 clamp(4px, 2vw, 16px);
}

.menu-btn {
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.1), rgba(0, 150, 200, 0.2));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: clamp(8px, 2vw, 16px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: clamp(36px, 6vw, 56px);
    height: clamp(36px, 6vw, 56px);
    flex-shrink: 0;
    min-width: 0;
}

.menu-btn:active {
    transform: scale(0.95);
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.3), rgba(0, 150, 200, 0.4));
    border-color: #00d4ff;
}

.menu-btn.active {
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.4), rgba(0, 150, 200, 0.5));
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.menu-icon {
    font-size: clamp(16px, 3vw, 24px);
    line-height: 1;
    color: white;
    filter: brightness(1.2);
    text-align: center;
}

.menu-label {
    display: none;
}

/* Efectos hover para desktop */
@media (hover: hover) {
    .menu-btn:hover {
        background: linear-gradient(145deg, rgba(0, 212, 255, 0.2), rgba(0, 150, 200, 0.3));
        border-color: #00d4ff;
        transform: translateY(-2px);
    }
}

/* ============================================
   NOTIFICACIONES
   ============================================ */

.notification {
    position: relative;
    padding: clamp(8px, 1.5vh, 16px) clamp(12px, 3vw, 24px);
    border-radius: clamp(15px, 3vw, 25px);
    width: 100%;
    text-align: center;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-size: clamp(12px, 2.5vw, 16px);
    pointer-events: auto;
}

.notification.success {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.9), rgba(0, 200, 0, 0.9));
    color: white;
    border: 1px solid rgba(0, 255, 0, 0.5);
}

.notification.error {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.9), rgba(200, 0, 0, 0.9));
    color: white;
    border: 1px solid rgba(255, 0, 0, 0.5);
}

.notification.info {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.9), rgba(0, 150, 200, 0.9));
    color: white;
    border: 1px solid rgba(0, 212, 255, 0.5);
}

.notification.warning {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.9), rgba(255, 140, 0, 0.9));
    color: white;
    border: 1px solid rgba(255, 165, 0, 0.5);
}


/* Safe area para iPhone */
@supports (padding: max(0px)) {
    .mobile-menu {
        padding-bottom: max(clamp(4px, 1vh, 12px), env(safe-area-inset-bottom));
    }
}

/* ============================================
   MODALES
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(15px, 3vh, 25px);
    border-bottom: 2px solid #00d4ff;
    background: rgba(0, 0, 0, 0.5);
}

.modal-header h2 {
    color: #00d4ff;
    font-size: clamp(18px, 4vw, 24px);
    margin: 0;
}

.close-btn {
    background: rgba(255, 0, 0, 0.2);
    color: #ff4444;
    border: 1px solid #ff4444;
    border-radius: 50%;
    width: clamp(35px, 6vw, 45px);
    height: clamp(35px, 6vw, 45px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: clamp(16px, 3vw, 20px);
    transition: all 0.3s ease;
}

/* Estilo personalizado para scrollbar */
.modal-body::-webkit-scrollbar,
#available-ships-list::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track,
#available-ships-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.modal-body::-webkit-scrollbar-thumb,
#available-ships-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #0bb3b3, #00ff88);
    border-radius: 5px;
    border: 2px solid rgba(0, 0, 0, 0.3);
}

.modal-body::-webkit-scrollbar-thumb:hover,
#available-ships-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #00ff88, #0bb3b3);
}

/* ============================================
   SISTEMA DE FLOTAS - SELECCIÓN DE NAVES
   ============================================ */

/* Animación para las tarjetas de naves */
.ship-selection-item {
    position: relative;
}

.ship-selection-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    background: linear-gradient(45deg, rgba(11, 179, 179, 0.1), rgba(0, 255, 136, 0.1));
}

.ship-selection-item:hover::before {
    opacity: 1;
}

.ship-selection-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(11, 179, 179, 0.5) !important;
}

.ship-selection-item:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 3px 10px rgba(11, 179, 179, 0.6) !important;
}

/* Estilo para naves seleccionadas */
.ship-selection-item.selected {
    border-color: #00ff88 !important;
    background: rgba(0, 255, 136, 0.15) !important;
    box-shadow: 0 4px 16px rgba(0, 255, 136, 0.4) !important;
}

.ship-selection-item.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #00ff88;
    color: #0a0a0a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    animation: checkmark-pop 0.3s ease;
}

@keyframes checkmark-pop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.close-btn:active {
    transform: scale(0.9);
    background: rgba(255, 0, 0, 0.4);
}

/* ============================================
   RECURSOS Y EDIFICIOS
   ============================================ */

.resources-display {
    display: flex;
    justify-content: space-around;
    padding: clamp(10px, 2vh, 15px);
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
}

.resource-item {
    display: flex;
    align-items: center;
    gap: clamp(4px, 1vw, 8px);
    color: white;
}

.resource-icon {
    width: clamp(16px, 3vw, 20px);
    height: clamp(16px, 3vw, 20px);
    object-fit: contain;
}

.resource-name {
    font-size: clamp(12px, 2.5vw, 16px);
    font-weight: 600;
}

.resource-amount {
    font-size: clamp(12px, 2.5vw, 16px);
    color: #00d4ff;
    font-weight: bold;
}

.buildings-list {
    flex: 1;
    overflow-y: auto;
    padding: clamp(15px, 3vh, 20px);
}

.building-category {
    margin-bottom: clamp(20px, 4vh, 30px);
}

.building-category h3 {
    color: #00d4ff;
    font-size: clamp(16px, 3.5vw, 20px);
    margin-bottom: clamp(10px, 2vh, 15px);
    padding-bottom: clamp(5px, 1vh, 8px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
}

.building-item {
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.1), rgba(0, 150, 200, 0.05));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: clamp(8px, 2vw, 12px);
    padding: clamp(12px, 2.5vh, 18px);
    margin-bottom: clamp(8px, 1.5vh, 12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.building-item:hover {
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.2), rgba(0, 150, 200, 0.1));
    border-color: #00d4ff;
    transform: translateY(-2px);
}

.building-info {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 12px);
    flex: 1;
}

.building-icon {
    font-size: clamp(20px, 4vw, 28px);
}

.building-icon-img {
    width: clamp(50px, 10vw, 70px);
    height: clamp(50px, 10vw, 70px);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #0bb3b3;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(11, 179, 179, 0.3);
}

.building-icon-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.building-item:hover .building-icon-img {
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.building-item:hover .building-icon-img img {
    transform: scale(1.05);
}

.building-details h4 {
    color: white;
    font-size: clamp(14px, 3vw, 18px);
    margin: 0 0 clamp(2px, 0.5vh, 4px) 0;
}

.building-details p {
    color: #aaa;
    font-size: clamp(11px, 2.2vw, 14px);
    margin: 0;
}

.building-cost {
    display: flex;
    flex-direction: column;
    gap: clamp(2px, 0.5vh, 4px);
    margin-right: clamp(8px, 2vw, 12px);
}

.cost-item {
    display: flex;
    align-items: center;
    gap: clamp(3px, 0.8vw, 6px);
    font-size: clamp(11px, 2.2vw, 14px);
    color: #ffd700;
}

.cost-icon {
    font-size: clamp(12px, 2.5vw, 16px);
}

.cost-icon img {
    width: clamp(12px, 2.5vw, 16px);
    height: clamp(12px, 2.5vw, 16px);
    object-fit: contain;
    vertical-align: middle;
}

.cost-amount {
    font-weight: bold;
}

.build-btn {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: white;
    border: none;
    padding: clamp(8px, 1.5vh, 12px) clamp(12px, 3vw, 18px);
    border-radius: clamp(6px, 1.5vw, 8px);
    cursor: pointer;
    font-weight: 600;
    font-size: clamp(11px, 2.2vw, 14px);
    transition: all 0.3s ease;
    min-width: clamp(70px, 15vw, 90px);
}

.build-btn:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, #00b8e6, #0088bb);
}

.build-btn:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Scrollbar personalizado */
.buildings-list::-webkit-scrollbar {
    width: 6px;
}

.buildings-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.buildings-list::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.5);
    border-radius: 3px;
}

.buildings-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.7);
}

/* ============================================
   HANGAR - NAVES ESPACIALES
   ============================================ */

.hangar-section {
    margin: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid #444;
}

.hangar-section h3 {
    color: #00d4ff;
    margin-bottom: 12px;
    font-size: clamp(14px, 3vw, 18px);
    text-align: center;
}

.spaceship-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    margin: 8px 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    border: 1px solid #666;
    gap: 10px;
}

.spaceship-stats-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
    width: 100%;
    padding: 8px 0;
    border-top: 1px solid rgba(11, 179, 179, 0.3);
}

.stat-item {
    font-size: 12px;
    color: #0bb3b3;
    background: rgba(11, 179, 179, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(11, 179, 179, 0.3);
}

.spaceship-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spaceship-icon {
    width: clamp(35px, 8vw, 45px);
    height: clamp(35px, 8vw, 45px);
    background: #ff6b35;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(16px, 4vw, 20px);
    font-weight: bold;
    flex-shrink: 0;
}

.spaceship-details {
    flex: 1;
    min-width: 0;
}

.spaceship-details h4 {
    color: white;
    margin: 0 0 4px 0;
    font-size: clamp(13px, 3vw, 16px);
    font-weight: bold;
    text-align: left;
}

.spaceship-details p {
    color: #aaa;
    margin: 2px 0;
    font-size: clamp(11px, 2.5vw, 13px);
    line-height: 1.3;
    text-align: left;
}

.spaceship-cost {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.spaceship-cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.spaceship-cost-items {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.spaceship-cost-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: clamp(11px, 2.5vw, 13px);
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #555;
}

.spaceship-cost-item .cost-icon img {
    width: clamp(12px, 3vw, 16px);
    height: clamp(12px, 3vw, 16px);
    object-fit: contain;
}

.spaceship-cost-item .cost-amount {
    color: white;
    font-weight: bold;
}

.build-spaceship-btn {
    background: #00d4ff;
    color: white;
    border: none;
    padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 16px);
    border-radius: 6px;
    cursor: pointer;
    font-size: clamp(12px, 2.8vw, 14px);
    font-weight: bold;
    transition: background 0.3s;
    width: 100%;
    margin-top: 8px;
}

.build-spaceship-btn:hover {
    background: #0099cc;
}

.build-spaceship-btn:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.construction-timer {
    color: #ff6b35;
    font-weight: bold;
    font-size: clamp(11px, 2.5vw, 13px);
    text-align: center;
    background: rgba(255, 107, 53, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ff6b35;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.refresh-timer-btn {
    background: #0bb3b3;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.refresh-timer-btn:hover {
    background: #00ffff;
    transform: rotate(180deg);
}

.refresh-timer-btn:active {
    transform: rotate(360deg) scale(0.9);
}

.refresh-timer-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

.spaceship-status {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: clamp(10px, 2.2vw, 12px);
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    margin-top: 8px;
}

.spaceship-status.under_construction {
    background: #ff6b35;
    color: white;
}

.spaceship-status.ready {
    background: #28a745;
    color: white;
}

.spaceship-status.in_mission {
    background: #007bff;
    color: white;
}

/* ============================================
   MINAS ABANDONADAS
   ============================================ */

.mine-popup {
    background: #1a1a1a;
    color: white;
    padding: 15px;
    border: 2px solid #0bb3b3;
    border-radius: 8px;
    font-family: monospace;
    min-width: 250px;
}

.mine-popup h3 {
    margin: 0 0 10px 0;
    color: #0bb3b3;
    font-size: 16px;
}

.mine-popup p {
    margin: 5px 0;
    font-size: 12px;
}

.mine-rewards {
    margin: 10px 0;
    padding: 8px;
    background: rgba(11, 179, 179, 0.1);
    border-radius: 4px;
}

.mine-rewards h4 {
    margin: 0 0 5px 0;
    color: #0bb3b3;
    font-size: 13px;
}

.reward-item {
    font-size: 11px;
    margin: 2px 0;
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.explore-btn {
    background: #0bb3b3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-family: monospace;
    font-size: 12px;
    margin-top: 10px;
        width: 100%;
    transition: background 0.3s ease;
}

.explore-btn:hover {
    background: #00ffff;
}

.explore-btn.disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.exploration-status {
    margin: 10px 0;
    padding: 8px;
    background: rgba(11, 179, 179, 0.1);
    border-radius: 4px;
}

.status-available {
    color: #28a745;
    font-weight: bold;
}

.status-exploring {
    color: #ffc107;
    font-weight: bold;
}

/* ============================================
   RECURSOS EN CARRETERAS
   ============================================ */

.road-resource-popup {
    color: white;
    background: #1a1a2e;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #0bb3b3;
    min-width: 200px;
}

.road-resource-popup h3 {
    color: #0bb3b3;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.road-resource-popup p {
    margin: 5px 0;
    font-size: 14px;
}

.collect-resource-btn {
    background: #0bb3b3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    margin-top: 10px;
    width: 100%;
    transition: background 0.3s ease;
}

.collect-resource-btn:hover {
    background: #00ffff;
}

/* ============================================
   ANIMACIONES
   ============================================ */

@keyframes resourcePulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes resourceGlow {
    0% { 
        transform: scale(1); 
        opacity: 0.6; 
    }
    50% { 
        transform: scale(1.2); 
        opacity: 0.3; 
    }
    100% { 
        transform: scale(1); 
        opacity: 0.6; 
    }
}

.ship-selection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: rgba(11, 179, 179, 0.1);
    border: 1px solid #0bb3b3;
    border-radius: 4px;
}

.ship-info h4 {
    margin: 0 0 5px 0;
    color: #0bb3b3;
    font-size: 14px;
}

.ship-info p {
    margin: 0;
    font-size: 11px;
    color: #ccc;
}

.select-ship-btn {
    background: #0bb3b3;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: monospace;
    font-size: 11px;
    transition: background 0.3s ease;
}

.select-ship-btn:hover:not(:disabled) {
    background: #00ffff;
}

.select-ship-btn:disabled {
    background: #666;
    cursor: not-allowed;
}

/* Marcadores */
.mine-marker {
    cursor: pointer;
}

.mine-marker img {
    transition: all 0.3s ease;
}

.mine-marker:hover img {
    transform: scale(1.1);
}

.ship-marker {
    cursor: pointer;
}

.ship-marker img {
    transition: all 0.3s ease;
}

.ship-marker:hover img {
    transform: scale(1.1);
}

@keyframes pulse {
    0% { 
        transform: scale(1); 
        box-shadow: 0 0 15px rgba(11, 179, 179, 0.8);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 0 25px rgba(11, 179, 179, 1);
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 0 15px rgba(11, 179, 179, 0.8);
    }
}

@keyframes minePulse {
    0% { 
        transform: scale(1); 
        box-shadow: 0 0 15px rgba(255, 193, 7, 0.8);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 0 25px rgba(255, 193, 7, 1);
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 0 15px rgba(255, 193, 7, 0.8);
    }
}

.ship-travel-popup {
    background: #1a1a1a;
    color: white;
    padding: 15px;
    border: 2px solid #0bb3b3;
    border-radius: 8px;
    font-family: monospace;
    min-width: 200px;
}

.ship-travel-popup.own-ship {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.ship-travel-popup.other-ship {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

.ship-travel-popup h3 {
    margin: 0 0 10px 0;
    color: #0bb3b3;
    font-size: 16px;
}

.ship-travel-popup.own-ship h3 {
    color: #28a745;
}

.ship-travel-popup.other-ship h3 {
    color: #ff4444;
}

.ship-travel-popup p {
    margin: 5px 0;
    font-size: 12px;
}

/* ============================================
   LEAFLET POPUPS
   ============================================ */

.leaflet-popup-content-wrapper {
    background: #1a1a2e !important;
    color: white !important;
    border-radius: clamp(8px, 2vw, 12px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
    max-width: clamp(200px, 80vw, 400px) !important;
}

.leaflet-popup-tip {
    background: #1a1a2e !important;
}

.leaflet-popup-content {
    margin: clamp(10px, 2vh, 15px) !important;
    line-height: 1.4 !important;
    font-size: clamp(12px, 2.5vw, 16px) !important;
}

.leaflet-popup-content button {
    background: linear-gradient(135deg, #00d4ff, #0099cc) !important;
    color: white !important;
    border: none !important;
    padding: clamp(8px, 1.5vh, 12px) clamp(12px, 3vw, 18px) !important;
    border-radius: clamp(6px, 1.5vw, 10px) !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    margin-top: clamp(8px, 1.5vh, 12px) !important;
    font-size: clamp(12px, 2.5vw, 16px) !important;
}

.leaflet-popup-content button:hover {
    background: linear-gradient(135deg, #00b8e6, #0088bb) !important;
    transform: translateY(-2px) !important;
}

.leaflet-popup-content button:active {
    transform: scale(0.98) !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Modal Body - Scroll habilitado */
.modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 0;
}

/* Clases utilitarias para popups y contenido dinámico */
.popup-container {
    color: white;
    background: #1a1a2e;
    padding: 10px;
    border-radius: 5px;
}

.popup-title {
    color: #00d4ff;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.popup-title-error {
    color: #ff4444;
    margin: 0 0 10px 0;
    font-size: 14px;
}

.popup-text {
    margin: 5px 0;
}

.popup-text-small {
    margin: 2px 0;
    font-size: 11px;
}

.popup-highlight {
    margin: 8px 0;
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.gps-trust-container {
    display: flex;
    align-items: center;
    margin: 2px 0;
}

.gps-trust-bar-container {
    width: 60px;
    height: 8px;
    background: #333;
    border-radius: 4px;
    margin-right: 8px;
}

.gps-trust-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.range-badge {
    background: rgba(0, 212, 255, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 12px;
    border: 1px solid #00d4ff;
}

.error-popup {
    color: white;
    background: #2a1a1a;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #ff4444;
    font-family: monospace;
    font-size: 12px;
}

.building-popup {
    color: white;
    background: black;
    padding: 8px;
    border: 1px solid white;
    font-family: monospace;
    font-size: 12px;
}

.building-popup h3 {
    color: white;
    margin: 0 0 8px 0;
    font-size: 14px;
}

.building-popup p {
    margin: 4px 0;
}

.upgrade-costs {
    margin: 8px 0;
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.cost-row {
    display: flex;
    align-items: center;
    margin: 2px 0;
}

.cost-row img {
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

.upgrade-btn {
    width: 100%;
    margin-top: 8px;
    background: black;
    color: white;
    border: 1px solid white;
    padding: 6px;
    font-family: monospace;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upgrade-btn:hover {
    background: #222;
    border-color: #00d4ff;
    color: #00d4ff;
}

.building-marker-icon {
    width: 30px;
    height: 30px;
    background: black;
    border: 1px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
}

.cancel-mode-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: 1px solid #ff4444;
    padding: 10px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.cancel-mode-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.05);
}

/* Iconos de recursos inline */
.icon-small {
    width: 16px;
    height: 16px;
}

/* Modal Footer */
.modal-footer {
    padding: 15px 20px;
    border-top: 2px solid #00d4ff;
    background: rgba(0, 0, 0, 0.5);
}

/* Modal Body con padding */
.modal-body-with-padding {
    padding: 20px;
}

/* Texto de carga */
.loading-text {
    text-align: center;
    color: #0bb3b3;
    margin: 0;
}

/* Botón de explorar flota */
.fleet-explore-btn {
    width: 100%;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* ============================================
   SISTEMA DE CUADRÍCULAS TERRITORIALES
   ============================================ */

/* Celdas de territorio individuales */
.own-territory-cell {
    transition: none !important;
    pointer-events: none !important;
}

.enemy-territory-cell {
    transition: none !important;
    pointer-events: none !important;
}

/* Celda con Defense Platform (amarillo verdoso) */
.defense-platform-cell {
    transition: none !important;
    pointer-events: none !important;
}

/* Celda fronteriza (borde del territorio) */
.border-cell {
    stroke-width: 2 !important;
    stroke-dasharray: 3, 3 !important;
}

/* Animación para nuevas celdas reclamadas */
@keyframes cell-claim {
    0% {
        fill-opacity: 0;
        transform: scale(0.8);
    }
    50% {
        fill-opacity: 0.3;
    }
    100% {
        fill-opacity: 0.15;
        transform: scale(1);
    }
}

.new-claimed-cell {
    animation: cell-claim 0.5s ease-out;
}

/* Celdas de preview (antes de construir) */
.preview-territory-cell {
    transition: all 0.3s ease !important;
}

.preview-territory-cell:hover {
    fill-opacity: 0.35 !important;
    stroke-width: 3 !important;
}

/* Grid global (cuadrícula tenue en todo el mundo) */
.global-grid-cell {
    pointer-events: none !important;
    fill: none !important;
}

/* Grid de construcción (celdas visibles al construir) */
.construction-grid-cell {
    transition: all 0.2s ease !important;
}

.construction-grid-cell:hover {
    fill-opacity: 0.2 !important;
    stroke-width: 3 !important;
}

/* Celdas disponibles para construcción */
.available-cell {
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.available-cell:hover {
    fill-opacity: 0.15 !important;
    stroke-width: 3 !important;
    stroke: #00ffff !important;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .ship-selection-item > div:first-of-type {
        width: 100px !important;
        min-height: 100px !important;
    }
    
    .ship-selection-item h4 {
        font-size: 16px !important;
    }
    
    .ship-selection-item p {
        font-size: 13px !important;
    }
}

@media (max-width: 500px) {
    .si-buttons-scifi__style-5__button-1 {
        padding: 12px 20px !important;
        font-size: 14px !important;
    }
}

/* Ajustes adicionales para pantallas muy pequeñas */
@media (max-width: 280px) {
    .menu-grid {
        gap: 1px;
        padding: 0 2px;
    }
    
    .menu-btn {
        width: clamp(32px, 8vw, 40px);
        height: clamp(32px, 8vw, 40px);
    }
}

/* Ajustes para pantallas muy grandes */
@media (min-width: 1200px) {
    .menu-btn {
        width: clamp(48px, 4vw, 64px);
        height: clamp(48px, 4vw, 64px);
    }
    
    .menu-icon {
        font-size: clamp(20px, 2vw, 28px);
    }
}

/* Mejoras para pantallas muy pequeñas - Hangar */
@media (max-width: 480px) {
    .hangar-section {
        margin: 10px 0;
        padding: 10px;
    }
    
    .spaceship-item {
        padding: 10px;
        margin: 6px 0;
    }
    
    .spaceship-info {
        gap: 10px;
    }
    
    .spaceship-cost-items {
        gap: 6px;
    }
    
    .spaceship-cost-item {
        font-size: 11px;
        padding: 3px 6px;
    }
}

