.strategy-map-canvas-container {
    flex: 1;
    min-height: 400px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent; /* Remove background */
    padding: 0; /* No padding */
    margin: 0; /* No margin */
    contain: layout; /* Improve rendering performance */
}

#strategy-map-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.save-status {
    /* padding: 5px 10px; */ /* Uncomment to show save status */
    /* background-color: rgba(0, 0, 0, 0.2); */
    /* border-radius: 3px; */
    /* color: #ffffff; */
    /* min-width: 200px; */ /* Prevent resizing */
    /* text-align: center; */
    display: none !important; /* Hide save status */
}

#strategyMapContainer {
    width: 100%;
    height: 600px;
    border: 1px solid #1f4b79;
    background-color: #2C5F7C;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

/* Full-page strategy map container */
#fullPageStrategyMapContainer {
    width: 100%;
    height: auto !important; /* Let it grow with content */
    min-height: auto !important;
    border: 1px solid #1f4b79;
    background-color: #0a2340; /* Match header bar color */
    border-radius: 5px;
    overflow: visible !important; /* Show all content including tools */
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    margin-top: 10px; /* Small positive margin for proper spacing */
    padding: 10px 0 20px 0; /* Add top padding for better spacing */
    display: flex;
    flex-direction: column; /* Stack tools and map vertically */
    align-items: center;
    justify-content: flex-start;
}

/* Scale down the canvas container to fit viewport */
#fullPageStrategyMapContainer .strategy-map-canvas-container {
    transform: scale(0.9); /* Scale down to 90% for better fit */
    transform-origin: center center; /* Origin at center for better positioning */
    width: 1024px !important;
    height: 1024px !important;
    background-color: #2C5F7C !important;
    margin-top: -50px; /* Pull up to reduce vertical gap */
}

/* Ensure the strategy map area contains the scaled content properly */
#fullPageStrategyMapContainer .strategy-map-area {
    height: auto; /* Let it size based on content */
    overflow: visible; /* Show all content */
    display: flex;
    justify-content: center;
    align-items: center; /* Center vertically */
    margin-bottom: 0; /* No extra margin */
    padding: 20px 0; /* Add vertical padding for better spacing */
}

/* Strategy page specific styles */
#strategyPage .strategy-info {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#strategyPage .strategy-info h2 {
    margin-bottom: 10px;
}

/* Make the strategy map tools more visible on full-page view */
#strategyPage .strategy-map-tools {
    background-color: rgba(13, 38, 68, 0.9);
    padding: 15px;
    border-radius: 5px 5px 0 0;
}

#strategyPage .tool-btn,
#strategyPage .action-btn {
    width: 40px;
    height: 40px;
}

/* Improve visibility of the active tools */
#strategyPage .tool-btn.active {
    background-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

/* Add media query for mobile devices */
@media (max-width: 768px) {
    #fullPageStrategyMapContainer {
        height: 500px;
        min-height: 500px;
    }

    #strategyPage .strategy-map-tools {
        padding: 10px;
    }

    #strategyPage .tool-btn,
    #strategyPage .action-btn {
        width: 36px;
        height: 36px;
    }
}

/* Strategy Map Wrapper Styles */
.strategy-map-container {
    display: flex;
    flex-direction: column;
    background: #0a2340;
    border-radius: 5px;
    overflow: hidden;
    min-height: 600px;
}

.strategy-map-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.strategy-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #102a43;
    border-bottom: 1px solid #1f4b79;
}

.map-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.map-selector label {
    font-weight: bold;
    color: #ffffff;
}

.map-selector select {
    padding: 5px 10px;
    background-color: #1c3a5e;
    color: #ffffff;
    border: 1px solid #2c5282;
    border-radius: 3px;
    cursor: pointer;
}

.strategy-map-tools {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 10px;
    background-color: #102a43;
    border-bottom: 1px solid #1f4b79;
    overflow: visible;
    width: max-content;
    margin: 0 auto;
    justify-content: center;
}

.tool-group {
    display: flex;
    gap: 5px;
    padding: 5px;
    border: 1px solid #1f4b79;
    border-radius: 3px;
    background-color: #0f2337;
}

