:root {
  --gold: #e6c36a;
  --gold-hover: #ffd700;
  --dark-bg: #0b1320;
  --panel-bg: #152238;
  --text-light: #e0e0e0;
  --muted: #9ca9b9;
  --teal: #28b5bd;
  --teal-dark: #083d44;
  --line: rgba(230, 195, 106, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--dark-bg);
  color: var(--text-light);
  background-image: url('../textura.png');
  background-size: 1024px 1024px;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(11, 19, 32, 0.25);
  pointer-events: none;
  z-index: -1;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 70px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 10px 40px;
  background:
    linear-gradient(rgba(10, 20, 35, 0.95), rgba(5, 10, 20, 0.98)),
    url('../textura.png');
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.logo img {
  height: 50px;
}

nav {
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

nav a {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #bbb;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: 0.3s;
}

nav a:hover,
nav a.is-active {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(230, 195, 106, 0.5);
}

.search-box {
  display: flex;
  align-items: center;
}

.search-box input {
  width: 170px;
  padding: 8px 15px;
  border: 1px solid #334;
  border-radius: 4px 0 0 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  outline: none;
}

.search-box button {
  background: #334;
  border: 1px solid #334;
  border-left: none;
  border-radius: 0 4px 4px 0;
  color: var(--gold);
  padding: 8px 12px;
  cursor: pointer;
}

.map-shell {
  width: 100%;
  margin: 0;
  padding: 0;
  height: calc(100vh - 72px - 34px);
}

.map-legal-footer {
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  border-top: 1px solid rgba(230, 195, 106, 0.35);
  background: rgba(3, 10, 18, 0.9);
  color: #d7dfec;
  font-size: 12px;
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 7px;
  color: #f2deb0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

select,
input {
  width: 100%;
  min-height: 40px;
  color: #fff;
  background: rgba(5, 12, 24, 0.8);
  border: 1px solid rgba(230, 195, 106, 0.24);
  border-radius: 6px;
  padding: 9px 11px;
  outline: none;
}

select:focus,
input:focus {
  border-color: rgba(40, 181, 189, 0.75);
  box-shadow: 0 0 0 3px rgba(40, 181, 189, 0.14);
}

button {
  min-height: 40px;
  border: 1px solid rgba(230, 195, 106, 0.45);
  border-radius: 6px;
  padding: 0 16px;
  color: #fff7df;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  cursor: pointer;
  background:
    linear-gradient(rgba(28, 130, 142, 0.8), rgba(8, 61, 68, 0.96)),
    url('../textura.png');
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

button:hover {
  filter: brightness(1.08);
}

.secondary-action {
  background:
    linear-gradient(rgba(32, 47, 72, 0.9), rgba(18, 29, 45, 0.95)),
    url('../textura.png');
}

.secondary-action.is-active {
  border-color: rgba(129, 226, 174, 0.7);
  box-shadow: 0 0 0 2px rgba(129, 226, 174, 0.2), 0 5px 0 rgba(0, 0, 0, 0.45);
}

.picker-item {
  display: grid;
  grid-template-rows: 40px;
  align-items: center;
  justify-items: center;
  gap: 0;
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(63, 86, 116, 0.45);
  border-radius: 4px;
  padding: 4px;
  background: rgba(11, 29, 51, 0.55);
  color: #e7f2ff;
  cursor: pointer;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.picker-item.is-selected {
  background: linear-gradient(180deg, rgba(53, 130, 72, 0.55), rgba(40, 108, 55, 0.55));
  border-color: rgba(174, 240, 130, 0.45);
}

.picker-item.is-rats-type {
  min-height: 62px;
  grid-template-rows: 32px 14px;
  gap: 1px;
  background: rgba(11, 29, 51, 0.12);
  border-color: rgba(222, 193, 96, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 231, 171, 0.12);
}

.picker-item.is-rats-type.is-selected {
  background: linear-gradient(180deg, rgba(74, 122, 53, 0.92), rgba(40, 78, 31, 0.96));
  border-color: rgba(246, 199, 90, 0.9);
  box-shadow: 0 0 12px rgba(246, 199, 90, 0.28);
}

.picker-item:has(img.icon-name-ratas):not(.is-selected),
.picker-item:has(img.icon-name-mazmorras):not(.is-selected),
.picker-item:has(img.icon-name-guaridas):not(.is-selected) {
  background: rgba(11, 29, 51, 0.12);
  border-color: rgba(63, 86, 116, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 231, 171, 0.06);
}

.picker-item:has(img.icon-name-ratas).is-selected,
.picker-item:has(img.icon-name-mazmorras).is-selected,
.picker-item:has(img.icon-name-guaridas).is-selected {
  background: linear-gradient(180deg, rgba(74, 122, 53, 0.92), rgba(40, 78, 31, 0.96));
  border-color: rgba(246, 199, 90, 0.95);
  box-shadow: 0 0 12px rgba(246, 199, 90, 0.28), inset 0 0 0 1px rgba(255, 239, 178, 0.18);
}

.picker-item img {
  width: 40px;
  height: 40px;
  border-radius: 3px;
  object-fit: contain;
  object-position: center center;
  margin: 0 auto;
  transform-origin: center center;
}

.picker-item img.icon-name-ratas,
.picker-item img.icon-name-mazmorras,
.picker-item img.icon-name-guaridas {
  width: 36px;
  height: 36px;
  object-fit: contain;
  object-position: center center;
  transform: translateY(6px);
}

.job-rail-item img.icon-name-ratas,
.job-rail-item img.icon-name-mazmorras,
.job-rail-item img.icon-name-guaridas,
.job-rail-icon.icon-name-ratas,
.job-rail-icon.icon-name-mazmorras,
.job-rail-icon.icon-name-guaridas {
  width: 30px;
  height: 30px;
  object-fit: contain;
  object-position: center center;
  transform: none;
}

.atlas-icon {
  width: 40px;
  height: 40px;
  display: block;
  margin: 0 auto;
  border-radius: 3px;
  background-image: var(--atlas-url);
  background-repeat: no-repeat;
  background-position: var(--atlas-x) var(--atlas-y);
  background-size: auto;
}

.job-rail-icon.atlas-icon {
  width: 36px;
  height: 36px;
}



.picker-item-label {
  display: block;
  width: 100%;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #f7e39c;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.selected-types {
  grid-column: auto;
  min-height: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
}

.resource-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid rgba(230, 195, 106, 0.3);
  border-radius: 999px;
  background: rgba(5, 12, 24, 0.7);
  color: #f4f7ff;
  font-size: 12px;
  font-weight: 700;
}

.resource-tag button {
  min-height: 22px;
  min-width: 22px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12px;
  box-shadow: none;
  background: rgba(8, 61, 68, 0.8);
}

.map-layout {
  position: relative;
  width: 100%;
  height: 100%;
}

.resource-panel,
.map-stage {
  border: 1px solid rgba(70, 92, 122, 0.55);
  background: linear-gradient(180deg, rgba(21, 34, 56, 0.97), rgba(12, 22, 38, 0.97));
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

.resource-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100% - 32px);
  z-index: 700;
  min-height: 520px;
  padding: 10px;
  backdrop-filter: blur(3px);
  overflow: hidden;
}

.panel-collapsible {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 12px;
  margin-top: 44px;
  min-height: 0;
}

.panel-collapse-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 34px;
  min-height: 34px;
  height: 34px;
  border-radius: 9px;
  padding: 0;
  display: grid;
  place-items: center;
}

.resource-panel.is-collapsed {
  width: 56px;
  min-height: 56px;
  max-height: 56px;
  padding: 8px;
}

.resource-panel.is-collapsed .panel-collapsible {
  display: none;
}

.resource-panel.is-collapsed .panel-collapse-btn {
  top: 8px;
  right: 8px;
}

.panel-tools {
  display: grid;
  gap: 8px;
}

.panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
}

.panel-head strong {
  max-width: 180px;
  text-align: right;
  color: #fff2c8;
  font-size: 13px;
  line-height: 1.35;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-grid div {
  padding: 12px 8px;
  border: 1px solid rgba(230, 195, 106, 0.16);
  border-radius: 6px;
  background: rgba(5, 12, 24, 0.55);
  text-align: center;
}

.stat-grid span {
  display: block;
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
}

.stat-grid small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.resource-list {
  display: grid;
  gap: 9px;
  max-height: 100%;
  overflow: auto;
  padding-right: 5px;
}

.resource-list {
  display: none;
}

.resource-group {
  display: grid;
  gap: 9px;
}

.resource-group-title {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(230, 195, 106, 0.16);
  border-radius: 6px;
  background: rgba(12, 28, 48, 0.92);
  color: #b8f065;
  font-size: 14px;
  font-weight: 800;
}

.resource-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid rgba(70, 92, 122, 0.45);
  border-radius: 6px;
  background: rgba(5, 12, 24, 0.45);
}

.resource-item strong {
  color: #fff2c8;
}

.resource-item span {
  color: var(--muted);
  font-size: 12px;
}

.resource-list-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 242, 200, 0.65);
  background: rgba(4, 20, 35, 0.75);
}

