/* In-game HUD: brush banner, toasts, crests, field manual, ensō minimap, makimono selection scroll, folding-fan command card.
   The HUD layer never takes pointer events itself; each piece takes them only over its painted shape (round discs, the fan's leaf). */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; zoom: var(--ui); }
#hud > * { position: absolute; }
.legible { text-shadow: 0 1px 2px rgba(0, 0, 0, .95), 0 0 10px rgba(0, 0, 0, .55); }

/* ---------------------------------------------------------------------------------------------- banner */
.banner { top: 4px; left: 50%; transform: translateX(-50%); height: 60px; padding: 0 56px 0 48px; display: flex; align-items: center; gap: 28px; white-space: nowrap;
  font-size: 16.5px; color: var(--paper-text); pointer-events: auto; }
.banner .stat { display: inline-flex; align-items: center; gap: 8px; }
.banner b { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.banner i { font-style: normal; color: var(--paper-dim); margin-left: -5px; font-size: .9em; }
.banner b.full { color: #f08a6e; }
.banner .icon { width: 22px; height: 22px; color: var(--washi-2); }
.banner .icon.gold { color: var(--kin-hi); filter: drop-shadow(0 0 4px rgba(236, 208, 138, .35)); }
.banner .sunicon { color: #f2c35a; } .banner .moonicon { color: #dfe6ff; }
.banner .sky b { font-weight: 400; color: var(--washi-2); font-size: .95em; }
.banner .folk .fk { font-family: 'Yuji Syuku', serif; font-size: 19px; color: var(--washi-2); line-height: 1; }
.banner .folk.none b { color: #f08a6e; }

.objective { top: 66px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; white-space: nowrap; font-size: 13.5px; color: var(--washi); pointer-events: none; }
.objective > span:last-child { text-shadow: 0 1px 2px rgba(0, 0, 0, .95), 0 0 12px rgba(0, 0, 0, .6); }
.objective .seal { --s: 24px; }

/* ---------------------------------------------------------------------------------------------- toasts: a fresh brush stroke each */
.toasts { position: fixed; z-index: 40; top: 100px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 40px 11px 30px; font-size: 14.5px; color: var(--paper-text); white-space: nowrap;
  animation: stroke-in .42s var(--ease-ink) both; transition: opacity .5s, transform .5s; }
.toast.out { opacity: 0; transform: translateY(-6px); }
.toast .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--washi-2); box-shadow: 0 0 0 2px rgba(0, 0, 0, .35); flex: none; }
.toast.warn .dot { background: var(--shu); box-shadow: 0 0 8px rgba(193, 57, 43, .8); }
.toast.good .dot { background: var(--kin-hi); box-shadow: 0 0 8px rgba(236, 208, 138, .7); }
/* a message about a place (a deposit found, a building finished, a field lost): click it and the camera goes there (view/ui/hud.js toast `at`) */
.toast.jump { cursor: pointer; }
.toast.jump .go { font-family: 'Yuji Syuku', serif; font-size: 13px; margin-left: 2px; padding: 1px 5px 2px; border-radius: 3px; color: var(--kin-hi); box-shadow: inset 0 0 0 1px rgba(236, 208, 138, .45); opacity: .8; }
.toast.jump:hover .go { opacity: 1; background: rgba(236, 208, 138, .14); }
.toast.jump:hover { filter: brightness(1.08); }
@keyframes stroke-in { from { clip-path: inset(0 100% 0 0); opacity: .4; } to { clip-path: inset(0 0 0 0); opacity: 1; } }

/* ---------------------------------------------------------------------------------------------- crests (top right) */
.crests { top: 12px; right: 16px; display: flex; gap: 12px; }
.crest { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; pointer-events: auto; color: var(--kin-hi);
  background: radial-gradient(circle at 35% 30%, #45332a, #150f0c 68%);
  box-shadow: 0 0 0 2px var(--kin), 0 0 0 4px rgba(18, 13, 11, .85), 0 0 0 5px rgba(201, 162, 74, .35), 0 6px 14px rgba(0, 0, 0, .55);
  transition: transform .18s var(--ease-ink), color .18s, box-shadow .18s; }
.crest .icon { width: 25px; height: 25px; }
.crest:hover { transform: rotate(-8deg) scale(1.08); color: #fff3d0; box-shadow: 0 0 0 2px var(--kin-hi), 0 0 0 4px rgba(18, 13, 11, .85), 0 0 18px rgba(236, 208, 138, .45), 0 6px 14px rgba(0, 0, 0, .55); }

/* ---------------------------------------------------------------------------------------------- field manual: a hanging scroll */
.manual { top: 74px; left: 18px; width: 540px; pointer-events: auto; animation: unroll .45s var(--ease-ink) both; }
.manual .roller { height: 15px; margin: 0 -10px; border-radius: 8px; background: linear-gradient(180deg, #5c3a26, #2a170e 55%, #120a06);
  box-shadow: inset 0 1px 0 rgba(255, 220, 170, .25), 0 3px 6px rgba(0, 0, 0, .5); position: relative; }
.manual .roller::before, .manual .roller::after { content: ""; position: absolute; top: -2px; width: 12px; height: 19px; border-radius: 6px; background: linear-gradient(180deg, var(--kin-hi), var(--kin-lo)); }
.manual .roller::before { left: -8px; } .manual .roller::after { right: -8px; }
.manual .sheet { padding: 16px 26px 14px; font-size: 12.5px; margin-top: -3px; margin-bottom: -3px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 26px; }
.manual .sheet > h3 { grid-column: 1 / -1; }
.manual h3 { margin: 0 0 8px; font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.manual .mclose { margin-left: auto; width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: var(--washi-faint); font: 700 15px/1 var(--sans, sans-serif); cursor: pointer; display: grid; place-items: center; transition: background .12s, color .12s; }
.manual .mclose:hover { background: rgba(120, 30, 20, .14); color: var(--shu-deep); }
.manual h3 .kanji { color: var(--shu-deep); font-size: 24px; }
.manual h4 { margin: 6px 0 3px; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--shu-deep); font-weight: 800; }
.manual .mrow { display: flex; justify-content: space-between; gap: 10px; padding: 1.5px 0; color: var(--washi-ink); }
.manual .mrow > span:last-child { text-align: right; color: var(--washi-faint); }
.manual .keys { display: inline-flex; gap: 3px; flex: none; }
@keyframes unroll { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 -20px 0); } }

/* ---------------------------------------------------------------------------------------------- ensō minimap */
.mapwrap { left: 10px; bottom: 8px; width: 296px; height: 296px; }
/* the map is painted on a round shikishi board: washi with a gilt rim, the ensō brushed over the seam */
.mapwrap::before { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: url("img/washi.svg") 0 0 / 200px, radial-gradient(circle, var(--washi) 60%, var(--washi-2) 86%, var(--washi-3));
  box-shadow: 0 0 0 2px var(--kin-lo), 0 0 0 4px rgba(18, 13, 11, .75), 0 14px 30px rgba(0, 0, 0, .55); }
.mapdisc { position: absolute; left: 30px; top: 30px; width: 236px; height: 236px; border-radius: 50%; overflow: hidden; pointer-events: auto; cursor: crosshair;
  background: var(--washi-2); box-shadow: 0 10px 26px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(0, 0, 0, .25); }
.mapdisc canvas { display: block; }
.mapenso { position: absolute; left: 10px; top: 10px; width: 276px; height: 276px; pointer-events: none; }
.mapenso svg { display: block; width: 100%; height: 100%; }
.mapwrap .dir { position: absolute; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 14px; color: var(--washi-ink); background: var(--washi); box-shadow: 0 0 0 1.5px var(--kin-lo); pointer-events: none; }
.mapwrap .n { left: 50%; top: 1px; transform: translateX(-50%); color: #fff2e4; background: var(--shu); box-shadow: 0 0 0 1.5px var(--shu-deep); }
.mapwrap .s { left: 50%; bottom: 1px; transform: translateX(-50%); }
.mapwrap .e { right: 1px; top: 50%; transform: translateY(-50%); }
.mapwrap .w { left: 1px; top: 50%; transform: translateY(-50%); }

/* ---------------------------------------------------------------------------------------------- makimono selection scroll */
.selscroll { bottom: 14px; left: 50%; transform: translateX(-50%); width: clamp(300px, calc(100vw / var(--ui) - 650px), 600px); display: flex; align-items: center; pointer-events: auto; }
.selscroll .rod { flex: none; width: 17px; height: 152px; border-radius: 9px; position: relative; z-index: 1;
  background: linear-gradient(90deg, #170c07, #5b3923 30%, #7a5032 45%, #3a2216 72%, #120905); box-shadow: 0 4px 10px rgba(0, 0, 0, .55); }
.selscroll .rod::before, .selscroll .rod::after { content: ""; position: absolute; left: -2px; width: 21px; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--kin-lo), var(--kin-hi) 45%, var(--kin-lo)); }
.selscroll .rod::before { top: -6px; } .selscroll .rod::after { bottom: -6px; }
.selscroll .paper { flex: 1; height: 126px; margin: 0 -4px; padding: 16px 26px 14px; box-sizing: border-box; }
.selscroll .pane { height: 100%; }
.selscroll .paper { container-type: inline-size; overflow: hidden; }
.pane.one { display: flex; gap: 18px; align-items: center; }
.portrait { width: 80px; height: 80px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--paper-text);
  background: radial-gradient(circle at 38% 32%, #3b2c24, var(--sumi) 70%); box-shadow: 0 0 0 3px var(--shu), 0 0 0 5px var(--washi), 0 0 0 6.5px var(--kin-lo), 0 6px 12px rgba(0, 0, 0, .35); }
.portrait .kanji { font-size: 44px; transform: translateY(2px); }
.portrait.foe { box-shadow: 0 0 0 3px var(--ai), 0 0 0 5px var(--washi), 0 0 0 6.5px var(--kin-lo), 0 6px 12px rgba(0, 0, 0, .35); }
.pane.one .body { flex: 1; min-width: 0; }
.pane.one h3 { margin: 0; font-size: 20px; font-weight: 800; color: var(--washi-ink); display: flex; align-items: baseline; gap: 10px; }
.pane.one h3 em { font-style: normal; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ai); font-weight: 800; }
.pane.one .role { margin: 1px 0 5px; font-size: 13px; color: var(--washi-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane.one .stats { display: flex; gap: 16px; font-size: 13.5px; font-weight: 600; color: var(--washi-ink); }
.pane.one .stats b { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--washi-faint); font-weight: 800; margin-right: 3px; }
.hprow { display: flex; align-items: center; gap: 12px; margin-top: 7px; }
.hp { flex: 1; height: 17px; background: rgba(42, 31, 24, .22); -webkit-mask: var(--ink) 0 0 / 100% 100% no-repeat; mask: var(--ink) 0 0 / 100% 100% no-repeat; }
.hp > i { display: block; height: 100%; width: 100%; transition: width .3s var(--ease-ink), background .3s; }
.hptext { font-size: 13px; font-weight: 600; color: var(--washi-ink); font-variant-numeric: tabular-nums; min-width: 82px; text-align: right; }
.pane.many h3 { margin: 0 0 8px; font-size: 14.5px; font-weight: 800; color: var(--washi-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane.many .grid { display: flex; flex-wrap: wrap; gap: 6px 5px; max-height: 70px; overflow: hidden; }
.mini { width: 31px; height: 31px; border-radius: 50%; position: relative; display: grid; place-items: center; color: var(--paper-text); background: radial-gradient(circle at 38% 32%, #3b2c24, var(--sumi) 72%); }
.mini::before { content: ""; position: absolute; inset: -2.5px; border-radius: 50%; background: conic-gradient(var(--hc, var(--matsuba)) calc(var(--hp, 1) * 360deg), rgba(42, 31, 24, .25) 0);
  -webkit-mask: radial-gradient(circle, transparent 15px, #000 15.5px); mask: radial-gradient(circle, transparent 15px, #000 15.5px); }
.mini .kanji { font-size: 16px; }
.mini:hover { transform: scale(1.12); }
.mini.foe { background: radial-gradient(circle at 38% 32%, #2c3550, #10131d 72%); }
.pane.many .more { align-self: center; font-weight: 800; color: var(--washi-faint); font-size: 13px; }

/* a narrow scroll (small window, large interface size) compacts its content instead of spilling it under the fan */
@container (max-width: 440px) {
  .portrait { width: 58px; height: 58px; } .portrait .kanji { font-size: 32px; }
  .pane.one { gap: 13px; }
  .pane.one h3 { font-size: 17px; } .pane.one .role { display: none; }
  .pane.one .stats { flex-wrap: wrap; gap: 2px 11px; font-size: 12.5px; }
  .hptext { min-width: 0; font-size: 12px; }
}

/* ---------------------------------------------------------------------------------------------- the folding fan */
.fan { right: 0; bottom: 0; pointer-events: none; }
.fanart { position: absolute; inset: 0; overflow: visible; filter: drop-shadow(-4px -2px 10px rgba(0, 0, 0, .45)); }
.fanart .leaf, .fanart .ribs, .fanart .kaname { pointer-events: visiblePainted; }
.fanart .pleat { stroke: rgba(110, 80, 40, .32); stroke-width: .8; }
.fanart .pleat.a { fill: url(#pleatA); } .fanart .pleat.b { fill: url(#pleatB); }
.fanart .rib { fill: url(#lacquer); stroke: rgba(0, 0, 0, .45); stroke-width: .6; }
.fanart .rib.guard { fill: #2a160d; }
.fanart .waves path { fill: none; stroke: rgba(40, 52, 92, .2); stroke-width: 1.1; }
.fanart .kirikane polygon { fill: var(--kin); }
.fanart .kaname { fill: url(#lacquer); stroke: var(--kin); stroke-width: 2.5; }
.fanart .kaname-in { fill: var(--kin-hi); }
.fan button { position: absolute; pointer-events: auto; }
.crestbtn { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; color: var(--paper-text);
  background: radial-gradient(circle at 35% 28%, #4a382c, #140e0b 66%); box-shadow: 0 0 0 2px var(--kin), 0 0 0 4.5px rgba(18, 13, 11, .9), 0 6px 14px rgba(0, 0, 0, .5);
  transition: transform .16s var(--ease-ink), filter .2s; }
.crestbtn .kanji { font-size: 31px; transform: translateY(-5px); }
.crestbtn .cost { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--kin-hi); letter-spacing: .04em; }
.crestbtn kbd { position: absolute; top: -5px; right: -5px; }
.crestbtn .cool { position: absolute; inset: 0; transform: rotate(-90deg); pointer-events: none; }
.crestbtn .cool circle { fill: none; stroke: var(--kin-hi); stroke-width: 2.5; stroke-dasharray: calc(var(--a, 1) * 194.8px) 194.8px; opacity: 0; transition: opacity .2s; }
.crestbtn.dis .cool circle { opacity: .9; }
.crestbtn:hover { transform: scale(1.08); }
.crestbtn:active { transform: scale(.96); }
.crestbtn.dis { filter: grayscale(.75) brightness(.72); }
.seal.order { transition: transform .16s var(--ease-ink), filter .2s; }
.seal.order:hover { transform: scale(1.1) rotate(-6deg); }
.seal.order.dis { filter: grayscale(.85) brightness(.75); }
.seal.order.on { background: radial-gradient(circle at 35% 30%, #4a5a3a, #26321f 58%, #141b10); color: var(--kin-hi); box-shadow: inset 0 0 0 2px rgba(236, 208, 138, .4), inset 0 0 0 4px #26321f, 0 0 0 2px var(--kin-lo), 0 2px 8px rgba(0, 0, 0, .45); }      /* hidden in the grass: pressing stands them up */
/* the fan's outer arc (2026-11-20): the stance of the selected soldiers (three ink seals) and the formations (six smaller ones), shown only with soldiers selected */
.seal.outer { transition: transform .16s var(--ease-ink), filter .2s, opacity .2s; }
.seal.outer.stance { background: radial-gradient(circle at 35% 30%, #4a3a30, var(--sumi-3) 55%, var(--sumi)); color: var(--washi); box-shadow: inset 0 0 0 2px rgba(236, 208, 138, .3), inset 0 0 0 4px var(--sumi-3), 0 2px 6px rgba(0, 0, 0, .4); }
.seal.outer.shape { background: radial-gradient(circle at 35% 30%, #3c4a5c, #24303e 58%, #151c26); color: #e9e2d0; box-shadow: inset 0 0 0 2px rgba(200, 214, 236, .3), inset 0 0 0 3.5px #24303e, 0 2px 6px rgba(0, 0, 0, .4); }
.seal.outer.on { color: var(--kin-hi); box-shadow: inset 0 0 0 2px rgba(236, 208, 138, .55), inset 0 0 0 4px var(--shu-deep), 0 0 0 2px var(--kin), 0 2px 8px rgba(0, 0, 0, .45); }
.seal.outer.mixed { box-shadow: inset 0 0 0 2px rgba(236, 208, 138, .4), inset 0 0 0 4px var(--sumi-3), 0 0 0 1.5px rgba(236, 208, 138, .5), 0 2px 6px rgba(0, 0, 0, .4); }
.seal.outer.dis { filter: grayscale(.85) brightness(.6); }
.seal.outer.gone { opacity: 0; pointer-events: none; transform: scale(.6); }
.seal.outer:not(.dis):not(.gone):hover { transform: scale(1.08); }
.tip .hidewhy { margin: 0 0 3px; padding-left: 12px; font-size: 12.5px; position: relative; }
.tip .hidewhy::before { content: ""; position: absolute; left: 1px; top: .62em; width: 7px; height: 2px; border-radius: 1px; background: var(--shu-deep); opacity: .7; }
.qtok { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--paper-dim); background: rgba(18, 13, 11, .55); box-shadow: inset 0 0 0 1px rgba(201, 162, 74, .35); }
.qtok .kanji { font-size: 13px; }
.qtok.on { color: var(--paper-text); background: radial-gradient(circle at 38% 32%, #3b2c24, var(--sumi) 72%); box-shadow: 0 0 0 1.5px var(--kin-lo); }
.qtok.on::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; background: conic-gradient(var(--kin-hi) calc(var(--p, 0) * 360deg), transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 13px, #000 13.5px); mask: radial-gradient(circle, transparent 13px, #000 13.5px); }
.qtok.on:hover { box-shadow: 0 0 0 2px var(--shu); }

/* ---------------------------------------------------------------------------------------------- box selection, perf readout */
#selbox { position: fixed; z-index: 11; pointer-events: none; display: none; border: 1.5px dashed rgba(246, 231, 168, .9); border-radius: 7px; background: rgba(246, 231, 168, .08); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
#dbg { position: fixed; right: 16px; top: 72px; margin: 0; z-index: 12; font: 11px/1.5 ui-monospace, Menlo, monospace; color: var(--paper-dim); white-space: pre; text-align: right; pointer-events: none; text-shadow: 0 1px 2px #000; }

@media (max-width: 1100px) { .objective { display: none; } .banner { gap: 18px; padding: 0 40px; font-size: 15px; } }

/* the verdict and the pause scroll own the screen: the HUD steps back */
body[data-state="over"] #hud { opacity: .18; transition: opacity 1.2s; }
body[data-state="paused"] #hud { opacity: .55; }
