/* Map detail cards, panels, and drop tiles. */

.map-category-pill,
.map-level-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #7d321d;
    border-radius: 3px;
    background:
        linear-gradient(180deg, rgba(255, 244, 196, 0.7), rgba(229, 205, 137, 0.72)),
        #fff9df;
    box-shadow: inset 0 0 8px rgba(112, 68, 27, 0.16);
    color: var(--accent-strong);
    font-size: 0.84rem;
    font-weight: 900;
}

.map-category-pill {
    text-transform: uppercase;
}

.map-drop-tile {
    position: relative;
    display: grid;
    place-items: center;
    width: 32px;
    border: 0;
    border-radius: 3px;
    background: #fff9df;
    box-shadow: inset 0 0 8px rgba(112, 68, 27, 0.16);
}

.map-drop-count {
    position: absolute;
    right: 0;
    bottom: 0;
    min-width: 16px;
    padding: 0 3px;
    border: 1px solid #3a1209;
    border-radius: 999px;
    background: linear-gradient(180deg, #8b6040, #3a1209);
    color: #fff4cf;
    font-size: 0.56rem;
    font-weight: 900;
    line-height: 1.4;
    text-align: center;
}

.map-wiki-info-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 34%);
    min-height: 320px;
}

.map-wiki-card--no-preview .map-wiki-info-grid {
    grid-template-columns: 1fr;
}

.map-wiki-card--no-preview .map-wiki-info-copy {
    min-height: 420px;
    padding-right: 28px;
}

.map-wiki-card--no-preview .map-wiki-description {
    max-width: none;
}

.map-wiki-info-copy {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 24px 20px 22px 0;
}

.map-wiki-vertical-title {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 230px;
    min-width: 54px;
    padding: 14px 9px;
    border: 1px solid #f0d9a2;
    border-radius: 0 13px 13px 0;
    background: #2f1d1f;
    color: #f0d9a2;
    font-size: 0.95rem;
    font-weight: 900;
    line-height: 1.38;
    writing-mode: vertical-rl;
    text-orientation: upright;
    text-shadow: 1px 1px 2px #000;
    box-shadow: 2px 3px 7px rgba(20, 8, 2, 0.36);
}

.map-wiki-description {
    max-width: 980px;
    color: #12110c;
    font-size: clamp(1rem, 1.12vw, 1.15rem);
    line-height: 1.42;
}

.map-wiki-description p {
    margin: 0 0 8px;
}

.map-wiki-description p:last-child {
    margin-bottom: 0;
}

.map-wiki-description a {
    color: #21170e;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.map-wiki-preview-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0 24px 18px;
    border-left: 2px dashed #9e332d;
}

.map-wiki-map-button {
    width: min(360px, 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 8px 22px;
    border: 1px solid #f0d9a2;
    border-radius: 0 0 11px 11px;
    background: #2f1d1f;
    color: #f0d9a2;
    font-size: clamp(1rem, 1.2vw, 1.18rem);
    font-weight: 900;
    text-align: center;
    text-decoration: none;
    text-shadow: 1px 1px 2px #000;
    box-shadow: 2px 3px 7px rgba(20, 8, 2, 0.36);
}

.map-wiki-map-button:hover,
.map-wiki-map-button:focus-visible {
    color: #fff7d7;
    background: #3a2528;
    transform: translateY(-1px);
}

.map-wiki-map-button--disabled,
.map-wiki-map-button--disabled:hover {
    color: rgba(240, 217, 162, 0.72);
    background: #2f1d1f;
    cursor: default;
    transform: none;
}

.map-wiki-preview-frame {
    width: min(100%, 390px);
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #050505;
    color: rgba(255, 255, 255, 0.58);
    font-weight: 800;
    text-align: center;
}

.map-wiki-preview-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-wiki-facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.map-wiki-card .map-category-pill,
.map-wiki-card .map-level-pill {
    min-height: 24px;
    padding: 3px 9px;
    border: 1px solid rgba(100, 16, 13, 0.22);
    background: #fff8cc;
    color: #4b1713;
    font-size: 0.76rem;
    font-weight: 900;
}

.map-wiki-sections {
    display: grid;
    grid-template-columns: minmax(210px, 0.9fr) minmax(190px, 300px) minmax(420px, 1.35fr);
    gap: 12px;
    padding: 18px 12px 14px;
}

.map-wiki-section-stack {
    display: grid;
    align-content: start;
    gap: 14px;
}

.map-wiki-section-stack--right {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.map-wiki-panel {
    min-width: 0;
}

.map-wiki-panel--drops {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(1080px, calc(100% - 48px));
}

.map-wiki-panel h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(230px, 70%);
    min-height: 44px;
    margin: 0 auto 8px;
    padding: 6px 14px;
    border: 1px solid #f0d9a2;
    border-radius: 12px;
    background: #2f1d1f;
    color: #f0d9a2;
    font-family: Tahoma, Arial, sans-serif;
    font-size: clamp(1rem, 1.1vw, 1.18rem);
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-shadow: 1px 1px 2px #000;
    box-shadow: 2px 3px 7px rgba(20, 8, 2, 0.36);
}

.map-wiki-box {
    box-sizing: border-box;
    height: 360px;
    min-height: 0;
    padding: 8px 9px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 2px dashed #9e332d;
    background: rgba(255, 255, 232, 0.54);
    scrollbar-gutter: stable;
}

.map-wiki-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 1px 8px;
}

.map-wiki-monster-list {
    display: grid;
    gap: 1px;
}

