/* ===============================
   VILÁGTÉRKÉP — terkep.css
   =============================== */
/* A térkép SVG-stílusait (.map-*) a főoldali előnézet is használja. */

.terkep-page,
.landing-map-frame {
    --tk-gold: var(--c-gold, #ffd24c);
    --tk-gold-soft: #c9a456;
    --tk-ink: #07121b;
    --tk-panel: rgba(8, 18, 28, 0.86);
    --tk-line: rgba(201, 164, 86, 0.35);
    --tk-text: var(--c-text, #eaf4fb);
    --tk-dim: var(--c-text-dim, #9fb3c2);
}

.terkep-page {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(201, 164, 86, 0.12), transparent 55%),
        radial-gradient(ellipse at 50% 100%, rgba(40, 110, 140, 0.18), transparent 60%),
        #050c13;
    color: var(--tk-text);
    min-height: 100vh;
}

#terkep-shell {
    max-width: 1720px;
    margin: 0 auto;
    padding: 96px 24px 56px;
    box-sizing: border-box;
}

/* ---------- Fejléc ---------- */

.terkep-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.terkep-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'SpectralBold', serif;
    font-size: 12px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--tk-gold-soft);
}

.terkep-eyebrow span {
    width: 42px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--tk-gold-soft), transparent);
}

.terkep-hero h1 {
    margin: 8px 0 6px;
    font-family: 'AOW', serif;
    font-size: clamp(30px, 3.4vw, 50px);
    letter-spacing: 0.04em;
    background: linear-gradient(180deg, #fff3c4, #e8c36a 55%, #a8803a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 18px rgba(232, 195, 106, 0.18);
}

.terkep-hero p {
    margin: 0;
    max-width: 640px;
    color: var(--tk-dim);
    font-size: 15px;
    line-height: 1.55;
}

.terkep-hero__stats {
    display: flex;
    gap: 10px;
}

.terkep-hero__stats > div {
    min-width: 92px;
    padding: 10px 16px;
    text-align: center;
    background: var(--tk-panel);
    border: 1px solid var(--tk-line);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.terkep-hero__stats strong {
    display: block;
    font-family: 'AOW', serif;
    font-size: 26px;
    color: var(--tk-gold);
}

.terkep-hero__stats span {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--tk-dim);
}

/* ---------- Elrendezés ---------- */

.terkep-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr) 340px;
    gap: 16px;
    align-items: start;
}

.terkep-panel-kicker {
    font-family: 'SpectralBold', serif;
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--tk-gold-soft);
}

/* ---------- Jelmagyarázat ---------- */

.terkep-legend {
    padding: 14px 10px;
    background: var(--tk-panel);
    border: 1px solid var(--tk-line);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    position: sticky;
    top: 84px;
}

.terkep-legend .terkep-panel-kicker { padding: 0 8px 10px; }

.terkep-legend ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 3px;
}

.terkep-legend button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--tk-text);
    text-align: left;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
}

.terkep-legend button img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    transition: transform 0.2s;
}

.terkep-legend button span { display: grid; min-width: 0; }
.terkep-legend button strong { font-family: 'AOW', serif; font-size: 14px; font-weight: normal; }
.terkep-legend button small {
    font-size: 11px;
    color: var(--tk-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.terkep-legend button:hover,
.terkep-legend button.is-hover {
    background: rgba(201, 164, 86, 0.08);
    border-color: rgba(201, 164, 86, 0.25);
}

.terkep-legend button:hover img,
.terkep-legend button.is-hover img { transform: scale(1.1); }

.terkep-legend button.is-active {
    background: linear-gradient(90deg, rgba(201, 164, 86, 0.22), rgba(201, 164, 86, 0.04));
    border-color: rgba(232, 195, 106, 0.6);
}

.terkep-legend button.is-active strong { color: var(--tk-gold); }

/* ---------- Térkép ---------- */

.terkep-stage {
    position: relative;
    border: 1px solid var(--tk-line);
    background: #04101a;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(0, 0, 0, 0.6);
}

.terkep-map {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    cursor: grab;
}

.terkep-map.is-dragging { cursor: grabbing; }

.terkep-svg {
    display: block;
    width: 100%;
    height: 100%;
}

.terkep-svg.is-vfx-off,
.terkep-svg.is-vfx-off *,
.terkep-svg.is-vfx-off *::before,
.terkep-svg.is-vfx-off *::after {
    animation-play-state: paused !important;
}

.map-vfx-toggle {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 10px;
    box-sizing: border-box;
    color: var(--tk-gold);
    background: rgba(5, 14, 22, .9);
    border: 1px solid var(--tk-line);
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.map-vfx-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--tk-gold); cursor: pointer; }
.map-vfx-toggle:focus-within { outline: 2px solid var(--tk-gold); outline-offset: 3px; }
.map-vfx-status { min-width: 25px; color: var(--tk-dim); font-size: 10px; }
.map-vfx-toggle input:checked ~ .map-vfx-status { color: var(--tk-gold); }

.terkep-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    gap: 6px;
}