.tool-btn, .width-btn, .action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Blue glassy effect */
    background: rgba(52, 152, 219, 0.15) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(52, 152, 219, 0.3) !important;
    box-shadow: 
        inset 0 0 20px rgba(52, 152, 219, 0.1),
        0 0 15px rgba(52, 152, 219, 0.05),
        0 8px 32px rgba(0, 0, 0, 0.3) !important;
    border-radius: 8px !important;
    cursor: pointer;
    color: #ffffff;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.color-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    border-radius: 8px !important;
    /* Color buttons keep their background colors but with glass overlay */
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
}

/* Glass shine effect for all buttons */
.tool-btn::before, .action-btn::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    transition: all 0.6s;
}

.tool-btn:hover::before, .action-btn:hover::before {
    animation: glass-shine 0.6s ease-in-out;
}

@keyframes glass-shine {
    0% {
        transform: rotate(45deg) translateY(-100%);
    }
    100% {
        transform: rotate(45deg) translateY(100%);
    }
}

.tool-btn:hover, .action-btn:hover, .width-btn:hover {
    background: rgba(52, 152, 219, 0.25) !important;
    border-color: rgba(52, 152, 219, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 
        inset 0 0 20px rgba(52, 152, 219, 0.2),
        0 0 20px rgba(52, 152, 219, 0.1),
        0 12px 40px rgba(0, 0, 0, 0.4) !important;
}

.tool-btn.active {
    background: rgba(59, 130, 246, 0.3) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
    box-shadow: 
        inset 0 0 20px rgba(59, 130, 246, 0.2),
        0 0 25px rgba(59, 130, 246, 0.3),
        0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

/* Hide hand/pan tool - uncomment to show */
.tool-btn[data-tool="pan"] {
    display: none !important;
}

.tool-btn:hover, .color-btn:hover, .width-btn:hover, .action-btn:hover {
    background-color: #2c5282;
}

.tool-btn.active {
    background-color: #3b82f6;
    border-color: #60a5fa;
}

.color-btn {
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(255, 255, 255, 0.1),
        0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

/* Glass overlay effect for color buttons */
.color-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(0, 0, 0, 0.1) 100%
    );
    border-radius: 6px;
    pointer-events: none;
}

.color-btn:hover {
    transform: translateY(-2px) scale(1.1);
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 
        inset 0 0 15px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(255, 255, 255, 0.2),
        0 12px 40px rgba(0, 0, 0, 0.4) !important;
}

.color-btn.active {
    transform: scale(1.1);
    border-color: #ffffff !important;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.3),
        0 0 30px currentColor,
        0 8px 32px rgba(0, 0, 0, 0.4) !important;
}

.color-btn.active::after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 16px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

.line-width {
    display: flex;
    align-items: center;
    gap: 5px;
}

.width-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.width-btn span {
    width: 15px;
    background-color: white;
}

/* Fullscreen width button lines */
.fullscreen-mode .width-btn span {
    max-width: 90% !important;
    background-color: white !important;
    display: block !important;
}

/* Width button styling already handled in the general hover rule above */

.width-btn.active {
    background: rgba(59, 130, 246, 0.3) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
    box-shadow: 
        inset 0 0 20px rgba(59, 130, 246, 0.2),
        0 0 25px rgba(59, 130, 246, 0.3),
        0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

/* Ship icons sizing */
.ship-icons img {
    width: 20px;
    height: 20px;
}

.lock-controls {
    /* display: inline-block; */ /* Uncomment to show lock controls */
    display: none !important; /* Hide lock controls */
    margin: 0 10px;
}

.lock-btn {
    padding: 5px 10px;
    margin: 0 5px;
    font-weight: bold;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

#lockStrategyBtn {
    background-color: #ff9900;
}

#unlockStrategyBtn {
    background-color: #4caf50;
}

#unlockStrategyBtn {
    background-color: #4caf50;
    color: #fff;
    border: 1px solid #388e3c;
}

#unlockStrategyBtn:hover {
    background-color: #388e3c;
}

.lock-status {
    /* display: flex; */ /* Uncomment to show lock status */
    display: none !important; /* Hide lock status */
    align-items: center;
    margin-right: 15px;
    font-size: 0.9rem;
}

