/* The front end: the gate, the letterbox, narration cards and spoken lines, the skip button, the veil between routes and
   the battle's frame. The War Hall's menu and its panels add their own rules below (menu.js). docs/front-end.md. */
:root{
  --ink:#140f0a; --ink2:#0e0a07; --paper:#ecdcb6; --sheet:#f3e6c6; --cinnabar:#b7322c; --gold:#d8b46a; --jade:#4e7d6b; --frost:#a9c6c0;
  --serif:"EB Garamond","Iowan Old Style","Palatino Linotype",Georgia,serif; --brush:"LXGW WenKai TC","Noto Serif TC","PingFang TC",serif;
  --ts:1; --lbd:1.2s;
  --bar:clamp(0px, calc((100vh - 100vw / 2.35) / 2), 13vh);
  --safe-l:env(safe-area-inset-left,0px); --safe-r:env(safe-area-inset-right,0px); --safe-b:env(safe-area-inset-bottom,0px); --safe-t:env(safe-area-inset-top,0px);
}
html.ts-s{--ts:.86} html.ts-l{--ts:1.2}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--ink);color:var(--paper);overflow:hidden;font-family:var(--serif);-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none}
button{font:inherit;color:inherit}
#stage{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none;outline:none}

/* ---------------------------------------------------------------- the letterbox: 2.35:1 bars */
#letterbox{position:fixed;inset:0;pointer-events:none;z-index:5}
#letterbox .lb{position:absolute;left:0;right:0;height:var(--bar);background:#0a0705;transition:transform var(--lbd) cubic-bezier(.6,0,.2,1)}
#letterbox .top{top:0;transform:translateY(-101%)} #letterbox .bot{bottom:0;transform:translateY(101%)}
#letterbox.on .lb{transform:none}
#letterbox .lb::after{content:"";position:absolute;left:0;right:0;height:22px;pointer-events:none}
#letterbox .top::after{bottom:-22px;background:linear-gradient(#0a070566,#0a070500)} #letterbox .bot::after{top:-22px;background:linear-gradient(#0a070500,#0a070566)}

