/* The players' map. Embedded in a WordPress page by the adoh-map shortcode, so
   it must not fight the surrounding theme: everything is scoped under #app, it
   claims a height rather than the viewport, and it sets no page-level styles. */

#app{
  --ink:#e8eef4;
  --muted:#9aa6b2;
  --panel:rgba(14,19,25,.93);
  --rule:#2d3841;
  --gold:#ffd666;

  position:relative;
  width:100%;
  height:min(78vh,760px);
  min-height:380px;
  background:#0b0e12;
  border:1px solid var(--rule);
  border-radius:6px;
  overflow:hidden;
  color:var(--ink);
  font:14px/1.55 system-ui,-apple-system,"Segoe UI",sans-serif;
  touch-action:none;
}

#app *{box-sizing:border-box}
#canvas{display:block;width:100%;height:100%;cursor:grab}
#canvas.drag{cursor:grabbing}

/* ------------------------------------------------------------------ chrome */
#controls{position:absolute;top:12px;right:12px;display:flex;flex-direction:column;gap:6px}
#controls button{
  width:36px;height:36px;border-radius:5px;border:1px solid var(--rule);
  background:var(--panel);color:var(--ink);font:600 15px/1 system-ui,sans-serif;
  cursor:pointer;
}
#controls button:hover{background:#1d252d;border-color:#3d4a55}
#controls button:focus-visible{outline:2px solid var(--gold);outline-offset:1px}
#controls #fit{font-size:12px;letter-spacing:.03em}

/* BELOW the view bar. At top:12px it sat exactly under #views, which has an
   opaque background and a higher z-index, so the search box was invisible from
   the moment the view bar was added. */
#search{position:absolute;top:58px;left:12px;width:min(268px,calc(100% - 84px));z-index:2}
#q{
  width:100%;padding:8px 11px;border-radius:5px;border:1px solid var(--rule);
  background:var(--panel);color:var(--ink);font:inherit;
}
#q:focus-visible{outline:2px solid var(--gold);outline-offset:1px}
#results{
  margin-top:4px;max-height:min(46vh,300px);overflow-y:auto;
  background:var(--panel);border:1px solid var(--rule);border-radius:5px;
}
#results[hidden]{display:none}
#results div{padding:7px 11px;cursor:pointer;border-bottom:1px solid #1e262e}
#results div:last-child{border-bottom:0}
#results div:hover,#results div.on{background:#232c35;color:var(--gold)}

/* -------------------------------------------------------------- the detail */
#info{
  position:absolute;left:12px;bottom:12px;width:min(320px,calc(100% - 24px));
  max-height:min(58%,420px);overflow-y:auto;
  background:var(--panel);border:1px solid var(--rule);border-radius:6px;
  padding:14px 16px 16px;
}
#info[hidden]{display:none}
#info h2{margin:0 6px 4px 0;font-size:16px;font-weight:600;line-height:1.3}
#info p{margin:0 0 10px;color:var(--muted);font-size:12.5px}
#close{
  position:absolute;top:8px;right:8px;width:26px;height:26px;
  border:0;border-radius:4px;background:none;color:var(--muted);
  font-size:19px;line-height:1;cursor:pointer;
}
#close:hover{background:#232c35;color:var(--ink)}

.giver{padding:5px 0;border-top:1px solid #1e262e;font-size:13px}
.giver:first-of-type{border-top:0}
.giver .qs{color:var(--muted);font-size:11.5px;margin-left:6px}
.ghead{
  color:var(--muted);font-size:11px;letter-spacing:.06em;
  text-transform:uppercase;margin:2px 0 3px;
}

#hint{
  position:absolute;left:12px;bottom:12px;margin:0;
  color:var(--muted);font-size:11.5px;pointer-events:none;
}
#info:not([hidden]) ~ #hint{display:none}

@media (max-width:560px){
  #app{height:min(70vh,560px)}
  #hint{display:none}
  #info{left:8px;right:8px;width:auto}
}

/* ---- the view bar and the filters -------------------------------------- */
/* Both float over the canvas like #controls and #search already do, so the map
   keeps the whole box and nothing steals height from it. */
#views, #filters{
  position:absolute; z-index:2; display:flex; gap:6px; align-items:center;
  background:rgba(10,14,18,.82); padding:6px 8px; border-radius:8px;
  backdrop-filter:blur(3px);
}
#views{ top:10px; left:10px; }
#filters{ top:10px; left:50%; transform:translateX(-50%); font-size:12px; }

#views button{
  background:#1a222c; color:#dce3ea; border:1px solid #2c3742;
  border-radius:6px; padding:5px 11px; font:inherit; font-size:13px; cursor:pointer;
}
#views button:hover:not(:disabled){ background:#243040; }
#views button.on{ border-color:#ffd666; color:#ffd666; }
#views button:disabled{ opacity:.38; cursor:default; }

#filters label{ display:flex; align-items:center; gap:4px; color:#c6d0da; cursor:pointer; }
#filters input{ accent-color:#ffd666; }
#filters select{
  background:#1a222c; color:#dce3ea; border:1px solid #2c3742;
  border-radius:6px; padding:3px 6px; font:inherit; font-size:12px;
}
#filters :disabled{ opacity:.38; cursor:default; }

/* ---- the panel's new sections ------------------------------------------ */
#igivers .lnk{
  padding:3px 6px; border-radius:5px; cursor:pointer; color:#cfe0f2;
  display:flex; justify-content:space-between; gap:8px;
}
#igivers .lnk:hover{ background:#1d2833; color:#fff; }
#igivers .acts{ display:flex; gap:6px; margin-top:10px; flex-wrap:wrap; }
#igivers .acts button{
  flex:1 1 auto; background:#1a222c; color:#dce3ea; border:1px solid #2c3742;
  border-radius:6px; padding:6px 10px; font:inherit; font-size:12px; cursor:pointer;
}
#igivers .acts button:hover{ background:#243040; border-color:#ffd666; color:#ffd666; }

#results .qs{ opacity:.55; margin-left:8px; font-size:11px; }

/* At phone width the two floating bars would collide, so they stack and the
   filters give up their centring. */
@media (max-width:760px){
  #filters{ top:52px; left:10px; transform:none; flex-wrap:wrap; max-width:calc(100% - 20px); }
  #search{ top:100px; }
}

/* ---- the guide ---------------------------------------------------------- */
#helpbox{
  position:absolute; z-index:4; top:58px; left:50%; transform:translateX(-50%);
  width:min(560px,calc(100% - 40px)); max-height:min(72vh,640px); overflow-y:auto;
  background:rgba(12,16,21,.97); border:1px solid var(--rule); border-radius:8px;
  padding:16px 20px 20px; color:var(--ink); line-height:1.5;
}
#helpbox h2{ margin:0 0 4px; font-size:17px; color:var(--gold); }
#helpbox h3{ margin:16px 0 3px; font-size:13px; color:#dce3ea; }
#helpbox p{ margin:0; font-size:13px; color:#aeb9c4; }
#helpbox #helpclose{
  float:right; background:none; border:0; color:var(--ink);
  font-size:22px; line-height:1; cursor:pointer; padding:0 2px;
}
#controls #help{ font-size:17px; }

@media (max-width:760px){
  #search{ top:150px; }
  #helpbox{ top:150px; }
}