.lock-status-text {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Locked Overlay */
.locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: none; /* Allow clicking through */
}

.locked-message {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px 25px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    border: 1px solid #ff9900;
    box-shadow: 0 0 15px rgba(255, 153, 0, 0.4);
}

.locked-message i {
    font-size: 2rem;
    color: #ff9900;
}

.locked-message span {
    font-size: 1.2rem;
    color: #fff;
    font-weight: bold;
}

/* Disabled tools when locked */
.edit-tools.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Refresh button styling */
#refresh-btn {
    background-color: #3498db;
    color: white;
    border: 1px solid #2980b9;
}

#refresh-btn:hover {
    background-color: #2980b9;
}

/* Real-time sync indicator */
.sync-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 5px;
    pointer-events: none;
    transition: opacity 0.3s;
    opacity: 0;
}

.sync-indicator.active {
    opacity: 1;
}

.sync-indicator i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ensure the strategy map header has enough space for controls */
.strategy-map-header {
    padding: 10px 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .strategy-map-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .lock-controls {
        width: 100%;
        justify-content: space-between;
    }

    .lock-status, .save-status {
        width: 100%;
        justify-content: space-between;
        margin-top: 5px;
    }
}
/* Mobile optimizations for strategy map */
@media (max-width: 768px) {
    .strategy-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .strategy-title-container {
        width: 100%;
        margin-bottom: 15px;
    }

    .strategy-title {
        font-size: 1.5rem;
    }

    #fullPageStrategyMapContainer {
        height: 500px !important;
        min-height: 500px !important;
        overflow: auto !important;
    }

    .strategy-map-tools {
        overflow-x: auto;
        padding: 5px;
        justify-content: flex-start;
        width: 100%;
    }

    .tool-group {
        margin: 0 3px;
        padding: 3px;
    }

    .tool-btn, .color-btn, .width-btn, .action-btn {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .strategy-map-canvas-container {
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .strategy-map-tools {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 4px;
    }

    .tool-btn, .color-btn, .width-btn, .action-btn {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .tool-group {
        padding: 2px;
        margin: 0 2px;
    }
}
/* Add this after existing CSS */
/* Radar Modal */
.radar-modal {
    display: none;
    position: fixed;
    z-index: 999999999 !important;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

/* Ensure radar modal works in fullscreen */
.fullscreen-mode .radar-modal {
    z-index: 999999999 !important;
}

.fullscreen-mode .radar-modal-content {
    z-index: 999999999 !important;
    margin: 10% auto !important; /* Better positioning in fullscreen */
}

.radar-modal-content {
    background-color: #0a2340;
    color: white;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #1f4b79;
    border-radius: 8px;
    width: 300px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.radar-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.radar-modal-close:hover {
    color: white;
}

#radar-range-input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #1f4b79;
    border-radius: 4px;
    background-color: #1c3a5e;
    color: white;
}

#radar-range-submit {
    background-color: #3498db;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
}

#radar-range-submit:hover {
    background-color: #2980b9;
}
.radar-modal {
    z-index: 999999999 !important; /* Extremely high to ensure it's on top in fullscreen */
    display: none;
}

.radar-modal-content {
    position: relative;
    z-index: 999999999; /* Same high value */
}

/* Fullscreen mode styling */
.fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background-color: #0C2138 !important; /* Card background color */
    overflow: hidden !important;
}

/* Hide the strategy header bar in fullscreen mode */
.fullscreen-mode #strategy-header-bar {
    display: none !important;
}

/* Hide non-fullscreen tools in fullscreen mode */
.fullscreen-mode > .strategy-map-tools:not(.fullscreen-tools) {
    display: none !important;
}

/* Fullscreen layout container */
.fullscreen-mode .strategy-map-wrapper {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* Tools panel on the right in fullscreen */
.fullscreen-mode .strategy-map-tools {
    position: fixed !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 220px !important; /* Slightly wider for better spacing */
    height: auto !important;
    max-height: 90vh !important; /* More vertical space */
    background-color: rgba(16, 42, 67, 0.98) !important;
    backdrop-filter: blur(15px) !important;
    padding: 20px 15px !important;
    margin: 0 !important;
    border-radius: 15px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important; /* Reduced gap between groups */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 10001 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Hide header placeholder in fullscreen */
.fullscreen-mode #active-users-header-placeholder {
    display: none !important;
}

/* Hide active users container in normal mode (it should be in header) */
#active-users-container:not(#active-users-header-placeholder #active-users-container) {
    display: none !important;
}