.map-wiki-empty {
    margin: 0;
    color: #11110d;
    font-size: clamp(0.98rem, 1.2vw, 1.16rem);
    font-style: italic;
    line-height: 1.3;
}

.map-wiki-empty strong {
    font-weight: 900;
}

.map-wiki-mini-empty {
    margin: 0;
    padding: 0 0 0 64px;
    color: rgba(17, 17, 13, 0.64);
    font-size: 0.88rem;
    font-style: italic;
    line-height: 1.3;
}

.map-wiki-entity-row,
.map-wiki-boss-head {
    min-width: 0;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    color: #21170e;
    text-decoration: none;
}

.map-wiki-entity-row {
    padding: 1px 2px;
}

.map-wiki-entity-row:hover,
.map-wiki-boss-head:hover,
.map-wiki-entity-row:focus-visible,
.map-wiki-boss-head:focus-visible {
    background: rgba(58, 40, 109, 0.09);
    color: #5f130f;
}

.map-wiki-entity-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
}

.map-wiki-entity-icon img {
    max-width: 52px;
    max-height: 52px;
    object-fit: contain;
    filter: drop-shadow(1px 2px 1px rgba(17, 12, 6, 0.38));
}

.map-wiki-entity-main {
    min-width: 0;
    display: grid;
}

.map-wiki-entity-name {
    min-width: 0;
    overflow-wrap: anywhere;
    color: inherit;
    font-size: clamp(0.92rem, 1.05vw, 1.05rem);
    font-weight: 650;
    line-height: 1.04;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.map-wiki-boss-row {
    padding: 3px 2px 5px;
    border-bottom: 1px solid rgba(158, 51, 45, 0.24);
}

.map-wiki-boss-row:last-child {
    border-bottom: 0;
}

.map-wiki-boss-head .map-wiki-entity-name {
    font-weight: 900;
}

.map-wiki-drop-grid {
    --wiki-item-cell-size: 32px;

    display: grid;
    grid-template-columns: repeat(auto-fill, 32px);
    gap: 2px;
}

.map-wiki-boss-drops {
    --wiki-item-cell-size: 32px;

    display: grid;
    grid-template-columns: repeat(5, 32px);
    justify-content: start;
    gap: 2px;
    width: max-content;
    max-width: 100%;
    padding: 3px 0 0;
    overflow: visible;
}

.map-wiki-drop-grid {
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
}

.map-wiki-card .map-drop-tile {
    width: 32px;
    border: 0;
    border-radius: 3px;
    background: rgba(255, 248, 206, 0.85);
}

.map-wiki-drop-placeholder {
    width: 28px;
    height: 28px;
}

.map-wiki-drop-placeholder {
    display: block;
    border-radius: 3px;
    background: rgba(58, 40, 109, 0.12);
}

.map-wiki-card .map-drop-count {
    right: 0;
    bottom: 0;
    min-width: 16px;
    height: auto;
    padding: 0 3px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 999px;
    background: #64100d;
    color: #fff7d7;
    font-size: 0.56rem;
    line-height: 1.35;
}

.map-wiki-panel--drops .map-wiki-box {
    height: auto;
    min-height: 104px;
    padding: 10px 14px;
    overflow: visible;
    scrollbar-gutter: auto;
}

.map-wiki-panel--drops .map-wiki-drop-grid {
    --wiki-item-cell-size: 32px;

    grid-template-columns: repeat(auto-fill, 32px);
    gap: 2px;
    justify-content: flex-start;
}

.map-wiki-panel--drops .map-drop-tile {
    width: 32px;
}

.map-wiki-panel--drops .map-wiki-drop-placeholder {
    width: 28px;
    height: 28px;
}

.map-wiki-panel--monsters .map-wiki-box {
    height: 360px;
    overflow-x: hidden;
    overflow-y: auto;
}

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

    .map-wiki-preview-panel {
        padding-top: 0;
        border-top: 2px dashed #9e332d;
        border-left: 0;
    }

    .map-wiki-sections {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        padding: 18px 12px 14px;
    }

    .map-wiki-panel--monsters {
        grid-row: span 2;
    }
}

@media (max-width: 760px) {
    .map-wiki-titlebar {
        min-height: 40px;
        padding: 5px 12px;
    }

    .map-wiki-info-copy {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0 12px 14px;
    }

    .map-wiki-card--no-preview .map-wiki-info-copy {
        min-height: 300px;
        padding-right: 12px;
    }

    .map-wiki-vertical-title {
        width: min(280px, 86%);
        min-height: 0;
        min-width: 0;
        justify-self: center;
        padding: 8px 14px;
        border-radius: 0 0 10px 10px;
        writing-mode: horizontal-tb;
        text-orientation: mixed;
    }

    .map-wiki-description {
        font-size: 1rem;
        line-height: 1.35;
    }

    .map-wiki-preview-panel {
        gap: 8px;
        padding: 0 12px 14px;
    }

    .map-wiki-map-button {
        min-height: 42px;
        width: min(280px, 86%);
    }

    .map-wiki-sections {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px 10px 12px;
    }

    .map-wiki-section-stack--right {
        grid-template-columns: 1fr;
    }

    .map-wiki-panel--drops {
        grid-column: auto;
        width: 100%;
    }

    .map-wiki-panel h2 {
        width: min(230px, 82%);
        min-height: 42px;
    }

    .map-wiki-box {
        height: 420px;
    }

    .map-wiki-panel--drops .map-wiki-box {
        height: auto;
        min-height: 104px;
    }

    .map-wiki-panel--monsters .map-wiki-box {
        height: 420px;
    }

    .map-wiki-mini-empty {
        padding-left: 64px;
    }
}
