:root {
  --paper: #e9dcc0;
  --paper-dark: #d6c39e;
  --ink: #2a2118;
  --ink-soft: #5a4a38;
  --blood: #8b1e1a;
  --night: #120f0c;
  --ok: #3f5b2e;
  --type: 'Special Elite', 'Courier New', monospace;
  --serif: 'IM Fell English', Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--night) radial-gradient(ellipse at top, #2b221a 0%, var(--night) 70%) fixed;
  color: var(--ink);
  font-family: var(--serif);
}

#app {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* ---------- Paper page ---------- */
.page {
  position: relative;
  background: var(--paper);
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,.25), transparent 60%),
    radial-gradient(ellipse at 90% 90%, rgba(120,80,30,.18), transparent 55%);
  border-radius: 3px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6), inset 0 0 80px rgba(90,60,20,.25);
  padding: 32px clamp(18px, 4vw, 44px);
  animation: fadeIn .35s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1, h2, h3 { font-family: var(--type); font-weight: normal; letter-spacing: .02em; margin: 0 0 .4em; }
h1 { font-size: clamp(30px, 6vw, 52px); line-height: 1.05; }
h2 { font-size: clamp(22px, 4vw, 30px); }
h3 { font-size: 18px; }
p { font-size: 19px; line-height: 1.5; margin: 0 0 1em; }

.label {
  font-family: var(--type);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.divider { text-align: center; color: var(--ink-soft); letter-spacing: .6em; margin: 18px 0; }

.stamp {
  display: inline-block;
  font-family: var(--type);
  color: var(--blood);
  border: 3px solid var(--blood);
  padding: 4px 12px;
  transform: rotate(-4deg);
  opacity: .85;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.stamp.ok { color: var(--ok); border-color: var(--ok); }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--type);
  font-size: 17px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 2px;
  padding: 12px 22px;
  cursor: pointer;
  transition: transform .1s, background .2s;
}
.btn:hover { background: var(--blood); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- Title ---------- */
.cover {
  margin: -32px calc(-1 * clamp(18px, 4vw, 44px)) 20px;
  aspect-ratio: 16 / 7;
  background: #000 url('../art/cover.jpg') center 70% / cover;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(18px, 4vw, 40px);
  border-radius: 3px 3px 0 0;
  box-shadow: inset 0 -60px 60px -30px rgba(233,220,192,.9);
}
.cover h1 { color: #f2e7cf; text-shadow: 0 2px 12px #000; }
.cover .label { color: #d6c39e; }
.title-art {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin: 20px 0;
}
.title-art img { width: 100%; aspect-ratio: 1; object-fit: cover; filter: sepia(.2) contrast(1.05); border: 1px solid var(--ink-soft); }

.stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 18px 0 24px; }
.stage-card { border: 2px solid var(--ink); padding: 14px; position: relative; }
.stage-card.locked { opacity: .45; border-style: dashed; }
.stage-card .num { font-family: var(--type); font-size: 34px; color: var(--blood); float: right; line-height: 1; }

/* ---------- Monster cards ---------- */
.monster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 16px; }
.mcard {
  background: var(--paper-dark);
  border: 1px solid var(--ink-soft);
  padding: 8px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform .15s, box-shadow .15s;
  position: relative;
}
.mcard:hover:not([disabled]) { transform: rotate(-1deg) translateY(-3px); box-shadow: 0 6px 14px rgba(0,0,0,.3); }
.mcard img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.mcard .name { font-family: var(--type); font-size: 15px; margin-top: 6px; }
.mcard[disabled] { cursor: not-allowed; filter: grayscale(1) brightness(.6); }
.mcard .done { position: absolute; top: 14px; right: 6px; font-size: 13px; background: var(--paper); }

.danger { display: flex; gap: 2px; margin-top: 4px; }
.danger i { width: 9px; height: 9px; border: 1px solid var(--ink-soft); display: block; }
.danger i.on { background: var(--blood); border-color: var(--blood); }

/* ---------- Encounter ---------- */
.scene {
  position: relative;
  min-height: 240px;
  border: 1px solid var(--ink-soft);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  margin-bottom: 18px;
}
.scene::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(18,15,12,.75)); }
.scene .scene-text { position: relative; z-index: 1; color: #f2e7cf; padding: 18px 20px; font-size: 20px; line-height: 1.45; }
.scene .portrait {
  position: absolute; z-index: 1; right: 14px; top: 14px; width: 110px;
  border: 3px solid var(--paper); box-shadow: 0 4px 12px rgba(0,0,0,.5); transform: rotate(3deg);
}

.meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.nerve { font-family: var(--type); }
.nerve span { color: var(--blood); font-size: 20px; }

.choices { display: grid; gap: 10px; }
.choice {
  text-align: left;
  font-family: var(--serif);
  font-size: 18px;
  background: rgba(255,255,255,.25);
  border: 1px solid var(--ink-soft);
  padding: 12px 16px;
  cursor: pointer;
  color: var(--ink);
  transition: background .15s, transform .1s;
}
.choice:hover { background: rgba(255,255,255,.55); transform: translateX(3px); }
.choice::before { content: '◆ '; color: var(--blood); }

.result { border-left: 4px solid var(--blood); padding: 10px 16px; background: rgba(139,30,26,.08); margin: 14px 0; }
.result.good { border-color: var(--ok); background: rgba(63,91,46,.1); }
.rule-ref { font-family: var(--type); font-size: 14px; color: var(--ink-soft); }

.rules-list { counter-reset: r; list-style: none; padding: 0; margin: 0; }
.rules-list li { counter-increment: r; padding: 6px 0 6px 38px; position: relative; font-size: 18px; }
.rules-list li::before { content: counter(r); position: absolute; left: 0; font-family: var(--type); font-size: 22px; color: var(--blood); }

/* ---------- Night Shift ---------- */
.ns-wrap { position: relative; }
canvas#ns {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  background: #000;
  border: 2px solid var(--ink);
  image-rendering: auto;
  touch-action: none;
}
.hud { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-family: var(--type); margin: 10px 0; }
.bar { height: 12px; width: 160px; border: 1px solid var(--ink); background: rgba(0,0,0,.08); display: inline-block; vertical-align: middle; }
.bar > b { display: block; height: 100%; background: var(--blood); transition: width .1s; }
.touchpad { display: none; gap: 8px; justify-content: center; margin-top: 10px; user-select: none; }
.touchpad button { font-size: 22px; width: 60px; height: 60px; }
@media (pointer: coarse) { .touchpad { display: flex; flex-wrap: wrap; } }

/* ---------- Quiz ---------- */
.quiz-q { font-size: 22px; margin-bottom: 14px; }
.quiz-img { width: 140px; float: right; margin: 0 0 10px 16px; border: 3px solid var(--paper-dark); transform: rotate(2deg); }
.choice.right { background: rgba(63,91,46,.25); border-color: var(--ok); }
.choice.wrong { background: rgba(139,30,26,.2); border-color: var(--blood); }
.progress { height: 6px; background: rgba(0,0,0,.1); margin-bottom: 16px; }
.progress b { display: block; height: 100%; background: var(--ink); }