/* Show active users container when inside header placeholder */
#active-users-header-placeholder #active-users-container {
    display: flex !important;
}

/* Fullscreen active users container - positioned at top */
.fullscreen-mode #fullscreen-active-users {
    position: fixed !important;
    left: 60px !important; /* Even more distance from left edge */
    top: 50% !important; /* Center vertically */
    transform: translateY(-50%) !important; /* Center adjustment */
    width: 180px !important; /* Back to original width */
    max-height: 85vh !important; /* Better height constraint */
    z-index: 10002 !important;
    background-color: rgba(16, 42, 67, 0.98) !important;
    backdrop-filter: blur(15px) !important;
    padding: 20px 15px !important;
    border-radius: 15px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    margin-left: 0 !important;
    right: auto !important;
}

/* Style fullscreen active users heading */
#fullscreen-active-users h4 {
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: bold !important;
    margin: 0 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    opacity: 1 !important;
    text-align: center !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

#fullscreen-active-users-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    align-items: stretch !important;
    padding: 5px 0 !important;
}

#fullscreen-active-users .active-user {
    display: flex !important;
    flex-direction: row !important; /* Horizontal layout */
    align-items: center !important;
    gap: 12px !important;
    padding: 12px !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
}

#fullscreen-active-users .active-user:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

#fullscreen-active-users .user-avatar {
    width: 45px !important;
    height: 45px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    background-size: cover !important;
    background-position: center !important;
}

#fullscreen-active-users .user-name {
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    word-break: break-word !important;
    flex: 1 !important;
    text-align: left !important;
}

#fullscreen-active-users .no-users {
    text-align: center !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 14px !important;
    padding: 30px 10px !important;
    font-style: italic !important;
}


/* Style the join code display in fullscreen */
.fullscreen-mode #strategy-code-display {
    background: rgba(76, 195, 247, 0.2) !important;
    border: 1px solid rgba(76, 195, 247, 0.3) !important;
    margin-bottom: 15px !important;
}

.fullscreen-mode #strategy-code {
    color: #4fc3f7 !important;
    font-size: 18px !important;
    letter-spacing: 3px !important;
}


/* Canvas container in fullscreen */
.fullscreen-mode .strategy-map-canvas-container {
    position: fixed !important;
    top: 50px !important; /* Position for the container */
    left: 260px !important; /* Adjusted for new active users position */
    right: 240px !important; /* More space for wider tools panel */
    bottom: 5px !important; /* Minimal bottom margin */
    width: auto !important;
    height: calc(100vh - 55px) !important; /* Adjusted for positioning */
    max-width: none !important; /* Remove max width constraint */
    max-height: none !important;
    margin: 0 auto !important;
    border-radius: 0 !important;
    padding: 0 !important; /* No padding */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important; /* Center the canvas */
    background-color: #0C2138 !important; /* Card background color */
    overflow: auto !important; /* Allow scrolling if needed */
}

/* Add divider between map and tools */
.fullscreen-mode::after {
    content: "";
    position: fixed;
    right: 235px; /* Adjusted to match new spacing */
    top: 60px;
    bottom: 10px;
    width: 1px;
    background: linear-gradient(to bottom, 
        transparent, 
        rgba(255, 255, 255, 0.1) 10%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 90%, 
        transparent);
    z-index: 10000;
}

/* Add divider between active users and map - removed */

.fullscreen-mode #edit_window {
    position: relative !important;
    width: 1024px !important; /* Fixed size to match canvas */
    height: 1024px !important; /* Fixed size to match canvas */
    max-width: none !important; /* Don't constrain size */
    max-height: none !important; /* Don't constrain size */
    margin: 0 !important;
    padding: 0 !important;
    background-color: #0C2138 !important; /* Card background color */
    overflow: hidden !important; /* Prevent drawing outside canvas */
    border-radius: 8px !important; /* Match canvas border radius */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

