/* Main App Layout */
/* mobile scroll fixes */
html, body {
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: auto;
}

.app,
.main-content {
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.ships-panel,
.city-panel,
.market-table {
    max-height: none !important;
    overflow-y: visible !important;
}

.map-modal-content,
.trade-modal-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 90vh;
}

.app {
    display: flex;
    min-height: 100vh;
    background: url('img/b/bureau.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #e0e0ff;
    font-family: 'Open Sans', sans-serif;
    position: relative;
    overflow-y: auto;            /* <-- wichtig: erlaubt vertikales Scrollen */
    -webkit-overflow-scrolling: touch; /* für iOS Smooth Scrolling */
}

/* Overlay für bessere Lesbarkeit */
.app::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 26, 0.7);
    z-index: 0;
}
/* Schiffssink-Modal Animation */
@keyframes sinkPulse {
    0% { box-shadow: 0 0 20px rgba(255,0,0,0.5); }
    50% { box-shadow: 0 0 50px rgba(255,0,0,0.8); }
    100% { box-shadow: 0 0 20px rgba(255,0,0,0.5); }
}

#shipSinkModal .video-container {
    animation: sinkPulse 2s infinite;
}
.main-content {
    grid-template-columns: 300px 1fr;
    /* gap: 45px;  /* Erhöht von 20px auf 25px für mehr Abstand */
    gap: 1rem;
    padding: 1rem; /* padding: 20px; */
    width: 100%;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;      /* auf Mobilen: untereinander */
    overflow-y: auto;            /* falls Inhalt größer */
}

/* Panel Styles - MEHR DURCHSICHTIGKEIT */
/* City Panel - Firefox-kompatibel */
.city-panel {
    background: rgba(26, 31, 53, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    min-height: 500px;
    height: 100%;  /* Statt overflow-y: visible */
    overflow: hidden;  /* Wichtig für Firefox */
}

.panel-title {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: #d4af37;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 10px;
}

/* Ship Card - MEHR DURCHSICHTIGKEIT */
.ship-card {
    background: rgba(10, 14, 26, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s;
    cursor: pointer;
}

.ship-card.active {
    border-color: #d4af37;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.ship-card.sailing {
    opacity: 0.7;
    cursor: not-allowed;
}

.ship-name {
    font-family: 'Cinzel', serif;
    color: #d4af37;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.ship-location {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #a0a0c0;
    margin: 5px 0;
}

/* Market Table - MIT SCROLLBAR */
/* ========== FIREFOX-FIXES ========== */
/* Haupt-Layout - KEINE doppelten display-Deklarationen! */
.main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1rem;
    padding: 1rem;
    width: 100%;
    position: relative;
    z-index: 1;
    /* ENTFERNT: display: flex; flex-direction: column; */
    overflow-y: auto;
    min-height: 0;  /* Wichtig für Firefox */
}

/* Firefox-spezifischer Fix für Grid-Höhe */
@supports (-moz-appearance: none) {
    .main-content {
        min-height: calc(100vh - 2rem);
    }
}

/* City Panel - Firefox-kompatibel */
.city-panel {
    background: rgba(26, 31, 53, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    min-height: 500px;
    height: 100%;  /* Statt overflow-y: visible */
    overflow: hidden;  /* Wichtig für Firefox */
}

/* Ships Panel ebenso anpassen */
.ships-panel {
    background: rgba(26, 31, 53, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    min-height: 500px;
    height: 100%;
    overflow: hidden;
}

/* Market Table - Firefox-fest */
.market-table {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;  /* Schlüssel für Firefox! */
    overflow: hidden;  /* Statt overflow-y: visible */
}

/* GoodsList - muss scrollen */
#goodsList {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-top: none;
    border-radius: 0 0 8px 8px;
    min-height: 0;  /* Firefox braucht das */
    max-height: 100%; /* Begrenzung */
}

/* Warehouse Panel - Firefox-kompatibel */
.warehouse-panel {
    margin-top: auto;
    background: rgba(10, 14, 26, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 180px;
    flex-shrink: 0;  /* Verhindert Schrumpfen */
}


/* Mobile View - Firefox-kompatibel */
@media (max-width: 768px) {
    .main-content {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 10px;
        min-height: auto;
    }

    .ships-panel, .city-panel {
        min-height: auto;
        height: auto;
        overflow: visible;
    }

    .market-table {
        min-height: 300px;
    }

    #goodsList {
        min-height: 200px;
        max-height: 400px;
    }
}

/* Verbesserte Markt-Header-Formatierung */
.market-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    background: rgba(10, 14, 26, 0.5);
    padding: 12px;
    border-radius: 8px 8px 0 0;
    font-weight: bold;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-bottom: none;
    flex-shrink: 0;
}

/* Spezifische Formatierung für die Spaltenüberschriften */
.market-header span {
    padding: 0 5px;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    color: #d4af37;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
}

/* Linksbündig für die Ware-Spalte */
.market-header span:nth-child(1) {
    text-align: left;
    justify-content: flex-start;
    align-items: flex-start;
}

/* Untertitel für die Preis-Spalten */
.market-header span:nth-child(2),
.market-header span:nth-child(3) {
    font-size: 0.8rem;
    color: #a0a0c0;
    font-family: 'Open Sans', sans-serif;
    font-weight: normal;
    margin-top: 2px;
}

/* Entferne den doppelten "Ware" Text */
.market-header span:nth-child(1)::after {
    content: ""; /* Entfernt das doppelte "Ware" */
}

.market-header span:nth-child(2)::before {
    content: "Kaufen";
    font-size: 0.95rem;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    margin-bottom: 2px;
}

.market-header span:nth-child(3)::before {
    content: "Verkaufen";
    font-size: 0.95rem;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    margin-bottom: 2px;
}

/* Entferne den ursprünglichen Text aus den Spans */
.market-header span:nth-child(2),
.market-header span:nth-child(3) {
    font-size: 0;
}

.market-header span:nth-child(2)::after {
    content: "(ins Lager)";
    font-size: 0.8rem;
    color: #a0a0c0;
    font-family: 'Open Sans', sans-serif;
    font-weight: normal;
}

.market-header span:nth-child(3)::after {
    content: "(aus Lager)";
    font-size: 0.8rem;
    color: #a0a0c0;
    font-family: 'Open Sans', sans-serif;
    font-weight: normal;
}

#goodsList {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;  /* Nimmt den gesamten verfügbaren Platz */
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-top: none;
    border-radius: 0 0 8px 8px;
    min-height: 200px;  /* Mindesthöhe */
}