.small { font-size: 15px; color: var(--ink-soft); }
.center { text-align: center; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
a.link, button.link { color: var(--blood); cursor: pointer; font-family: var(--type); font-size: 14px; text-decoration: underline; background: none; border: none; }

@media (max-width: 560px) {
  .title-art { grid-template-columns: repeat(3, 1fr); }
  .scene .portrait { width: 72px; }
  p { font-size: 17px; }
}

/* ---------- Miki & Key ---------- */
.duo { display: flex; justify-content: center; gap: 4%; margin: 10px 0 18px; }
.duo img { width: 34%; max-width: 260px; aspect-ratio: 820 / 925; object-fit: cover; border: 1px solid var(--ink-soft); }
.duo.small-duo img { width: 22%; }

.pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 16px; }
.pick-card {
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  background: var(--paper-dark); border: 2px solid var(--ink); padding: 12px;
  transition: transform .15s, box-shadow .15s;
}
.pick-card:hover { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 8px 18px rgba(0,0,0,.35); }
.pick-card img { width: 100%; aspect-ratio: 820 / 925; object-fit: cover; display: block; margin-bottom: 10px; }

.scene.short { min-height: 150px; }
.scene.tall { min-height: 300px; }
.scene { background-size: cover; }

.dialogue { display: grid; gap: 10px; margin: 6px 0 12px; }
.narr { font-style: italic; color: var(--ink-soft); margin: 0; }
.line { display: flex; gap: 10px; align-items: flex-start; }
.line.me { flex-direction: row-reverse; }
.line .avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ink); flex: none; }
.line .avatar.ghost { display: grid; place-items: center; background: var(--ink); color: var(--paper); font-family: var(--type); }
.bubble {
  background: rgba(255,255,255,.45); border: 1px solid var(--ink-soft); padding: 8px 12px;
  border-radius: 10px; font-size: 18px; line-height: 1.4; max-width: 80%;
}
.line.me .bubble { background: rgba(139,30,26,.1); }
.line.other .bubble { background: rgba(20,20,30,.08); font-style: italic; }
.who { display: block; font-family: var(--type); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.who em { text-transform: none; letter-spacing: 0; }
.prompt { font-size: 18px; margin: 4px 0 0; }

.bond { font-family: var(--type); color: var(--blood); }
.bond-change { font-family: var(--type); font-size: 14px; margin-top: 6px; }
.bond-change.up { color: var(--blood); }
.bond-change.down { color: var(--ink-soft); }

/* ---------- Trophies ---------- */
.seal {
  width: 52px; height: 52px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--type); font-size: 24px; line-height: 1;
  color: var(--paper-dark); background: rgba(90,74,56,.25);
  border: 2px dashed var(--ink-soft);
}
.trophy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 16px; }
.trophy { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid rgba(90,74,56,.35); opacity: .6; }
.trophy.on { opacity: 1; background: rgba(255,255,255,.3); border-color: var(--ink-soft); }
.trophy.on .seal, .trophy-toast .seal {
  color: #f2e7cf; border: none;
  background: radial-gradient(circle at 35% 30%, #b8342c, var(--blood) 60%, #5e1310);
  box-shadow: 0 2px 6px rgba(0,0,0,.4), inset 0 0 0 4px rgba(0,0,0,.18);
  transform: rotate(-6deg);
}
.trophy .when { color: var(--blood); margin-top: 2px; }

.trophy-toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 10px; z-index: 50; }
.trophy-toast {
  display: flex; gap: 12px; align-items: center; min-width: 240px; max-width: calc(100vw - 32px);
  background: var(--paper); color: var(--ink); padding: 10px 16px 10px 10px; border-radius: 3px;
  box-shadow: 0 8px 30px rgba(0,0,0,.55); animation: trophyIn .45s cubic-bezier(.2,1.4,.4,1);
  transition: opacity .5s, transform .5s;
}
.trophy-toast.out { opacity: 0; transform: translateY(10px); }
@keyframes trophyIn { from { opacity: 0; transform: translateY(20px) scale(.9); } to { opacity: 1; transform: none; } }

/* ---------- World map ---------- */
.world-page { padding-top: 22px; }
.world-wrap { position: relative; border: 2px solid var(--ink); box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--ink-soft); background: #2b221a; }
.world-wrap canvas { display: block; width: 100%; cursor: crosshair; touch-action: none; }
.world-zoom { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; }
.world-zoom .btn { width: 36px; height: 36px; padding: 0; font-size: 20px; background: rgba(233,220,192,.85); }
.world-toast { position: absolute; left: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, 80%); pointer-events: none; }
.world-note { background: var(--paper); border: 2px solid var(--ink); padding: 8px 12px; font-size: 16px; line-height: 1.35; box-shadow: 0 4px 14px rgba(0,0,0,.4); animation: fadeIn .3s ease; transition: opacity .6s; }
.world-note.out { opacity: 0; }
.world-panel { min-height: 92px; margin-top: 16px; padding: 12px 16px; border-left: 4px solid var(--blood); background: rgba(139,30,26,.06); }
.world-panel .site-name { font-family: var(--type); font-size: 20px; }
.world-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.key-hint { font-size: 11px; border: 1px solid currentColor; border-radius: 3px; padding: 0 4px; margin-left: 6px; opacity: .7; vertical-align: middle; }
@media (pointer: coarse) { .key-hint { display: none; } }
.world-name { display: inline-flex; align-items: center; gap: 8px; }
.world-name input { font-family: var(--type); font-size: 15px; width: 12em; padding: 4px 8px; border: 1px solid var(--ink-soft); background: rgba(255,255,255,.4); color: var(--ink); }
.world-name input:focus { outline: 2px solid var(--blood); }