.fullscreen-mode #strategy-map-canvas {
    position: absolute !important;
    width: 1024px !important; /* Keep original size */
    height: 1024px !important; /* Keep original size */
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    left: 50% !important;
    top: 50% !important; /* Center vertically */
    transform: translate(-50%, -50%) !important; /* Standard centering */
    transform-origin: center center !important;
}

.fullscreen-mode .strategy-map-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 60px !important;
    background-color: rgba(16, 42, 67, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    padding: 12px 20px !important;
    border-radius: 0 !important;
    z-index: 10000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

/* Position top controls at the very top in fullscreen - centered with map */
.fullscreen-mode .strategy-top-controls {
    position: fixed !important;
    top: 10px !important;
    left: 50% !important; /* Center horizontally */
    transform: translateX(-50%) scale(0.85) !important; /* Scale down to 85% */
    height: auto !important;
    background-color: rgba(16, 42, 67, 0.98) !important;
    backdrop-filter: blur(15px) !important;
    padding: 8px 15px !important; /* Reduced padding */
    z-index: 10000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    width: auto !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Prevent save status from resizing in fullscreen */
.fullscreen-mode .strategy-top-controls .save-status {
    min-width: 180px !important; /* Reduced width */
    white-space: nowrap !important;
    font-size: 12px !important; /* Smaller font */
}

/* Tool groups in grid layout */
.fullscreen-mode .tool-group {
    display: flex !important; /* Change to flex for better containment */
    flex-wrap: wrap !important;
    gap: 10px !important; /* Better spacing between buttons */
    padding: 14px !important;
    width: 100% !important;
    background-color: rgba(15, 35, 55, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(31, 75, 121, 0.5) !important;
    border-radius: 10px !important;
    position: relative !important;
    box-sizing: border-box !important;
    justify-content: center !important; /* Center items horizontally */
    align-items: center !important; /* Center items vertically */
}

/* Add labels to tool groups */
.fullscreen-mode .tool-group::before {
    content: attr(data-label);
    position: absolute;
    top: -8px;
    left: 10px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    background-color: rgba(16, 42, 67, 0.98);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Special layout for drawing tools */
.fullscreen-mode .tool-group:first-child {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
}

/* Ship icons group */
.fullscreen-mode .ship-icons {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
}

.fullscreen-mode .tool-btn,
.fullscreen-mode .action-btn {
    width: 45px !important;
    height: 45px !important;
    font-size: 16px !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* Enhanced blue glassy effect for fullscreen */
    background: rgba(52, 152, 219, 0.12) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(52, 152, 219, 0.25) !important;
    box-shadow: 
        inset 0 0 25px rgba(52, 152, 219, 0.08),
        0 0 20px rgba(52, 152, 219, 0.05),
        0 10px 35px rgba(0, 0, 0, 0.35) !important;
}

.fullscreen-mode .tool-btn:hover,
.fullscreen-mode .action-btn:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Active tool highlighting in fullscreen */
.fullscreen-mode .tool-btn.active {
    background-color: #3b82f6 !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.6) !important;
}

.fullscreen-mode .width-btn.active {
    background-color: #3b82f6 !important;
    border-color: #60a5fa !important;
}

/* Color picker in 3x2 grid - remove extra background */
.fullscreen-mode .color-picker {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 0 !important; /* Remove padding */
    width: 100% !important;
    background-color: transparent !important; /* No background */
    border: none !important; /* No border */
    border-radius: 0 !important;
    box-sizing: border-box !important;
    justify-content: center !important;
    align-items: center !important;
}

.fullscreen-mode .color-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    transition: all 0.2s ease !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer !important;
    position: relative !important;
    flex-shrink: 0 !important;
}

.fullscreen-mode .color-btn:hover {
    transform: scale(1.1) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.fullscreen-mode .color-btn.active {
    border-color: #ffffff !important;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.5) !important;
}

/* Line width in horizontal layout */
.fullscreen-mode .line-width {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 0 !important; /* Remove padding to match other groups */
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.fullscreen-mode .width-btn {
    width: 40px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    padding: 0 4px !important;
}

/* Action buttons in 2x2 grid */
.fullscreen-mode .tool-group.edit-tools:last-child {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
}

/* Hide horizontal scrollbar in fullscreen tools */
.fullscreen-mode .strategy-map-tools::-webkit-scrollbar {
    width: 4px;
}

.fullscreen-mode .strategy-map-tools::-webkit-scrollbar-track {
    background: transparent;
}

.fullscreen-mode .strategy-map-tools::-webkit-scrollbar-thumb {
    background: #2c5282;
    border-radius: 2px;
}

/* Nice staged toolbar for desktop */
@media (min-width: 1024px) {
    .strategy-map-tools {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 20px;
        flex-wrap: nowrap;
        overflow: visible; /* Allow content to exceed container */
        width: max-content; /* Width based on content */
        margin: 0 auto; /* Center the toolbar */
    }
    
    .tool-group {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        background-color: rgba(15, 35, 55, 0.5);
        backdrop-filter: blur(5px);
        border: 1px solid #1f4b79;
        border-radius: 8px;
        transition: all 0.3s ease;
    }
    
    .tool-group:hover {
        background-color: rgba(15, 35, 55, 0.8);
        border-color: #3b82f6;
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
    }
    
    .fullscreen-mode .tool-group {
        background-color: rgba(15, 35, 55, 0.7);
    }
    
    /* Fullscreen button special styling */
    #fullscreen-btn {
        background-color: #4b5563;
        transition: all 0.3s ease;
    }
    
    #fullscreen-btn:hover {
        background-color: #6b7280;
        transform: scale(1.1);
    }
    
    #fullscreen-btn.active {
        background-color: #10b981;
        box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
    }
}

/* Fix for fullPageStrategyMapContainer to prevent extra space below map */
#fullPageStrategyMapContainer {
    height: fit-content \!important;
    min-height: unset \!important;
    max-height: none \!important;
}

/* Ensure strategy page and card dont force height */
#strategyPage {
    min-height: unset \!important;
    height: auto \!important;
}