.resource-list-meta {
  display: block;
  color: #91a4be;
  font-size: 11px;
}

.coords {
  font-family: 'Cinzel', serif;
  color: var(--teal);
  font-weight: 700;
}

.map-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: rgba(5, 12, 24, 0.7);
}

.map-stage .leaflet-top.leaflet-right {
  top: 14px;
  right: 14px;
}

.dofus-map {
  position: absolute;
  inset: 0;
  border: none;
}

.map-selector {
  display: grid;
  gap: 10px;
}

.sidebar-selector {
  position: static;
}

.resource-panel-floating {
  width: 100%;
  min-height: 140px;
  max-height: none;
  border: 1px solid rgba(77, 98, 128, 0.6);
  border-radius: 20px;
  padding: 16px 14px;
  background: rgba(37, 39, 47, 0.92);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.4);
}

.resource-panel-floating h3 {
  margin: 0 0 12px;
  color: #95c83f;
  font-size: 22px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  overflow: visible;
  max-height: none;
}

.job-rail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 60px;
}

.job-rail-item {
  width: 58px;
  height: 58px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(24, 30, 44, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.job-rail-item img,
.job-rail-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.job-rail-item.is-rats-job {
  width: 86px;
  border-radius: 14px;
  flex-direction: column;
  gap: 2px;
  padding: 6px 4px 5px;
  border-color: rgba(246, 199, 90, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 233, 177, 0.12);
}

.job-rail-item.is-rats-job .job-rail-label {
  display: block;
  width: 100%;
  margin-top: 2px;
  color: #f7e39c;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-align: center;
}

.job-rail-item.is-rats-job.is-active {
  border-color: rgba(255, 212, 102, 0.98);
  box-shadow: 0 0 0 3px rgba(255, 212, 102, 0.24);
}

.job-rail-item.is-active {
  border-color: rgba(255, 212, 102, 0.82);
  box-shadow: 0 0 0 3px rgba(255, 212, 102, 0.25);
}

.map-cursor {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 550;
  min-width: 70px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 242, 200, 0.42);
  background: rgba(12, 67, 82, 0.84);
  color: #efffff;
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translate(0, 0);
  transition: opacity 0.15s ease-out;
}

.resource-marker {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.resource-marker img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 242, 200, 0.95);
  background: rgba(6, 25, 45, 0.88);
  box-shadow: 0 0 14px rgba(26, 199, 226, 0.45), 0 6px 16px rgba(0, 0, 0, 0.45);
}

