/* The EU5 map page (/map/, map-page.mjs, map.js): the map and its panel side by side, stacked on phones. */
.eumap { margin: 6px 0 0; }
.eumap .mapbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 10px; }
.eumap .modes { display: flex; flex-wrap: wrap; gap: 4px; }
.eumap .modes button { display: inline-flex; align-items: center; gap: 6px; font: 600 14px/1 var(--body); padding: 6px 10px 6px 7px; min-height: 36px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); color: var(--ink-soft); cursor: pointer; }
.eumap .modes button img { width: 22px; height: 22px; flex: none; }
.eumap .modes button:hover { color: var(--ink); border-color: var(--ac); }
.eumap .modes button[aria-pressed="true"] { background: var(--panel-2); color: var(--ink); border-color: var(--ac); }
.eu5-find { position: relative; margin-left: auto; width: 300px; max-width: 100%; }
.eu5-find input { width: 100%; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; font-size: 15px; background: var(--panel); color: var(--ink); }
#eu5-find-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 12px 28px rgba(0,0,0,.4); max-height: 60vh; overflow: auto; }
#eu5-find-list button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
#eu5-find-list button:hover, #eu5-find-list button:focus { background: var(--panel-2); }
#eu5-find-list small { display: inline; margin-left: 4px; }

.eumap .mapwrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
#eu5-map { position: relative; height: min(76vh, 840px); min-height: 420px; background: #0d1d24; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
#eu5-map canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; outline: none; }
#eu5-map canvas:active { cursor: grabbing; }
#eu5-map canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--ac); }
#eu5-map .still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
#eu5-map.ready .still { display: none; }
#eu5-map .zoom { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 4px; }
#eu5-map .zoom button { width: 36px; height: 36px; font: 600 20px/1 var(--body); border: 1px solid rgba(255,255,255,.22); border-radius: 6px; background: rgba(12,19,23,.82); color: #eef2f4; cursor: pointer; }
#eu5-map .zoom button:hover { border-color: rgba(255,255,255,.5); }
#eu5-map .legend { position: absolute; left: 10px; bottom: 10px; max-width: min(560px, calc(100% - 20px)); display: flex; flex-wrap: wrap; gap: 3px 12px; padding: 7px 10px; border-radius: 8px; background: rgba(12,19,23,.84); color: #e6edf0; font-size: 13px; line-height: 1.4; pointer-events: none; }
#eu5-map .legend .ramp { display: inline-block; width: 140px; height: 10px; border-radius: 3px; align-self: center; }
#eu5-map .legend .more { color: #9fb0b8; }
#eu5-map .tip { position: absolute; z-index: 5; pointer-events: none; max-width: 260px; padding: 6px 9px; border-radius: 6px; background: rgba(10,15,18,.92); color: #eef2f4; font-size: 14px; line-height: 1.35; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
#eu5-map .stale { position: absolute; left: 12px; bottom: 12px; margin: 0; padding: 6px 10px; border-radius: 6px; background: rgba(10,15,18,.9); color: #fff; font-size: 14px; }
#eu5-map.failed::after { content: 'The map could not load. Reload the page to try again.'; position: absolute; left: 12px; bottom: 12px; padding: 6px 10px; border-radius: 6px; background: rgba(10,15,18,.9); color: #fff; font-size: 14px; }
.eumap .sw, .eumap-after .sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.35); }

#eu5-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 10px; max-height: min(76vh, 840px); overflow: auto; }
#eu5-panel h2 { margin: 0 0 4px; font-size: 26px; }
#eu5-panel p { margin: 0 0 10px; font-size: 15px; }
#eu5-panel .where { color: var(--muted); }
#eu5-panel .pid { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#eu5-panel .pid .copy { margin-left: 0; }
#eu5-panel table.kv { font-size: 14.5px; margin: 4px 0 10px; }
#eu5-panel table.kv th { width: 40%; font-weight: 400; color: var(--muted); padding: 5px 8px 5px 0; vertical-align: top; }
#eu5-panel table.kv td { padding: 5px 0; }
#eu5-panel table.kv tr:hover { background: none; }
#eu5-panel code { font-size: 13px; color: var(--muted); }
#eu5-panel .cinfo { color: var(--ink-soft); }
#eu5-panel .linkish { border: 0; padding: 0; background: none; color: var(--ac); font: inherit; cursor: pointer; text-align: left; }
#eu5-panel .mi { width: 20px; height: 20px; vertical-align: -4px; margin-right: 5px; }
#eu5-panel h2 .mi { width: 28px; height: 28px; vertical-align: -3px; margin-right: 8px; }
#eu5-panel .linkish:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .eumap .mapwrap { grid-template-columns: 1fr; }
  #eu5-map { height: 62vh; min-height: 320px; }
  #eu5-panel { max-height: none; }
  .eu5-find { margin-left: 0; width: 100%; }
  .eumap .modes button { padding: 5px 8px 5px 6px; font-size: 13.5px; gap: 4px; }
  .eumap .modes button img { width: 18px; height: 18px; }
  #eu5-map .legend { left: 6px; bottom: 6px; max-width: calc(100% - 12px); gap: 2px 9px; padding: 4px 7px; font-size: 12px; }
  #eu5-map .legend .ramp { width: 90px; }
}