.terkep-controls button {
    width: 36px;
    height: 36px;
    font-size: 20px;
    line-height: 1;
    color: var(--tk-gold);
    background: rgba(5, 14, 22, 0.85);
    border: 1px solid var(--tk-line);
    cursor: pointer;
    transition: background 0.18s, transform 0.18s;
}

.terkep-controls button:hover { background: rgba(201, 164, 86, 0.18); transform: translateY(-1px); }

.terkep-fs-btn,
.landing-map-fs {
    display: inline-grid;
    place-items: center;
}

/* ---------- Teljes képernyő ---------- */

html.map-fs-lock { overflow: hidden; }

.terkep-layout:fullscreen,
.terkep-layout.is-pseudo-fullscreen {
    display: block;
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #03070d;
}

.terkep-layout.is-pseudo-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
}

.terkep-layout:fullscreen .terkep-legend,
.terkep-layout.is-pseudo-fullscreen .terkep-legend { display: none; }

.terkep-layout:fullscreen .terkep-stage,
.terkep-layout.is-pseudo-fullscreen .terkep-stage {
    height: 100%;
    border: 0;
    box-shadow: none;
}

.terkep-layout:fullscreen .terkep-map,
.terkep-layout.is-pseudo-fullscreen .terkep-map {
    aspect-ratio: auto;
    height: 100%;
}

@media (min-width: 901px) {
    .terkep-layout:fullscreen .terkep-detail,
    .terkep-layout.is-pseudo-fullscreen .terkep-detail {
        position: absolute;
        top: 16px;
        right: 68px;
        width: 360px;
        max-height: calc(100% - 32px);
        z-index: 5;
        background: rgba(6, 14, 22, 0.94);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    }
    .terkep-layout:fullscreen .terkep-detail:not(.is-open),
    .terkep-layout.is-pseudo-fullscreen .terkep-detail:not(.is-open) { display: none; }
}

.terkep-hint {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    padding: 4px 12px;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--tk-dim);
    background: rgba(5, 14, 22, 0.7);
    border: 1px solid rgba(201, 164, 86, 0.18);
    pointer-events: none;
    white-space: nowrap;
}

/* SVG elemek */

.map-borders path {
    stroke: rgba(30, 20, 10, 0.55);
    stroke-width: 2.4;
    stroke-dasharray: 7 4 1.5 4;
    stroke-linejoin: round;
}

.map-region {
    cursor: pointer;
    fill-opacity: var(--region-op, 0.34);
    transition: fill-opacity 0.25s, filter 0.25s;
}

.map-region.is-hover { fill-opacity: calc(var(--region-op, 0.34) + 0.16); }
.map-region.is-active { fill-opacity: calc(var(--region-op, 0.34) + 0.24); filter: brightness(1.15); }
.terkep-map.has-selection .map-region:not(.is-active) { fill-opacity: calc(var(--region-op, 0.34) * 0.4); }

.map-landmark { cursor: pointer; }

.map-route {
    fill: none;
    stroke: rgba(240, 210, 140, 0.55);
    stroke-width: 2;
    stroke-dasharray: 2 7;
    stroke-linecap: round;
    pointer-events: none;
    transition: stroke 0.25s, stroke-width 0.25s;
}

