:root {
    color-scheme: light;
    background: #e7decd;
    color: #271f17;
    font: 15px/1.45 system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
.atlas-header {
    color: #f7e6c6;
    background: #28261e;
    border-bottom: 3px solid #a87b41;
    padding: 12px clamp(14px, 3vw, 36px);
}
.atlas-header, .atlas-brand, .atlas-nav {
    display: flex;
    align-items: center;
    gap: 12px 18px;
    flex-wrap: wrap;
}
.atlas-header { justify-content: space-between; }
.atlas-wordmark {
    color: #f0c67f;
    font: bold 23px/1 Georgia, serif;
    text-decoration: none;
}
.atlas-brand h1 { margin: 0; font: 22px/1.2 Georgia, serif; }
.atlas-nav a { color: #f7e6c6; font-weight: 600; }
.atlas-language { font-size: 13px; text-decoration: none; }
.atlas-main { padding: clamp(8px, 2vw, 22px) clamp(8px, 3vw, 36px) 12px; }
.atlas-selection {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 3px 12px;
    margin-bottom: 8px;
    padding: 8px 13px;
    background: #f7eddd;
    border: 1px solid #bba78c;
}
.atlas-selection small { flex-basis: 100%; }
.atlas-selection a { color: #543c24; font-weight: 650; }
.atlas-toolbar {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 9px 14px;
    padding: 11px 13px;
    background: #fbf3e5;
    border: 1px solid #bba78c;
    border-radius: 6px 6px 0 0;
}
.atlas-toolbar label > span {
    display: block;
    font-size: 13px;
    font-weight: 650;
    margin-bottom: 4px;
}
.atlas-toolbar select, .atlas-toolbar input[type="search"], button {
    min-height: 36px;
    border: 1px solid #a3947d;
    border-radius: 4px;
    padding: 5px 8px;
    color: #302619;
    background: #fffaf0;
    font: inherit;
}
button { cursor: pointer; font-weight: 650; }
button:disabled, input:disabled, select:disabled { opacity: .58; cursor: default; }
.atlas-primary { background: #543c24; border-color: #543c24; color: #fff4e0; }
.atlas-town select { max-width: 190px; }
.atlas-search {
    display: flex;
    align-items: end;
    gap: 7px;
    flex: 1 1 280px;
}
.atlas-search label { flex: 1 1 80px; min-width: 0; }
.atlas-search input { width: 100%; }
.atlas-search button { white-space: nowrap; }
.atlas-toolbar .atlas-spawns { display: flex; align-items: center; gap: 5px; min-height: 36px; }
.atlas-toolbar .atlas-spawns span { margin: 0; }
.atlas-spawns input { accent-color: #543c24; }
.atlas-frame {
    position: relative;
    height: calc(100dvh - 240px);
    min-height: 400px;
    background: #181f23;
    border: 1px solid #514738;
    border-top: 0;
}
#world-map {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
}
#world-map.dragging { cursor: grabbing; }
:is(a, button, input, select):focus-visible {
    outline: 2px solid #9a5e19;
    outline-offset: 3px;
}
#world-map:focus-visible { outline: 3px solid #edba6d; outline-offset: -3px; }
.atlas-tools {
    position: absolute;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    top: 10px;
    left: 10px;
}
.atlas-tools button { min-width: 36px; }
.atlas-legend, .atlas-marker {
    position: absolute;
    background: #24231f;
    color: #fbecd2;
    padding: 6px 9px;
    border: 1px solid #8c7654;
    border-radius: 4px;
    font-size: 13px;
    pointer-events: none;
}
.atlas-legend { bottom: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.atlas-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
#spawn-legend { vertical-align: middle; margin-right: 4px; image-rendering: pixelated; }
.pin-symbol { background: #ffd070; border: 1px solid #fff1c8; }
.atlas-marker { top: 54px; left: 10px; max-width: calc(100% - 20px); }
.atlas-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 10px; font-size: 13px; }
.atlas-footer p, .atlas-footer output, #map-status { margin: 6px 0 0; }
#map-position { font-family: ui-monospace, monospace; font-weight: 600; }
.atlas-error { color: #8d271d; font-weight: 650; }
@media (max-width: 620px) {
    .atlas-frame { height: 63dvh; min-height: 350px; }
    .atlas-header { gap: 7px 12px; }
    .atlas-toolbar { gap: 7px 12px; }
    .atlas-search { order: 2; flex-basis: 100%; }
}
