/* Leonida interactive map — project-native canvas UI */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.map-section { max-width: 1380px; }
.map-shell {
  width: 100%; min-width: 0;
  height: min(78dvh, 820px); min-height: 680px; display: grid; grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
  overflow: hidden; border: 1px solid var(--line-strong); border-radius: 8px;
  background: #130c16; box-shadow: 0 30px 90px rgba(8, 2, 9, .38);
}
.map-sidebar {
  position: relative; z-index: 4; display: flex; flex-direction: column; min-width: 0; min-height: 0;
  padding: 22px 18px 18px; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(34, 18, 34, .98), rgba(18, 11, 20, .98));
}
.map-sidebar-head { display: flex; justify-content: space-between; gap: 12px; align-items: end; margin-bottom: 16px; }
.map-kicker { font: 700 9px/1.4 var(--mono); letter-spacing: .2em; color: var(--sunset); }
.map-sidebar-head strong { font: 800 12px/1 var(--font); color: #fff; }
.map-search-wrap { position: relative; display: block; }
.map-search-wrap input {
  width: 100%; height: 46px; padding: 0 44px 0 14px; border: 1px solid var(--line);
  border-radius: 5px; outline: 0; background: rgba(255,255,255,.045); color: #fff;
  font: 500 13px/1 var(--font); transition: border-color .2s, background .2s;
}
.map-search-wrap input:focus { border-color: var(--pink); background: rgba(255,255,255,.07); box-shadow: 0 0 0 3px rgba(255,93,147,.12); }
.map-search-wrap input::placeholder { color: #8f7c8c; }
.map-search-wrap kbd {
  position: absolute; right: 10px; top: 10px; width: 26px; height: 26px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 4px; color: var(--dim); background: rgba(0,0,0,.2); font: 11px var(--mono);
}
.map-groups {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
  max-height: 208px; margin: 14px 0 16px; overflow-y: auto; padding-right: 4px;
}
.map-group-btn {
  min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border: 1px solid transparent; border-radius: 4px;
  background: rgba(255,255,255,.035); color: var(--dim); cursor: pointer;
  font: 700 11px/1.2 var(--font); text-align: left; transition: .18s ease;
}
.map-group-btn small { color: #7d6979; font: 9px var(--mono); }
.map-group-btn:hover { color: #fff; background: rgba(255,255,255,.07); }
.map-group-btn.active { color: #1c0c14; border-color: transparent; background: linear-gradient(120deg, #ffb25f, #ff6d94); }
.map-group-btn.active small { color: rgba(28,12,20,.65); }
.map-category-head {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 12px 2px 10px; border-top: 1px solid var(--line);
}
.map-category-head span { font: 800 11px/1 var(--font); color: #fff; }
.map-category-head button {
  border: 0; background: transparent; color: #ff9dbb; cursor: pointer; padding: 5px;
  font: 700 10px/1 var(--font);
}
.map-categories { min-height: 0; flex: 1; overflow-y: auto; padding-right: 4px; }
.map-categories::-webkit-scrollbar, .map-groups::-webkit-scrollbar { width: 5px; }
.map-categories::-webkit-scrollbar-thumb, .map-groups::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 5px; }
.map-category-row {
  width: 100%; min-height: 43px; display: grid; grid-template-columns: 28px minmax(0,1fr) auto;
  align-items: center; gap: 8px; padding: 6px 7px; border: 0; border-bottom: 1px solid rgba(255,255,255,.045);
  background: transparent; color: #c6b5c2; cursor: pointer; text-align: left; transition: .15s ease;
}
.map-category-row:hover { color: #fff; background: rgba(255,255,255,.04); }
.map-category-row[aria-pressed="false"] { opacity: .42; }
.map-category-icon {
  width: 26px; height: 26px; display: grid; place-items: center;
}
.map-category-icon canvas { display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.48)); }
.map-category-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 11px/1.25 var(--font); }
.map-category-count { color: #806c7b; font: 10px var(--mono); }

.map-stage {
  position: relative; width: 100%; min-width: 0; min-height: 0; overflow: hidden; touch-action: none;
  background:
    radial-gradient(circle at 50% 45%, rgba(94,204,220,.22), transparent 38%),
    #2f94b0;
}
#leonidaMap { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
#leonidaMap.is-dragging { cursor: grabbing; }
.map-controls {
  position: absolute; z-index: 5; right: 18px; top: 18px; display: grid; overflow: hidden;
  border: 1px solid rgba(255,255,255,.18); border-radius: 6px; background: rgba(12,8,14,.82); backdrop-filter: blur(12px);
}
.map-controls button {
  width: 42px; height: 42px; border: 0; border-bottom: 1px solid rgba(255,255,255,.12);
  background: transparent; color: #fff; cursor: pointer; font: 500 20px/1 var(--font);
}
.map-controls button:last-child { border-bottom: 0; font-size: 17px; }
.map-controls button:hover { background: rgba(255,93,147,.18); }
.map-legend {
  position: absolute; z-index: 4; left: 18px; bottom: 18px; display: flex; gap: 14px; flex-wrap: wrap;
  padding: 9px 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 5px;
  background: rgba(11,7,13,.78); backdrop-filter: blur(10px); color: #c9b8c4; font: 10px var(--mono);
}
.map-legend span { display: flex; align-items: center; gap: 6px; }
.map-legend b { color: #fff; font-weight: 700; }
.map-legend small { font: inherit; }
.map-legend i { width: 7px; height: 7px; border-radius: 50%; }
.legend-visible { background: #ff719c; box-shadow: 0 0 9px #ff719c; }
.legend-found { background: #48e0ad; box-shadow: 0 0 9px #48e0ad; }
.map-detail {
  position: absolute; z-index: 8; right: 72px; top: 18px; width: min(330px, calc(100% - 110px));
  padding: 20px; border: 1px solid rgba(255,112,158,.38); border-radius: 7px;
  background: linear-gradient(160deg, rgba(32,18,31,.97), rgba(14,9,17,.97));
  box-shadow: 0 22px 64px rgba(0,0,0,.48); backdrop-filter: blur(18px);
}
.map-detail-close {
  position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border: 1px solid var(--line);
  border-radius: 4px; background: rgba(255,255,255,.04); color: #fff; cursor: pointer; font-size: 18px;
}
.map-detail-type { display: block; margin: 2px 38px 8px 0; color: #ff9cbb; font: 800 9px/1.3 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.map-detail h3 { margin: 0 38px 10px 0; color: #fff; font: 800 22px/1.15 var(--display); letter-spacing: -.02em; }
.map-detail p { max-height: 150px; overflow-y: auto; margin: 0 0 12px; color: #cbbbc6; font-size: 12.5px; line-height: 1.65; }
.map-detail-meta { color: #7f6c7b; font: 9px/1.5 var(--mono); letter-spacing: .08em; }
.map-found-btn {
  width: 100%; min-height: 42px; margin-top: 14px; border: 0; border-radius: 4px; cursor: pointer;
  background: linear-gradient(120deg, #ffae61, #ff6c94); color: #200d16; font: 800 11px/1 var(--font); letter-spacing: .05em;
}
.map-found-btn.is-found { background: rgba(72,224,173,.14); color: #72ecc1; border: 1px solid rgba(72,224,173,.35); }
.map-empty {
  position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%,-50%);
  padding: 14px 18px; border: 1px solid var(--line); border-radius: 5px;
  color: #d8c8d3; background: rgba(13,8,15,.82); font-size: 12px;
}
.map-source { position: absolute; z-index: 2; right: 18px; bottom: 19px; color: rgba(255,255,255,.62); font: 7px/1.35 var(--mono); letter-spacing: .1em; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.map-source a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 900px) {
  .map-shell { height: auto; min-height: 980px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(600px, 1fr); }
  .map-sidebar { min-height: auto; max-width: 100%; overflow: hidden; border-right: 0; border-bottom: 1px solid var(--line); }
  .map-groups { width: 100%; max-width: 100%; grid-template-columns: repeat(5, minmax(110px, 1fr)); max-height: none; overflow-x: auto; overflow-y: hidden; }
  .map-categories { width: 100%; max-width: 100%; min-width: 0; display: flex; flex: none; gap: 6px; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
  .map-category-row { min-width: 165px; border: 1px solid var(--line); border-radius: 4px; }
  .map-stage { min-height: 600px; }
}

@media (max-width: 620px) {
  .map-section { padding-inline: 12px; }
  .map-shell { min-height: 870px; grid-template-rows: auto 520px; }
  .map-sidebar { padding: 16px 14px 14px; }
  .map-groups { grid-template-columns: repeat(10, 118px); margin-bottom: 10px; }
  .map-category-head { padding-top: 10px; }
  .map-stage { min-height: 520px; }
  .map-detail { left: 12px; right: 12px; top: auto; bottom: 58px; width: auto; }
  .map-controls { right: 12px; top: 12px; }
  .map-controls button { width: 40px; height: 40px; }
  .map-legend { left: 12px; bottom: 12px; }
  .map-source { right: 12px; bottom: 56px; max-width: 168px; font-size: 6px; text-align: right; }
}