/* ---------------------------------------------------------------- narration cards and spoken lines */
#cards,#subs{position:fixed;left:0;right:0;pointer-events:none;z-index:6}
#cards{top:0;bottom:0}
.card{position:absolute;left:50%;top:54%;width:min(78vw,1100px);transform:translate(-50%,-50%);text-align:center;font-style:italic;font-weight:400;
  font-size:calc(clamp(17px, 2.25vw, 34px) * var(--ts));line-height:1.35;letter-spacing:.05em;color:#f4ead2;
  text-shadow:0 0 2px #0a0705cc,0 0 14px #0a0705b3,0 0 34px #0a070580;opacity:0;filter:blur(7px);transition:opacity 1.3s ease,filter 1.3s ease,letter-spacing 2.2s cubic-bezier(.2,.6,.2,1)}
.card.on{opacity:1;filter:blur(0);letter-spacing:.03em}
.card.off{opacity:0;filter:blur(5px);transition-duration:.9s}
.card.low{top:auto;bottom:calc(var(--bar) + 7vh);transform:translateX(-50%)}
.card.dark{color:#1d140d;text-shadow:0 0 3px #f3e6c6cc,0 0 16px #f3e6c699}
#subs{bottom:0;height:max(var(--bar), 64px);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 6vw calc(var(--safe-b) * .5)}
.line{position:absolute;max-width:min(86vw,1050px);text-align:center;font-size:calc(clamp(15px, 1.75vw, 25px) * var(--ts));line-height:1.3;color:#f1e6cb;
  text-shadow:0 0 2px #0a0705,0 0 12px #0a0705cc;opacity:0;transform:translateY(5px);transition:opacity .7s ease,transform .9s ease}
.line.on{opacity:1;transform:none} .line.off{opacity:0;transform:translateY(-3px);transition-duration:.55s}
.line.narr .txt{font-style:italic;letter-spacing:.03em}
.line.speech{display:flex;align-items:center;justify-content:center;gap:.7em}
.line .who{display:inline-flex;align-items:center;gap:.45em;font-variant:small-caps;letter-spacing:.12em;font-size:.78em;color:#d9c6a0;white-space:nowrap}
.line .who b{display:inline-grid;place-items:center;width:1.7em;height:1.7em;background:var(--cinnabar);color:#f6e9cf;font-family:var(--brush);font-weight:700;font-size:1.05em;letter-spacing:0;border-radius:2px;box-shadow:inset 0 0 0 1.5px #f6e9cf55}
.line .who img.seal{width:1.75em;height:1.75em;display:block;filter:drop-shadow(0 0 3px #0a0705aa)}
.line .txt::before{content:"“"} .line .txt::after{content:"”"} .line.narr .txt::before,.line.narr .txt::after{content:none}
@media (max-height:500px){ .line{max-width:80vw} #subs{height:max(var(--bar), 52px)} }

/* ---------------------------------------------------------------- skip */
#skip{position:fixed;top:calc(max(var(--bar), 0px) * .5 + var(--safe-t));right:calc(18px + var(--safe-r));transform:translateY(-50%);z-index:8;border:0;background:#140f0a8c;color:#eadcbc;
  padding:.45em .9em .5em 1em;border-radius:999px;font-variant:small-caps;letter-spacing:.14em;font-size:15px;cursor:pointer;opacity:0;pointer-events:none;transition:opacity .4s ease;backdrop-filter:blur(3px)}
#skip span{margin-left:.45em;font-size:1.2em;line-height:0}
#skip.on{opacity:1;pointer-events:auto} #skip:hover,#skip:focus-visible{background:#b7322ccc;outline:none}
@media (max-height:500px){ #skip{top:calc(10px + var(--safe-t));transform:none} }

/* ---------------------------------------------------------------- the gate: loading, and the tap that lets the sound in */
#gate{position:fixed;inset:0;z-index:20;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2.2vh;
  background:radial-gradient(ellipse at 50% 45%,#211912 0%,#120d09 55%,#0a0705 100%);transition:opacity 1.1s ease}
#gate.gone{opacity:0;pointer-events:none}
#gate .gmark canvas{width:76px;height:76px;display:block;animation:breathe 3.6s ease-in-out infinite}
#gate.title .gmark{display:none}
#gate .gtitle{display:flex;flex-direction:column;align-items:center;gap:.4vh}
#gate .gtitle[hidden]{display:none}
#gate .gtitle canvas{width:min(34vh,240px);height:min(34vh,240px)}
#gate .gname{font-variant:small-caps;letter-spacing:.62em;margin-right:-.62em;font-size:clamp(20px,3.6vh,34px);color:#efe2c2}
#gate .gby{font-style:italic;font-size:clamp(12px,1.9vh,16px);color:#b39f7c;letter-spacing:.08em;margin-top:.6vh}
#gate .gbegin{margin-top:3vh;border:0;background:none;cursor:pointer;font-style:italic;font-size:clamp(17px,2.6vh,22px);letter-spacing:.32em;margin-right:-.32em;color:#efe2c2;padding:.8em 1.6em;position:relative}
#gate .gbegin span{animation:pulse 2.8s ease-in-out infinite}
#gate .gbegin::after{content:"";position:absolute;left:22%;right:22%;bottom:.45em;height:2px;background:linear-gradient(90deg,#b7322c00,#b7322c,#b7322c00);opacity:.0;transition:opacity .4s ease}
#gate .gbegin:hover::after,#gate .gbegin:focus-visible::after{opacity:1} #gate .gbegin:focus-visible{outline:none}
#gate .gbegin:disabled{cursor:progress} #gate .gbegin:disabled span{animation:none;opacity:.35}
#gate .gnote{font-size:13px;letter-spacing:.2em;font-variant:small-caps;color:#8f7d61}
#gate .gload{width:150px;height:2px;background:#ffffff12;border-radius:2px;overflow:hidden;transition:opacity .6s ease}
#gate .gload i{display:block;height:100%;width:0;background:linear-gradient(90deg,#b7322c,#d8b46a);transition:width .35s ease}
#gate.ready .gload{opacity:0}
#gate.waiting .gbegin span{animation:none;opacity:.55}
#gate.title .gname{animation:rise 1.3s ease 1.5s both} #gate.title .gby{animation:rise 1.3s ease 1.9s both} #gate.title .gbegin{animation:rise 1.1s ease 2.3s both}
@keyframes rise{from{opacity:0;transform:translateY(6px);filter:blur(3px)}to{opacity:1;transform:none;filter:none}}
@keyframes breathe{0%,100%{transform:scale(1);filter:brightness(.92)}50%{transform:scale(1.045);filter:brightness(1.08)}}
@keyframes pulse{0%,100%{opacity:.55}50%{opacity:1}}

/* ---------------------------------------------------------------- the veil between routes, and the battle's frame */
#veil{position:fixed;inset:0;z-index:15;pointer-events:none;opacity:0;transition:opacity .8s ease;display:grid;place-items:center}
#veil .vink{position:absolute;inset:0;background:var(--ink2)}
#veil .vload{position:relative;width:120px;height:2px;background:#ffffff10;border-radius:2px;overflow:hidden;opacity:0;transition:opacity .4s ease}
#veil .vload i{position:absolute;top:0;bottom:0;width:40%;background:linear-gradient(90deg,#b7322c00,#b7322c,#d8b46a,#d8b46a00);animation:slide 1.4s ease-in-out infinite}
#veil.on{opacity:1;pointer-events:auto} #veil.busy .vload{opacity:1}
@keyframes slide{0%{left:-40%}100%{left:100%}}
#battle{position:fixed;inset:0;width:100%;height:100%;border:0;z-index:12;background:var(--ink);opacity:0;transition:opacity .9s ease}
#battle.on{opacity:1}

/* ---------------------------------------------------------------- the menu's frame (menu.js styles its contents) */
#menu{position:fixed;inset:0;z-index:9;pointer-events:none}
#menu>*{pointer-events:auto}
#panel{position:fixed;inset:0;z-index:10}

/* ---------------------------------------------------------------- turn the phone; errors */
#turn{position:fixed;inset:0;z-index:30;display:none;place-items:center;text-align:center;background:#0e0a07f2;padding:8vw}
#turn .ph{font-size:46px;display:inline-block;animation:turn 2.4s ease-in-out infinite;color:#d8b46a}
#turn p{font-size:18px;line-height:1.5;color:#e6d8b8} #turn small{color:#9c8a6c}
#turn button{margin-top:18px;background:none;border:1px solid #ecdcb655;border-radius:999px;padding:.5em 1.4em;color:#ecdcb6;font-style:italic;cursor:pointer}
html.portrait #turn{display:grid} html.portrait.turnok #turn{display:none}
@keyframes turn{0%,30%{transform:rotate(0)}60%,100%{transform:rotate(-90deg)}}
#err{position:fixed;inset:0;z-index:40;display:grid;place-items:center;padding:10vw;background:var(--ink);color:#ecdcb6;font-size:18px;line-height:1.5;text-align:center}
#err[hidden]{display:none}

/* ---------------------------------------------------------------- reduced motion */
html.rm *{animation-duration:.01s !important;animation-iteration-count:1 !important}
html.rm .card,html.rm .line{transition-duration:.25s !important;filter:none !important}

/* ================================================================ the War Hall: the main page (menu.js)
   The menu on the left over a dark gradient: the brushed 將 and GENERAL, the items as brushed glyphs with English
   labels, a cinnabar brush stroke under the focused one. Sheets of paper unroll over the dimmed hall for Settings and a
   chapter's card; Credits is a hanging scroll; the Chapters' seals stand over the realm map on the far wall. */
.hm{--hmw:min(36vw,440px);--gl:clamp(34px,6.2vh,50px);--fs:calc(clamp(16px,2.55vh,21px) * var(--ts))}
.hm .hm-shade{position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,#0a0705f2 0%,#0a0705d9 calc(var(--hmw) * .55),#0a070580 calc(var(--hmw) * 1.02),#0a070500 calc(var(--hmw) * 1.55));opacity:0;transition:opacity 1.6s ease}
.hm .hm-col{position:absolute;left:calc(clamp(18px,4.2vw,64px) + var(--safe-l));top:0;bottom:0;width:calc(var(--hmw) - clamp(18px,4.2vw,64px));display:flex;flex-direction:column;justify-content:center;gap:clamp(8px,2.6vh,26px);padding:calc(var(--safe-t) + 2vh) 0 calc(var(--safe-b) + 2vh);pointer-events:none}
.hm .hm-col>*{pointer-events:auto}
.hm.in .hm-shade{opacity:1}
.hm.away .hm-col{opacity:0;transform:translateX(-14px);pointer-events:none}
.hm.away .hm-col>*{pointer-events:none}
.hm.out .hm-col,.hm.out .hm-shade{opacity:0;transition-duration:.6s}
.hm .hm-col{transition:opacity .7s ease,transform .7s ease}
/* the title */
.hm-title{display:flex;flex-direction:column;align-items:flex-start;gap:.2vh;opacity:0;transform:translateY(6px);transition:opacity 1.4s ease .2s,transform 1.4s ease .2s}
.hm.in .hm-title{opacity:1;transform:none}
.hm-jiang{width:clamp(64px,15vh,128px);height:clamp(64px,15vh,128px);margin-left:-.5vh;filter:drop-shadow(0 0 14px #0a0705)}
.hm-name{font-variant:small-caps;letter-spacing:.56em;font-size:clamp(15px,2.6vh,22px);color:#eadcbc;margin-top:-.4vh;text-shadow:0 0 12px #0a0705}
/* the items */
.hm-items{display:flex;flex-direction:column;align-items:flex-start;gap:clamp(0px,.5vh,6px)}
.hm-item{position:relative;display:flex;align-items:center;gap:clamp(10px,1.5vw,16px);border:0;background:none;padding:clamp(3px,.75vh,8px) 34px clamp(3px,.75vh,8px) 0;cursor:pointer;text-align:left;color:#e6d6b2;opacity:0;transform:translateX(-8px);transition:opacity .9s ease,transform .9s ease,color .3s ease;outline:none;-webkit-tap-highlight-color:transparent}
.hm.in .hm-item{opacity:.86;transform:none}
.hm.in .hm-item:nth-child(1){transition-delay:.35s}.hm.in .hm-item:nth-child(2){transition-delay:.45s}.hm.in .hm-item:nth-child(3){transition-delay:.55s}
.hm.in .hm-item:nth-child(4){transition-delay:.65s}.hm.in .hm-item:nth-child(5){transition-delay:.75s}.hm.in .hm-item:nth-child(6){transition-delay:.85s}
.hm.in .hm-item.on{opacity:1;color:#f6ebd2;transition-delay:0s}
.hm-item .g{width:var(--gl);height:var(--gl);flex:none;filter:drop-shadow(0 0 6px #0a0705);transition:transform .45s cubic-bezier(.2,.7,.2,1),filter .45s ease}
.hm-item.on .g{transform:scale(1.07);filter:drop-shadow(0 0 6px #0a0705) drop-shadow(0 0 10px #d8b46a40)}
.hm-item .lab{position:relative;z-index:1;font-size:var(--fs);letter-spacing:.06em;line-height:1.15;text-shadow:0 0 8px #0a0705,0 0 2px #0a0705}
.hm-item .lab small{display:block;font-size:.74em;font-style:italic;letter-spacing:.03em;color:#bfa985;margin-top:.15em}
.hm-item .stroke{position:absolute;left:calc(var(--gl) * .55);right:-6px;bottom:calc(clamp(3px,.75vh,8px) - .32em);height:clamp(16px,2.9vh,26px);background:var(--stroke) no-repeat left center/100% 100%;opacity:.95;clip-path:inset(0 100% 0 0);transition:clip-path .16s ease}
.hm-item.on .stroke{clip-path:inset(0 0 0 0);transition:clip-path .5s cubic-bezier(.3,.6,.2,1)}
.hm-foot{font-style:italic;font-size:clamp(11px,1.7vh,14px);letter-spacing:.08em;color:#9c8866;opacity:0;transition:opacity 1.6s ease 1s}
.hm.in .hm-foot{opacity:1}
/* sheets of paper: rollers top and bottom, the paper unrolling between them */
.hm-panel{position:fixed;inset:0;display:grid;place-items:center;padding:calc(10px + var(--safe-t)) calc(14px + var(--safe-r)) calc(10px + var(--safe-b)) calc(14px + var(--safe-l));pointer-events:none}
.hm-panel>*{pointer-events:auto}
.hm-sheet{position:relative;color:#20170f;background:radial-gradient(ellipse at 30% 20%,#f6ead0 0%,#f1e3c3 45%,#e7d4ac 100%);padding:clamp(14px,3vh,26px) clamp(18px,3vw,34px);box-shadow:0 22px 50px #000000a6,0 0 0 1px #3b241422 inset;clip-path:inset(0 0 100% 0);transition:clip-path .7s cubic-bezier(.5,0,.2,1)}
.hm-sheet::before,.hm-sheet::after{content:"";position:absolute;left:-10px;right:-10px;height:12px;border-radius:6px;background:linear-gradient(#5b3a22,#2b1a0d 60%,#1a0f07);box-shadow:0 2px 6px #00000066}
.hm-sheet::before{top:-6px}.hm-sheet::after{bottom:-6px}
.hm-panel.in .hm-sheet,.hm-confirm.in .hm-sheet{clip-path:inset(-14px -14px -14px -14px)}
.hm-panel.out .hm-sheet,.hm-confirm.out .hm-sheet{clip-path:inset(0 0 100% 0);transition-duration:.35s}
.hm-sheet h2{margin:0;font-weight:600;font-size:clamp(19px,3.4vh,26px);letter-spacing:.08em}
.hm-rule{display:block;width:min(100%,360px);height:14px;margin:4px 0 10px -4px;opacity:.9}
.hm-x{position:absolute;top:6px;right:8px;width:38px;height:38px;border:0;border-radius:50%;background:none;color:#5a4630;font-size:26px;line-height:1;cursor:pointer;display:grid;place-items:center}
.hm-x:hover,.hm-x:focus-visible{background:#b7322c1f;color:#b7322c;outline:none}
.hm-btn{border:1px solid #3b2c1c;background:#2a1d12;color:#f3e6c6;border-radius:3px;padding:.5em 1.1em;font-size:calc(15px * var(--ts));letter-spacing:.04em;cursor:pointer;transition:background .2s ease,color .2s ease,box-shadow .2s ease}
.hm-btn:hover,.hm-btn:focus-visible{background:#b7322c;border-color:#8f1d18;outline:none;box-shadow:0 0 0 3px #b7322c33}
.hm-btn.ghost{background:transparent;color:#3b2c1c;border-color:#3b2c1c66}
.hm-btn.ghost:hover,.hm-btn.ghost:focus-visible{background:#3b2c1c;color:#f3e6c6}
.hm-btn.danger:hover,.hm-btn.danger:focus-visible{background:#8f1d18;border-color:#8f1d18}
.hm-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
/* the confirm */
.hm-confirm{position:fixed;inset:0;display:grid;place-items:center;background:#0a07058c;opacity:0;transition:opacity .3s ease;z-index:2}
.hm-confirm.in{opacity:1}.hm-confirm.out{opacity:0}
.hm-ask{width:min(440px,92vw)}
.hm-ask p{margin:6px 0 14px;font-size:calc(16px * var(--ts));line-height:1.4;color:#4a3a28}
/* Settings */
.hm-settings{width:min(700px,94vw);max-height:calc(100vh - 34px);overflow:auto}
.hm-head{display:flex;align-items:center;gap:12px}
.hm-head .g{width:44px;height:44px;filter:brightness(.25) sepia(.4)}
.hm-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px 26px}
.hm-f{display:flex;flex-direction:column;gap:6px}
.hm-f.wide{grid-column:1 / -1}
.hm-f label,.hm-f .lbl{font-variant:small-caps;letter-spacing:.12em;font-size:calc(14px * var(--ts));color:#5a4630}
.hm-f input[type=range]{width:100%;accent-color:#b7322c;height:22px;outline:none}
.hm-f input[type=range]:focus-visible{box-shadow:0 0 0 2px #f1e3c3,0 0 0 4px #b7322c88;border-radius:3px}
.hm-f.hm-row{flex-direction:row;justify-content:flex-start;margin-top:4px}
.hm-seg{display:flex;gap:6px;flex-wrap:wrap}
.hm-seg button{border:1px solid #3b2c1c55;background:transparent;border-radius:3px;padding:.38em .9em;cursor:pointer;color:#3b2c1c;text-align:left;font-size:calc(15px * var(--ts));display:flex;flex-direction:column}
.hm-seg button small{font-size:.78em;font-style:italic;color:#6b5a42}
.hm-seg button[aria-checked="true"]{background:#2a1d12;color:#f3e6c6;border-color:#2a1d12}.hm-seg button[aria-checked="true"] small{color:#d8c7a2}
.hm-seg button:focus-visible{outline:2px solid #b7322c;outline-offset:1px}
/* Credits: a hanging scroll on the left while the camera walks the banners */
.creditp{place-items:center start;padding-left:calc(clamp(18px,5vw,72px) + var(--safe-l))}
.hm-credits{position:relative;width:min(340px,40vw);text-align:center;color:#eadcbc;padding:clamp(14px,4vh,40px) 10px;background:linear-gradient(90deg,#0a070500,#0a0705b3 20%,#0a0705b3 80%,#0a070500);opacity:0;transform:translateY(10px);transition:opacity 1.2s ease,transform 1.2s ease}
.creditp.in .hm-credits{opacity:1;transform:none}.creditp.out .hm-credits{opacity:0;transition-duration:.4s}
.hm-credits .hm-jiang{width:clamp(56px,12vh,96px);height:clamp(56px,12vh,96px);margin:0 auto}
.hm-credits .hm-name{margin:0 0 .6vh .56em}
.hm-credits .hm-rule{margin:6px auto 12px}
.hm-credits .hm-x{color:#d8c7a2;top:0;right:0}
.hm-credits dl{margin:0;display:flex;flex-direction:column;gap:clamp(8px,2.2vh,18px)}
.hm-credits dt{font-variant:small-caps;letter-spacing:.18em;font-size:calc(clamp(11px,1.8vh,14px) * var(--ts));color:#a8916c}
.hm-credits dd{margin:.2em 0 0;font-size:calc(clamp(16px,2.8vh,22px) * var(--ts));letter-spacing:.04em}
.hm-credits dd i{color:#b7322c;font-style:normal;padding:0 .3em}
/* Chapters: the seals over the realm map, the chapter's card on the left */
.chapterp{display:block}
.hm-chapters{position:absolute;inset:0;pointer-events:none}
.hm-chapters>*{pointer-events:auto}
.hm-chead{position:absolute;left:calc(clamp(18px,4vw,60px) + var(--safe-l));top:calc(clamp(10px,4vh,40px) + var(--safe-t));display:flex;align-items:center;gap:12px;color:#eadcbc;text-shadow:0 0 10px #0a0705;opacity:0;transition:opacity 1s ease .6s}
.chapterp.in .hm-chead{opacity:1}.chapterp.out .hm-chead{opacity:0;transition:opacity .3s ease}
.hm-chead .g{width:42px;height:42px}
.hm-chead h2{margin:0;font-weight:600;font-size:clamp(19px,3.4vh,26px);letter-spacing:.1em}
.hm-chead p{margin:.1em 0 0;font-style:italic;font-size:clamp(12px,2vh,15px);color:#bfa985}
.hm-chead .hm-x{position:static;color:#d8c7a2;margin-left:6px}
.hm-seals{position:absolute;inset:0;pointer-events:none}
.hm-seal{position:absolute;left:0;top:0;width:clamp(30px,5.6vh,46px);height:clamp(30px,5.6vh,46px);margin:calc(clamp(30px,5.6vh,46px) / -2) 0 0 calc(clamp(30px,5.6vh,46px) / -2);border:0;padding:0;background:none;cursor:pointer;opacity:0;pointer-events:none;transition:opacity .5s ease;outline:none}
.hm-seal.shown{opacity:1;pointer-events:auto}
.hm-seal img{width:100%;height:100%;display:block;filter:drop-shadow(0 2px 3px #0008);transition:transform .3s cubic-bezier(.2,.7,.2,1)}
.hm-seal.soon img{opacity:.78}
.hm-seal.on img,.hm-seal:hover img{transform:scale(1.18) rotate(-4deg)}
.hm-seal .tip{position:absolute;left:50%;top:calc(100% + 4px);transform:translateX(-50%);white-space:nowrap;font-size:calc(13px * var(--ts));font-style:italic;color:#f1e6cb;text-shadow:0 0 6px #0a0705,0 0 2px #0a0705;opacity:0;transition:opacity .25s ease;pointer-events:none}
.hm-seal.on .tip,.hm-seal:hover .tip{opacity:1}
.hm-card{position:absolute;left:calc(clamp(18px,4vw,60px) + var(--safe-l));top:50%;transform:translateY(-44%);width:min(360px,34vw)}
.hm-cardin{opacity:1}
.hm-card.in .hm-sheet{clip-path:inset(-14px)}
.hm-cn{font-variant:small-caps;letter-spacing:.16em;color:#8a6f4c;font-size:calc(14px * var(--ts))}
.hm-cardin h3{margin:.1em 0 .45em;font-size:clamp(20px,3.6vh,26px);font-weight:600;line-height:1.15}
.hm-soon{font-style:italic;color:#6b5a42;margin:0}
.hm-secret{border-top:1px solid #3c281433;border-bottom:1px solid #3c281433;padding:7px 0;margin:4px 0 10px;font-size:calc(14.5px * var(--ts))}
.hm-secret b{display:block;color:#b7322c;font-weight:600;letter-spacing:.02em}
.hm-secret span{font-style:italic;color:#4a3a28}
.hm-secret.dim b{color:#6b5a42}
.hm-best{display:flex;align-items:center;gap:6px;margin:4px 0;font-size:calc(14px * var(--ts))}
.hm-best span{width:4.4em;font-variant:small-caps;letter-spacing:.1em;color:#5a4630}
.hm-best img{width:26px;height:26px;opacity:.22;filter:grayscale(1)}
.hm-best img.on{opacity:1;filter:none;transform:rotate(-4deg)}
.hm-best em{margin-left:4px;color:#6b5a42;font-size:.9em}
.hm-cardin .hm-row{margin-top:12px}
/* a phone held wide: everything a little tighter, the sheets two columns, nothing to scroll */
@media (max-height:500px){
  .hm{--hmw:min(44vw,380px);--gl:30px;--fs:calc(15px * var(--ts))}
  .hm .hm-col{gap:6px}
  .hm-jiang{width:58px;height:58px}
  .hm-name{font-size:14px}
  .hm-item{padding:2px 8px 2px 0}
  .hm-item .stroke{height:14px}
  .hm-settings{padding:10px 18px;width:min(720px,96vw)}
  .hm-grid{gap:6px 18px}
  .hm-rule{margin:2px 0 4px;height:10px}
  .hm-head .g{width:30px;height:30px}
  .hm-seg button{padding:.25em .7em}
  .hm-card{width:min(300px,40vw);top:auto;bottom:calc(10px + var(--safe-b));transform:none}
  .hm-cardin{padding:10px 14px}
  .hm-cardin h3{font-size:18px;margin-bottom:.2em}
  .hm-secret{padding:4px 0;margin:2px 0 6px;font-size:13px}
  .hm-best img{width:20px;height:20px}
  .hm-chead .g{width:30px;height:30px}
  .hm-cardin .hm-row{gap:6px;flex-wrap:nowrap;margin-top:8px}
  .hm-cardin .hm-btn{padding:.38em .7em;font-size:calc(13px * var(--ts))}
}
@media (prefers-reduced-motion:reduce){.hm-sheet,.hm-item,.hm-title,.hm-col{transition-duration:.01s !important}}
