* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 100, 120, 0.6) rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #000000;
    overflow: hidden;
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    touch-action: none;
}

.map-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #000000;
}

canvas {
    display: block;
    image-rendering: crisp-edges;       /* fallback for old browsers */
    image-rendering: pixelated;          /* modern browsers */
    -ms-interpolation-mode: nearest-neighbor; /* IE/Edge */
    width: 100vw;
    height: 100vh;
}

.instructions {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    pointer-events: none;
    opacity: 0.8;
    z-index: 100;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* UI Panel Styles */
.ui-panel, .diplomacy-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(30, 30, 30, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    width: 280px;
    z-index: 100;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.ui-panel h2, .diplomacy-panel h2 {
    margin-bottom: 15px;
    color: white;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.ui-panel.settled {
    opacity: 1.0;
}

.ui-panel.settled button:disabled,
.ui-panel.settled input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.diplomacy-panel h2 {
    margin-bottom: 15px;
    color: white;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.diplomacy-panel h3 {
    margin-bottom: 10px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #ccc;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #444;
    color: white;
}

button {
    width: 100%;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
    display: block;
}

button:hover {
    background-color: #45a049;
}

#countryInfo {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #555;
}

#countryInfo h3 {
    margin-bottom: 10px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#diplomacyMenu {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #555;
}

#diplomacyMenu h3 {
    margin-bottom: 10px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.foreign-relations-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.foreign-relations-section h3 {
    margin-bottom: 10px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#expandBtn {
    margin-top: 10px;
    background-color: #2196F3;
}

#expandBtn:hover {
    background-color: #0b7dda;
}

#expandTroops {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#finishBtn {
    margin-top: 10px;
    background-color: #f44336;
}

#finishBtn:hover {
    background-color: #d32f2f;
}

.buildings-section {
    margin-top: 15px;
}

.buildings-section h3 {
    margin-bottom: 10px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#buildingsList {
    margin-bottom: 10px;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 5px;
    background-color: #333;
}

.building-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    border-bottom: 1px solid #444;
}

.building-item:last-child {
    border-bottom: none;
}

.building-icon {
    font-size: 20px;
    margin-right: 10px;
}

.building-name {
    flex-grow: 1;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.building-actions {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

#buildingType {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #444;
    color: white;
}

#buildBtn {
    background-color: #9c27b0;
    flex-basis: 80px;
    padding: 8px;
}

#buildBtn:hover {
    background-color: #7b1fa2;
}

.building-multiplier {
    font-size: 0.8em;
    color: #aaa;
    margin-left: 5px;
}

.connections-list {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.connections-list h4 {
    margin: 5px 0;
    color: #333;
}

.connection-item {
    padding: 3px 8px;
    margin: 3px 0;
    background-color: #333;
    border-radius: 3px;
    font-size: 0.9em;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.tools-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(30, 30, 30, 0.9);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    z-index: 100;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.brush-size {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

hr {
    margin: 15px 0;
    border: 0;
    border-top: 1px solid #555;
}

.hidden {
    display: none;
}

.warning-text {
    color: #d32f2f;
    font-weight: bold;
    margin-top: 5px;
}

.country-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.country-color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    border: 1px solid #000;
}

.diplomacy-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.war-btn {
    background-color: #e74c3c;
}

.war-btn:hover {
    background-color: #c0392b;
}

.peace-btn {
    background-color: #3498db;
}

.peace-btn:hover {
    background-color: #2980b9;
}

#closeDiplomacyBtn {
    background-color: #7f8c8d;
}

#closeDiplomacyBtn:hover {
    background-color: #95a5a6;
}

.war-result {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    background-color: #333;
    border: 1px solid #555;
    color: white;
}

.country-hover {
    opacity: 0.8;
    cursor: pointer;
    filter: brightness(1.2);
}