#strategyPage .card {
    min-height: unset \!important;
    height: auto \!important;
}

/* Override any page minimum heights */
.page {
    min-height: unset \!important;
    height: auto \!important;
}

main {
    min-height: unset \!important;
    height: auto \!important;
}

.container {
    min-height: unset \!important;
    height: auto \!important;
}

/* Specific fix for strategy page container sizing */
#strategyPage .card {
    display: flex;
    flex-direction: column;
}

#fullPageStrategyMapContainer {
    flex: 0 0 auto; /* Do not grow or shrink, size based on content */
}
/* Emergency height fix with maximum specificity */
body .page#strategyPage {
    min-height: auto \!important;
    height: auto \!important;
    max-height: none \!important;
}

body .page#strategyPage .card {
    min-height: auto \!important;
    height: auto \!important;
    max-height: none \!important;
}

body .page#strategyPage .card #fullPageStrategyMapContainer {
    height: auto \!important;
    min-height: auto \!important;
    max-height: none \!important;
}

/* Remove any inline styles */
#strategyPage[style*="min-height"] {
    min-height: auto \!important;
}

.card[style*="min-height"] {
    min-height: auto \!important;
}

#fullPageStrategyMapContainer[style*="height"] {
    height: auto \!important;
}

/* Responsive adjustments for standard zoom levels */
@media screen and (min-resolution: 96dpi) and (max-resolution: 120dpi) {
    /* Adjustments for 100% browser zoom */
    #fullPageStrategyMapContainer .strategy-map-canvas-container {
        transform: scale(0.85) !important; /* Slightly smaller for 100% zoom */
    }
    
    .fullscreen-mode .strategy-map-canvas-container {
        top: 60px !important; /* Less top spacing at 100% zoom */
        height: calc(100vh - 70px) !important;
    }
    
    .fullscreen-mode .strategy-map-tools {
        right: 5px !important; /* Tighter spacing */
        width: 180px !important; /* Narrower tools panel */
    }
    
    .fullscreen-mode #fullscreen-active-users {
        left: 5px !important; /* Tighter spacing */
        width: 160px !important; /* Narrower users panel */
    }
    
    .fullscreen-mode .strategy-map-canvas-container {
        left: 190px !important; /* Adjust for narrower panels */
        right: 210px !important;
    }
    
    .fullscreen-mode #strategy-map-canvas {
        transform: translate(-50%, -50%) !important; /* No additional scaling at 100% zoom */
    }
    
    /* Adjust divider */
    .fullscreen-mode::after {
        right: 185px !important;
    }
}

