/* Still & Seek — storybook look: cream paper, black ink, brass, one red. */
:root {
  --paper: #fbf3e0;
  --paper2: #f4e8cc;
  --ink: #1e1b16;
  --soft: #5d554a;
  --brass: #a8801f;
  --red: #c23b2b;
  --leather: #7b4b2a;
  --green: #3f6a3a;
  --line: #d9c9a3;
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.screen { padding: 20px 18px 32px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.center { text-align: center; align-items: center; }
h1 { font-size: 30px; line-height: 1.15; margin: 0; letter-spacing: 0.01em; }
h2 { font-size: 22px; line-height: 1.2; margin: 0; }
h3 { font-size: 18px; margin: 0; }
p { margin: 0; }
.soft { color: var(--soft); }
.small { font-size: 15px; }
.verse { font-style: italic; color: var(--leather); font-size: 16px; }
.hero { width: min(78%, 320px); height: auto; display: block; margin: 0 auto; }
.hero.sm { width: min(52%, 210px); }

/* buttons */
.btn {
  appearance: none; font: inherit; font-weight: 700; color: var(--ink);
  background: var(--paper2); border: 2px solid var(--ink); border-radius: 12px;
  padding: 13px 18px; min-height: 52px; width: 100%; cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink); text-align: center; text-decoration: none; display: block;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.red { background: var(--red); color: #fff; }
.btn.plain { background: transparent; box-shadow: none; border-color: var(--line); font-weight: 400; }
.btn[disabled] { opacity: 0.45; box-shadow: none; cursor: default; }
.row { display: flex; gap: 10px; align-items: stretch; }
.row > * { flex: 1; }
.row > .fixed { flex: 0 0 auto; width: auto; }
.linkish { background: none; border: 0; font: inherit; color: var(--leather); text-decoration: underline; padding: 6px; cursor: pointer; }

/* inputs */
label { font-size: 15px; color: var(--soft); display: block; margin-bottom: 4px; }
input[type=text], input[type=number], input[type=password], input[type=email], textarea, select {
  font: inherit; color: var(--ink); background: #fffaf0; border: 2px solid var(--ink); border-radius: 10px;
  padding: 11px 12px; width: 100%; min-height: 50px;
}
textarea { min-height: 84px; resize: vertical; }
input.code { text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; text-align: center; font-size: 22px; }
.msg { font-size: 16px; min-height: 22px; }
.msg.bad { color: var(--red); }
.msg.good { color: var(--green); }

/* cards and chips */
.card { background: #fffaf0; border: 2px solid var(--ink); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.card.tap { cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; box-shadow: 3px 3px 0 var(--ink); }
.card.tap:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.card.off { opacity: 0.5; }
.card.done { border-color: var(--green); background: #f1f5e6; }
.card .top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.tag { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brass); white-space: nowrap; }
.tag.red { color: var(--red); }
.tag.green { color: var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 16px; background: transparent; border: 2px solid var(--line); border-radius: 999px; padding: 8px 14px; min-height: 44px; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.banner { background: var(--ink); color: var(--paper); border-radius: 12px; padding: 10px 14px; font-size: 16px; }
.banner.warn { background: #f3d9a4; color: var(--ink); border: 2px solid var(--brass); }
.cap { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: var(--red); border: 2px solid var(--ink); vertical-align: -3px; }
.cap.empty { background: transparent; border-style: dashed; }

/* raid screen */
.raid { display: flex; flex-direction: column; height: 100dvh; }
.raid-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 2px solid var(--ink); background: var(--paper2); }
.raid-head .caps { display: flex; gap: 5px; align-items: center; }
.raid-head .who { font-weight: 700; font-size: 17px; }
.raid-head .clock { font-variant-numeric: tabular-nums; font-size: 16px; color: var(--soft); }
.raid-body { flex: 1; min-height: 0; position: relative; }
.pane { position: absolute; inset: 0; overflow-y: auto; display: none; }
.pane.on { display: block; }
.pane.pad { padding: 14px; }
.pane.pad > * + * { margin-top: 12px; }
.tabs { display: flex; border-top: 2px solid var(--ink); background: var(--paper2); }
.tabs button { flex: 1; font: inherit; font-weight: 700; background: none; border: 0; padding: 14px 6px calc(14px + env(safe-area-inset-bottom)); min-height: 54px; color: var(--soft); cursor: pointer; }
.tabs button.on { color: var(--ink); box-shadow: inset 0 4px 0 var(--red); }
.raid-note { padding: 10px 14px; background: var(--ink); color: var(--paper); font-size: 16px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.raid-note[hidden] { display: none; }
.raid-note .btn { width: auto; min-height: 42px; padding: 8px 14px; box-shadow: none; border-color: var(--paper); }
.practice { background: #f3d9a4; padding: 6px 14px; font-size: 14px; text-align: center; border-bottom: 2px solid var(--brass); }

/* the map */
.lm { position: absolute; inset: 0; overflow: hidden; background: #3b3527; touch-action: none; user-select: none; -webkit-user-select: none; }
.lm-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.lm-img { display: block; filter: sepia(0.35) saturate(0.9) brightness(1.05); pointer-events: none; }
.lm-svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.lm-border { fill: rgba(251, 243, 224, 0.1); stroke: #f6d77a; stroke-width: calc(var(--sw, 3) * 1px); stroke-linejoin: round; }
.lm-search { fill: rgba(194, 59, 43, 0.2); stroke: var(--red); stroke-width: calc(var(--sw, 3) * 1px); stroke-dasharray: calc(var(--sw, 3) * 3px) calc(var(--sw, 3) * 2px); }
.lm-acc { fill: rgba(60, 130, 220, 0.18); stroke: rgba(60, 130, 220, 0.6); stroke-width: calc(var(--sw, 3) * 0.4px); }
.lm-pins { position: absolute; inset: 0; pointer-events: none; }
.lm-pin { position: absolute; left: 0; top: 0; width: 0; height: 0; border: 0; padding: 0; background: none; pointer-events: auto; cursor: pointer; }
.lm-pin span {
  position: absolute; left: -17px; top: -17px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--red); color: #fff; border: 2px solid var(--ink); font: 700 15px/30px var(--font); text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}
.lm-pin.done span { background: var(--green); }
.lm-pin.guess span { background: #b9a67c; color: var(--ink); border-style: dashed; }
.lm-pin.base span { background: var(--paper); color: var(--ink); }
.lm-pin.stash span { background: var(--ink); }
.lm-pin.sel span { outline: 3px solid #fff; }
.lm-me { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: #2f7fe0; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35); }
.lm-ctl { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.lm-ctl button { width: 46px; height: 46px; border-radius: 10px; border: 2px solid var(--ink); background: var(--paper); font: 700 22px/1 var(--font); color: var(--ink); cursor: pointer; }
.lm-credit { position: absolute; left: 6px; bottom: 4px; font-size: 11px; color: #fff; text-shadow: 0 1px 2px #000; pointer-events: none; }
.map-msg { position: absolute; left: 10px; top: 10px; right: 66px; background: rgba(30, 27, 22, 0.86); color: var(--paper); padding: 8px 10px; border-radius: 10px; font-size: 14px; pointer-events: none; }
.map-msg:empty { display: none; }
.map-switch { position: absolute; left: 10px; bottom: 26px; z-index: 3; }
.map-switch .chip { background: var(--paper); border-color: var(--ink); font-size: 14px; min-height: 40px; }
#gmap { position: absolute; inset: 0; display: none; z-index: 2; }
#gmap.on { display: block; }

/* sheet (pop-up from the bottom) */
.sheet-back { position: fixed; inset: 0; background: rgba(30, 27, 22, 0.55); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--paper); border: 2px solid var(--ink); border-bottom: 0; border-radius: 18px 18px 0 0; width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; padding: 18px 18px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.sheet .x { align-self: flex-end; margin: -6px -6px -10px 0; }
.hint { background: var(--paper2); border-left: 4px solid var(--brass); padding: 10px 12px; border-radius: 0 10px 10px 0; font-size: 17px; }
.tipline { display: flex; gap: 12px; align-items: center; }
.tipline img { width: 76px; height: 76px; object-fit: contain; flex: 0 0 auto; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; font-size: 16px; z-index: 40; max-width: 90vw; text-align: center; }

/* warrant */
.warrant { background: #f6d9cf; border: 2px solid var(--ink); border-radius: 6px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.warrant h2 { text-align: center; letter-spacing: 0.08em; text-transform: uppercase; font-size: 20px; }
.warrant .line { border-bottom: 1px solid var(--ink); padding-bottom: 2px; }
.sigpad { background: #fffaf0; border: 2px dashed var(--ink); border-radius: 8px; width: 100%; height: 130px; touch-action: none; display: block; }
.big { font-size: 34px; font-weight: 700; letter-spacing: 0.12em; text-align: center; }
.badge { width: 100%; max-width: 330px; height: auto; border: 2px solid var(--ink); border-radius: 12px; display: block; margin: 0 auto; }

/* setup page */
.admin .screen { gap: 14px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; }
.listrow { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.pickmap { position: relative; height: 56dvh; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; }
hr { border: 0; border-top: 2px solid var(--line); margin: 4px 0; width: 100%; }