/* Scrollbar Styling für goodslist */
#goodsList::-webkit-scrollbar {
    width: 8px;
}

#goodsList::-webkit-scrollbar-track {
    background: rgba(26, 31, 53, 0.3);
    border-radius: 4px;
}

#goodsList::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.4);
    border-radius: 4px;
}

#goodsList::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.6);
}

/* Für Firefox */
#goodsList {
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.4) rgba(26, 31, 53, 0.3);
}

.market-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 12px;
    background: rgba(26, 31, 53, 0.3);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    cursor: pointer;
    transition: all 0.2s;
    align-items: center;
}

/* Linksbündig für die Ware-Spalte in den Rows */
.market-row > div:nth-child(1) {
    text-align: left;
    padding-left: 10px;
}

.market-row > div:nth-child(2),
.market-row > div:nth-child(3) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.market-row:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
}

.market-row:nth-child(even) {
    background: rgba(26, 31, 53, 0.4);
}

/* Verbesserte Preis-Darstellung */
.price-buy {
    color: #4caf50;
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
}

.price-sell {
    color: #ff9800;
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
}

/* Buttons */
button, .small-btn {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.9), rgba(184, 134, 11, 0.9));
    color: #0a0e1a;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    transition: all 0.2s;
    font-size: 0.9rem;
}

button:hover, .small-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.choice-modal-content, .trade-modal-content {
    background: linear-gradient(135deg, rgba(26, 31, 53, 0.9), rgba(10, 14, 26, 0.9));
    border: 2px solid #d4af37;
    border-radius: 16px;
    padding: 25px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
}

.choice-modal-header, .trade-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 15px;
}

.choice-modal-header h3, .trade-modal-header h3 {
    color: #d4af37;
    font-family: 'Cinzel', serif;
    margin: 0;
}