.map-route--sea { stroke: rgba(170, 230, 245, 0.5); stroke-dasharray: 10 8; }
.map-route--mystic { stroke: rgba(255, 211, 107, 0.55); stroke-dasharray: 1 6; stroke-width: 2.6; }
.map-route.is-active { stroke: #ffe39a; stroke-width: 3; animation: tk-route 1.4s linear infinite; }

.map-marker { cursor: pointer; outline: none; }

.map-marker image,
.map-marker__ring,
.map-marker__halo {
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 0.22s ease, opacity 0.22s;
}

.map-marker__ring { fill: rgba(6, 14, 22, 0.78); stroke: var(--tk-gold-soft); stroke-width: 2; }
.map-marker__halo { opacity: 0.25; filter: url(#f-glow); }

.map-marker__pulse {
    fill: none;
    stroke: rgba(255, 220, 140, 0.6);
    stroke-width: 2;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
}

.map-marker__label rect {
    fill: rgba(6, 14, 22, 0.86);
    stroke: rgba(201, 164, 86, 0.65);
    stroke-width: 1;
}

.map-marker__label text {
    font-family: 'AOW', serif;
    font-size: 20px;
    fill: #f6e3a8;
    text-anchor: middle;
    letter-spacing: 0.04em;
}

.map-marker__count circle { fill: #8a2a2a; stroke: #ffd9a0; stroke-width: 1.4; }
.map-marker__count text { font-size: 11px; font-weight: 700; fill: #fff; text-anchor: middle; font-family: sans-serif; }

.map-marker.is-hover image,
.map-marker:focus-visible image,
.map-marker.is-active image { transform: scale(1.14); }
.map-marker.is-hover .map-marker__ring,
.map-marker.is-active .map-marker__ring { transform: scale(1.14); stroke: var(--tk-gold); }
.map-marker.is-hover .map-marker__halo,
.map-marker.is-active .map-marker__halo { opacity: 0.6; transform: scale(1.3); }
.map-marker.is-active .map-marker__pulse { animation: tk-pulse 1.8s ease-out infinite; }
.map-marker.is-active .map-marker__label rect { fill: rgba(60, 42, 12, 0.92); stroke: var(--tk-gold); }
.map-marker:focus-visible .map-marker__ring { stroke: #fff; stroke-width: 3; }

.map-sea-label {
    font-family: 'AOW', serif;
    font-size: 22px;
    font-style: italic;
    letter-spacing: 0.3em;
    fill: rgba(180, 225, 240, 0.32);
    text-anchor: middle;
    pointer-events: none;
}

.map-sea-label--sky { fill: rgba(255, 220, 140, 0.45); font-size: 18px; }

.map-compass__n {
    font-family: 'AOW', serif;
    font-size: 15px;
    fill: #e8c36a;
    text-anchor: middle;
}

.map-scale text { font-size: 12px; fill: #e8c36a; font-family: 'SpectralBold', serif; }

/* Animációk */

.mf-flow { animation: tk-flow 3s linear infinite; }
.mf-flicker { animation: tk-flicker 3.2s ease-in-out infinite; }
.mf-twinkle { animation: tk-twinkle 3s ease-in-out infinite; }
.mf-lava { animation: tk-lava 2.4s ease-in-out infinite; }
.mf-neon { animation: tk-neon 2.8s ease-in-out infinite; }
.mf-glow { animation: tk-glow 4s ease-in-out infinite; }
.mf-aura { animation: tk-aura 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.mf-bob { animation: tk-bob 4.5s ease-in-out infinite; }
.mf-smoke { animation: tk-smoke 6s ease-in-out infinite; }
.mf-spin, .mf-spin-rev { transform-box: view-box; }
.mf-spin { animation: tk-spin 40s linear infinite; transform-origin: 1440px 205px; }
.mf-spin-rev { animation: tk-spin 26s linear infinite reverse; transform-origin: 1440px 205px; }
.map-cloud { animation: tk-cloud 70s linear infinite alternate; }

@keyframes tk-flow { to { stroke-dashoffset: -32; } }
@keyframes tk-route { to { stroke-dashoffset: -18; } }
@keyframes tk-flicker { 0%, 100% { opacity: 1; } 45% { opacity: 0.55; } 50% { opacity: 0.9; } }
@keyframes tk-twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes tk-lava { 0%, 100% { opacity: 0.75; filter: brightness(1); } 50% { opacity: 1; filter: brightness(1.35); } }
@keyframes tk-neon { 0%, 100% { opacity: 1; } 50% { opacity: 0.72; } }
@keyframes tk-glow { 0%, 100% { opacity: 0.85; } 50% { opacity: 1; filter: brightness(1.25); } }
@keyframes tk-aura { 0%, 100% { opacity: 0.6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes tk-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@keyframes tk-smoke { 0%, 100% { transform: translate(0, 0); opacity: 0.9; } 50% { transform: translate(6px, -6px); opacity: 0.6; } }
@keyframes tk-spin { to { transform: rotate(360deg); } }
@keyframes tk-cloud { from { transform: translateX(-60px); } to { transform: translateX(80px); } }
@keyframes tk-pulse { 0% { opacity: 0.9; transform: scale(0.9); } 100% { opacity: 0; transform: scale(1.8); } }

/* Arkanória: cyber-város, drónok, hajók */
.mf-blink { animation: tk-blink 1.6s steps(1, end) infinite; }
.mf-holo { animation: tk-holo 3.4s ease-in-out infinite; }
.mf-rotor { animation: tk-rotor 0.18s linear infinite; }
.mf-engine { animation: tk-engine 0.9s ease-in-out infinite; }
.mf-wake { stroke-dasharray: 4 3; animation: tk-flow 1.2s linear infinite reverse; }
.map-drone { filter: drop-shadow(0 0 2px rgba(63, 243, 255, 0.5)); }
.map-ship { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); }

@keyframes tk-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.15; } }
@keyframes tk-holo { 0%, 100% { opacity: 0.9; } 48% { opacity: 0.55; } 50% { opacity: 1; } 52% { opacity: 0.4; } }
@keyframes tk-rotor { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.7; } }
@keyframes tk-engine { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; filter: brightness(1.4); } }

/* Arkanória: Toxy lövései és a zombik reakciói ugyanazon nyolc másodperces körben. */
.mf-toxy-laser { opacity: .6; animation-duration: 8s; animation-timing-function: linear; animation-iteration-count: infinite; }
.mf-toxy-laser--green { animation-name: tk-toxy-green; }
.mf-toxy-laser--pink { animation-name: tk-toxy-pink; }
.mf-toxy-target { transform-box: fill-box; transform-origin: center bottom; animation: tk-toxy-zombie 8s linear infinite; }
.mf-toxy-target--pink { animation-name: tk-toxy-zombie-pink; }
.mf-toxy-impact { opacity: 0; animation: tk-toxy-impact 8s linear infinite; }
.mf-toxy-impact--pink { animation-name: tk-toxy-impact-pink; }
.mf-linda-mace { transform-box: fill-box; transform-origin: left center; animation: tk-linda-mace 3.5s ease-in-out infinite; }
.mf-zakura-particle { animation: tk-zakura-particle 1.6s linear infinite; }
.mf-robot-step { animation: tk-robot-step .9s steps(2, end) infinite; }
@keyframes tk-toxy-green { 0%, 12%, 20%, 100% { opacity: 0; } 13%, 19% { opacity: 1; } }
@keyframes tk-toxy-pink { 0%, 42%, 50%, 100% { opacity: 0; } 43%, 49% { opacity: 1; } }
@keyframes tk-toxy-zombie {
    0%, 18%, 100% { transform: rotate(0); opacity: 1; }
    23% { transform: rotate(75deg); opacity: .8; }
    30%, 88% { transform: rotate(90deg); opacity: 0; }
    94% { transform: rotate(0); opacity: 0; }
}
@keyframes tk-toxy-zombie-pink {
    0%, 48%, 100% { transform: rotate(0); opacity: 1; }
    53% { transform: rotate(-75deg); opacity: .8; }
    60%, 88% { transform: rotate(-90deg); opacity: 0; }
    94% { transform: rotate(0); opacity: 0; }
}
@keyframes tk-toxy-impact { 0%, 17%, 23%, 100% { opacity: 0; } 18%, 21% { opacity: 1; } }
@keyframes tk-toxy-impact-pink { 0%, 47%, 53%, 100% { opacity: 0; } 48%, 51% { opacity: 1; } }
@keyframes tk-linda-mace { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(12deg); } }
@keyframes tk-zakura-particle { 0% { transform: translateX(0); opacity: .9; } 100% { transform: translateX(-12px); opacity: 0; } }
@keyframes tk-robot-step { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-1px) rotate(2deg); } }

/* Frosta: hó, jeges szél, tábortűz, jéglények */
.mf-snow { fill: #ffffff; transform-box: fill-box; animation: tk-snow 7s linear infinite; }
.mf-snowfall-dense .mf-snow { animation-name: tk-snow-dense; }
.mf-rise { transform-box: fill-box; transform-origin: center; animation: tk-rise 4.5s ease-out infinite; }
.mf-fire { transform-box: fill-box; transform-origin: center bottom; animation: tk-fire 0.8s ease-in-out infinite alternate; }
.mf-walk { animation: tk-walk 0.7s ease-in-out infinite; }
.map-creatures { filter: drop-shadow(0 0 2px rgba(160, 230, 255, 0.6)); }

@keyframes tk-snow {
    0% { transform: translate(0, -12px); opacity: 0; }
    15% { opacity: 0.95; }
    85% { opacity: 0.8; }
    100% { transform: translate(14px, 36px); opacity: 0; }
}
@keyframes tk-snow-dense {
    0% { transform: translate(0, 0); opacity: 0; }
    15% { opacity: 1; }
    100% { transform: translate(8px, 44px); opacity: 0; }
}
@keyframes tk-rise {
    0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
    15% { opacity: 0.8; }
    100% { transform: translate(10px, -42px) scale(2.2); opacity: 0; }
}
@keyframes tk-fire { from { transform: scale(0.85, 0.9); opacity: 0.85; } to { transform: scale(1.1, 1.15); opacity: 1; } }
@keyframes tk-walk { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }

/* Atlantika: uszonyok, April csillagos buborékai és Laguna tengerparti tánca. */
.mf-sea-fin { transform-box: fill-box; transform-origin: center; animation: tk-sea-fin 1.8s ease-in-out infinite alternate; }
.mf-april-bubble { animation: tk-april-bubble 7s ease-in-out infinite; }
.mf-laguna-dance { transform-box: fill-box; transform-origin: center bottom; animation: tk-laguna-dance 1.4s ease-in-out infinite; }
@keyframes tk-sea-fin { from { transform: scaleY(.9); } to { transform: scaleY(1.1); } }
@keyframes tk-april-bubble {
    0%, 100% { transform: translateY(2px); opacity: .55; }
    50% { transform: translateY(-6px); opacity: 1; }
}
@keyframes tk-laguna-dance {
    0%, 100% { transform: rotate(-8deg) translateX(-1px); }
    25% { transform: rotate(0) translateY(-1.5px); }
    50% { transform: rotate(8deg) translateX(1px); }
    75% { transform: rotate(0) translateY(-1.5px); }
}

/* Shinra: naplemez, színes kígyók és sivatagi szélforgatagok. */
.mf-shinra-sundisc { transform-box: fill-box; transform-origin: center; animation: tk-spin 18s linear infinite; }
.mf-medusa-snake { transform-box: fill-box; transform-origin: center; animation: tk-medusa-snake .8s ease-in-out infinite alternate; }
.mf-shinra-wind { fill: none; stroke: #f0d59c; stroke-width: 1.7; stroke-linecap: round; stroke-dasharray: 32 90; animation: tk-wind 6s ease-in-out infinite; }
.mf-shinra-tornado { animation: tk-shinra-tornado 2.4s ease-in-out infinite; }
@keyframes tk-medusa-snake { from { transform: scaleY(.8); } to { transform: scaleY(1.2); } }
@keyframes tk-shinra-tornado { 0%, 100% { transform: skewX(-5deg); } 50% { transform: skewX(5deg); } }

/* Dontos: sziklás puszták fölött kavargó szél. */
.mf-dontos-wind { fill: none; stroke: #d5bc87; stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 28 74; animation: tk-wind 7s ease-in-out infinite; opacity: .5; }

/* Lavos: szálló parázs és a fészkébe visszatérő főnix. */
.mf-lavos-ember { animation: tk-lavos-ember 5s ease-out infinite; }
.mf-phoenix-wing { transform-box: fill-box; transform-origin: center; animation: tk-phoenix-wing .65s ease-in-out infinite alternate; }
.map-phoenix-flight { animation: tk-phoenix-flight var(--phoenix-cycle) linear infinite; }
.map-phoenix-rest { opacity: 0; animation: tk-phoenix-rest var(--phoenix-cycle) linear infinite; }
@keyframes tk-lavos-ember {
    0%, 100% { transform: translate(0, 0); opacity: 0; }
    15% { opacity: .9; }
    80% { transform: translate(5px, -17px); opacity: .5; }
    95% { transform: translate(7px, -22px); opacity: 0; }
}
@keyframes tk-phoenix-wing { from { transform: scaleY(.65); } to { transform: scaleY(1); } }
@keyframes tk-phoenix-flight { 0%, 79.99% { opacity: 1; } 80%, 100% { opacity: 0; } }
@keyframes tk-phoenix-rest { 0%, 79.99% { opacity: 0; } 80%, 100% { opacity: 1; } }

/* Sáskanyál: a húsevő növények mozgó, fogas szája. */
.mf-carnivore-jaw { transform-box: fill-box; transform-origin: center bottom; animation: tk-carnivore-jaw 4.2s ease-in-out infinite; }
@keyframes tk-carnivore-jaw {
    0%, 100% { transform: rotate(-8deg) translateY(-1px); }
    45%, 60% { transform: rotate(5deg) translateY(2px); }
}

/* Paludem: mocsárköd, felszálló buborékok, ugráló békák és úszó krokodilok. */
.mf-marsh-mist { opacity: .18; animation: tk-marsh-mist 12s ease-in-out infinite alternate; }
.mf-marsh-bubble { animation: tk-marsh-bubble 4.5s ease-out infinite; }
.mf-frog-hop { animation: tk-frog-hop var(--frog-duration, 5s) ease-in-out infinite; animation-delay: var(--frog-delay, 0s); }
.mf-croc-swim { animation: tk-croc-swim 2.8s ease-in-out infinite; }

@keyframes tk-marsh-mist {
    from { transform: translate(-8px, 0); opacity: .13; }
    to { transform: translate(10px, -3px); opacity: .24; }
}
@keyframes tk-marsh-bubble {
    0%, 100% { transform: translateY(0) scale(.6); opacity: 0; }
    20% { opacity: .8; }
    80% { transform: translateY(-10px) scale(1.2); opacity: .5; }
    90% { transform: translateY(-12px) scale(1.4); opacity: 0; }
}
@keyframes tk-frog-hop {
    0%, 22%, 100% { transform: translate(0, 0); }
    28% { transform: translate(6px, -9px); }
    34%, 66% { transform: translate(12px, 0); }
    72% { transform: translate(6px, -9px); }
    78% { transform: translate(0, 0); }
}
@keyframes tk-croc-swim {
    0%, 100% { transform: translateY(-.7px); }
    50% { transform: translateY(.7px); }
}

/* Soras: őszi lomb, lélekfa, Abra, Foxy és Alice lila lepkéi. */
.mf-soras-leaf { animation: tk-soras-leaf 8s linear infinite; }
.mf-soul-crown { animation: tk-soul-crown 4.5s ease-in-out infinite; }
.mf-soras-soul { animation: tk-soras-soul 3.2s ease-in-out infinite; }
.mf-abra-scythe { transform-box: fill-box; transform-origin: center bottom; animation: tk-abra-scythe 4s ease-in-out infinite; }
.mf-foxy-tail { transform-box: fill-box; transform-origin: right bottom; animation: tk-foxy-tail 2s ease-in-out infinite; }
.mf-foxy-fire { animation: tk-foxy-fire .9s ease-in-out infinite alternate; }
.mf-foxy-ember { animation: tk-foxy-ember 4s linear infinite; }
.mf-alice-wings { transform-box: fill-box; transform-origin: center; animation: tk-alice-wings .4s ease-in-out infinite alternate; }
@keyframes tk-soras-leaf {
    0% { transform: translate(0, -3px) rotate(0deg); opacity: 0; }
    15% { opacity: 1; }
    70% { opacity: .9; }
    100% { transform: translate(14px, 22px) rotate(190deg); opacity: 0; }
}
@keyframes tk-soul-crown { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
@keyframes tk-soras-soul { 0%, 100% { opacity: .55; transform: translateY(1px); } 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes tk-abra-scythe { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(8deg); } }
@keyframes tk-foxy-tail { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(10deg); } }
@keyframes tk-foxy-fire { from { opacity: .55; } to { opacity: 1; } }
@keyframes tk-foxy-ember { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translate(4px, -11px); opacity: 0; } }
@keyframes tk-alice-wings { from { transform: scaleX(.3); } to { transform: scaleX(1); } }

/* Soras időjárása */
.mf-wind {
    fill: none;
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 2.4;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, .6));
    stroke-linecap: round;
    stroke-dasharray: 40 100;
    animation: tk-wind 5s ease-in-out infinite;
}
.mf-petal { transform-box: fill-box; transform-origin: center; animation: tk-petal 9s linear infinite; }
.mf-rain line { stroke: rgba(170, 200, 235, 0.65); stroke-width: 1.1; stroke-dasharray: 7 9; animation: tk-rain 0.7s linear infinite; }
.mf-bolt { fill: none; stroke: #fff4b0; stroke-width: 2.6; stroke-linejoin: round; filter: drop-shadow(0 0 4px #ffe36a); opacity: 0; animation: tk-bolt 4.6s linear infinite; }
.mf-flash { opacity: 0; animation: tk-flash 4.6s linear infinite; }
.mf-stormcloud { animation: tk-bob 6s ease-in-out infinite; }

@keyframes tk-wind {
    0% { stroke-dashoffset: 140; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { stroke-dashoffset: -40; opacity: 0; }
}
@keyframes tk-petal {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    50% { transform: translate(45px, 14px) rotate(200deg); }
    90% { opacity: 0.9; }
    100% { transform: translate(95px, 36px) rotate(420deg); opacity: 0; }
}
@keyframes tk-rain { to { stroke-dashoffset: -16; } }
@keyframes tk-bolt {
    0%, 86%, 100% { opacity: 0; }
    87%, 89% { opacity: 1; }
    88% { opacity: 0.2; }
    91% { opacity: 0.8; }
    93% { opacity: 0; }
}
@keyframes tk-flash {
    0%, 86%, 100% { opacity: 0; }
    87% { opacity: 0.55; }
    89% { opacity: 0.35; }
    91% { opacity: 0.4; }
    94% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .terkep-svg *, .terkep-svg *::before { animation: none !important; transition: none !important; }
    .mf-wind { stroke-dasharray: none; opacity: 0.4; }
}

/* ---------- Részletpanel ---------- */

.terkep-detail {
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    background: var(--tk-panel);
    border: 1px solid var(--tk-line);
}

.terkep-detail__empty {
    padding: 48px 26px;
    text-align: center;
    color: var(--tk-dim);
}

.terkep-detail__empty-seal {
    width: 74px;
    height: 74px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    font-size: 30px;
    color: var(--tk-gold);
    border: 1px solid var(--tk-line);
    border-radius: 50%;
    box-shadow: inset 0 0 22px rgba(201, 164, 86, 0.2);
}

.terkep-detail__empty h2,
.terkep-detail__body h2 {
    margin: 4px 0 10px;
    font-family: 'AOW', serif;
    font-weight: normal;
    font-size: 26px;
    color: var(--tk-gold);
}

.terkep-detail__empty p { margin: 0; font-size: 14px; line-height: 1.5; }

.terkep-detail__banner {
    position: relative;
    height: 170px;
    overflow: hidden;
}

.terkep-detail__banner > img:first-child {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: tk-ken 14s ease-in-out infinite alternate;
}

.terkep-detail__banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 35%, rgba(8, 18, 28, 0.96));
}

.terkep-detail__crest {
    position: absolute;
    left: 18px;
    bottom: -4px;
    width: 86px;
    height: 86px;
    object-fit: contain;
    z-index: 1;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.8));
}