/* ---------- Levels, health and camps ---------- */
.world-hud { position: absolute; top: 10px; left: 10px; background: rgba(233,220,192,.88); border: 1px solid var(--ink-soft); padding: 6px 10px; font-family: var(--type); font-size: 13px; line-height: 1.6; pointer-events: none; }
.world-hud small { color: var(--ink-soft); }
.hpbar { display: inline-block; width: 90px; height: 8px; border: 1px solid var(--ink); background: rgba(0,0,0,.08); vertical-align: middle; }
.hpbar > b { display: block; height: 100%; background: var(--ok); transition: width .2s; }
.hpbar.low > b { background: var(--blood); }
.hpbar.xp > b { background: #b08a2e; }
.camp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.camp-head .link { margin-left: auto; font-size: 18px; }
.camp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 10px; }
.camp-grid .btn, .upg .btn { font-size: 14px; padding: 6px 12px; margin: 6px 0; }
.resrow { display: flex; gap: 14px; font-family: var(--type); margin: 4px 0; }
.res small { color: var(--ink-soft); }
.upgs { display: grid; gap: 8px; margin-top: 6px; }
.upg { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px dashed var(--ink-soft); padding-top: 6px; }
.upg .btn small { display: block; font-size: 11px; opacity: .8; }
.pips { color: var(--blood); letter-spacing: 2px; }
.camp-log { list-style: none; padding: 0; margin: 4px 0 0; font-size: 15px; }
.camp-log li { padding: 3px 0; border-bottom: 1px dotted rgba(90,74,56,.3); }
.warn { color: var(--blood); }
.trophy-toast.xp-toast { padding: 6px 12px; }
.trophy-toast.level-up { border-color: #b08a2e; }

/* The field atlas keeps the journal's ink and paper, with room to read the landscape. */
#app:has(.world-page) { max-width: 1220px; }
.world-page { padding: 22px clamp(14px, 3vw, 32px) 28px; }
.world-page button.link { border: 0; background: none; color: var(--ink-soft); font: 14px var(--type); cursor: pointer; min-height: 44px; padding: 0 8px 0 0; }
.world-page .topbar { border-bottom: 1px solid rgba(90,74,56,.25); margin-bottom: 18px; }
.world-page .topbar > .label { font-size: 11px; letter-spacing: .12em; text-align: right; }
.world-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0 0 18px; }
.world-heading h1 { font-size: clamp(30px, 4.5vw, 44px); margin-bottom: 7px; }
.world-heading .label { font-size: 11px; letter-spacing: .1em; line-height: 1.5; }
.world-heading > .btn { font-size: 13px; padding: 12px 15px; flex: none; border-color: #756449; }
.world-status { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 18px; padding: 10px 0 13px; border-top: 1px solid rgba(90,74,56,.25); }
.world-hud { position: static; display: flex; flex-wrap: wrap; gap: 6px 22px; border: 0; padding: 0; background: none; font-size: 12px; }
.world-hud > div { white-space: nowrap; }
.world-status > .small { font-size: 13px; font-style: italic; }
.world-wrap { border-color: #5b5d43; background: #b6b79a; box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px #8e8c70, 0 7px 18px rgba(50,46,29,.13); overflow: hidden; }
.world-wrap canvas:focus-visible { outline: 3px solid #f5e7b6; outline-offset: -4px; }
.world-zoom { top: 12px; right: 12px; flex-direction: row; gap: 5px; }
.world-zoom .btn { width: 44px; height: 44px; background: #eee4ca; border: 1px solid #69644d; color: #343c2c; box-shadow: 0 2px 5px rgba(30,42,30,.14); font-size: 22px; }
.world-zoom [data-atlas] { width: 64px; font-size: 13px; }
.world-zoom .btn:hover:not(:disabled) { background: #354b40; color: #f8efd9; }
.world-zoom .btn:disabled { opacity: .5; }
.world-compass { position: absolute; top: 16px; left: 17px; display: grid; justify-items: center; gap: 4px; color: #424b36; pointer-events: none; font: 12px var(--type); }
.world-compass i { height: 25px; width: 17px; background: linear-gradient(90deg, #5c684b 50%, #e3dfc1 50%); clip-path: polygon(50% 0, 100% 100%, 50% 76%, 0 100%); }
.world-map-note { position: absolute; bottom: 13px; left: 16px; font: 10px var(--type); letter-spacing: .14em; color: #384832; pointer-events: none; background: rgba(232,227,197,.78); padding: 6px 8px; }
.world-map-note span { margin: 0 5px; }
.world-toast { bottom: 48px; left: 14px; max-width: min(340px, calc(100% - 28px)); gap: 6px; }
.world-note { border: 1px solid #7e765b; font-size: 15px; box-shadow: 0 3px 10px rgba(35,45,30,.15); background: #efe6ce; }
.world-map-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 9px 16px; margin-top: 14px; }
.world-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--ink-soft); }
.world-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.world-legend i { display: inline-block; width: 12px; height: 9px; }
.world-legend .water { background: #638f87; border: 1px solid #436d67; border-radius: 35%; }
.world-legend .forest { background: #81965e; clip-path: polygon(50% 0, 100% 100%, 0 100%); height: 13px; }
.world-legend .objective { background: #8b1e1a; width: 9px; height: 9px; transform: rotate(45deg); }
.world-actions { display: flex; gap: 5px; }
.world-actions .btn { min-height: 44px; padding: 8px 12px; border: 1px solid #a29779; font-size: 13px; }
.world-actions kbd { font: 10px var(--type); opacity: .65; margin-left: 5px; }
.world-panel { margin-top: 12px; min-height: 0; padding: 12px 15px; }
.world-page button:focus-visible { outline: 3px solid #8b1e1a; outline-offset: 3px; }
.world-name { flex-wrap: wrap; }
@media (max-width: 560px) {
  #app:has(.world-page) { padding: 10px 8px 30px; }
  .world-page { padding: 14px 13px 22px; }
  .world-page .topbar { margin-bottom: 14px; }
  .world-page .topbar > .label { font-size: 9px; max-width: 120px; }
  .world-heading { align-items: flex-start; gap: 8px; margin-bottom: 12px; }
  .world-heading > .btn { max-width: 112px; font-size: 12px; line-height: 1.4; padding: 9px 10px; }
  .world-heading .label { font-size: 10px; max-width: 220px; }
  .world-hud { gap: 4px 12px; font-size: 11px; }
  .world-hud .hpbar { width: 60px; }
  .world-status { padding-top: 9px; gap: 4px; }
  .world-status > .small { font-size: 12px; }
  .world-map-tools { gap: 7px; }
  .world-actions { margin-left: auto; }
  .world-legend { gap: 10px; font-size: 12px; }
  .world-foot { line-height: 1.5; }
}
@media (prefers-reduced-motion: reduce) {
  .world-page, .world-note { animation: none; }
  .world-page *, .world-page *::before, .world-page *::after { transition: none; }
}

/* Full-screen atlas: the map fills the window and the journal floats over it in small cards. */
#app:has(.world-full) { max-width: none; margin: 0; padding: 0; }
.world-full { position: fixed; inset: 0; margin: 0; padding: 0; max-width: none; background: #d7d2b5; }
.world-full .world-wrap { position: absolute; inset: 0; border: 0; box-shadow: none; background: #d7d2b5; }
.world-full .world-wrap canvas { width: 100%; height: 100%; }
.world-card { background: rgba(240,232,210,.94); border: 1px solid rgba(94,84,60,.65); border-radius: 4px; box-shadow: 0 4px 16px rgba(35,40,25,.22); padding: 10px 14px; pointer-events: auto; }
.world-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 12px; pointer-events: none; }
/* Top left: the only paper here is the menu link and the field notes; level and health sit on the map itself. */
.world-top-left { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; pointer-events: none; min-width: 0; }
.world-title { flex: 0 0 100%; display: flex; align-items: center; justify-content: space-between; gap: 4px 14px; flex-wrap: wrap; padding: 6px 14px; pointer-events: auto; }
.world-full .world-title button.world-menu-link { min-height: 30px; }
.world-title .label { font-size: 10px; letter-spacing: .1em; }
.world-bars { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding-left: 4px; pointer-events: auto; }
.world-full .world-hud { position: static; display: grid; grid-template-columns: max-content max-content; align-items: center; gap: 4px 8px; padding: 0; border: 0; background: none; font-size: 12px; }
.world-bars .world-hud > div { display: contents; }
.world-bars .hud-label { display: inline-flex; align-items: center; gap: 5px; }
.world-me { display: flex; align-items: center; gap: 8px; }
.hud-badge.you-badge { width: 40px; height: 40px; font-size: 18px; flex: none; border: 2px solid #f4ead2; box-shadow: 0 1px 3px rgba(0,0,0,.3); text-shadow: none; }
.world-bars, .world-bars .world-hud { color: var(--ink); text-shadow: 0 0 3px rgba(244,234,210,.95), 0 0 6px rgba(244,234,210,.9); }
.world-bars .hpbar { width: 110px; height: 9px; background: rgba(244,234,210,.75); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.world-where { font-family: var(--type); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.world-top-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.world-top-right > * { pointer-events: auto; }
.world-full .world-zoom { position: static; flex-direction: row; }
.world-bottom { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; pointer-events: none; }
.world-left { display: flex; flex-direction: column; gap: 8px; width: min(440px, 100%); pointer-events: none; }
.world-full .world-toast { position: static; max-width: none; }
.world-full .world-panel { margin: 0; min-height: 0; max-height: 40vh; overflow: auto; border-left: 4px solid var(--blood); }
.world-full .world-panel:empty { display: none; }
/* You in the journal: a red-ink initial instead of a portrait. */
.you-badge { display: inline-flex; align-items: center; justify-content: center; background: #8b1e1a; color: #f2e7cf; font-family: var(--type); font-weight: bold; border-radius: 50%; }
.line .you-badge { width: 44px; height: 44px; font-size: 20px; flex: none; }
.meet-form { margin-top: 18px; }
.meet-name { font-family: var(--type); font-size: 17px; padding: 10px 12px; border: 1px solid var(--ink-soft); background: rgba(255,255,255,.45); color: var(--ink); min-width: 14em; }
.meet-name:focus { outline: 2px solid var(--blood); }
@media (max-width: 700px) {
  .world-top { gap: 8px; }
  .world-title { max-width: none; }
  .world-zoom .btn { width: 36px; height: 36px; font-size: 18px; }
  .world-zoom [data-atlas] { width: 54px; font-size: 12px; }
  .world-top-right { flex-direction: column; align-items: flex-end; gap: 6px; }
  .world-bottom { align-items: flex-end; gap: 8px; }
  .world-left { width: auto; flex: 1; min-width: 0; }
  .world-full .world-panel { max-height: 30vh; }
}
/* Tap something on the map: a small card of what you can do with it. */
.world-menu { position: absolute; z-index: 5; display: flex; flex-direction: column; gap: 6px; min-width: 190px; max-width: 260px; padding: 10px 12px; animation: fadeIn .15s ease; }
.world-menu .label { font-size: 11px; letter-spacing: .08em; margin-bottom: 2px; }
.world-menu .btn { font-size: 14px; padding: 8px 12px; min-height: 40px; text-align: left; }
.world-menu kbd { font: 10px var(--type); opacity: .6; margin-left: 6px; }
.world-menu.wide { max-width: 320px; }
.world-menu p { margin: 0 0 4px; line-height: 1.35; }
/* Main menu: the game opens here. */
.menu-list { display: grid; gap: 10px; max-width: 460px; margin: 22px auto; }
.menu-item { display: grid; gap: 2px; text-align: left; padding: 14px 18px; min-height: 56px; border: 2px solid var(--ink); background: rgba(255,255,255,.35); color: var(--ink); font-family: var(--type); cursor: pointer; transition: background .15s, transform .15s; }
.menu-item b { font-size: 19px; }
.menu-item small { font-family: var(--body, inherit); font-size: 13px; color: var(--ink-soft); }
.menu-item:hover { background: rgba(139,30,26,.08); transform: translateX(3px); }
.menu-item:focus-visible { outline: 3px solid var(--blood); outline-offset: 2px; }
.menu-item.primary { background: var(--ink); color: var(--paper); }
.menu-item.primary small { color: rgba(242,231,207,.75); }
.menu-item.primary:hover { background: #3a2e22; }
@media (prefers-reduced-motion: reduce) { .menu-item { transition: none; } .menu-item:hover { transform: none; } }
/* Click menus always sit above the floating cards. */
.world-full .world-top, .world-full .world-bottom { z-index: 2; }
.world-full .world-menu { z-index: 10; }

/* ---------- The harbour board and the blue door ---------- */
.notice-place { margin-bottom: 8px; }
.notice-paper { font-family: var(--type); background: #f4ead2; border: 1px solid var(--ink-soft); box-shadow: 2px 3px 0 rgba(42,33,24,.25); padding: 12px 18px; margin: 0 auto 18px; max-width: 22em; transform: rotate(-1.2deg); text-align: center; }
.notice-paper p { margin: 2px 0; }
.notice-paper p:first-child { font-size: 1.15em; letter-spacing: .04em; }
.door-scene { position: relative; border: 1px solid var(--ink-soft); line-height: 0; }
.door-scene img { width: 100%; display: block; }
.door-hotspot { position: absolute; left: 55.5%; top: 20%; width: 10.2%; height: 56%; background: transparent; border: 0; cursor: pointer; border-radius: 3px; transition: box-shadow .2s; }
.door-hotspot:hover, .door-hotspot:focus-visible { box-shadow: 0 0 0 2px rgba(120,170,255,.9), 0 0 24px 6px rgba(90,150,255,.55); outline: none; }
.door-row { justify-content: center; margin-top: 14px; }

/* ---------- Accounts: an entry card in the field station's register ---------- */
.register { position: relative; max-width: 470px; margin: 8px auto 6px; padding: 0 30px 24px; background: #f6eedb; border: 1px solid var(--ink-soft); box-shadow: 4px 5px 0 rgba(42,33,24,.22); }
.register-photo { margin: 0 -30px 18px; height: 150px; overflow: hidden; border-bottom: 1px solid var(--ink-soft); position: relative; }
.register-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; filter: sepia(.15) contrast(1.05); display: block; }
.register-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 55%, #f6eedb); }
.register-stamp { position: absolute; top: 118px; right: 22px; width: 76px; height: 76px; border-radius: 50%; border: 3px double var(--blood); color: var(--blood); display: grid; place-content: center; text-align: center; font: 10px/1.15 var(--type); letter-spacing: .12em; text-transform: uppercase; transform: rotate(-14deg); opacity: .8; background: rgba(246,238,219,.6); }
.register-stamp b { font-size: 15px; letter-spacing: .05em; }
.register-head { text-align: center; padding: 0 40px; }
.register-head h2 { margin: 4px 0 18px; font-size: 26px; }
.register-lede { font-size: 16px; color: var(--ink-soft); margin: 0 0 18px; }
.register-foot { font-size: 13px; color: var(--ink-soft); text-align: center; margin: 18px 0 0; font-style: italic; }
.account-error { color: var(--blood); font-family: var(--type); text-align: center; margin: 0 0 12px; }

.signin-buttons { display: grid; gap: 10px; }
.signin-btn { display: flex; align-items: center; gap: 14px; min-height: 50px; padding: 0 18px; background: #fffaf0; color: var(--ink); border: 1.5px solid var(--ink); border-radius: 3px; font: 16px var(--type); text-decoration: none; box-shadow: 2px 2px 0 var(--ink); transition: transform .12s, box-shadow .12s; }
.signin-btn span { flex: 1; text-align: center; margin-right: 22px; }
.signin-btn svg { width: 22px; height: 22px; flex: none; color: #000; }
.signin-btn.facebook svg { color: #1877f2; }
.signin-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.signin-btn:active { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--ink); }
.signin-btn:focus-visible { outline: 3px solid var(--blood); outline-offset: 2px; }
.signin-or { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--ink-soft); font: 13px var(--type); letter-spacing: .14em; text-transform: uppercase; }
.signin-or::before, .signin-or::after { content: ''; flex: 1; border-top: 1px dashed var(--ink-soft); }

.ledger { display: grid; gap: 6px; }
.ledger[hidden], .account-error[hidden] { display: none; }
.ledger-line { font: 19px var(--type); color: var(--ink); background: transparent; border: 0; border-bottom: 1.5px solid var(--ink); padding: 6px 2px; border-radius: 0; width: 100%; }
.ledger-line::placeholder { color: rgba(90,74,56,.5); }
.ledger-line:focus { outline: none; border-bottom-color: var(--blood); background: rgba(139,30,26,.04); }
.ledger-code { font-size: 30px; letter-spacing: .55em; text-align: center; padding-left: .55em; }
.ledger-btn { margin-top: 12px; width: 100%; }
.ledger-sent { margin: 0 0 6px; text-align: center; }
.ledger-links { display: flex; justify-content: space-between; margin: 8px 0 0; }

.ledger-entry { display: grid; grid-template-columns: auto 1fr; gap: 0 14px; margin: 6px 0 20px; }
.ledger-entry dt { font: 12px var(--type); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); padding: 10px 0 6px; border-bottom: 1px dotted var(--ink-soft); }
.ledger-entry dd { margin: 0; padding: 8px 0 6px; border-bottom: 1px dotted var(--ink-soft); font-size: 17px; overflow-wrap: anywhere; }
.register-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.link.danger { color: var(--blood); }

.register-choices { display: grid; gap: 10px; }
.register-choice { display: grid; gap: 3px; text-align: left; padding: 14px 16px; background: #fffaf0; border: 1.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); color: var(--ink); cursor: pointer; font-family: var(--type); }
.register-choice b { font-size: 18px; }
.register-choice small { font-size: 13px; color: var(--ink-soft); }
.register-choice:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }

@media (max-width: 520px) {
  .register { padding: 0 18px 20px; }
  .register-photo { margin: 0 -18px 16px; height: 120px; }
  .register-stamp { top: 64px; right: 10px; width: 56px; height: 56px; }
  .register-stamp b { font-size: 12px; }
  .register-head { padding: 0; }
  .signin-btn { gap: 10px; padding: 0 14px; font-size: 15px; }
  .signin-btn span { margin-right: 0; white-space: nowrap; }
  .register-head h2 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .signin-btn, .register-choice { transition: none; } .signin-btn:hover, .register-choice:hover { transform: none; } }

/* Round icon buttons, bottom left above the "Next" panel: your camp (a tent) and the journal (a book). */
.world-buttons { display: flex; gap: 8px; pointer-events: none; }
.round-btn { pointer-events: auto; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 2px solid var(--ink); background: #f4ead2; color: var(--ink); box-shadow: 2px 2px 0 rgba(42,33,24,.3); display: grid; place-items: center; cursor: pointer; transition: transform .12s, color .12s; }
.round-btn svg { width: 24px; height: 24px; display: block; }
.round-btn:hover { color: var(--blood); transform: translateY(-1px); }
.round-btn:active { transform: translateY(1px); box-shadow: 0 0 0 rgba(42,33,24,.3); }
.round-btn:focus-visible { outline: 3px solid var(--blood); outline-offset: 3px; }
.round-btn[hidden] { display: none; }
.round-btn.locked { opacity: .55; }

/* Bottom right: the checklist and the journal. */
.world-right { display: flex; flex-direction: column; gap: 8px; pointer-events: none; flex: none; }
.round-btn.alert { position: relative; }
.round-btn.alert::after { content: ''; position: absolute; top: 1px; right: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--blood); border: 2px solid #f4ead2; }
.world-panel[hidden] { display: none; }

/* Pop-ups (the checklist and the journal): a card over a dimmed map. */
.pop-back { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 12px; background: rgba(18,15,12,.4); animation: popIn .15s ease; }
.pop-back[hidden] { display: none; }
@keyframes popIn { from { opacity: 0; } to { opacity: 1; } }
.pop-card { width: min(440px, 100%); max-height: 100%; overflow: auto; padding: 16px 18px 18px; box-shadow: 4px 5px 0 rgba(42,33,24,.25), 0 10px 40px rgba(0,0,0,.35); }
.pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pop-head h2 { margin: 0; font-size: 22px; }
.pop-card button.pop-close { font-size: 28px; line-height: 1; text-decoration: none; padding: 0 6px; color: var(--ink); min-width: 36px; min-height: 36px; }
.pop-card button.pop-close:hover { color: var(--blood); }
.pop-card .world-foot { flex-direction: column; gap: 6px; margin-top: 10px; }
.pop-card .row { margin-top: 12px; }

/* The checklist: each stop with a box, ticked when done. */
.checklist { list-style: none; padding: 0; margin: 6px 0 14px; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dotted var(--ink-soft); }
.checklist li > span:nth-child(2) { flex: 1; min-width: 0; }
.checklist .tick { flex: none; width: 20px; height: 20px; border: 2px solid var(--ink); display: grid; place-items: center; font: 15px/1 var(--type); color: var(--ok); }
.checklist li.done { color: var(--ink-soft); }
.checklist li.done b { text-decoration: line-through; text-decoration-color: rgba(42,33,24,.4); }
.checklist li.now .tick { border-color: var(--blood); }
.checklist li.now b { color: var(--blood); }
.checklist .btn { font-size: 14px; padding: 6px 12px; flex: none; }
@media (prefers-reduced-motion: reduce) { .round-btn, .pop-back { transition: none; animation: none; } }

/* Your picture: Key's or Miki's face. */
.you-face { border-radius: 50%; object-fit: cover; }
.hud-badge.you-face { width: 40px; height: 40px; flex: none; border: 2px solid #f4ead2; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.avatar-pick { display: inline-flex; gap: 10px; margin: 6px 0 12px; }
.avatar-pick button { padding: 2px; border: 3px solid transparent; border-radius: 50%; background: none; cursor: pointer; line-height: 0; }
.avatar-pick img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 1px solid var(--ink-soft); }
.avatar-pick button[aria-pressed="true"] { border-color: var(--blood); }
.avatar-pick button:focus-visible { outline: 2px solid var(--blood); outline-offset: 2px; }
.meet-form .avatar-pick, .pop-card .avatar-pick { display: flex; }
.world-name .avatar-pick { margin: 0; }
.world-name .avatar-pick img { width: 36px; height: 36px; }

/* Your picture at the top of the map opens your account. */
.hud-me { padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; line-height: 0; flex: none; transition: transform .12s; }
.hud-me:hover { transform: scale(1.06); }
.hud-me:focus-visible { outline: 3px solid var(--blood); outline-offset: 2px; }
.me-name { width: 100%; margin: 4px 0 14px; }
.me-account { border-top: 1px dotted var(--ink-soft); padding-top: 12px; }
.me-account:empty { display: none; }
.me-who { margin: 4px 0 10px; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .hud-me { transition: none; } }

/* Your picture in the account pop-up, with a small edit button. */
.me-pic { position: relative; width: 72px; height: 72px; margin: 2px 0 12px; }
.me-badge { width: 72px; height: 72px; font-size: 30px; display: inline-flex; border: 2px solid var(--ink); }
.me-badge.you-face { display: block; }
.me-edit { position: absolute; right: -4px; bottom: -4px; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid var(--ink); background: #f4ead2; color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: 1px 1px 0 rgba(42,33,24,.3); }
.me-edit svg { width: 14px; height: 14px; }
.me-edit:hover, .me-edit[aria-expanded="true"] { color: var(--blood); border-color: var(--blood); }
.me-edit:focus-visible { outline: 2px solid var(--blood); outline-offset: 2px; }
.me-picker[hidden] { display: none; }
.me-picker .avatar-pick { margin-top: 0; }

/* Account: the sign-ins connected to it, and buttons to connect more. */
.account-note { font-family: var(--type); color: var(--ok); text-align: center; margin: 0 0 12px; }
.account-note[hidden] { display: none; }
.link-list { list-style: none; padding: 0; margin: 6px 0 16px; }
.link-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dotted var(--ink-soft); }
.link-icon { width: 22px; height: 22px; flex: none; color: #000; }
.link-icon.facebook { color: #1877f2; }
.link-icon svg { width: 22px; height: 22px; display: block; }
.link-what { flex: 1; min-width: 0; display: grid; }
.link-what .small { color: var(--ink-soft); overflow-wrap: anywhere; }
.link-connect { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 6px 0 14px; }
.link-connect .signin-btn { min-height: 44px; font-size: 14px; padding: 0 12px; gap: 8px; cursor: pointer; }
.link-connect .signin-btn span { margin-right: 0; }
.link-connect .signin-btn svg { width: 18px; height: 18px; }
.ledger[hidden] { display: none; }

/* Stamina: a blue bar under health, its cost on level buttons, and a note when you're too tired. */
.hpbar.stamina > b { background: #3f6e9e; }
.hud-bolt { width: 16px; text-align: center; font-size: 13px; }
.hud-barwrap { display: inline-flex; align-items: center; gap: 6px; }
.hud-num { font-size: 11px; }
.btn .cost { font-size: .8em; opacity: .85; margin-left: 6px; }
#stamina-note { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 50; max-width: min(440px, calc(100% - 32px)); padding: 10px 16px; background: #f4ead2; color: var(--ink); border: 2px solid var(--ink); box-shadow: 3px 3px 0 rgba(42,33,24,.3); font-family: var(--type); font-size: 14px; text-align: center; }
#stamina-note[hidden] { display: none; }

/* Under the zoom buttons: stamina, coins and diamonds, straight on the map like the bars. */
.world-wallet { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-family: var(--type); font-size: 15px; color: var(--ink); text-shadow: 0 0 3px rgba(244,234,210,.95), 0 0 6px rgba(244,234,210,.9); }
.wallet-item { display: inline-flex; align-items: center; gap: 5px; cursor: default; }
.wallet-item > [aria-hidden] { width: 18px; text-align: center; }
.wallet-item b { font-weight: bold; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Agreeing to the terms when you choose a name. */
.agree { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 15px; cursor: pointer; }
.agree input { width: 18px; height: 18px; accent-color: var(--blood); flex: none; }
.agree a { color: var(--blood); }
.meet-form .meet-name { display: block; }
.meet-join { margin-top: 14px; }
.meet-form .account-error { text-align: left; margin: 8px 0 0; }
/* A camp drawn in the margins of the field journal. */
.ico { display: inline-block; vertical-align: -3px; }
#app:has(.camp-full) { max-width: none; padding: 0; }
.camp-full { position: fixed; inset: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden; animation: none; background: #e4dcc1; box-shadow: none; }
.camp-full [hidden] { display: none !important; }
.camp-full button { cursor: pointer; }
.camp-full button:disabled { cursor: not-allowed; opacity: .5; }
.camp-full button:focus-visible, .camp-full summary:focus-visible, .camp-landscape:focus-visible { outline: 2px solid var(--blood); outline-offset: 3px; }
.camp-landscape { display: block; width: 100%; height: 100%; touch-action: none; }
.camp-full[data-mode=inspect] .camp-landscape { cursor: grab; }
.camp-full[data-mode=inspect] .camp-landscape:active { cursor: grabbing; }
.camp-full:not([data-mode=inspect]) .camp-landscape { cursor: crosshair; }
.camp-journal-card { background: rgba(241,232,210,.96); border: 1px solid #85745b; box-shadow: 2px 3px 0 rgba(71,53,34,.12), inset 0 0 24px rgba(128,93,43,.07); border-radius: 2px; }
.camp-top { position: absolute; top: max(16px, env(safe-area-inset-top)); left: 18px; right: 18px; display: flex; justify-content: space-between; gap: 24px; pointer-events: none; }
.camp-top-left { min-width: 0; }
.camp-titlebar { display: inline-flex; align-items: center; gap: 20px; padding: 0 14px; pointer-events: auto; }
.camp-titlebar .link { min-height: 44px; font-size: 13px; white-space: nowrap; }
.camp-titlebar .label { font-size: 10px; }
.camp-title-note { padding: 13px 5px; text-shadow: 0 1px 3px #e4dcc1; }
.camp-title-note h1 { font-size: clamp(17px, 2vw, 23px); line-height: 1.4; }
.camp-title-note p { font-size: 14px; font-style: italic; }
.camp-top-right { display: flex; flex-direction: column; align-items: end; gap: 12px; }
.camp-resource-bar { display: flex; gap: 0; padding: 9px 0; color: var(--ink); pointer-events: auto; }
.camp-resource-bar > span { display: grid; grid-template-columns: 20px auto; align-items: center; column-gap: 9px; padding: 0 15px; border-right: 1px solid #b6a68a; }
.camp-resource-bar > span:last-child { border: 0; }
.camp-resource-bar b { font: normal 17px var(--type); }
.camp-resource-bar small { grid-column: 2; font: italic 12px var(--serif); }
.camp-resource-bar .camp-worker-count { grid-template-columns: auto; }
.camp-worker-count small { grid-column: 1; }
.camp-res-icon { position: relative; flex-shrink: 0; display: inline-block; width: 19px; height: 19px; vertical-align: middle; background: center / contain no-repeat; }
.camp-res-icon.wood { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2026%2026%22%20stroke%3D%22%2367573f%22%20stroke-width%3D%221.2%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%2016%2018%207%2023%2011%209%2020Z%22%20fill%3D%22%239c7d55%22/%3E%3Cellipse%20cx%3D%2220%22%20cy%3D%229%22%20rx%3D%223%22%20ry%3D%224%22%20transform%3D%22rotate%28-34%2020%209%29%22%20fill%3D%22%23d4b98b%22/%3E%3Cpath%20d%3D%22m6%2016%2012-7m-10%209%2010-6%22%20fill%3D%22none%22/%3E%3C/svg%3E"); }
.camp-res-icon.stone { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2026%2026%22%20stroke%3D%22%2367573f%22%20stroke-width%3D%221.2%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m3%2017%203-9%209-4%208%208-4%208-12%201Z%22%20fill%3D%22%23aaa99a%22/%3E%3Cpath%20d%3D%22m6%208%207%207%2010-3m-10%203%206%205%22%20fill%3D%22none%22/%3E%3C/svg%3E"); }
.camp-res-icon.food { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2026%2026%22%20stroke%3D%22%2367573f%22%20stroke-width%3D%221.2%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2023V4m0%2011-7-5m7%209%207-5%22%20fill%3D%22none%22/%3E%3Cpath%20d%3D%22M12%2012C5%2010%204%204%206%203c6%200%207%207%206%209Zm0%206c2-8%207-10%209-8%201%205-4%209-9%208Z%22%20fill%3D%22%23909766%22/%3E%3C/svg%3E"); }
.camp-res-icon.coins { background: #b8a46b; border: 1px solid #776142; border-radius: 50%; box-shadow: inset 0 0 0 3px #dfca95; width: 17px; height: 17px; }
.camp-res-icon.coins:after { content: '·'; position: absolute; inset: -2px 0 0; text-align: center; color: #776142; }
.camp-res-icon.diamonds { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2026%2026%22%20stroke%3D%22%2367573f%22%20stroke-width%3D%221.2%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m3%209%205-6h10l5%206-10%2014Z%22%20fill%3D%22%2391aaa4%22/%3E%3Cpath%20d%3D%22M3%209h20M8%203l5%2020%205-20%22%20fill%3D%22none%22/%3E%3C/svg%3E"); }
.camp-full .btn { margin: 0; min-height: 44px; padding: 10px 13px; font-size: 12px; letter-spacing: 0; box-shadow: none; }
.camp-full .btn.ghost { background: rgba(241,232,210,.94); }
.camp-full .btn:hover { transform: none; }
.camp-full .btn.ghost[aria-pressed=true] { background: var(--ink); color: var(--paper); }
.camp-zoom { display: flex; gap: 6px; pointer-events: auto; }
.camp-zoom .btn { min-width: 44px; }
.camp-zoom [data-zoom] { font-size: 21px; padding: 5px 12px; }
.camp-objects { position: absolute; inset: 0; pointer-events: none; isolation: isolate; }
.camp-object, .camp-log-pick { position: absolute; pointer-events: auto; border: 0; background: transparent; padding: 0; color: var(--ink); touch-action: manipulation; }
.camp-object { pointer-events: none; }
.camp-log-pick { transform: translate(-50%, -50%); border-radius: 50%; }
.camp-log-pick span { display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 11px var(--type); padding: 6px; background: var(--paper); border: 1px solid #85745b; }
.camp-log-pick:hover, .camp-log-pick:focus-visible { outline: 1px dashed var(--blood); }
.camp-log-pick:hover span, .camp-log-pick:focus-visible span { display: block; }
.camp-full:not([data-mode=inspect]) .camp-objects { visibility: hidden; }
.camp-bottom { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); left: 18px; right: 18px; display: flex; justify-content: space-between; align-items: end; gap: 14px; pointer-events: none; }
.camp-tools { display: flex; padding: 6px; gap: 6px; pointer-events: auto; }
.camp-tools .btn.ghost { border-color: transparent; background: transparent; }
.camp-tools .btn.ghost:hover { border-color: #85745b; }
.camp-modebar { position: absolute; bottom: 98px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 36px)); padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.camp-modebar > span { font-size: 16px; }
.camp-modebar > div { display: flex; gap: 6px; flex-shrink: 0; }
.camp-toasts { position: absolute; top: 148px; left: 50%; transform: translateX(-50%); width: min(370px, calc(100% - 36px)); pointer-events: none; z-index: 6; }
.camp-toasts .world-note { background: #f1e8d2; color: var(--ink); border: 1px solid #85745b; font: 15px/1.4 var(--serif); padding: 12px 16px; margin-bottom: 8px; box-shadow: 1px 2px 5px #4a351d22; }
.camp-inspector, .camp-construction { position: absolute; z-index: 5; top: 145px; right: 18px; bottom: 98px; width: 340px; max-width: calc(100% - 36px); overflow: auto; overscroll-behavior: contain; padding: 22px; }
.camp-construction { width: 540px; left: 18px; right: auto; }
.camp-close { position: absolute; top: 0; right: 0; width: 42px; height: 42px; font: 25px var(--serif); background: transparent; border: 0; color: var(--ink); }
.camp-panel-heading { display: flex; gap: 12px; font: 9px var(--type); color: var(--ink-soft); border-bottom: 1px solid #b6a68a; padding: 0 20px 12px 0; }
.camp-sheet h2 { font-size: 24px; margin: 16px 0 10px; }
.camp-sheet p, .camp-construction p { font-size: 16px; line-height: 1.45; }
.camp-sheet .small { font-size: 13px; color: var(--ink-soft); }
.camp-tent-preview { display: flex; align-items: center; margin: 0 -5px 12px; border-bottom: 1px solid #b6a68a; }
.camp-tent-preview canvas { width: 150px; height: 92px; }
.camp-tent-preview > span { font: 9px/1.5 var(--type); color: var(--ink-soft); }
.camp-tent-preview b { display: block; font: italic 16px var(--serif); margin-top: 5px; }
.camp-stat-grid { border-block: 1px solid #b6a68a; padding: 8px 0; margin: 12px 0; }
.camp-stat-grid > div { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; font-size: 14px; }
.camp-stat-grid i { font-style: normal; padding: 0 8px; }
.camp-stat-grid em { font-style: normal; color: var(--ok); }
.camp-section-label { font: 10px var(--type); letter-spacing: .05em; color: var(--ink-soft); margin: 16px 0 8px; }
.camp-costs { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 12px; }
.camp-costs > div { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #b6a68a; padding: 7px 4px; }
.camp-costs > div > span:last-child { font-size: 12px; }
.camp-costs b { display: block; color: var(--ok); font: 12px var(--type); }
.camp-costs .missing b { color: var(--blood); }
.camp-full .camp-warning { color: var(--blood); border-left: 2px solid #9e6d4c; padding-left: 9px; font-size: 14px; }
.camp-full .camp-primary { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.camp-primary > span { font-size: 10px; white-space: nowrap; }
.camp-health { margin: 15px 0 10px; }
.camp-health > span:first-child { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.camp-full .hpbar { display: block; width: 100%; height: 7px; }
.camp-secondary-actions { display: flex; gap: 7px; margin-bottom: 10px; }
.camp-secondary-actions .btn { font-size: 11px; flex: 1; padding: 7px; }
.camp-building-preview canvas { display: block; margin: 0 auto 10px; width: 140px; height: 98px; }
.camp-staff { display: grid; gap: 5px; padding: 10px 0; border-block: 1px solid #b6a68a; margin-bottom: 10px; font-size: 15px; }
.camp-staff span { font-size: 13px; color: var(--ink-soft); }
.camp-full .camp-hire { margin: 9px 0; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 5px; font-size: 11px; }
.camp-full .resrow { display: flex; flex-wrap: wrap; gap: 14px 18px; margin: 12px 0; font: 13px var(--type); }
.camp-full .res { display: flex; align-items: center; gap: 7px; }
.camp-rates { display: grid; gap: 5px; margin-bottom: 14px; }
.camp-rates > span { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.camp-rates b { margin-left: auto; color: var(--ok); }
.camp-boosts { margin-top: 20px; border-top: 1px solid #b6a68a; padding-top: 12px; }
.camp-boosts summary { min-height: 44px; cursor: pointer; font-size: 14px; }
.camp-boosts > div { display: grid; gap: 8px; }
.camp-full .camp-log { padding-left: 16px; font-size: 15px; }
.camp-full .camp-log li { border-bottom: 1px solid #b6a68a; padding: 10px 0; }
.camp-log li > span { display: block; color: var(--ink-soft); font-size: 12px; }
.camp-complete { color: var(--ok); padding: 12px 0; border-block: 1px solid #9aa17e; }
.camp-full .camp-arrange { width: 100%; margin: 14px 0 8px; }
.camp-construction > .label { font-size: 10px; }
.camp-construction > h2 { font-size: 26px; margin-top: 16px; }
.camp-build-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.camp-build-card { display: flex; align-items: center; gap: 6px; min-width: 0; text-align: left; padding: 7px 5px; color: var(--ink); border: 1px solid #b6a68a; background: transparent; }
.camp-build-card:hover, .camp-build-card[aria-pressed=true] { border-color: var(--blood); background: #e7d9bb70; }
.camp-build-card canvas { width: 65px; height: 46px; flex-shrink: 0; }
.camp-build-card b { display: block; font: 11px var(--type); }
.camp-build-card small { font-size: 12px; color: var(--ink-soft); display: block; padding-top: 4px; }
.camp-build-card em { font-size: 11px; display: block; color: var(--ok); }
.camp-keyboard-note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 1050px) {
  .camp-titlebar .label { display: none; }
  .camp-title-note { max-width: 280px; }
  .camp-resource-bar > span { padding: 0 10px; }
  .camp-bottom { justify-content: center; flex-wrap: wrap; gap: 7px; }
  .camp-tools { order: 2; }
  .camp-inspector, .camp-construction { bottom: 96px; }
  .camp-modebar { bottom: 96px; }
}
@media (max-width: 600px) {
  .camp-top { top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; gap: 10px; flex-direction: column; }
  .camp-top-left { display: flex; align-items: center; gap: 12px; }
  .camp-titlebar { flex-shrink: 0; padding-inline: 10px; }
  .camp-titlebar .link { font-size: 11px; }
  .camp-title-note { padding: 0; }
  .camp-title-note h1 { font-size: 15px; line-height: 1.3; margin: 0; }
  .camp-title-note p { display: block; font-size: 11px; line-height: 1.3; margin: 4px 0 0; }
  .camp-top-right { flex-direction: row; align-items: start; gap: 8px; }
  .camp-resource-bar { flex: 1; justify-content: space-around; padding-block: 8px; }
  .camp-resource-bar > span { padding-inline: 7px; column-gap: 5px; grid-template-columns: 16px auto; }
  .camp-resource-bar b { font-size: 13px; }
  .camp-resource-bar small { font-size: 11px; }
  .camp-resource-bar .camp-res-icon { width: 15px; height: 15px; }
  .camp-resource-bar .camp-worker-count { display: none; }
  .camp-zoom { flex-wrap: wrap; justify-content: end; width: 44px; gap: 6px; position: absolute; right: 0; top: 112px; }
  .camp-zoom [data-fit] { font-size: 10px; padding: 6px; }
  .camp-bottom { bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; right: 10px; gap: 8px; }
  .camp-tools { flex: 1 0 100%; justify-content: space-between; padding: 4px; gap: 2px; }
  .camp-tools .btn { font-size: 10px; padding: 7px 6px; max-width: 72px; line-height: 1.4; }
  .camp-inspector, .camp-construction { top: 124px; bottom: 90px; right: 10px; left: 10px; width: auto; max-width: none; padding: 18px; }
  .camp-modebar { bottom: 90px; width: calc(100% - 20px); padding: 10px; gap: 8px; flex-wrap: wrap; }
  .camp-modebar > span { font-size: 15px; flex: 1 0 100%; }
  .camp-modebar > div { margin-left: auto; }
  .camp-build-menu { gap: 7px; }
  .camp-build-card { flex-direction: column; align-items: start; padding: 10px; }
  .camp-build-card canvas { align-self: center; }
  .camp-toasts { top: 124px; }
}

@media (max-height: 550px) and (min-width: 601px) {
  .camp-title-note { display: none; }
  .camp-top-right { flex-direction: row; }
  .camp-resource-bar > span { padding-inline: 8px; }
  .camp-inspector, .camp-construction { top: 84px; bottom: 90px; }
  .camp-bottom { flex-wrap: nowrap; }
  .camp-modebar { bottom: 90px; }
  .camp-toasts { top: 84px; }
}

.camp-land-info { position: absolute; bottom: 96px; left: 18px; padding: 11px 14px; text-align: left; color: var(--ink); }
.camp-land-info b { display: block; font: 12px var(--type); margin-bottom: 6px; }
.camp-land-info span { display: block; font: italic 14px var(--serif); }
.camp-full:not([data-mode=inspect]) .camp-land-info { display: none; }
@media (max-width: 600px) {
  .camp-land-info { bottom: 80px; left: 10px; padding: 9px 12px; }
  .camp-land-info b { font-size: 11px; }
  .camp-land-info span { font-size: 12px; }
}

.camp-crop-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.camp-crop-choices .btn[aria-pressed="true"] { background: #4b5739; color: #f6ecd5; border-color: #38462a; }
