@font-face { font-family: "xkcd Script"; src: url("xkcd-script.ttf") format("truetype"); font-display: swap; }
:root { --paper: #2a2118; --fog: #1c1610; --ink: #e4cd9c; --ink2: #c2aa7b; --ink3: #95805c; --red: #d2553f; --dark: #0e0a06; color-scheme: dark; }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fog); color: var(--ink); overflow: hidden; }
body { font: 18px/1.35 "xkcd Script", "Comic Sans MS", system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
#map { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#map:active { cursor: grabbing; }
a { color: var(--ink); }
button { font: inherit; font-size: 18px; color: var(--ink); background: rgba(42, 33, 24, .94); border: 2px solid var(--ink2); border-radius: 10px;
  padding: 8px 14px; min-height: 44px; cursor: pointer; box-shadow: 2px 3px 0 var(--dark); }
button.on { background: var(--red); color: var(--dark); border-color: var(--ink); }
button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.cartouche { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 12px; max-width: min(360px, calc(100vw - 150px)); padding: 10px 14px;
  background: rgba(42, 33, 24, .94); border: 2px solid var(--ink2); outline: 1px solid var(--ink3); outline-offset: -7px; }
.cartouche h1 { margin: 0 0 4px; font: italic bold 28px Georgia, "Times New Roman", serif; color: var(--ink); }
#account { margin: 4px 0; font-size: 16px; color: var(--ink2); }
#account label, #legend label { display: block; margin: 4px 0; cursor: pointer; }
#account button { font-size: 15px; min-height: 36px; padding: 4px 10px; margin: 4px 4px 0 0; }
#legend { font-size: 16px; }
#legend i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin: 0 6px -2px 4px; border: 1px solid var(--dark); }
#legend span { color: var(--ink3); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--red); vertical-align: -4px; }
.tools { position: fixed; left: 12px; right: 12px; bottom: max(34px, calc(env(safe-area-inset-bottom) + 28px)); display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; pointer-events: none; }
.tools > * { pointer-events: auto; }
.zoom button { width: 48px; font-size: 24px; padding: 0; }
.zoom button + button { margin-left: 6px; }
#orders { position: fixed; right: 12px; top: 220px; width: min(380px, calc(100vw - 24px)); max-height: calc(100vh - 360px); overflow: auto; padding: 12px 16px;
  background: rgba(42, 33, 24, .96); border: 2px solid var(--red); font-size: 22px; line-height: 1.3; }
#orders ol { margin: 8px 0 0; padding-left: 1.4em; }
#orders li { margin: 6px 0; }
#orders span { color: var(--ink3); font-size: 18px; }
#status { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(108px, calc(env(safe-area-inset-bottom) + 100px)); margin: 0; max-width: calc(100vw - 32px);
  font-size: 20px; text-align: center; color: var(--ink); text-shadow: 0 0 4px var(--dark), 0 0 8px var(--dark); pointer-events: none; }
footer { position: fixed; left: 0; right: 0; bottom: 0; padding: 4px 10px max(4px, env(safe-area-inset-bottom)); font: italic 12px Georgia, serif; color: var(--ink3);
  background: rgba(28, 22, 16, .85); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
footer details { display: inline; }
footer summary { display: inline; cursor: pointer; }
footer details[open] { position: fixed; left: 8px; right: 8px; bottom: 28px; white-space: normal; background: rgba(28, 22, 16, .97); border: 1px solid var(--ink3); padding: 8px; }
footer a { color: var(--ink2); }
.only-overlay { display: none; }
body.overlay .only-overlay { display: inline-block; }
@media (max-width: 600px) {
  .cartouche { max-width: calc(100vw - 130px); padding: 8px 10px; }
  .cartouche h1 { font-size: 22px; }
  #orders { top: auto; bottom: 150px; max-height: 28vh; font-size: 20px; }
  .tools button { font-size: 16px; padding: 6px 10px; }
}
