/* --------------------------------------------------------------------------
   PRIMAL — interface
   Bone, ash, ochre and old hide. Nothing on screen that a person in a skin
   tent could not have known about themselves.
   -------------------------------------------------------------------------- */

:root {
  --bone: #e8e0cf;
  --bone-dim: #b6ad99;
  --ash: #14120f;
  --ash2: #1e1a15;
  --hide: #3a2f22;
  --ochre: #c8752c;
  --ochre-dim: #8a5320;
  --blood: #8c1b16;
  --moss: #6d8047;
  --ui-font: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --ui-sans: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #000; color: var(--bone);
  font-family: var(--ui-sans);
  -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none;
  cursor: default;
}

#view { display: block; width: 100vw; height: 100vh; background: #05070a; }
body.locked { cursor: none; }

/* ------------------------------------------------------------ screen fx */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#vignette {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 38%, rgba(0,0,0,0.85) 100%);
  transition: opacity .4s ease;
}
#bloodfx {
  position: absolute; inset: 0; opacity: 0; mix-blend-mode: multiply;
  background:
    radial-gradient(circle at 18% 22%, rgba(120,10,8,.85) 0 6%, transparent 22%),
    radial-gradient(circle at 78% 30%, rgba(120,10,8,.7) 0 4%, transparent 17%),
    radial-gradient(circle at 62% 74%, rgba(120,10,8,.75) 0 5%, transparent 20%),
    radial-gradient(circle at 32% 68%, rgba(120,10,8,.6) 0 3%, transparent 14%);
  transition: opacity 1.6s ease;
}
#flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
#sleepfade { position: absolute; inset: 0; background: #050504; opacity: 0; }

/* ---------------------------------------------------------------- loading */
#loading {
  position: fixed; inset: 0; z-index: 100; display: flex;
  align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 45%, #241d15 0%, #0a0908 70%);
  transition: opacity .8s ease;
}
#loading.gone { opacity: 0; pointer-events: none; }
.lo-inner { text-align: center; width: min(420px, 80vw); }
.lo-title {
  font-family: var(--ui-font); font-size: 4rem; letter-spacing: .5em;
  text-indent: .5em; color: var(--bone); margin-bottom: 1.6rem;
  text-shadow: 0 0 30px rgba(200,117,44,.35);
}
.lo-bar { height: 2px; background: rgba(232,224,207,.14); overflow: hidden; }
#lo-fill { height: 100%; width: 0%; background: var(--ochre); transition: width .25s ease; }
#lo-msg { margin-top: .9rem; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--bone-dim); }

/* ----------------------------------------------------------------- screens */
.screen {
  position: fixed; inset: 0; z-index: 60; display: flex;
  align-items: center; justify-content: center;
  background: rgba(6,6,5,.82); backdrop-filter: blur(3px);
}
.screen.hidden, .hidden { display: none !important; }

.panel {
  background: linear-gradient(180deg, rgba(32,27,20,.97), rgba(18,15,12,.98));
  border: 1px solid rgba(200,117,44,.28);
  box-shadow: 0 30px 80px rgba(0,0,0,.7), inset 0 1px 0 rgba(232,224,207,.06);
  padding: 2.2rem 2.4rem; min-width: 340px; max-width: min(900px, 92vw);
  max-height: 88vh; overflow: auto;
}
.panel.wide { max-width: min(1100px, 94vw); }
.panel.scroll { overflow-y: auto; }
.panel h1 {
  font-family: var(--ui-font); font-size: 3.2rem; letter-spacing: .42em;
  text-indent: .42em; margin: 0 0 .2rem; font-weight: 400;
}
.panel h2 {
  font-family: var(--ui-font); font-size: 1.5rem; letter-spacing: .30em;
  text-transform: uppercase; margin: 0 0 1.2rem; font-weight: 400; color: var(--ochre);
}
.panel h3 {
  font-size: .78rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ochre); margin: 1.2rem 0 .4rem; font-weight: 600;
}
.panel p { line-height: 1.6; color: var(--bone-dim); margin: .4rem 0; font-size: .92rem; }
.panel .sub { color: var(--bone-dim); letter-spacing: .18em; font-size: .8rem; text-transform: uppercase; margin-bottom: 2rem; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 2rem; }