.resource-marker-fallback {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255, 242, 200, 0.95);
  background: radial-gradient(circle at 36% 36%, #fff6c2, #22b3c8 52%, #0f5861 82%);
  box-shadow: 0 0 14px rgba(26, 199, 226, 0.45), 0 6px 16px rgba(0, 0, 0, 0.45);
  color: #031e31;
  font-size: 14px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.resource-marker-badge {
  position: absolute;
  right: -8px;
  bottom: -7px;
  min-width: 20px;
  height: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 242, 200, 0.95);
  background: #0e7a87;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  padding: 0 4px;
}

.map-cell-highlight {
  stroke: #111;
  stroke-width: 1.2;
  fill: transparent;
}

.map-grid-line {
  stroke: rgba(236, 241, 247, 0.45);
  stroke-width: 1;
}

.leaflet-tooltip.resource-tooltip {
  border: 1px solid rgba(255, 242, 200, 0.4);
  background: rgba(4, 20, 35, 0.92);
  color: #efffff;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
}

.leaflet-tooltip.resource-tooltip:before {
  border-top-color: rgba(4, 20, 35, 0.92);
}

.leaflet-tooltip.resource-preview-tooltip {
  padding: 8px 10px;
}

.resource-preview {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
}

.resource-preview img {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 242, 200, 0.75);
  background: rgba(4, 20, 35, 0.7);
}

