/* Squad map overlay: only the map, in a small always-on-top window */
.is-overlay .window-app-bar,
.is-overlay .navigation-drawer,
.is-overlay #floating-timer-panel {
    display: none !important;
}

.is-overlay .mud-main-content {
    padding: 0 !important;
}

.squad-page.is-overlay {
    height: 100vh;
    padding: 0;
}

.squad-page.is-overlay .squad-roster {
    display: none;
}

.squad-page.is-overlay .squad-map {
    border: none;
    border-radius: 0;
}

.squad-overlay-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 4px 0 8px;
    background: rgba(20, 22, 22, 0.95);
    border-bottom: 1px solid rgba(143, 130, 95, 0.42);
    font-size: 12px;
    user-select: none;
}

.squad-overlay-grip {
    flex: 1;
    min-width: 0;
    cursor: move;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.squad-overlay-bar input[type="range"] {
    width: 70px;
}

.squad-overlay-bar button {
    width: 24px;
    height: 22px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #f2eee2;
    cursor: pointer;
}

.squad-overlay-bar button:hover {
    background: rgba(143, 130, 95, 0.3);
}

/* Squad map page and its Leaflet markers */
.squad-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
    min-height: 320px;
    padding: 0 16px;
    box-sizing: border-box;
}

.squad-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding-bottom: 8px;
}

.squad-toolbar .squad-map-select {
    max-width: 220px;
}

.squad-setup {
    margin-bottom: 8px;
}

.squad-setup .squad-code-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.squad-body {
    display: flex;
    flex: 1;
    gap: 8px;
    min-height: 0;
}

.squad-map {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(143, 130, 95, 0.42);
    border-radius: 4px;
    background: #0e1011;
}

.squad-roster {
    width: 220px;
    flex-shrink: 0;
    overflow-y: auto;
    border: 1px solid rgba(143, 130, 95, 0.42);
    border-radius: 4px;
    background: rgba(20, 22, 22, 0.85);
}

.squad-roster-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    cursor: pointer;
    border-bottom: 1px solid rgba(143, 130, 95, 0.18);
}

.squad-roster-item:hover {
    background: rgba(143, 130, 95, 0.14);
}

.squad-roster-item.is-offline {
    opacity: 0.5;
}

.squad-roster-text {
    min-width: 0;
}

.squad-roster-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.squad-roster-detail {
    font-size: 0.75rem;
    opacity: 0.75;
}

.squad-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid #fff;
}

.squad-empty {
    padding: 12px;
    font-size: 0.85rem;
    opacity: 0.75;
}

@media (max-width: 700px) {
    .squad-body {
        flex-direction: column;
    }

    .squad-roster {
        width: auto;
        max-height: 30%;
    }
}

/* Leaflet markers */
.squad-marker-host {
    background: transparent;
    border: none;
}

.squad-marker svg {
    width: 32px;
    height: 32px;
    overflow: visible;
}

.squad-marker-dot {
    fill: var(--squad-color);
    stroke: #101010;
    stroke-width: 2.5;
}

.squad-marker-nose {
    fill: var(--squad-color);
    stroke: #101010;
    stroke-width: 1.5;
}

.squad-marker.is-self .squad-marker-dot {
    stroke: #ffffff;
    stroke-width: 3;
}

.squad-marker.is-stale {
    opacity: 0.5;
}

.squad-marker.is-other-raid {
    opacity: 0.35;
    filter: grayscale(0.7);
}

.squad-height {
    color: #ffd54f;
    font-weight: 700;
}

.squad-other-raid {
    color: #bdbdbd;
    font-style: italic;
}

.leaflet-tooltip.squad-marker-label {
    background: rgba(16, 16, 16, 0.85);
    color: #f2eee2;
    border: 1px solid rgba(143, 130, 95, 0.6);
    box-shadow: none;
    padding: 1px 6px;
    font-size: 12px;
    font-weight: 500;
}