button {
  font-family: var(--ui-sans); font-size: .78rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--bone);
  background: rgba(200,117,44,.10); border: 1px solid rgba(200,117,44,.42);
  padding: .70rem 1.4rem; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
button:hover { background: rgba(200,117,44,.26); border-color: var(--ochre); }
button:active { transform: translateY(1px); }
button.big { padding: 1rem 2.2rem; font-size: .88rem; }
button:disabled { opacity: .35; cursor: not-allowed; }
.row { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.4rem; align-items: center; }

#seedline { margin-top: 1.6rem; display: flex; gap: .8rem; align-items: center; font-size: .76rem; letter-spacing: .12em; color: var(--bone-dim); text-transform: uppercase; }
#seedline input {
  background: rgba(0,0,0,.4); border: 1px solid rgba(232,224,207,.18); color: var(--bone);
  padding: .45rem .7rem; font-family: var(--ui-sans); font-size: .8rem; letter-spacing: .08em; width: 12rem;
}
.tinyhint { margin-top: 1.4rem; font-size: .72rem; color: rgba(182,173,153,.55); letter-spacing: .08em; }

/* --------------------------------------------------------------- settings */
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 1.4rem; padding: .55rem 0; border-bottom: 1px solid rgba(232,224,207,.07); }
.setrow label { font-size: .82rem; letter-spacing: .1em; color: var(--bone); }
.setrow .hint { font-size: .7rem; color: rgba(182,173,153,.6); display: block; margin-top: .15rem; letter-spacing: 0; }
.setrow .ctl { display: flex; align-items: center; gap: .6rem; min-width: 230px; justify-content: flex-end; }
.setrow input[type=range] { width: 150px; accent-color: var(--ochre); }
.setrow select {
  background: rgba(0,0,0,.45); color: var(--bone); border: 1px solid rgba(232,224,207,.2);
  padding: .35rem .6rem; font-family: var(--ui-sans); font-size: .78rem; letter-spacing: .08em;
}
.setrow .val { min-width: 3.2rem; text-align: right; font-size: .76rem; color: var(--ochre); }