/* Expand Warehouse Modal Styles */
.expand-info {
    margin: 20px 0;
    padding: 15px;
    background: rgba(10, 14, 26, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.expand-details {
    margin: 15px 0;
    padding: 10px;
    background: rgba(26, 31, 53, 0.3);
    border-radius: 6px;
}

.expand-details div {
    margin: 8px 0;
    padding: 5px 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.expand-details div:last-child {
    border-bottom: none;
}

.expand-details strong {
    color: #d4af37;
}

.close-btn {
    background: transparent;
    color: #d4af37;
    border: 1px solid #d4af37;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    padding: 0;
    font-size: 1.2rem;
    line-height: 1;
}

/* Map Modal */
.map-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.map-modal.active {
    display: flex;
}

.map-modal-content {
    background: linear-gradient(135deg, rgba(26, 31, 53, 0.9), rgba(10, 14, 26, 0.9));
    border: 2px solid #d4af37;
    border-radius: 16px;
    width: 90%;
    height: 90%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    overflow-y: auto;                /* erlaubt Scrollen im Modal */
    max-height: 90vh;               /* optional: begrenzt Höhe, aber scrollbar */
    -webkit-overflow-scrolling: touch;
}

.map-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 14px 14px;
    min-height: 400px; /* Fallback für Darstellungsprobleme */
    height: 100%;      /* wird durch flex überschrieben, aber wichtig */
}


.warehouse-panel {
    margin-top: auto;  /* Drückt das Warehouse nach unten */
    background: rgba(10, 14, 26, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 180px;  /* Mindesthöhe für Warehouse */
    max-height: 250px;  /* Maximale Höhe */
}

#warehouseContent {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
    margin-top: 10px;
    max-height: calc(100% - 40px);
}

#warehouseContent::-webkit-scrollbar {
    width: 8px;
}

#warehouseContent::-webkit-scrollbar-track {
    background: rgba(26, 31, 53, 0.3);
    border-radius: 4px;
}

#warehouseContent::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.4);
    border-radius: 4px;
}

#warehouseContent::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.6);
}

#warehouseContent {
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.4) rgba(26, 31, 53, 0.3);
}

.warehouse-item {
    background: rgba(26, 31, 53, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    margin: 5px 0;
    cursor: pointer;
    transition: all 0.2s;
}

.warehouse-item:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
}

/* Choice Modal Boxes */
.price-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.price-box {
    flex: 1;
    background: rgba(26, 31, 53, 0.5);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.price-box:hover:not(.disabled) {
    transform: translateY(-5px);
    border-color: #d4af37;
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.2);
}

.price-box.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.buy-box {
    border-color: rgba(76, 175, 80, 0.5);
}

.buy-box:hover:not(.disabled) {
    border-color: #4caf50;
}

.sell-box {
    border-color: rgba(255, 152, 0, 0.5);
}

.sell-box:hover:not(.disabled) {
    border-color: #ff9800;
}

.price-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.price-label {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #d4af37;
}

.price-value {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.price-stock {
    font-size: 0.9rem;
    color: #a0a0c0;
    margin-bottom: 5px;
}

.warning {
    color: #ff9800;
    font-size: 0.8rem;
    margin-top: 8px;
}

/* Slider Controls */
.slider-container {
    margin: 15px 0;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(212, 175, 55, 0.2);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #d4af37;
    cursor: pointer;
    border: 3px solid #0a0e1a;
}

.quantity-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.quantity-buttons button {
    flex: 1;
    min-width: 60px;
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
    border: 1px solid #d4af37;
    padding: 6px 0;
}

.quantity-buttons button:hover {
    background: rgba(212, 175, 55, 0.4);
}

.quantity-input-wrapper {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

#quantityInput, #cargoInput {
    background: rgba(10, 14, 26, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 6px;
    color: #fff;
    padding: 8px 12px;
    width: 100px;
    font-size: 1rem;
}

.max-hint {
    color: #a0a0c0;
    margin-left: 10px;
    font-size: 0.9rem;
}

.total-info {
    margin: 20px 0;
    padding: 15px;
    background: rgba(10, 14, 26, 0.4);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
}

.gold-info {
    margin: 15px 0;
    padding: 12px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 8px;
    color: #d4af37;
}

.trade-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.cancel-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.confirm-btn {
    flex: 2;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.9), rgba(184, 134, 11, 0.9));
    color: #0a0e1a;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Ship Cargo */
.cargo-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.cargo-item {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.cargo-item:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: translateY(-2px);
}

.capacity-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 5px 0;
    overflow: hidden;
}

.capacity-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.8), rgba(139, 195, 74, 0.8));
    border-radius: 3px;
    transition: width 0.3s;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 20px;
    color: #a0a0c0;
    font-style: italic;
}

/* City Header */
.city-header {
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    margin-bottom: 20px;
}

.city-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: #d4af37;
    margin-bottom: 5px;
}

#cityDetails {
    color: #a0a0c0;
    font-size: 0.9rem;
}

/* Video Modal */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.rename-modal-content {
    background: linear-gradient(135deg, rgba(26, 31, 53, 0.95), rgba(10, 14, 26, 0.95));
    border: 2px solid #d4af37;
    border-radius: 16px;
    padding: 25px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
}

/* Popup-Styling für Karma-Anzeige */
.karma-display {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(0,0,0,0.3);
    margin-top: 5px;
}