.terkep-detail__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 30px;
    height: 30px;
    color: var(--tk-text);
    background: rgba(5, 14, 22, 0.75);
    border: 1px solid var(--tk-line);
    cursor: pointer;
}

.terkep-detail__body { padding: 14px 20px 22px; }

.terkep-detail__chips { display: flex; gap: 8px; margin-bottom: 12px; }
.terkep-detail__chips span {
    padding: 3px 10px;
    font-size: 12px;
    color: var(--tk-dim);
    border: 1px solid rgba(201, 164, 86, 0.3);
    background: rgba(201, 164, 86, 0.06);
}
.terkep-detail__chips strong { color: var(--tk-gold); }

.terkep-detail__desc {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #d3e0ea;
}

.terkep-detail__body h3 {
    margin: 0 0 8px;
    font-family: 'SpectralBold', serif;
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--tk-gold-soft);
}

.terkep-detail__heroes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}

.terkep-detail__heroes a {
    display: grid;
    justify-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--tk-text);
    font-size: 11px;
    text-align: center;
}

.terkep-detail__heroes img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border: 1px solid var(--tk-line);
    transition: transform 0.18s, border-color 0.18s;
}

.terkep-detail__heroes span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.terkep-detail__heroes a:hover img { transform: translateY(-2px); border-color: var(--tk-gold); }