/* ------------------------------------------------------------- game panels */
.gamepanel {
  position: fixed; z-index: 50; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4,4,3,.72); backdrop-filter: blur(2px);
}
.gp-inner {
  --tile: clamp(44px, 6vh, 72px);            /* one dial sizes every grid below */
  position: relative;
  width: min(1160px, 95vw); max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(30,25,19,.985), rgba(16,14,11,.99));
  border: 1px solid rgba(200,117,44,.25);
  padding: 1.4rem 1.7rem 1.2rem;
  box-shadow: 0 24px 70px rgba(0,0,0,.75);
}
.gp-title {
  font-family: var(--ui-font); font-size: 1.35rem; letter-spacing: .32em;
  text-transform: uppercase; color: var(--ochre); margin-bottom: .15rem; flex: none;
}
.gp-sub { font-size: .72rem; letter-spacing: .13em; color: rgba(182,173,153,.7); text-transform: uppercase; margin-bottom: .9rem; flex: none; }
.gp-close { position: absolute; top: 1.1rem; right: 1.4rem; z-index: 3; }
/* the two working panels always fill the same box, so nothing jumps about */
.craftwin, .statwin { height: min(88vh, 900px); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; overflow: auto; flex: 1; min-height: 0; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 1.4rem; overflow: auto; flex: 1; min-height: 0; }
@media (max-width: 780px) { .grid2 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ icons */
.ic { width: 100%; height: 100%; display: block; }
.dim { color: rgba(182,173,153,.55); font-weight: 400; letter-spacing: .06em; text-transform: none; }
.dhint { font-size: .76rem; color: rgba(182,173,153,.5); line-height: 1.5; padding: .3rem 0; }
.bad { color: #d4665a; }

/* ------------------------------------------------------------- crafting */
.craftlay {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: 9.5rem minmax(0,1fr) 15.5rem; gap: 1.1rem;
}
.cats { display: flex; flex-direction: column; gap: .22rem; border-right: 1px solid rgba(232,224,207,.07); padding-right: .8rem; }
.cats button {
  display: flex; justify-content: space-between; align-items: center; gap: .4rem;
  padding: .5rem .6rem; font-size: .66rem; letter-spacing: .1em; text-align: left;
  background: none; border: 1px solid transparent; border-left: 2px solid transparent;
  color: var(--bone-dim);
}
.cats button:hover { background: rgba(200,117,44,.09); border-left-color: rgba(200,117,44,.45); color: var(--bone); }
.cats button.on { background: rgba(200,117,44,.16); border-left-color: var(--ochre); color: var(--bone); }
.cats button i { font-style: normal; font-size: .62rem; color: rgba(182,173,153,.5); }

/* auto only as a safety valve on a very short window — at any sensible size
   the whole list fits, which is the point of shrinking the tiles with vh */
.tiles { overflow-y: auto; min-height: 0; padding-right: .3rem; }
.tiles h4 {
  font-size: .6rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ochre-dim); margin: .45rem 0 .25rem; font-weight: 600;
}
.tiles h4:first-child { margin-top: 0; }
.tilerow { display: flex; flex-wrap: wrap; gap: .35rem; }

.tile {
  position: relative; width: calc(var(--tile) + 18px); padding: .34rem .2rem .3rem;
  display: flex; flex-direction: column; align-items: center; gap: .18rem;
  background: rgba(232,224,207,.035); border: 1px solid rgba(232,224,207,.09);
  cursor: pointer; text-transform: none; letter-spacing: 0;
  transition: background .1s, border-color .1s, transform .1s;
}
.tile:hover, .tile.sel { background: rgba(200,117,44,.16); border-color: var(--ochre); }
.tile:hover { transform: translateY(-1px); }
.tile .art { width: var(--tile); height: calc(var(--tile) * .74); flex: none; }
.tile .nm {
  font-size: .58rem; line-height: 1.15; color: var(--bone-dim); text-align: center;
  width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile.sel .nm, .tile:hover .nm { color: var(--bone); }
.tile .mult {
  position: absolute; top: 2px; right: 3px; font-size: .58rem; color: var(--moss);
}
.tile.no { opacity: .34; }
.tile.no:hover { opacity: .6; background: rgba(232,224,207,.05); border-color: rgba(232,224,207,.18); }
.tile .lock {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0,0,0,.22) 6px 7px);
}