/* Checkpoint dropdown styles */
.checkpoint-dropdown {
    position: relative;
    display: inline-block;
}

.checkpoint-dropdown .checkpoint-main {
    position: relative;
}

.checkpoint-dropdown .checkpoint-options {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(52, 152, 219, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(52, 152, 219, 0.4);
    border-radius: 8px;
    padding: 4px;
    display: none;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.checkpoint-dropdown:hover .checkpoint-options {
    display: block;
}

.checkpoint-option {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(52, 152, 219, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 6px;
    cursor: pointer;
    color: #ffffff;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.checkpoint-option:last-child {
    margin-bottom: 0;
}

.checkpoint-option:hover {
    background: rgba(52, 152, 219, 0.3);
    border-color: rgba(52, 152, 219, 0.5);
    transform: translateX(2px);
    box-shadow: 
        inset 0 0 20px rgba(52, 152, 219, 0.2),
        0 0 20px rgba(52, 152, 219, 0.1),
        0 4px 16px rgba(0, 0, 0, 0.3);
}

.checkpoint-option.active {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 
        inset 0 0 20px rgba(59, 130, 246, 0.2),
        0 0 25px rgba(59, 130, 246, 0.3),
        0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Free-draw dropdown styles */
.freedraw-dropdown {
    position: relative;
    display: inline-block;
}

.freedraw-dropdown .freedraw-main {
    position: relative;
}

.freedraw-dropdown .freedraw-options {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(52, 152, 219, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(52, 152, 219, 0.4);
    border-radius: 8px;
    padding: 4px;
    display: none;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    flex-direction: column;
}

.freedraw-dropdown:hover .freedraw-options {
    display: flex;
}

.freedraw-option {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(52, 152, 219, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 6px;
    cursor: pointer;
    color: #ffffff;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.freedraw-option:last-child {
    margin-bottom: 0;
}

.freedraw-option:hover {
    background: rgba(52, 152, 219, 0.3);
    border-color: rgba(52, 152, 219, 0.5);
    transform: translateX(2px);
    box-shadow: 
        inset 0 0 20px rgba(52, 152, 219, 0.2),
        0 0 20px rgba(52, 152, 219, 0.1),
        0 4px 16px rgba(0, 0, 0, 0.3);
}

.freedraw-option.active {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 
        inset 0 0 20px rgba(59, 130, 246, 0.2),
        0 0 25px rgba(59, 130, 246, 0.3),
        0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Line dropdown styles */
.line-dropdown {
    position: relative;
    display: inline-block;
}

.line-dropdown .line-main {
    position: relative;
}

.line-dropdown .line-options {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(52, 152, 219, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(52, 152, 219, 0.4);
    border-radius: 8px;
    padding: 4px;
    display: none;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    flex-direction: column;
}

.line-dropdown:hover .line-options {
    display: flex;
}

.line-option {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(52, 152, 219, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 6px;
    cursor: pointer;
    color: #ffffff;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.line-option:last-child {
    margin-bottom: 0;
}

.line-option:hover {
    background: rgba(52, 152, 219, 0.3);
    border-color: rgba(52, 152, 219, 0.5);
    transform: translateX(2px);
    box-shadow: 
        inset 0 0 20px rgba(52, 152, 219, 0.2),
        0 0 20px rgba(52, 152, 219, 0.1),
        0 4px 16px rgba(0, 0, 0, 0.3);
}

.line-option.active {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 
        inset 0 0 20px rgba(59, 130, 246, 0.2),
        0 0 25px rgba(59, 130, 246, 0.3),
        0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Dropdown caret indicator on main buttons */
.freedraw-main::after,
.checkpoint-main::after,
.line-main::after {
    content: "\25BE"; /* ▼ small caret */
    font-size: 8px;
    position: absolute;
    bottom: 3px;
    right: 3px;
    color: #ffffff;
    opacity: 0.8;
    pointer-events: none;
}