.resource-preview strong {
  display: block;
  color: #f8f6e7;
  font-size: 13px;
  line-height: 1.1;
}

.resource-preview span {
  display: block;
  color: #b6f5c8;
  font-size: 12px;
}

.resource-preview small {
  display: block;
  color: #9ec0dc;
  font-size: 11px;
}

.map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #fff2c8;
  font-family: 'Cinzel', serif;
  text-align: center;
  background: rgba(5, 12, 24, 0.55);
  pointer-events: none;
}

.map-empty.is-hidden {
  display: none;
}

.map-info-card {
  position: absolute;
  left: 50%;
  bottom: 16px;
  top: auto;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 30px));
  z-index: 920;
  border: 1px solid rgba(70, 92, 122, 0.6);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(18, 118, 128, 0.88), rgba(6, 53, 58, 0.92));
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.48);
  overflow: hidden;
}

.map-info-card.is-hidden {
  display: none;
}

.map-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(90deg, rgba(5, 22, 44, 0.96), rgba(7, 38, 72, 0.92));
}

.map-info-head h3 {
  margin: 0;
  color: #f4fbff;
  font-size: 24px;
  font-family: 'Cinzel', serif;
  font-weight: 700;
}

.map-info-head button {
  min-height: 34px;
  min-width: 34px;
  width: 34px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  font-size: 24px;
  line-height: 1;
  box-shadow: none;
}

.map-info-body {
  min-height: 150px;
  max-height: 220px;
  overflow: auto;
  padding: 10px 12px;
}

.map-info-pane {
  display: none;
  background: rgba(0, 35, 39, 0.72);
  border-radius: 12px;
  padding: 10px 12px;
}

.map-info-pane.is-active {
  display: block;
}

.map-info-subtitle {
  display: inline-block;
  margin: 0 0 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 33, 37, 0.85);
  color: #d7f5ff;
  font-weight: 700;
  font-size: 13px;
}

.map-info-row {
  margin: 0 0 6px;
  color: #e9fffc;
  font-size: 14px;
}

.map-info-thumb-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
}

.map-info-thumb-strip.is-loading::before {
  content: 'Cargando miniaturas...';
  color: #ccebef;
  font-size: 12px;
}

.map-info-thumb {
  min-height: 0;
  min-width: 0;
  width: 96px;
  flex: 0 0 96px;
  padding: 0;
  border: 1px solid rgba(255, 242, 200, 0.42);
  border-radius: 8px;
  background: rgba(4, 20, 35, 0.85);
  box-shadow: none;
  overflow: hidden;
  display: grid;
  grid-template-rows: 64px auto;
  cursor: zoom-in;
}