.detail {
  border-left: 1px solid rgba(232,224,207,.07); padding-left: 1rem;
  display: flex; flex-direction: column; overflow: hidden; min-height: 0;
}
.detail h4 {
  font-size: .6rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ochre-dim); margin: .7rem 0 .35rem; font-weight: 600;
}
.dhead { display: flex; align-items: center; gap: .6rem; }
.dhead .bigart { width: 3.1rem; height: 3.1rem; flex: none; }
.dname { font-size: .95rem; color: var(--bone); line-height: 1.2; }
.dkind { font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ochre-dim); margin-top: .12rem; }
.ddesc { font-size: .74rem; line-height: 1.5; color: var(--bone-dim); margin: .55rem 0 0; }
.ings { display: flex; flex-direction: column; gap: .18rem; }
.ing { display: flex; align-items: center; gap: .45rem; font-size: .74rem; color: var(--bone-dim); }
.ing .art { width: 1.35rem; height: 1.35rem; flex: none; }
.ing .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ing .n { color: var(--moss); font-variant-numeric: tabular-nums; }
.ing .n b { color: rgba(182,173,153,.5); font-weight: 400; }
.ing.lack .nm { color: rgba(182,173,153,.55); }
.ing.lack .n { color: #d4665a; }
.facts { display: flex; flex-direction: column; gap: .1rem; }
.facts > div { display: flex; justify-content: space-between; gap: .5rem; font-size: .68rem; }
.facts span { color: rgba(182,173,153,.5); letter-spacing: .1em; text-transform: uppercase; }
.facts b { color: var(--bone-dim); font-weight: 400; text-align: right; }
.makebtn { margin-top: auto; width: 100%; padding: .7rem; font-size: .72rem; }
.makebtn.no { opacity: .35; cursor: not-allowed; }
.makebtn.no:hover { background: rgba(200,117,44,.10); border-color: rgba(200,117,44,.42); }
.dblock { font-size: .66rem; color: #d4665a; margin-top: .4rem; line-height: 1.4; text-align: center; }

.carried {
  flex: none; margin-top: .9rem; padding-top: .7rem; border-top: 1px solid rgba(232,224,207,.07);
  display: flex; align-items: center; gap: .9rem;
}
.carried .ctitle {
  display: flex; align-items: center; gap: .4rem; flex: none;
  font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(182,173,153,.6);
}
.carried .ctitle .ic { width: .95rem; height: .95rem; }
.carried .chips { display: flex; flex-wrap: wrap; gap: .22rem; overflow: hidden; max-height: 3.4rem; }
.chip {
  display: flex; align-items: center; gap: .15rem; padding: .1rem .28rem .1rem .1rem;
  background: rgba(232,224,207,.04); border: 1px solid rgba(232,224,207,.08);
}
.chip .ic { width: 1.25rem; height: 1.25rem; flex: none; }
.chip b { font-size: .62rem; color: var(--ochre); font-weight: 600; }
.chip.none { opacity: .32; }
.chip.none b { color: var(--bone-dim); }

/* ---------------------------------------------------------------- status */
.statlay {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: 15rem minmax(0,1fr) 15.5rem; gap: 1.2rem;
}
.statlay .col { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.statlay h3 {
  font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ochre);
  margin: 0 0 .45rem; font-weight: 600; display: flex; justify-content: space-between;
  align-items: baseline; gap: .5rem; flex: none;
}
.goodscol h3:nth-of-type(2) { margin-top: .9rem; }
.needcol h3:nth-of-type(2) { margin-top: 1.1rem; }

/* the figure */
.figure { width: 100%; flex: 1 1 auto; min-height: 0; max-height: 40vh; }
.figure .bp { stroke: rgba(232,224,207,.16); stroke-width: 1.1; transition: fill .2s; }
.figure .bp.hurt { stroke: rgba(232,224,207,.34); }
.figure .bp.dead { stroke: #d4665a; stroke-dasharray: 3 2; }
.figure .pin circle { stroke: rgba(10,9,8,.75); stroke-width: 1.4; }
.figure .pin text {
  font-family: var(--ui-sans); font-size: 8px; font-weight: 700;
  fill: #14120f; text-anchor: middle;
}

.bloodrow { display: flex; align-items: center; gap: .45rem; margin: .5rem 0 .6rem; flex: none; }
.bloodrow .g { width: 1rem; height: 1rem; flex: none; }
.bloodrow .pct { font-size: .66rem; color: var(--bone-dim); font-variant-numeric: tabular-nums; }
.bar { flex: 1; height: 4px; background: rgba(232,224,207,.10); display: block; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ochre); transition: width .3s; }

.wounds { list-style: none; padding: 0; margin: 0; overflow: hidden; flex: none; }
.wounds li {
  display: flex; gap: .5rem; padding: .26rem .45rem; margin-bottom: .2rem; font-size: .72rem;
  border-left: 2px solid var(--blood); background: rgba(140,27,22,.09);
}
.wounds li.ok { border-left-color: var(--moss); background: rgba(109,128,71,.08); }
.wounds li.off { border-left-color: #d4665a; background: rgba(212,102,90,.12); }
.wounds li .p { color: var(--bone); text-transform: capitalize; min-width: 4.6rem; flex: none; }
.wounds li .w { color: var(--bone-dim); }

/* belt + carried slots */
.belt {
  display: grid; gap: .28rem; flex: none;
  grid-template-columns: repeat(6, minmax(0, calc(var(--tile) + 16px)));
}
.bslot {
  position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: rgba(232,224,207,.04); border: 1px solid rgba(232,224,207,.10); cursor: pointer;
  transition: border-color .12s, background .12s;
}
.bslot:hover { background: rgba(200,117,44,.12); border-color: rgba(200,117,44,.5); }
.bslot.on { border-color: var(--ochre); background: rgba(200,117,44,.17); }
.bslot.empty { cursor: default; background: rgba(232,224,207,.02); }
.bslot.empty:hover { background: rgba(232,224,207,.02); border-color: rgba(232,224,207,.10); }
.bslot .k { position: absolute; top: 2px; left: 4px; font-size: .56rem; color: rgba(182,173,153,.5); }
.bslot .art { width: 76%; height: 76%; }
.bslot .n { position: absolute; bottom: 1px; right: 4px; font-size: .58rem; color: var(--ochre); }
.bslot .x {
  position: absolute; top: -1px; right: -1px; padding: 0; width: 14px; height: 14px; line-height: 1;
  font-size: .7rem; border: none; background: rgba(0,0,0,.45); color: rgba(182,173,153,.7);
  opacity: 0; transition: opacity .12s;
}
.bslot:hover .x { opacity: 1; }
.bslot .x:hover { background: var(--blood); color: var(--bone); }

.slots {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: .3rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr));
  grid-auto-rows: min-content; gap: .28rem; align-content: start;
}
.slot {
  position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: rgba(232,224,207,.04); border: 1px solid rgba(232,224,207,.09); cursor: pointer;
  transition: border-color .12s, background .12s;
}
.slot:hover { background: rgba(200,117,44,.14); border-color: rgba(200,117,44,.5); }
.slot.held { border-color: var(--ochre); background: rgba(200,117,44,.14); }
.slot .art { width: 74%; height: 74%; }
.slot .n { position: absolute; bottom: 1px; right: 4px; font-size: .6rem; color: var(--ochre); font-weight: 600; }
.slot .dur { position: absolute; left: 3px; right: 3px; bottom: 3px; height: 2px; background: rgba(0,0,0,.4); }
.slot .dur > i { display: block; height: 100%; }
.slot .acts {
  position: absolute; inset: auto 0 0 0; display: flex; opacity: 0; transition: opacity .12s;
  background: rgba(8,7,6,.9);
}
.slot:hover .acts { opacity: 1; }
.slot .acts button {
  flex: 1; padding: .16rem 0; font-size: .52rem; letter-spacing: .06em;
  border: none; background: none; color: var(--bone-dim);
}
.slot .acts button:hover { background: rgba(200,117,44,.35); color: var(--bone); }

/* needs + crops */
.needs { display: flex; flex-direction: column; flex: none; }
.need { display: flex; align-items: center; gap: .45rem; margin-top: .5rem; }
.need .g { width: 1rem; height: 1rem; flex: none; }
.need .l { font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(182,173,153,.6); width: 3.6rem; flex: none; }
.need .bar { flex: 1; }
.cap { font-size: .72rem; line-height: 1.4; margin: .18rem 0 0 1.45rem; }

.crops { overflow: hidden; flex: 0 1 auto; min-height: 0; }
.crop { margin-bottom: .55rem; display: grid; grid-template-columns: 1fr auto; gap: .1rem .5rem; }
.crop .cn { font-size: .78rem; color: var(--bone); }
.crop .ch { font-size: .64rem; color: var(--ochre); }
.crop .bar { grid-column: 1/-1; }
.crop .cs { grid-column: 1/-1; font-size: .62rem; color: rgba(182,173,153,.5); letter-spacing: .06em; }

@media (max-width: 1000px) {
  .craftlay { grid-template-columns: 8rem minmax(0,1fr); }
  .craftlay .detail { display: none; }
  .statlay { grid-template-columns: 12rem minmax(0,1fr); }
  .statlay .needcol { display: none; }
}

.meter { height: 3px; background: rgba(232,224,207,.12); margin-top: .3rem; }
.meter > i { display: block; height: 100%; background: var(--ochre); }

/* tribe + chronicle */
.member { display: flex; gap: .7rem; align-items: baseline; padding: .3rem .5rem; border-bottom: 1px solid rgba(232,224,207,.05); font-size: .84rem; }
.member .nm { min-width: 9rem; }
.member .rl { color: var(--ochre); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; min-width: 6rem; }
.member .st { color: var(--bone-dim); font-size: .76rem; flex: 1; }

.relrow { display: flex; justify-content: space-between; padding: .34rem .5rem; font-size: .84rem; border-bottom: 1px solid rgba(232,224,207,.05); }
.relrow .stand { letter-spacing: .1em; font-size: .72rem; text-transform: uppercase; }
.stand.war { color: var(--blood); }
.stand.hostile { color: #c4552e; }
.stand.wary { color: var(--bone-dim); }
.stand.warm, .stand.friendly, .stand.allied { color: var(--moss); }

.chron { max-height: 62vh; overflow-y: auto; padding-right: .6rem; }
.chron .ev { padding: .4rem .2rem; border-bottom: 1px solid rgba(232,224,207,.05); font-size: .86rem; line-height: 1.45; }
.chron .ev .dt { color: rgba(182,173,153,.55); font-size: .70rem; letter-spacing: .1em; text-transform: uppercase; display: block; }
.chron .ev.war { border-left: 2px solid var(--blood); padding-left: .6rem; }
.chron .ev.death { border-left: 2px solid #55202a; padding-left: .6rem; }
.chron .ev.politics { border-left: 2px solid var(--ochre-dim); padding-left: .6rem; }
.chron .ev.tech { border-left: 2px solid #4a6b8a; padding-left: .6rem; }
.chron .ev.life { border-left: 2px solid var(--moss); padding-left: .6rem; }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.filters button { padding: .32rem .7rem; font-size: .68rem; }
.filters button.on { background: rgba(200,117,44,.3); border-color: var(--ochre); }

/* ------------------------------------------------------------------- HUD */
#prompt {
  position: fixed; left: 50%; bottom: 22%; transform: translateX(-50%);
  z-index: 10; pointer-events: none; text-align: center;
  font-size: .88rem; letter-spacing: .06em; color: var(--bone);
  text-shadow: 0 2px 8px rgba(0,0,0,.9); opacity: 0; transition: opacity .12s;
}
#prompt b { color: var(--ochre); font-weight: 600; }
#prompt .sub2 { display: block; font-size: .74rem; color: var(--bone-dim); margin-top: .2rem; }

#toasts {
  position: fixed; left: 50%; top: 10%; transform: translateX(-50%);
  z-index: 12; pointer-events: none; text-align: center; width: min(560px, 80vw);
}
.toast {
  font-size: .90rem; letter-spacing: .02em; color: var(--bone);
  text-shadow: 0 2px 10px rgba(0,0,0,.95); margin-bottom: .35rem;
  opacity: 0; transform: translateY(-6px);
  animation: toastIn .3s ease forwards, toastOut .8s ease 4.2s forwards;
  line-height: 1.4;
}
.toast.warn { color: #e0a24a; }
.toast.bad { color: #d4665a; }
.toast.good { color: #a9c07a; }
@keyframes toastIn { to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-4px); } }

#subtitle {
  position: fixed; left: 50%; bottom: 9%; transform: translateX(-50%);
  z-index: 11; pointer-events: none; text-align: center; width: min(700px, 86vw);
  font-size: 1rem; color: var(--bone); text-shadow: 0 2px 10px rgba(0,0,0,.95);
  opacity: 0; transition: opacity .25s;
}
#subtitle .who { color: var(--ochre); letter-spacing: .1em; font-size: .74rem; text-transform: uppercase; display: block; }

#hudcanvas { position: fixed; inset: 0; z-index: 8; pointer-events: none; }

/* ---------------------------------------------------------------- death */
#deathscreen {
  position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center;
  background: rgba(10,2,2,.92); animation: fadeIn 3s ease forwards; opacity: 0;
}
@keyframes fadeIn { to { opacity: 1; } }
.dead-inner { text-align: center; }
#dead-title {
  font-family: var(--ui-font); font-size: 3rem; letter-spacing: .4em; text-indent: .4em;
  color: #8c1b16; margin-bottom: 1rem;
}
#dead-sub { color: var(--bone-dim); margin-bottom: 2.4rem; font-size: .95rem; line-height: 1.7; max-width: 520px; }

/* ---------------------------------------------------------------- debug */
#debug {
  position: fixed; top: 8px; left: 10px; z-index: 40;
  font-family: ui-monospace, Consolas, monospace; font-size: 11px;
  color: rgba(232,224,207,.75); text-shadow: 0 1px 3px #000; line-height: 1.45;
  pointer-events: none; white-space: pre;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,.3); }
::-webkit-scrollbar-thumb { background: rgba(200,117,44,.35); }
::-webkit-scrollbar-thumb:hover { background: rgba(200,117,44,.55); }