.karma-value {
    font-weight: bold;
    color: white;
}

/* Marker mit Karma-Farben */
.leaflet-marker-icon.karma-marker {
    border: 2px solid white !important;
    border-radius: 50% !important;
}
.input-group {
    margin: 15px 0;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #d4af37;
    font-weight: bold;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.5);
    background: rgba(10, 14, 26, 0.7);
    color: white;
    font-size: 1rem;
}

.input-group input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* Mobile Optimierungen */
@media (max-width: 768px) {
    .app {
        display: block;
    }
    .main-content {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }
    .ships-panel, .city-panel {
        min-height: auto;
        padding: 15px;
        backdrop-filter: none; /* Performance auf mobilen Geräten verbessern */
    }
    .panel-title {
        font-size: 1rem;
    }
    .city-title {
        font-size: 1.4rem;
    }
    .market-header {
        grid-template-columns: 1fr 0.8fr 0.8fr;
        padding: 8px;
    }
    .market-header span {
        font-size: 0.8rem;
    }
    .market-row {
        grid-template-columns: 1fr 0.8fr 0.8fr;
        padding: 8px;
    }
    /* Leaflet Fehleranzeige verstecken falls nötig */
    .leaflet-control-container .leaflet-top.leaflet-left {
        z-index: 1000 !important;
    }
    .price-buy, .price-sell {
        font-size: 0.95rem;
    }
    #goodsList {
        min-height: 150px;
    }
    .warehouse-panel {
        max-height: 200px;
        min-height: 120px;
    }
    .map-modal {
        padding: 0;
    }
.map-modal-content {
    background: linear-gradient(135deg, rgba(26, 31, 53, 0.9), rgba(10, 14, 26, 0.9));
    border: 2px solid #d4af37;
    border-radius: 16px;
    width: 90%;
    height: 90vh;               /* Feste Höhe statt max-height */
    max-height: 90vh;            /* max-height bleibt als Fallback */
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    overflow: hidden;            /* Wichtig: kein auto, sonst Height-Problem */
    -webkit-overflow-scrolling: touch;
}

.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 14px 14px;
    min-height: 400px;           /* Fallback */
    height: 100%;                 /* Nimmt 100% vom Elter (height: 90vh) */
}

#travelMap {
    width: 100%;
    height: 100%;                /* Füllt den Container komplett */
}

    .map-modal-header {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        align-items: flex-start;
    }
    .map-modal-header h3 {
        font-size: 1.2rem;
    }

    button, .small-btn {
        padding: 12px 16px;
        font-size: 1rem;
        min-height: 44px;
        min-width: 44px;
    }
    .close-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    .filter-input {
        font-size: 0.9rem !important;
    }
    .ship-card {
        padding: 12px;
    }
    .ship-name {
        font-size: 1rem;
    }
    .cargo-item {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
    .price-box {
        padding: 15px;
    }
    .price-icon {
        font-size: 2rem;
    }
    .price-value {
        font-size: 1.2rem;
    }
    .quantity-buttons button {
        min-width: 50px;
        padding: 10px 0;
    }
    #quantityInput, #cargoInput {
        width: 80px;
        padding: 10px;
        font-size: 1rem;
    }
    .trade-actions {
        flex-direction: column;
    }
    .cancel-btn, .confirm-btn {
        width: 100%;
        padding: 14px;
    }
    .choice-modal-content, .trade-modal-content {
        padding: 15px;
        max-width: 100%;
    }
    .price-row {
        flex-direction: column;
    }
    /* Video-Modal responsive */
    .video-modal-container {
        width: 95% !important;
        border-radius: 12px !important;
    }
    .ship-sink-modal .sink-video-container {
        width: 95% !important;
    }
    .cargo-modal-inner {
        max-width: 100% !important;
        width: 95% !important;
        padding: 1rem !important;
    }
    .cargo-modal-inner .quantity-buttons {
        grid-template-columns: repeat(5, 1fr);
    }
    .cargo-modal-inner .quantity-buttons button {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        gap: 10px;
        padding: 5px;
    }
    .ships-panel, .city-panel {
        padding: 10px;
    }
    .panel-title {
        font-size: 0.9rem;
    }
    .market-header span {
        font-size: 0.7rem;
    }
    .market-row {
        font-size: 0.8rem;
    }
    .price-buy, .price-sell {
        font-size: 0.85rem;
    }
    .city-title {
        font-size: 1.2rem;
    }
    .map-modal-header {
        padding: 10px;
    }
    .map-modal-header h3 {
        font-size: 1rem;
    }
    .map-modal-header button {
        font-size: 0.8rem;
        padding:
    }
}
