/* The world map page, in the same browns and golds as the patch notes. */
:root { color-scheme: dark; --ground: #17130e; --panel: #3e3529; --inner: #2e271d; --edge: #5d5140; --dark: #1e1a14; --text: #f0e2c0; --soft: #bfb095; --gold: #ff981f; --yellow: #ffe135; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; background: var(--ground); color: var(--text); font: 13px/1.45 Verdana, "Segoe UI", sans-serif; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 14px; border-bottom: 3px solid var(--edge); }
.top h1 { margin: 0; font-size: 19px; color: var(--gold); text-shadow: 2px 2px 0 #000; }
.links { display: flex; gap: 8px; }
.links a { padding: 6px 12px; background: var(--panel); border: 2px solid var(--dark); color: var(--text); text-decoration: none; }
.links a.play { background: #7a2e22; color: #fff; font-weight: bold; }
.links a:hover { border-color: var(--gold); }
.page { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 8px; padding: 8px; }
.side { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
#find { width: 100%; padding: 8px 10px; font: inherit; color: #fff; background: var(--inner); border: 2px solid var(--edge); }
#find:focus { outline: none; border-color: var(--gold); }
#results { max-height: 45%; overflow-y: auto; }
#results:empty { display: none; }
#info { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 10px; background: var(--panel); border: 2px solid var(--edge); }
#results { padding: 6px 10px; background: var(--panel); border: 2px solid var(--gold); }
.side h2 { margin: 0 0 6px; font-size: 16px; color: var(--gold); }
.side h3 { margin: 8px 0 2px; font-size: 12px; color: var(--gold); }
.side p { margin: 4px 0; color: var(--soft); font-size: 12px; }
.side summary { padding: 5px 0; cursor: pointer; font-weight: bold; color: var(--yellow); border-top: 1px solid #0004; }
.side ul { margin: 0; padding: 0; list-style: none; }
.side li button { display: block; width: 100%; padding: 3px 6px; text-align: left; background: none; border: 1px solid transparent; }
.side li button:hover, .side li button:focus-visible { background: #ffffff14; border-color: var(--gold); }
.side li b { display: block; font-size: 12px; }
.side li small { display: block; font-size: 11px; color: var(--soft); }
.back { margin-bottom: 4px; padding: 3px 9px; font-size: 11px; background: var(--inner); border: 1px solid var(--edge); }
#worldmap { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; }
.bar { display: flex; flex-wrap: wrap; gap: 4px; }
.choice { padding: 3px 8px; font-size: 11px; background: var(--panel); border: 2px solid var(--dark); }
.choice:hover { border-color: var(--gold); }
.choice.on { background: #7a2e22; }
.tools { display: flex; gap: 4px; }
#mapin, #mapout { min-width: 32px; font-weight: bold; }
.mapbody { flex: 1; min-height: 0; display: flex; gap: 8px; }
.mapview { position: relative; flex: 1; min-width: 0; border: 2px solid var(--dark); background: #0b0806; }
#mapcanvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#mapcanvas:active { cursor: grabbing; }
.mapview p { position: absolute; left: 6px; bottom: 4px; margin: 0; font-size: 11px; color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000; pointer-events: none; }
#maptip { position: absolute; z-index: 1; padding: 3px 8px; pointer-events: none; font-size: 11px; white-space: nowrap; background: #ffffa0; color: #000; border: 1px solid #000; }
#legend { width: 176px; margin: 0; padding: 4px; overflow-y: auto; list-style: none; display: flex; flex-direction: column; gap: 2px; background: var(--inner); border: 2px solid var(--dark); }
#legend button { display: flex; align-items: center; gap: 6px; width: 100%; padding: 2px 4px; font-size: 11px; text-align: left; background: none; border: 1px solid transparent; }
#legend button:hover { background: #ffffff14; }
#legend button.on { background: #6a5a38; border-color: var(--yellow); }
#legend canvas { width: 22px; height: 22px; flex: none; }
@media (max-width: 760px) {
  html, body { height: auto; }
  .page { display: flex; flex-direction: column-reverse; }
  #worldmap { height: 82vh; }
  .mapbody { flex-direction: column; }
  #legend { width: auto; max-height: 22%; flex-direction: row; flex-wrap: wrap; }
  #legend li { width: 48%; }
  #info { max-height: 70vh; }
  #results { max-height: 40vh; }
}