.leaflet-tooltip.squad-marker-label::before {
    display: none;
}

/* Map info layers */
.squad-layer-host {
    background: transparent;
    border: none;
}

.squad-extract,
.squad-boss {
    transform: translate(-50%, -50%);
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(12, 14, 14, 0.82);
    border: 1px solid currentColor;
}

.squad-extract-pmc { color: #81c784; }
.squad-extract-scav { color: #fff176; }
.squad-extract-shared { color: #4dd0e1; }
.squad-extract-transit { color: #ce93d8; }

.squad-boss {
    color: #ff8a80;
}

.squad-lock {
    width: 16px;
    height: 16px;
}

.squad-lock circle,
.squad-lock path {
    fill: #ffd54f;
    stroke: #101010;
    stroke-width: 1.5;
}

.squad-hazard {
    stroke: #ff5252;
    fill: #ff5252;
    fill-opacity: 0.12;
}

/* Drawing tools */
.leaflet-container.squad-tool-pen,
.leaflet-container.squad-tool-pin {
    cursor: crosshair;
}

.leaflet-container.squad-tool-erase {
    cursor: default;
}

.squad-pin-host {
    background: transparent;
    border: none;
}

.squad-pin {
    width: 24px;
    height: 32px;
    overflow: visible;
}

.squad-pin path {
    fill: var(--squad-color);
    stroke: #101010;
    stroke-width: 1.5;
}

.squad-pin circle {
    fill: #101010;
}

.squad-quest {
    width: 22px;
    height: 22px;
    overflow: visible;
}

.squad-quest path {
    fill: var(--squad-color);
    stroke: #101010;
    stroke-width: 1.5;
}

.squad-quest rect,
.squad-quest circle {
    fill: #101010;
}

.leaflet-tooltip.squad-quest-label {
    max-width: 280px;
    white-space: normal;
    line-height: 1.35;
}

.squad-quest-by {
    opacity: 0.7;
    font-size: 11px;
}

.squad-quest-popup-host .leaflet-popup-content-wrapper,
.squad-quest-popup-host .leaflet-popup-tip {
    background: rgba(20, 22, 22, 0.96);
    color: #f2eee2;
    border: 1px solid rgba(143, 130, 95, 0.6);
}

.squad-quest-popup-host .leaflet-popup-close-button {
    color: #f2eee2;
}

.squad-quest-popup-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.squad-quest-popup-objective {
    font-size: 12px;
    opacity: 0.85;
    margin-bottom: 6px;
}

.squad-quest-popup-pictures {
    font-size: 12px;
    opacity: 0.9;
}

.squad-quest-popup-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    overflow-x: hidden;
    overflow-y: auto;
}

.squad-quest-popup-grid img {
    box-sizing: border-box;
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 3px;
    cursor: zoom-in;
    border: 1px solid rgba(143, 130, 95, 0.4);
}

.squad-quest-popup-link {
    display: inline-block;
    margin-top: 6px;
    color: #4fc3f7 !important;
}

.squad-lightbox {
    position: absolute;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.85);
    cursor: zoom-out;
}

.squad-lightbox img {
    max-width: 92%;
    max-height: 82%;
    object-fit: contain;
    border: 1px solid rgba(143, 130, 95, 0.6);
}

.squad-lightbox-caption {
    color: #f2eee2;
    font-size: 13px;
}

.squad-quest-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding-bottom: 8px;
}

.squad-toolbar .squad-quest-search {
    width: 260px;
    flex: 0 0 auto;
}

.squad-tools {
    display: flex;
    align-items: center;
    gap: 2px;
}

.squad-tools .squad-tool-divider {
    width: 1px;
    height: 22px;
    margin: 0 4px;
    background: rgba(143, 130, 95, 0.42);
}

.squad-map .leaflet-control-layers {
    background: rgba(20, 22, 22, 0.9);
    color: #f2eee2;
}