.terkep-detail__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.terkep-btn {
    flex: 1 1 auto;
    padding: 10px 14px;
    text-align: center;
    text-decoration: none;
    font-family: 'AOW', serif;
    font-size: 14px;
    letter-spacing: 0.06em;
    color: var(--tk-text);
    border: 1px solid var(--tk-line);
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.18s, border-color 0.18s;
}

.terkep-btn:hover { background: rgba(201, 164, 86, 0.14); border-color: var(--tk-gold-soft); }

.terkep-btn--gold {
    color: #1a1204;
    background: linear-gradient(180deg, #ffe7a0, #d9a940);
    border-color: #ffe39a;
}

.terkep-btn--gold:hover { background: linear-gradient(180deg, #fff0c0, #e8b84e); }

@keyframes tk-ken { from { transform: scale(1); } to { transform: scale(1.1); } }

/* ---------- Reszponzív ---------- */

@media (max-width: 1280px) {
    .terkep-layout { grid-template-columns: minmax(0, 1fr) 320px; }
    .terkep-legend {
        grid-column: 1 / -1;
        order: 3;
        position: static;
        max-height: none;
    }
    .terkep-legend ul { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (max-width: 900px) {
    #terkep-shell { padding: 84px 16px 40px; }
    .terkep-hero { flex-direction: column; align-items: stretch; }
    .terkep-hero__stats > div { flex: 1; min-width: 0; }
    .terkep-layout { grid-template-columns: minmax(0, 1fr); }
    .terkep-legend { order: 2; }
    .terkep-legend ul { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .terkep-map { aspect-ratio: 4 / 3; }
    .terkep-hint { display: none; }

    /* Részletpanel alsó lapként */
    .terkep-detail {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        z-index: 50;
        max-height: 72vh;
        border-width: 1px 0 0;
        transform: translateY(105%);
        transition: transform 0.3s ease;
        box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.6);
        background: #08121c;
    }
    .terkep-eyebrow { font-size: 10px; letter-spacing: 0.18em; }
    .terkep-eyebrow span { display: none; }
    .terkep-detail.is-open { transform: translateY(0); }
}

.mf-wind--ice { stroke: rgba(196, 238, 255, 0.95); filter: drop-shadow(0 0 3px rgba(110, 200, 255, 0.85)); }
.mf-fire-glow { transform-box: fill-box; transform-origin: center; animation: tk-aura 1.6s ease-in-out infinite; }

/* Kincs Város: szellemek, világítótorony-fény, vörös derengés */
.mf-ghost { animation: tk-ghost 5s ease-in-out infinite; }
.mf-beam { transform-box: view-box; animation: tk-beam 6s ease-in-out infinite; }
.mf-redpulse { opacity: .16; animation: tk-redpulse 5s ease-in-out infinite; }
.map-mrpump { filter: drop-shadow(0 0 4px rgba(255, 140, 30, .8)); }
.map-creatures--dark { filter: drop-shadow(0 0 3px rgba(255, 40, 40, .45)); }

@keyframes tk-ghost {
    0%, 100% { opacity: 0; transform: translateY(2px); }
    40%, 60% { opacity: .85; transform: translateY(-4px); }
}
@keyframes tk-beam {
    0%, 100% { transform: rotate(-28deg); opacity: .5; }
    50% { transform: rotate(28deg); opacity: 1; }
}
@keyframes tk-redpulse {
    0%, 100% { opacity: .1; }
    50% { opacity: .26; }
}

/* Sagar: madárkák, szekérkerekek, arkánkapuk, lebegő rúnák, Goody léghajója */
.mf-flap { transform-box: fill-box; transform-origin: center; animation: tk-flap 0.5s ease-in-out infinite alternate; }
.mf-wheel { transform-box: fill-box; transform-origin: center; animation: tk-wheel 1.4s linear infinite; }
.mf-swirl { animation: tk-swirl 1.8s linear infinite; }
.mf-runerise { animation: tk-runerise 7s ease-in-out infinite; }
.map-sagar-runes { filter: drop-shadow(0 0 3px rgba(120, 255, 220, 0.9)); }
.map-animals { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35)); }
.map-airship { filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45)); }

@keyframes tk-flap { from { transform: scaleY(1); } to { transform: scaleY(-0.5); } }
@keyframes tk-wheel { to { transform: rotate(360deg); } }
@keyframes tk-swirl { to { stroke-dashoffset: -18; } }
@keyframes tk-runerise {
    0% { opacity: 0; transform: translateY(6px); }
    30%, 60% { opacity: 0.95; }
    100% { opacity: 0; transform: translateY(-26px); }
}
