/* Maps (public): terrain picture with the monster spots, the list of maps and the monsters of the open one. */
.content-wrapper > .mp-wrap { padding: 6px max(28px, 7%) 34px !important; }
@media (max-width: 992px) { .content-wrapper > .mp-wrap { padding: 4px 14px 24px !important; } }
.mp-wrap { color: #e3eff8; }

/* map list */
/* the maps in an even grid, in the order players go (GameMaps: average monster level) */
.mp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 6px; margin: 0 0 14px; }
.mp-pill { display: flex; flex-direction: column; padding: 6px 11px; text-decoration: none !important; background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(110, 190, 245, .16); border-radius: 8px; transition: border-color .15s, background .15s; }
.mp-pill b { overflow: hidden; color: #dfeaf5; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.mp-pill small { color: #7f98ad; font-size: 10.5px; }
.mp-pill:hover { border-color: rgba(150, 212, 255, .45); }
.mp-pill.is-active { background: rgba(96, 176, 232, .16); border-color: rgba(150, 212, 255, .7); }
.mp-pill.is-active b { color: #fff; }

/* board + legend */
.mp-main { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 14px; align-items: start; }
@media (max-width: 900px) { .mp-main { grid-template-columns: minmax(0, 1fr); } }
.mp-board { padding: 12px;
    background: linear-gradient(180deg, rgba(14, 30, 48, .92), rgba(4, 9, 17, .96)) padding-box,
                linear-gradient(160deg, rgba(110, 190, 245, .3), rgba(30, 60, 90, .25) 55%, rgba(110, 190, 245, .12)) border-box;
    border: 1px solid transparent; border-radius: 10px; box-shadow: 0 8px 20px rgba(0, 0, 0, .35); }
.mp-head { display: flex; justify-content: space-between; gap: 10px; margin: 0 2px 10px; }
.mp-head h2 { margin: 0; color: #eef4f9; font: 700 18px/1.2 Georgia, 'Times New Roman', serif; }
.mp-head span { color: #7f98ad; font-size: 12px; }
/* stage: with WebGL (maps.js) a block of ground drawn on a canvas, the pins on top (.mp-layer.is-gl, placed in px);
   without it the flat picture (.mp-canvas) with the pins in % of the 256 x 256 grid */
.mp-stage { position: relative; width: 100%; height: clamp(320px, 56vw, 620px); overflow: hidden; border-radius: 10px; outline: none;
    background: radial-gradient(ellipse 70% 62% at 50% 50%, rgba(52, 104, 156, .3), transparent 72%),
                radial-gradient(ellipse 120% 70% at 50% 120%, rgba(24, 60, 96, .45), transparent 65%), #060b12;
    border: 1px solid rgba(110, 190, 245, .18); box-shadow: inset 0 0 60px rgba(0, 0, 0, .55); }
@media (max-width: 600px) { .mp-stage { height: 94vw; } }
.mp-stage:focus-visible { box-shadow: inset 0 0 60px rgba(0, 0, 0, .55), 0 0 0 2px rgba(150, 212, 255, .55); }
.mp-stage.is-gl { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.mp-stage.is-dragging { cursor: grabbing; }
.mp-stage.is-gl .mp-canvas { display: none; }
.mp-stage.is-flat { height: auto; padding: 10px; }
.mp-gl { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.mp-canvas { position: relative; height: 100%; max-width: 100%; margin: 0 auto; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 8px;
    border: 1px solid rgba(110, 190, 245, .2); box-shadow: inset 0 0 40px rgba(0, 0, 0, .6); background: #090e15; }
.mp-stage.is-flat .mp-canvas { width: 100%; max-width: 640px; height: auto; }
.mp-terrain { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; opacity: .95; }
.mp-terrain.is-client { image-rendering: auto; opacity: 1; } /* the game client's minimap: a picture, not cells */
.mp-layer { position: absolute; inset: 0; }
.mp-layer.is-gl { z-index: 2; overflow: hidden; pointer-events: none; }
.mp-layer.is-gl:not(.is-ready) { visibility: hidden; }
.mp-layer.is-gl .mp-spot { pointer-events: auto; }

/* zoom / turn buttons and the hint */
.mp-ctrl { position: absolute; top: 10px; right: 10px; z-index: 6; display: flex; flex-direction: column; gap: 2px; padding: 4px;
    background: rgba(6, 14, 24, .78); border: 1px solid rgba(110, 190, 245, .22); border-radius: 10px; box-shadow: 0 6px 16px rgba(0, 0, 0, .45); }
.mp-ctrl[hidden] { display: none; }
.content-wrapper .mp-ctrl button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; color: #cfe3f3; font-size: 15px; line-height: 1;
    background: transparent; border: 0; border-radius: 7px; box-shadow: none; cursor: pointer; transition: background .15s, color .15s; }
.content-wrapper .mp-ctrl button:hover, .content-wrapper .mp-ctrl button:focus-visible { color: #fff; background: rgba(96, 176, 232, .22); outline: none; }
.mp-ctrl hr { height: 1px; margin: 2px 5px; background: rgba(110, 190, 245, .2); border: 0; opacity: 1; }
.mp-compass { display: inline-block; color: #9fd3ff; }
.mp-tip { position: absolute; left: 10px; bottom: 10px; z-index: 6; max-width: calc(100% - 70px); margin: 0; padding: 4px 10px; color: #a9c2d6; font-size: 11.5px;
    background: rgba(6, 14, 24, .75); border: 1px solid rgba(110, 190, 245, .16); border-radius: 6px; pointer-events: none; transition: opacity .6s; }
.mp-tip[hidden] { display: none; }
.mp-tip.is-gone { opacity: 0; }

/* spots: a coloured pin per big group of a monster (--s = size, bigger for more monsters; --k = a little bigger when
   zoomed in; --stem = how far the head stands above the ground, by the tilt) */
.mp-spot { position: absolute; cursor: pointer; outline: none; }
.mp-dot { --sz: calc(var(--s, 12px) * var(--k, 1)); z-index: 2; width: var(--sz); height: var(--sz); margin: calc(var(--sz) / -2) 0 0 calc(var(--sz) / -2);
    background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--mon) 45%, #fff), var(--mon) 62%); border: 2px solid rgba(255, 255, 255, .92); border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .45), 0 0 10px var(--mon), 0 0 22px color-mix(in srgb, var(--mon) 45%, transparent); transition: transform .15s, box-shadow .15s, opacity .2s; }
.mp-dot::before { content: ''; position: absolute; inset: -4px; border: 2px solid var(--mon); border-radius: 50%; opacity: 0; pointer-events: none;
    animation: mp-pulse 2.8s ease-out infinite; animation-delay: var(--d, 0s); }
@keyframes mp-pulse { 0% { transform: scale(.8); opacity: .6; } 70%, 100% { transform: scale(2.1); opacity: 0; } }
.mp-layer.is-gl .mp-dot { margin-top: calc(var(--sz) / -2 - var(--stem, 0px)); }
.mp-layer.is-gl .mp-dot::after { content: ''; position: absolute; top: calc(100% + 2px); left: 50%; width: 2px; height: var(--stem, 0px); margin-left: -1px; border-radius: 1px;
    background: linear-gradient(rgba(255, 255, 255, .85), color-mix(in srgb, var(--mon) 70%, transparent)); box-shadow: 0 0 4px rgba(0, 0, 0, .6); pointer-events: none; }
.mp-dot:hover, .mp-dot:focus-visible, .mp-dot.is-lit { transform: scale(1.35); box-shadow: 0 0 0 2px #fff, 0 0 18px var(--mon), 0 0 34px var(--mon); }
.mp-dot:hover, .mp-dot:focus-visible { z-index: 6000 !important; }
.mp-main.is-focus .mp-spot:not(.is-lit) { opacity: .15; }
.mp-main.is-focus .mp-spot:not(.is-lit)::before { animation: none; }
@media (prefers-reduced-motion: reduce) {
    .mp-dot { transition: none; }
    .mp-dot::before { animation: none; }
    .mp-tip { transition: none; }
}
/* 3D / 2D switch */
.mp-view { display: flex; padding: 3px; gap: 3px; background: rgba(4, 10, 17, .7); border: 1px solid rgba(110, 190, 245, .16); border-radius: 8px; }
.content-wrapper .mp-view button { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; color: #8fa7bb; font-size: 11.5px; font-weight: 800;
    background: transparent; border: 0; border-radius: 5px; cursor: pointer; box-shadow: none; }
.content-wrapper .mp-view button.is-active { color: #fff; background: linear-gradient(180deg, #2b6a9c, #18456c); }
.mp-head { align-items: center; }
.mp-head > div:first-child { display: flex; flex-direction: column; gap: 2px; }
/* legend */
.mp-legend { padding: 12px; background: rgba(4, 10, 17, .55); border: 1px solid rgba(110, 190, 245, .16); border-radius: 10px; }
.mp-legend .dl-group-title { margin: 0 0 8px; color: #7f98ad; font-size: 9.5px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
.mp-legend .dl-group-title span { margin-left: 4px; padding: 0 6px; color: #9fd3ff; background: rgba(96, 176, 232, .12); border-radius: 8px; }
.mp-legend-list { display: flex; flex-direction: column; gap: 5px; }
.mp-mon { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; color: inherit; text-align: left; cursor: pointer;
    background: rgba(255, 255, 255, .03); border: 1px solid rgba(110, 190, 245, .12); border-left: 3px solid var(--mon, #6fc1e2); border-radius: 7px; transition: background .15s; }
.mp-mon:hover, .mp-mon.is-lit { background: color-mix(in srgb, var(--mon) 14%, transparent); }
.mp-mon-pic { flex: 0 0 30px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #0b1722; font-weight: 900;
    background: var(--mon, #6fc1e2); border-radius: 50%; }
.mp-mon-pic img { width: 100%; height: 100%; object-fit: cover; }
.mp-mon-text { display: flex; flex-direction: column; min-width: 0; }
.mp-mon-text b { color: #eef4f9; font-size: 12.5px; line-height: 1.25; }
.mp-mon-text small { color: #7f98ad; font-size: 11px; }

/* hover card */
.mp-card { position: fixed; z-index: 2000; display: flex; align-items: center; gap: 12px; min-width: 200px; max-width: 280px; padding: 10px 14px 10px 10px; pointer-events: none;
    background: linear-gradient(180deg, rgba(20, 42, 66, .98), rgba(9, 18, 29, .98)); border: 1px solid rgba(96, 176, 232, .45); border-radius: 10px; box-shadow: 0 14px 30px rgba(0, 0, 0, .6); }
.mp-card[hidden] { display: none; }
.mp-card-pic { flex: 0 0 64px; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 8px;
    background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--mon) 40%, transparent), rgba(0, 0, 0, .4)); border: 1px solid color-mix(in srgb, var(--mon) 60%, transparent); }
.mp-card-pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mp-card-pic span { color: var(--mon); font: 900 28px/1 Georgia, serif; }
.mp-card-pic { border-color: color-mix(in srgb, var(--mon) 60%, transparent); }
.mp-card-text { display: flex; flex-direction: column; min-width: 0; }
.mp-card-text b { color: #eef4f9; font-size: 14px; }
.mp-card-text small { color: #9fd3ff; font-size: 12px; font-weight: 700; }
.mp-card-text em { color: #7f98ad; font-size: 11px; font-style: normal; }

/* Monster pictures (rendered from the client's 3D models, img/monsters/<index>.png): dark background with the
   monster's colour as the ring, zoomed to the head and body in the list; whole monster in the hover card */
.mp-mon-pic:has(img) { flex-basis: 36px; width: 36px; height: 36px; background: radial-gradient(circle at 50% 30%, #2a3b4f, #0b121b 75%); border: 2px solid var(--mon, #6fc1e2); }
.mp-mon-pic:has(img) img { object-fit: contain; object-position: 50% 20%; transform: scale(1.35); transform-origin: 50% 25%; }
.mp-card-pic:has(img) { flex-basis: 84px; width: 84px; height: 84px; background: radial-gradient(circle at 50% 35%, #2a3b4f, #0b121b 75%); }
.mp-hint { margin: 0 0 8px; color: #8fa3b4; font-size: 12px; }
.mp-clear { float: right; margin-top: -2px; padding: 1px 8px; color: #78b2de; font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; background: rgba(120, 178, 222, .1); border: 1px solid rgba(120, 178, 222, .35); border-radius: 4px; cursor: pointer; }
.mp-clear:hover { background: rgba(120, 178, 222, .2); }
.mp-mon.is-marked { box-shadow: inset 3px 0 0 var(--mon), 0 0 0 1px var(--mon); }
.mp-mon.is-marked::after { content: '\2713'; margin-left: auto; color: var(--mon); font-weight: 900; }
/* key under the map */
.mp-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; color: #8fa3b4; font-size: 12px; }
.mp-key span { display: inline-flex; align-items: center; gap: 6px; }
.mp-key i { display: inline-block; flex: none; }
.mp-key-area { width: 11px; height: 11px; background: #6fc1e2; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 8px #6fc1e2; }
.mp-key-safe { width: 11px; height: 11px; background: #26684a; border-radius: 2px; }