.map-info-thumb.is-active {
  border-color: rgba(176, 243, 101, 0.88);
  box-shadow: 0 0 0 2px rgba(176, 243, 101, 0.24);
}

.map-info-thumb img {
  width: 100%;
  height: 64px;
  object-fit: cover;
  display: block;
}

.map-info-thumb-date {
  display: block;
  padding: 2px 4px;
  font-size: 11px;
  color: #f2f7fe;
  text-align: center;
  background: rgba(3, 13, 25, 0.8);
}

.map-info-resources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-info-resource {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 242, 200, 0.45);
  border-radius: 8px;
  background: rgba(7, 20, 34, 0.78);
  display: grid;
  place-items: center;
  position: relative;
}

.map-info-resource img {
  width: 30px;
  height: 30px;
  object-fit: cover;
}

.map-info-resource-badge {
  position: absolute;
  right: -6px;
  bottom: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 10px;
  padding: 0 4px;
  border: 1px solid rgba(255, 242, 200, 0.95);
  background: #0e7a87;
  color: #fff;
  font-size: 11px;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.map-info-empty {
  margin: 0;
  color: #ccebef;
}

.map-info-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.map-info-tabs button {
  border-radius: 0;
  min-height: 44px;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
  background: rgba(0, 35, 39, 0.82);
  color: #e6f9ff;
  font-size: 15px;
}

.map-info-tabs button.is-active {
  background: rgba(0, 20, 23, 0.95);
  color: #b5f54c;
}

.map-info-image-modal {
  position: absolute;
  inset: 0;
  z-index: 960;
  background: rgba(5, 10, 20, 0.72);
  display: grid;
  place-items: center;
  padding: 24px;
}

.map-info-image-modal.is-hidden {
  display: none;
}

.map-info-image-viewer {
  width: min(1120px, 100%);
  max-height: min(88vh, 760px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-rows: minmax(240px, 1fr) auto;
}

.map-info-image-main {
  width: 100%;
  height: min(74vh, 660px);
  object-fit: contain;
  display: block;
  background: rgba(0, 0, 0, 0.45);
}

.map-info-image-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 12px 10px;
  background: linear-gradient(180deg, rgba(4, 16, 30, 0.9), rgba(4, 16, 30, 0.95));
}

.map-info-image-strip .map-info-thumb {
  width: 104px;
  flex-basis: 104px;
}

.map-info-image-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 3;
  width: 40px;
  min-height: 40px;
  border-radius: 50%;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: none;
  background: rgba(6, 20, 36, 0.78);
  font-size: 32px;
  line-height: 1;
}

@media (max-width: 1050px) {
  .resource-panel {
    min-height: 440px;
  }

  .resource-list {
    max-height: 300px;
  }
}

@media (min-width: 1400px) {
  .resource-panel {
    width: min(500px, calc(100vw - 32px));
  }
}

@media (max-width: 700px) {
  header {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 10px;
  }

  .search-box {
    width: min(100%, 320px);
  }

  .search-box input {
    width: 100%;
  }

  .map-shell {
    width: 100%;
    height: calc(100vh - 186px - 34px);
  }

  .resource-panel {
    width: min(320px, calc(100vw - 24px));
    left: 12px;
    top: 12px;
    max-height: calc(100% - 24px);
  }

  .resource-panel.is-collapsed {
    width: 56px;
    min-height: 56px;
    max-height: 56px;
  }

  .map-stage {
    min-height: 100%;
  }

  .map-info-card {
    width: min(96vw, 460px);
    bottom: 12px;
  }

  .map-info-head h3 {
    font-size: 20px;
  }

  .map-legal-footer {
    height: auto;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .map-selector {
    transform: none;
  }

  .job-rail {
    justify-content: flex-start;
  }
}