/* Colors for different terrain types */
.deep-water { background-color: #0077be; }
.shallow-water { background-color: #59c0e7; }
.sand { background-color: #e6d298; }
.low-grass { background-color: #a9d271; }
.grass { background-color: #7ec850; }
.forest { background-color: #2d8c41; }
.dense-forest { background-color: #1a5c28; }
.hills { background-color: #a87e5c; }
.mountain { background-color: #8c6d57; }
.high-mountain { background-color: #6e574b; }
.snow { background-color: #ffffff; }

/* Add styling for cities list */
.cities-list {
    margin-bottom: 10px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

.cities-list h4 {
    margin: 5px 0;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.city-item {
    padding: 3px 8px;
    margin: 3px 0;
    background-color: #444;
    border-radius: 3px;
    font-size: 0.9em;
    color: #eee;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

#continueWarBtn {
    background-color: #c0392b;
    margin-bottom: 10px;
}

#continueWarBtn:hover {
    background-color: #a93226;
}

.research-section {
    margin-top: 15px;
}

.research-section h3 {
    margin-bottom: 10px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.research-card {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    background-color: #333;
    border: 1px solid #555;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.research-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.research-icon {
    font-size: 1.2em;
    margin-right: 5px;
}

.research-name {
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.research-cost {
    color: #4CAF50;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.research-description {
    font-size: 0.9em;
    color: #ccc;
    margin: 5px 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.research-progress {
    height: 10px;
    background-color: #444;
    border-radius: 5px;
    margin: 5px 0;
}

.research-progress-bar {
    height: 100%;
    background-color: #007bff;
    border-radius: 5px;
    transition: width 0.3s ease-in-out;
}

.research-time {
    font-size: 0.8em;
    color: #ccc;
    text-align: right;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.technology-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.technology-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px;
    border-radius: 4px;
    background-color: #333;
    border: 1px solid #555;
    cursor: pointer;
    transition: background-color 0.2s;
}

.technology-item:hover {
    background-color: #444;
}

.technology-icon {
    font-size: 1.2em;
}

.technology-info {
    flex-grow: 1;
}

.technology-name {
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.technology-cost {
    color: #4CAF50;
    font-size: 0.9em;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.technology-description {
    font-size: 0.8em;
    color: #ccc;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.completed-technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.completed-tech {
    background-color: #333;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    gap: 3px;
    color: #ccc;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.ideology-section {
    margin-top: 15px;
}

.ideology-section h3 {
    margin-bottom: 10px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.ideology-card {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    background-color: #333;
    border: 1px solid #555;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ideology-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.ideology-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px;
    border-radius: 4px;
    background-color: #333;
    border: 1px solid #555;
    cursor: pointer;
    transition: background-color 0.2s;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.ideology-item:hover {
    background-color: #444;
}

.ideology-item.selected {
    background-color: #4c6285;
    border-color: #6c82a5;
}

.ideology-icon {
    font-size: 1.2em;
    margin-right: 5px;
}

.ideology-info {
    flex-grow: 1;
}

.ideology-name {
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.ideology-description {
    font-size: 0.8em;
    color: #ccc;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    max-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ideology-effects {
    font-size: 0.8em;
    color: #4CAF50;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Military Leader Styles */
.military-leader-section {
    margin-bottom: 15px;
}

.leader-card {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    background-color: #333;
    border: 1px solid #555;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.leader-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.leader-name {
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.leader-stat {
    color: #4CAF50;
    font-size: 0.9em;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.leader-description {
    font-size: 0.8em;
    color: #ccc;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.leader-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.leader-option {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px;
    border-radius: 4px;
    background-color: #333;
    border: 1px solid #555;
    cursor: pointer;
    transition: background-color 0.2s;
}

.leader-option:hover {
    background-color: #444;
}

#fireLeaderBtn {
    background-color: #e74c3c;
    margin-top: 10px;
}

#fireLeaderBtn:hover {
    background-color: #c0392b;
}

#hireLeaderBtn {
    background-color: #3498db;
    margin-top: 10px;
}

#hireLeaderBtn:hover {
    background-color: #2980b9;
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 100, 120, 0.6);
    border-radius: 5px;
    border: 2px solid rgba(30, 30, 50, 0.5);
    box-shadow: 0 0 5px rgba(0, 200, 255, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 120, 150, 0.8);
    box-shadow: 0 0 8px rgba(50, 200, 255, 0.4);
}

/* Mobile styles */
@media (max-width: 768px) {
    .ui-panel, .diplomacy-panel {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        padding: 12px;
        font-size: 14px;
        max-height: 60vh;
        margin: 0 auto;
    }
    
    .ui-panel h2, .diplomacy-panel h2 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .ui-panel h3, .diplomacy-panel h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .form-group {
        margin-bottom: 8px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 3px;
    }
    
    .form-group input, .form-group select {
        padding: 8px;
        font-size: 16px;
        height: 40px;
    }
    
    button {
        padding: 12px;
        font-size: 16px;
        min-height: 44px;
    }
    
    #buildingsList {
        max-height: 120px;
    }
    
    .building-item {
        padding: 8px;
    }
    
    .building-icon {
        font-size: 18px;
    }
    
    .instructions {
        font-size: 12px;
        bottom: 70px;
        left: 10px;
        padding: 6px;
    }
    
    .tools-panel {
        padding: 8px;
        bottom: 70px;
        right: 10px;
    }
    
    .top-nav-bar {
        flex-direction: column;
        padding: 5px;
    }
    
    .game-title {
        font-size: 16px;
        margin-bottom: 5px;
    }
    
    .nav-buttons {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
        justify-content: space-between;
    }
    
    .nav-button {
        padding: 8px;
        font-size: 14px;
        flex: 1;
        min-width: auto;
        white-space: nowrap;
    }
    
    .country-stats {
        width: 100%;
        justify-content: space-around;
        margin-top: 5px;
    }
    
    .menu-panel {
        width: 100%;
        max-width: none;
        top: 100px;
        right: 0;
        left: 0;
        border-radius: 0;
        padding: 10px;
    }
    
    .menu-panel.hidden {
        transform: translateY(100%);
    }
    
    .mobile-zoom-controls {
        position: fixed;
        bottom: 20px;
        right: 20px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        z-index: 100;
    }
    
    .mobile-control-button {
        width: 50px;
        height: 50px;
        border-radius: 25px;
        background-color: rgba(50, 50, 50, 0.8);
        color: white;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 24px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        border: none;
    }
    
    .mobile-control-button:active {
        background-color: rgba(80, 80, 80, 0.8);
    }
    
    .foreign-country-item,
    .technology-item,
    .ideology-item,
    .leader-option,
    .war-item {
        padding: 12px;
        min-height: 44px;
    }
    
    .diplomacy-panel {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* New mobile portrait orientation specific adjustments */
@media (max-width: 576px) and (orientation: portrait) {
    .top-nav-bar {
        padding: 3px;
    }
    
    .nav-button {
        padding: 6px;
        font-size: 12px;
    }
    
    .stat-item {
        font-size: 12px;
    }
    
    .menu-panel {
        top: 90px;
    }
    
    .map-container {
        height: calc(100vh - 90px);
        top: 90px;
    }
    
    canvas {
        height: 100%;
    }
}

/* Ensure modal dialogs don't overflow screen */
@media (max-height: 600px) {
    .ui-panel, .diplomacy-panel, .menu-panel {
        max-height: 80vh;
    }
}

/* Adjust starfield on mobile to reduce performance impact */
@media (max-width: 768px) {
    .star {
        animation-duration: 6s;
    }
}

/* Top Navigation Bar */
.top-nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(30, 30, 30, 0.9);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    z-index: 100;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.game-title {
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.nav-button {
    background-color: #333;
    color: white;
    border: 1px solid #555;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    width: auto;
    font-weight: normal;
    transition: background-color 0.2s;
}

.nav-button:hover {
    background-color: #555;
}

.nav-button.active {
    background-color: #4CAF50;
    border-color: #45a049;
}

.country-stats {
    display: flex;
    gap: 15px;
}

.stat-item {
    font-size: 0.9rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/* Menu Panels */
.menu-panel {
    position: fixed;
    top: 60px;
    right: 20px;
    background-color: rgba(30, 30, 30, 0.95);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    width: 350px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    z-index: 99;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.menu-panel.hidden {
    transform: translateX(370px);
    opacity: 0;
    pointer-events: none;
}

.menu-panel h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: white;
    text-align: center;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Foreign countries list */
#foreignCountriesList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.foreign-country-item {
    display: flex;
    align-items: center;
    background-color: #333;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.foreign-country-item:hover {
    background-color: #444;
}

.foreign-country-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    border: 1px solid #000;
}

.foreign-country-info {
    flex-grow: 1;
}

.foreign-country-name {
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.foreign-country-troops {
    font-size: 0.8em;
    color: #ccc;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .top-nav-bar {
        padding: 5px 10px;
    }
    
    .game-title {
        font-size: 1rem;
    }
    
    .nav-button {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    
    .stat-item {
        font-size: 0.8rem;
    }
    
    .menu-panel {
        width: 320px;
        top: 50px;
    }
}

.bottom-menu-frame {
    display: none;
}

/* Add starfield background */
.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.star {
    position: absolute;
    width: 1px;
    height: 1px;
    background-color: white;
    border-radius: 50%;
    opacity: 0;
    animation-name: twinkle;
    animation-duration: 4s;
    animation-iteration-count: infinite;
}

@keyframes twinkle {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

#navalInvadeBtn {
    background-color: #3498db;
    margin-bottom: 10px;
}

#navalInvadeBtn:hover {
    background-color: #2980b9;
}

#cancelNavalBtn {
    background-color: #e74c3c;
    margin-top: 10px;
}

#cancelNavalBtn:hover {
    background-color: #c0392b;
}

.war-status {
    padding: 5px 10px;
    background-color: #e74c3c;
    color: white;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

#attackOptions {
    margin-top: 10px;
    padding: 10px;
    background-color: #333;
    border: 1px solid #555;
    border-radius: 4px;
}

.attack-btn {
    background-color: #e67e22;
}

.attack-btn:hover {
    background-color: #d35400;
}

#warResultPanel {
    margin-top: 10px;
    padding: 10px;
    background-color: #333;
    border: 1px solid #555;
    border-radius: 4px;
}

#battleResultText {
    margin: 5px 0;
}

#activeWarsPanel {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #555;
}

.war-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin: 5px 0;
    background-color: #3a3a3a;
    border-radius: 4px;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.war-countries {
    display: flex;
    align-items: center;
}

.war-country {
    padding: 3px 6px;
    margin: 0 2px;
    background-color: #555;
    border-radius: 3px;
}

.war-duration {
    font-size: 0.8em;
    color: #aaa;
}

.war-attack {
    background-color: #e67e22;
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    color: white;
    cursor: pointer;
    font-size: 0.9em;
}

.war-attack:hover {
    background-color: #d35400;
}

/* Biome Information Styles */
.biome-info-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #555;
}

.biome-info-section h3 {
    margin-bottom: 10px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.biome-effects {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.biome-effect {
    padding: 5px 10px;
    background-color: #333;
    border-radius: 4px;
    font-size: 0.9em;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.biome-distribution {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
    max-height: 150px;
    overflow-y: auto;
}

.biome-type {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    background-color: #333;
    border-radius: 4px;
}

.biome-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid #000;
}

.biome-name {
    font-size: 0.9em;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/* Make room for biomes info on mobile */
@media (max-width: 768px) {
    .biome-distribution {
        max-height: 100px;
    }
    
    .biome-effects {
        flex-direction: column;
        gap: 5px;
    }
}

/* Add styles for camera lock indicator */
#cameraLockIndicator {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 1000;
    pointer-events: none;
    transition: opacity 0.5s;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/* Add styles for the new stats sections */
.economy-stats-section, .military-stats-section {
    margin-bottom: 15px;
}

.stat-box {
    background-color: rgba(50, 50, 50, 0.8);
    border-radius: 5px;
    padding: 12px;
    margin-bottom: 10px;
}

.stat-box h3 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #f0f0f0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.stat-box p {
    margin: 4px 0;
    color: #ffffff;
    font-size: 1.1em;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/* Style for economy stats */
#economyMoneyCount {
    color: #4CAF50;
    font-weight: bold;
}

/* Style for military stats */
#militaryTroopCount {
    color: #f39c12;
    font-weight: bold;
}

.resources-overview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.resource-card {
    background-color: #2a2a2a;
    border-radius: 5px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.resource-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.resource-name {
    font-weight: bold;
    margin-bottom: 2px;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.resource-amount {
    font-size: 0.9em;
    color: #bbb;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.resource-value {
    font-size: 0.8em;
    color: #4CAF50;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.resource-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 10px 0;
}

.resource-map-btn {
    background-color: #333;
    border: 1px solid #555;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
    flex: 1;
    min-width: 80px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.resource-map-btn:hover {
    background-color: #444;
}

.resource-map-btn.active {
    background-color: #4CAF50;
    border-color: #45a049;
}

.legend-container {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.resource-legend {
    width: 100%;
    max-width: 300px;
    border-radius: 4px;
    padding: 5px;
    background-color: #222;
}

.legend-title {
    text-align: center;
    font-size: 0.9em;
    margin-bottom: 5px;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.legend-gradient {
    height: 15px;
    border-radius: 3px;
    margin: 5px 0;
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #ccc;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.resource-extraction-section {
    margin-top: 15px;
}

.action-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    width: 100%;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.action-button:hover {
    background-color: #45a049;
}

#extractorOptions {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#extractorType {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #444;
    color: white;
}

#confirmExtractorBtn, #cancelExtractorBtn {
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#confirmExtractorBtn {
    background-color: #4CAF50;
    color: white;
}

#cancelExtractorBtn {
    background-color: #e74c3c;
    color: white;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .resources-overview {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
    
    .resource-selection {
        flex-wrap: wrap;
    }
    
    .resource-map-btn {
        font-size: 0.8em;
        padding: 8px 5px;
        flex-basis: calc(33.333% - 5px);
        min-width: 0;
    }
}

/* Style for the Show Map button when active */
#showMapBtn.active {
    background-color: #1abc9c; 
    border-color: #16a085;
}