/* Eltaris — world map */

.map-page {
    min-height: 100vh;
    background: #0a0806;
    display: flex;
    flex-direction: column;
}

.map-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem clamp(1rem, 3vw, 2rem);
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    background: rgba(0, 0, 0, 0.85);
    z-index: 10;
}

.map-header__back {
    font-family: "Cinzel", serif;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold-light);
    text-decoration: none;
}

.map-header__back:hover {
    color: #fff;
}

.map-header__hint {
    margin: 0;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.map-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.5rem, 2vh, 1.25rem);
    overflow: auto;
}

.map-wrap {
    position: relative;
    width: min(1200px, 96vw);
    line-height: 0;
}

.map-wrap__image {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.65);
}

.map-markers {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

/* Warstwa granic — cała mapa-granice.png nałożona na czystą mapę. Teren pod spodem jest
   identyczny, więc po pojawieniu się nakładki widać wyłącznie świecące kontury regionów
   ze wzoru. Domyślnie ukryta; pojawia się po najechaniu na mapę. */
.map-regions {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.map-region--all {
    position: absolute;
    inset: 0;
    background-image: url("grafiki/mapa-granice-disp.jpg?v=8");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.map-region--all.is-active {
    opacity: 1;
}

/* Czytelny napis nakładany na ciemny region (Shadow Lands), w stylu pozostałych nazw. */
.map-label {
    position: absolute;
    transform: translate(-50%, -50%);
    font-family: "Cinzel", serif;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--gold-light);
    white-space: nowrap;
    pointer-events: none;
    z-index: 5;
    text-shadow:
        0 0 3px rgba(0, 0, 0, 1),
        0 0 6px rgba(0, 0, 0, 1),
        0 0 12px rgba(0, 0, 0, 0.95),
        0 0 18px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(212, 175, 55, 0.35);
}

/* Niewidzialne pola najechania nad nazwami królestw. */
.map-name-hot {
    position: absolute;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    z-index: 4;
}

.map-name-hot:focus-visible {
    outline: 1px solid rgba(212, 175, 55, 0.5);
}

/* Tylko urządzenia dotykowe (telefon/tablet): mapa jest powiększona i przewijalna
   (palcem przesuwa się po mapie), dzięki czemu znaczniki i nazwy są klikalne.
   Na PC (mysz/hover) nic się nie zmienia. */
@media (hover: none) and (pointer: coarse) {
    .map-stage {
        display: block;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .map-wrap {
        width: 185vw;
        max-width: none;
        margin: 0 auto;
    }

    .map-name-hot {
        min-width: 44px;
        min-height: 38px;
    }
}

/* Podgląd pól nazw (kalibracja) */
.show-hotspots .map-name-hot {
    background: rgba(212, 175, 55, 0.18);
    outline: 1px dashed rgba(212, 175, 55, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.show-hotspots .map-name-hot::after {
    content: attr(data-label);
    font-family: "Cinzel", serif;
    font-size: 0.55rem;
    letter-spacing: 0.05em;
    color: #fff;
    text-align: center;
    pointer-events: none;
}

.map-debug-toggle {
    font-family: "Cinzel", serif;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 3px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
}

.map-debug-toggle:hover {
    color: #fff;
    border-color: rgba(212, 175, 55, 0.6);
}

.map-coords {
    position: absolute;
    left: 0.5rem;
    bottom: 0.5rem;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.7rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 3px;
    padding: 0.2rem 0.45rem;
    pointer-events: none;
    z-index: 6;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.show-hotspots .map-coords {
    opacity: 1;
}

.map-hit {
    position: absolute;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    transform: translate(-50%, -50%);
    border-radius: 3px;
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

.map-hit:hover,
.map-hit:focus-visible,
.map-hit.is-active {
    background: rgba(212, 175, 55, 0.12);
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.55);
    outline: none;
}

.map-panel {
    position: fixed;
    right: clamp(0.75rem, 2vw, 1.5rem);
    bottom: clamp(0.75rem, 2vw, 1.5rem);
    width: min(320px, 88vw);
    padding: 1rem 1.1rem 1.1rem;
    background: rgba(8, 6, 4, 0.92);
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
    z-index: 20;
}

.map-panel[hidden] {
    display: none;
}

.map-panel__close {
    position: absolute;
    top: 0.35rem;
    right: 0.5rem;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.map-panel__close:hover {
    color: #fff;
}

.map-panel__type {
    margin: 0 0 0.35rem;
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
}

.map-panel__title {
    margin: 0 0 0.5rem;
    font-family: "Cinzel", serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #f5efe4;
}

.map-panel__image {
    display: block;
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    object-position: center;
    margin-bottom: 0.65rem;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 2px;
}

.map-panel__image[hidden] {
    display: none;
}

.map-panel__desc {
    margin: 0;
    font-family: "Lato", sans-serif;
    font-size: 0.85rem;
    line-height: 1.55;
    color: rgba(245, 239, 228, 0.82);
}

/* Nakładka z herbem królestwa (po kliknięciu nazwy) */
.map-herb {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vh, 3rem);
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(2px);
    z-index: 50;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.map-herb[hidden] {
    display: none;
}

.map-herb.is-open {
    opacity: 1;
}

.map-herb__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    max-width: min(90vw, 540px);
}

.map-herb__title {
    margin: 0;
    font-family: "Cinzel", serif;
    font-size: clamp(1rem, 2.2vw, 1.35rem);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold-light);
    text-align: center;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}

.map-herb__title[hidden] {
    display: none;
}

.map-herb__img {
    display: block;
    max-width: min(90vw, 540px);
    max-height: 88vh;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.45),
        0 18px 60px rgba(0, 0, 0, 0.8),
        0 0 60px rgba(212, 175, 55, 0.15);
    transform: scale(0.96);
    transition: transform 0.25s ease;
}

.map-herb.is-open .map-herb__img {
    transform: scale(1);
}

.map-herb__close {
    position: absolute;
    top: clamp(0.75rem, 2vh, 1.5rem);
    right: clamp(0.75rem, 2vw, 1.75rem);
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 50%;
    background: rgba(8, 6, 4, 0.7);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.map-herb__close:hover {
    color: #fff;
    border-color: rgba(212, 175, 55, 0.8);
}

/* Okno lore — Earldom of Oak Ridge */
.map-lore {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 3vh, 2rem);
    background: rgba(0, 0, 0, 0.86);
    backdrop-filter: blur(3px);
    z-index: 55;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.map-lore[hidden] {
    display: none;
}

.map-lore.is-open {
    opacity: 1;
}

.map-lore__close {
    position: absolute;
    top: clamp(0.75rem, 2vh, 1.5rem);
    right: clamp(0.75rem, 2vw, 1.75rem);
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 50%;
    background: rgba(8, 6, 4, 0.7);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.map-lore__close:hover {
    color: #fff;
    border-color: rgba(212, 175, 55, 0.8);
}

.map-lore__card {
    width: min(92vw, 620px);
    max-height: 92vh;
    overflow: auto;
    padding: clamp(1rem, 2.5vw, 1.5rem);
    background: rgba(8, 6, 4, 0.92);
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.8);
}

.map-lore__heading {
    margin: 0 0 0.85rem;
    font-family: "Cinzel", serif;
    font-size: clamp(1rem, 2.2vw, 1.35rem);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: center;
    color: var(--gold-light);
}

.map-lore__nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.map-lore__tab {
    padding: 0.4rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    font-family: "Cinzel", serif;
    font-size: 0.58rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.map-lore__tab:hover {
    color: var(--gold-light);
    border-color: rgba(212, 175, 55, 0.35);
}

.map-lore__tab.is-active {
    color: var(--gold-light);
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.12);
}

.map-lore__panels {
    min-height: 120px;
}

.map-lore__panel[hidden] {
    display: none;
}

.map-lore__img {
    display: block;
    width: 100%;
    max-height: 50vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.3);
    margin-bottom: 1rem;
}

.map-lore__title {
    margin: 0 0 0.75rem;
    font-family: "Cinzel", serif;
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    font-weight: 600;
    color: var(--gold-light);
    text-align: center;
    letter-spacing: 0.04em;
}

.map-lore__body {
    margin: 0 0 0.85rem;
    font-family: "Lato", sans-serif;
    font-size: 0.88rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.82);
    text-align: left;
}

.map-lore__body:last-child {
    margin-bottom: 0;
}

.map-lore__img--herb {
    max-height: 38vh;
    max-width: min(100%, 280px);
    margin-left: auto;
    margin-right: auto;
}

.map-lore__defs {
    margin: 0 0 1rem;
    font-family: "Lato", sans-serif;
    font-size: 0.86rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
}

.map-lore__defs dt {
    margin-top: 0.55rem;
    font-family: "Cinzel", serif;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-light);
}

.map-lore__defs dt:first-child {
    margin-top: 0;
}

.map-lore__defs dd {
    margin: 0.15rem 0 0;
}

.map-lore__rule {
    border: none;
    border-top: 1px solid rgba(212, 175, 55, 0.25);
    margin: 1rem 0;
}

.map-lore__subtitle {
    margin: 0 0 0.85rem;
    font-family: "Cinzel", serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
    color: var(--gold-light);
}

.map-lore__symbol {
    margin-bottom: 0.75rem;
}

.map-lore__symbol:last-child {
    margin-bottom: 0;
}

.map-lore__symbol-name {
    margin: 0 0 0.3rem;
    font-family: "Cinzel", serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(212, 175, 55, 0.95);
    letter-spacing: 0.04em;
}

.map-lore__list {
    margin: 0;
    padding-left: 1.15rem;
    font-family: "Lato", sans-serif;
    font-size: 0.84rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.78);
}

.map-lore__list li {
    margin-bottom: 0.15rem;
}

.map-lore__text {
    margin: 0;
    padding: 1rem 0.25rem;
    font-family: "Lato", sans-serif;
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.82);
    text-align: center;
    font-style: italic;
}

@media (max-width: 700px) {
    .map-hit:hover,
    .map-hit.is-active {
        background: rgba(212, 175, 55, 0.18);
    }
}
