/* Map explorer additions on top of style.css */
body.explorer { overflow: hidden; }
body.browsing { overflow: auto; background: #0c0c12; }
body.browsing #view, body.browsing #crosshair { display: none; }
body:not(.exploring) #crosshair { display: none; }

#browse { position: relative; min-height: 100%; padding: 20px 16px 40px; max-width: 1400px; margin: 0 auto; }
.browse-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 0; background: #0c0c12; }
.browse-head h1 { margin: 0; font-size: 22px; }
#search { flex: 1; min-width: 200px; max-width: 420px; font: inherit; padding: 8px 12px; border-radius: 8px;
  border: 1px solid #33334a; background: #15151f; color: var(--text); }
#search:focus { outline: none; border-color: var(--accent); }
#count { color: var(--muted); }
.browse-head .quality { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--text); cursor: pointer; }
.browse-head .quality + .quality { margin-left: 0; }
.browse-head .quality input { accent-color: var(--accent); }

#grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 8px; }
.card { display: block; text-decoration: none; color: inherit; border: 1px solid #262636; border-radius: 10px;
  overflow: hidden; background: #15151f; transition: border-color 0.15s, transform 0.15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card[hidden] { display: none; }
.card .thumb { aspect-ratio: 16 / 9; background: #1d1d2a center / cover no-repeat; }
.card .thumb.none { display: grid; place-items: center; color: #3b3b52; font-size: 13px; }
.card .meta { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; }
.card .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .who { min-width: 0; }
.card .by { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .size { color: var(--muted); font-size: 12px; white-space: nowrap; align-self: center; }
.card .tag { color: var(--accent); font-size: 12px; }
#browse > .contact { margin: 0 0 6px; padding: 0; border: 0; }

/* map overlay, top left; above the menu overlay, so "All maps" and the parts stay clickable with the menu open */
#xhud { position: fixed; z-index: 3; left: 14px; top: 12px; max-width: calc(100vw - 320px); padding: 10px 12px 8px;
  border-radius: 10px; background: rgba(10, 10, 16, 0.72); backdrop-filter: blur(4px); pointer-events: none; }
#xhud a { pointer-events: auto; color: var(--muted); text-decoration: none; font-size: 13px; }
#xhud a:hover { color: var(--text); }
#title { font-size: 18px; font-weight: 700; margin-top: 4px; overflow-wrap: anywhere; }
#by { color: var(--muted); font-size: 13px; pointer-events: auto; cursor: help; width: fit-content; }
#by:empty { display: none; }
#parts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
#parts:empty { display: none; }
#parts .label { margin-right: 2px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
#xhud #parts a { padding: 3px 11px; border: 1px solid #3a3a52; border-radius: 999px; background: #232332; color: var(--text);
  font-size: 12px; font-weight: 600; transition: border-color 0.15s, background-color 0.15s; }
#xhud #parts a:hover { border-color: var(--accent); background: #2c2c40; }
#xhud #parts a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#xhud #parts a[aria-current] { border-color: var(--accent); background: var(--accent); color: #fff; }
.card .parts { display: block; color: var(--accent); font-size: 12px; }
#readout { font: 12px/1.5 ui-monospace, Consolas, monospace; color: var(--muted); white-space: pre; margin-top: 8px;
  background: rgba(255, 255, 255, 0.04); padding: 4px 8px; border-radius: 6px; }

/* controls, top right while exploring (src/explorer.js renderKeys) */
#keys { position: fixed; right: 14px; top: 12px; width: 272px; padding: 10px 12px 8px; border-radius: 10px;
  background: rgba(10, 10, 16, 0.72); backdrop-filter: blur(4px); font-size: 13px; pointer-events: none; }
#keys[hidden], body.browsing #keys { display: none; }
#keys h2 { display: flex; justify-content: space-between; align-items: center; margin: 0 0 6px; font-size: 11px;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
#keys .row { display: grid; grid-template-columns: 92px 1fr; gap: 8px; align-items: center; padding: 2px 0; }
#keys .row.active .what { color: var(--text); }
#keys .what { color: #c9c9d6; white-space: nowrap; }
#keys kbd { display: inline-block; min-width: 20px; margin: 0 3px 2px 0; padding: 0 5px; border: 1px solid #3a3a52;
  border-bottom-width: 2px; border-radius: 4px; background: #1a1a26; color: var(--text); text-align: center;
  font: 11px/1.5 ui-monospace, Consolas, monospace; }
#keys .state { margin-left: 6px; padding: 0 6px; border-radius: 999px; background: #262636; color: var(--muted);
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
#keys .state.on { background: var(--accent); color: #fff; }
@media (max-width: 720px), (max-height: 420px) { #keys { display: none; } }

#toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); padding: 8px 14px; border-radius: 8px;
  background: var(--panel); opacity: 0; transition: opacity 0.3s; pointer-events: none; }
#toast.on { opacity: 1; }

@media (max-width: 520px) { #grid { grid-template-columns: 1fr 1fr; gap: 10px; } .card .size { display: none; } }
