:root { color-scheme: dark; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #e8eee8; background: #121d20; font-size: 16px; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button, select, input { min-height: 46px; border-radius: 6px; }
button { border: 1px solid #61706b; background: #223330; color: #edf2e8; }
button:hover { background: #314840; }
button:disabled, select:disabled { opacity: .5; cursor: wait; }
:focus-visible { outline: 3px solid #d5b474; outline-offset: 3px; }
.topbar { height: 76px; display: flex; justify-content: space-between; align-items: center; padding: 0 30px; border-bottom: 1px solid #35443e; }
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; color: #e8eee8; letter-spacing: .16em; font-weight: 650; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 42px; border: 1px solid #a68d5e; color: #d7bd85; font-family: Georgia, serif; font-size: 1.6rem; }
.brand small { display: block; font-size: .75rem; font-weight: 400; letter-spacing: .05em; margin-top: 2px; color: #b6c4bd; }
.edition { color: #b6c4bd; font-size: .875rem; }
main { display: grid; grid-template-columns: 310px minmax(0, 1fr); min-height: calc(100dvh - 76px); }
.panel { padding: 32px 26px; border-right: 1px solid #35443e; background: #192624; }
.eyebrow { color: #d5b474; text-transform: uppercase; font-size: .75rem; letter-spacing: .12em; margin: 0 0 12px; font-weight: 600; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: 2.2rem; font-weight: 400; line-height: 1.1; margin: 0 0 16px; }
.intro { color: #b6c4bd; font-size: .875rem; line-height: 1.65; margin: 0 0 30px; }
label { display: block; margin: 18px 0 8px; font-size: .875rem; font-weight: 600; }
select, input { width: 100%; color: #e8eee8; border: 1px solid #53675c; background: #12201d; padding: 10px 12px; }
select { appearance: none; padding-right: 35px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23c9d4cc' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.field-note { font-size: .75rem; color: #b6c4bd; line-height: 1.5; margin: 7px 0 0; }
.seed-row { display: flex; gap: 8px; }
.seed-row input { min-width: 0; font-variant-numeric: tabular-nums; }
.dice { width: 48px; flex-shrink: 0; font-size: 1.7rem; line-height: 1; }
.primary { width: 100%; margin-top: 24px; background: #d5b474; border-color: #d5b474; color: #18251f; font-weight: 700; }
.primary:hover { background: #e7c78a; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 32px; border-top: 1px solid #35443e; padding-top: 24px; font-size: .75rem; color: #b6c4bd; }
.legend span { display: flex; align-items: center; gap: 8px; }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }
.building { background: #b69a73; }.prop { background: #6b9b8b; }.magic { background: #ad88c6; }.crypt { background: #8e97a4; }
.explanation { color: #9aafa3; font-size: .75rem; line-height: 1.65; margin: 20px 0 0; }
.viewport { position: relative; min-height: 650px; overflow: hidden; background: #27382f; }
#scene { position: absolute; inset: 0; touch-action: none; }
#scene canvas { display: block; width: 100%; height: 100%; }
.map-heading { position: absolute; top: 28px; left: 30px; pointer-events: none; padding: 12px 18px; border-left: 2px solid #d5b474; background: #15231ed9; }
.map-heading .eyebrow { margin-bottom: 5px; }
h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 1.6rem; margin: 0; }
.view-button { position: absolute; top: 28px; right: 24px; padding: 8px 14px; background: #15231ee8; font-size: .875rem; }
.map-bottom { position: absolute; bottom: 20px; left: 24px; right: 70px; pointer-events: none; }
#status { display: inline-block; padding: 10px 14px; border: 1px solid #53675c; border-radius: 6px; background: #15231ee8; font-size: .875rem; line-height: 1.5; margin: 0; }
.camera-help { font-size: .75rem; line-height: 1.5; color: #d5dfd4; text-shadow: 0 1px 3px #000; }
.compass { position: absolute; bottom: 24px; right: 26px; display: grid; justify-items: center; font-size: .75rem; color: #e7d6b1; pointer-events: none; }
.compass span { font-size: 1.8rem; line-height: 1.3; }
.error { color: #ffceaa; }
noscript { display: block; padding: 20px; }
@media (min-width: 1450px) { main { grid-template-columns: 340px minmax(0, 1fr); }.panel { padding: 40px 32px; } }
@media (max-width: 760px) {
  .topbar { height: 66px; padding: 0 18px; }.edition { display: none; }
  main { display: flex; flex-direction: column; min-height: calc(100dvh - 66px); }
  .panel { padding: 24px 20px; border-right: 0; border-bottom: 1px solid #35443e; }
  h1 { font-size: 1.9rem; margin-bottom: 8px; }.intro { margin-bottom: 8px; }
  #map-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
  #map-form label { margin: 8px 0 0; } label[for="kind"] { grid-column: 1; grid-row: 1; } #kind { grid-column: 1; grid-row: 2; }
  label[for="people"] { grid-column: 2; grid-row: 1; } #people { grid-column: 2; grid-row: 2; }
  #people-note { display: none; } label[for="seed"] { grid-column: 1; grid-row: 3; }
  .seed-row { grid-column: 1; grid-row: 4; } #seed-note { grid-column: 1 / -1; grid-row: 5; margin: 0; }
  .primary { grid-column: 2; grid-row: 4; margin: 0; }
  .legend { display: flex; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; gap: 16px; }.explanation { margin-top: 12px; }
  .viewport { min-height: 62dvh; height: 620px; max-height: 850px; }
  .map-heading { top: 16px; left: 16px; padding: 8px 12px; max-width: calc(100% - 32px); }
  h2 { font-size: 1.3rem; }.map-heading .eyebrow { font-size: .65rem; }
  .view-button { top: 100px; right: 16px; }.map-bottom { left: 16px; bottom: 10px; }
  .camera-help { font-size: .7rem; } .compass { right: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
[hidden] { display: none !important; }
fieldset { margin: 14px 0; padding: 10px; min-width: 0; border: 1px solid #53675c; border-radius: 6px; }
legend, summary { color: #d5b474; font-size: .85rem; }
details { margin-top: 16px; }
summary { min-height: 44px; cursor: pointer; padding: 12px 0; }
textarea { width: 100%; color: #e8eee8; background: #12201d; border: 1px solid #53675c; border-radius: 6px; padding: 10px; font: inherit; resize: vertical; }
input[type="range"] { padding: 0; accent-color: #d5b474; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-weight: 400; }
.check input { width: 20px; min-height: 24px; accent-color: #d5b474; }
#advanced-options button, #district-editor button, #export-layout { margin: 6px 4px 0 0; padding: 8px; font-size: .8rem; }
.description { color: #d0dccf; font-size: .85rem; line-height: 1.6; }
#register { display: grid; gap: 5px; max-height: 240px; overflow-y: auto; }
#register button { text-align: left; padding: 8px; font-size: .8rem; }
#place-details { font-size: .8rem; line-height: 1.6; }
.inspection { position: absolute; bottom: 135px; left: 24px; right: 24px; max-height: 180px; overflow-y: auto; background: #15231eeb; padding: 12px; border: 1px solid #53675c; border-radius: 6px; font-size: .8rem; line-height: 1.5; }
.water { background: #407f9e; }.path { background: #a69a7c; }.inhabitant { background: #d88766; }.trap { background: #c45f73; }.wall { background: #7b8072; }.temple { background: #cebc8d; }
@media (min-width: 761px) {
  main { height: calc(100dvh - 76px); min-height: 600px; }
  .panel { overflow-y: auto; }
  .viewport { min-height: 0; }
}
@media (max-width: 760px) {
  #advanced-options { grid-column: 1 / -1; grid-row: 6; }
  #advanced-options[open] { max-height: 65dvh; overflow-y: auto; }
  #district-rows { max-height: 60dvh; overflow-y: auto; }
  .inspection { left: 16px; right: 16px; bottom: 135px; max-height: 25dvh; }
  #map-form { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .panel { min-width: 0; }
  h2 { overflow-wrap: anywhere; }
  #map-form > .primary { align-self: stretch; }
}
