/* Map module (tactical HUD editor) */
.map-module .perso-carousel {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.map-card-banner {
    position: relative;
    min-height: 108px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(250, 204, 21, 0.26);
}

.map-card-icon {
    width: 36px;
    height: 36px;
    color: rgba(250, 204, 21, 0.82);
    z-index: 1;
}

.map-article-title {
    margin-bottom: 0.55rem;
}

.map-publish-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    border: 1px solid rgba(250, 204, 21, 0.3);
    background: rgba(10, 12, 16, 0.8);
    padding: 0.45rem 0.55rem;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    cursor: pointer;
}

.map-publish-toggle input {
    accent-color: #facc15;
}

.map-publish-toggle .lucide {
    width: 14px;
    height: 14px;
    color: #facc15;
}

.map-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 1rem;
    align-items: start;
}

.map-editor-board-wrap {
    overflow: auto;
    border: 1px solid rgba(250, 204, 21, 0.2);
    padding: 0.45rem;
    background: rgba(6, 8, 12, 0.75);
}

.corner-frame {
    position: relative;
}

.corner-frame::before,
.corner-frame::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-color: rgba(250, 204, 21, 0.66);
    pointer-events: none;
}

.corner-frame::before {
    left: -1px;
    top: -1px;
    border-left: 1px solid;
    border-top: 1px solid;
}

.corner-frame::after {
    right: -1px;
    bottom: -1px;
    border-right: 1px solid;
    border-bottom: 1px solid;
}

.map-editor-board {
    width: min(100%, 760px);
    display: grid;
    grid-template-columns: repeat(30, minmax(18px, 1fr));
    border: 1px solid rgba(250, 204, 21, 0.15);
    background: rgba(5, 7, 10, 0.95);
}

.map-cell {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(13, 17, 23, 0.8);
    padding: 0;
    border-radius: 0;
    cursor: pointer;
    overflow: hidden;
}

.map-cell.is-drag-over {
    outline: 1px solid rgba(250, 204, 21, 0.75);
    outline-offset: -1px;
}

.map-cell-terrain-icon {
    width: 30%;
    height: 30%;
    color: rgba(250, 204, 21, 0.45);
    pointer-events: none;
}

.map-terrain-empty { background: rgba(13, 17, 23, 0.8); }
.map-terrain-wall {
    background:
        repeating-linear-gradient(
            45deg,
            rgba(156, 163, 175, 0.34) 0px,
            rgba(156, 163, 175, 0.34) 3px,
            rgba(75, 85, 99, 0.3) 3px,
            rgba(75, 85, 99, 0.3) 6px
        ),
        rgba(55, 65, 81, 0.36);
}
.map-terrain-water { background: rgba(59, 130, 246, 0.32); }
.map-terrain-forest { background: rgba(34, 197, 94, 0.32); }
.map-terrain-height { background: rgba(251, 191, 36, 0.26); }
.map-terrain-cover { background: rgba(156, 163, 175, 0.25); }
.map-terrain-fort { background: rgba(239, 68, 68, 0.25); }

.map-spawn-marker {
    position: absolute;
    right: 1px;
    bottom: 1px;
    font-size: 0.5rem;
    line-height: 1;
    padding: 1px 2px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.5);
}

.map-spawn-marker.is-p1 {
    color: #93c5fd;
    border-color: rgba(147, 197, 253, 0.75);
}

.map-spawn-marker.is-p2 {
    color: #fca5a5;
    border-color: rgba(252, 165, 165, 0.75);
}

.map-editor-sidebar {
    position: sticky;
    top: 82px;
    display: grid;
    gap: 0.75rem;
}

.map-sidebar-block {
    border: 1px solid rgba(250, 204, 21, 0.24);
    background: rgba(7, 9, 13, 0.84);
    padding: 0.55rem;
    display: grid;
    gap: 0.45rem;
}

.map-sidebar-block h3 {
    margin: 0;
    color: #facc15;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.map-tools {
    display: grid;
    gap: 0.38rem;
}

.map-tool {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: center;
    gap: 0.42rem;
    border: 1px solid rgba(250, 204, 21, 0.24);
    background: rgba(13, 17, 23, 0.84);
    color: #e5e7eb;
    padding: 0.4rem 0.45rem;
    border-radius: 0;
    cursor: grab;
}

.map-tool .lucide {
    width: 14px;
    height: 14px;
    color: rgba(250, 204, 21, 0.82);
}

.map-tool span {
    text-transform: uppercase;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
}

.map-tool.is-active,
.map-tool:hover {
    border-color: rgba(250, 204, 21, 0.72);
    background: rgba(250, 204, 21, 0.08);
}

.map-spawn-palette {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
}

.map-spawn-token {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(14, 16, 21, 0.88);
    color: #f3f4f6;
    border-radius: 0;
    min-height: 30px;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: grab;
}

.map-spawn-token.is-p1 {
    border-color: rgba(147, 197, 253, 0.55);
    color: #bfdbfe;
}

.map-spawn-token.is-p2 {
    border-color: rgba(252, 165, 165, 0.55);
    color: #fecaca;
}

.map-spawn-token.is-active {
    background: rgba(250, 204, 21, 0.12);
    border-color: rgba(250, 204, 21, 0.78);
    color: #fde68a;
}

@media (max-width: 1200px) {
    .map-editor-layout {
        grid-template-columns: 1fr;
    }

    .map-editor-sidebar {
        position: static;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .map-editor-sidebar {
        grid-template-columns: 1fr;
    }

    .map-publish-toggle span {
        display: none;
    }
}
