/* BIRINGAN: Mga Bakas ng Nawawala
   The page is a banig under lamplight. Straw, indigo, ochre. */

:root{
  --ink:#0E1B2E;
  --ink-2:#0a1526;
  --indigo:#2A3D6B;
  --jade:#3E7F6B;
  --ochre:#D9A22B;
  --maroon:#A8342E;
  --ivory:#EADFC8;
  --rose:#E9A6B4;
  --panel-hi:#12233c;
  --panel-lo:#0a1629;
  --fraunces:"Fraunces",Georgia,"Times New Roman",serif;
  --sans:"Instrument Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  --mono:"Martian Mono",ui-monospace,"SFMono-Regular",Menlo,monospace;
  --gold-line:rgba(217,162,43,.28);
  --ivory-line:rgba(234,223,200,.16);
  --shadow:0 18px 44px rgba(0,0,0,.45);
}

*,*::before,*::after{box-sizing:border-box;}
html{-webkit-text-size-adjust:100%;}
body{
  margin:0;
  min-height:100%;
  color:var(--ivory);
  background-color:var(--ink);
  background-image:
    repeating-linear-gradient(0deg,rgba(42,61,107,.14) 0,rgba(42,61,107,.14) 1px,transparent 1px,transparent 8px),
    repeating-linear-gradient(90deg,rgba(217,162,43,.028) 0,rgba(217,162,43,.028) 1px,transparent 1px,transparent 11px);
  font-family:var(--sans);
  font-size:17px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

img{max-width:100%;}
button{font-family:inherit;color:inherit;}
h1,h2,h3,p{margin:0;}
[hidden]{display:none !important;}
.en{color:rgba(234,223,200,.72);}

:focus-visible{
  outline:2px solid var(--ochre);
  outline-offset:3px;
  box-shadow:0 0 0 2px var(--ink);
}

.skip-link{
  position:absolute;left:12px;top:-80px;z-index:100;
  background:var(--ivory);color:var(--ink);
  padding:10px 16px;font-weight:600;text-decoration:none;
  transition:top .2s ease;
}
.skip-link:focus{top:12px;}

.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;
}

.page{width:100%;overflow-x:hidden;}
main{max-width:1480px;margin:0 auto;padding:0 clamp(14px,3vw,40px);}

/* ---------- title band ---------- */

.title-band{
  position:relative;
  height:clamp(280px,32vw,450px);
  margin-bottom:clamp(14px,2vw,26px);
}
.sky-strip{
  position:absolute;left:0;right:0;top:0;height:16px;
  background:var(--ink);
  border-bottom:1px solid rgba(217,162,43,.12);
}
.sky{
  position:absolute;left:0;right:0;top:16px;bottom:0;
  overflow:hidden;
  border-top:1px solid rgba(217,162,43,.16);
  border-bottom:1px solid rgba(42,61,107,.9);
}
.sky img{
  width:100%;height:100%;object-fit:cover;object-position:center 52%;
  display:block;filter:saturate(.96) contrast(1.02);
}
.sky-shade{
  position:absolute;inset:0;
  background:linear-gradient(180deg,rgba(14,27,46,.06) 0%,rgba(14,27,46,0) 40%,rgba(14,27,46,.55) 84%,var(--ink) 100%);
}
.title-cartouche{
  position:absolute;left:50%;top:53%;transform:translate(-50%,-50%);
  width:min(92%,900px);
  aspect-ratio:648/270;
  background:url(assets/weave_frame_01_title_cartouche.webp) center/100% 100% no-repeat;
  z-index:3;
  filter:drop-shadow(0 18px 30px rgba(0,0,0,.5));
}
.title-cartouche::before{
  content:"";position:absolute;left:9.4%;right:9.4%;top:20.5%;bottom:20%;
  background:linear-gradient(180deg,rgba(14,27,46,.82),rgba(14,27,46,.68));
}
.title-ink{
  position:absolute;inset:0;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;padding:0 5%;
}
.title-ink h1{
  font-family:var(--fraunces);
  font-weight:700;
  font-size:clamp(38px,7.4vw,92px);
  letter-spacing:.15em;
  line-height:.88;
  color:var(--ivory);
  text-shadow:0 3px 0 rgba(0,0,0,.3);
  font-variation-settings:"SOFT" 100,"WONK" 1;
  margin-left:.15em;
}
.title-fil{
  font-family:var(--fraunces);
  font-weight:400;
  font-size:clamp(16px,3.2vw,40px);
  line-height:1.05;
  letter-spacing:.01em;
  margin-top:.28em;
  font-variation-settings:"SOFT" 100,"WONK" 1;
}
.title-eng{
  font-family:var(--sans);
  font-weight:600;
  font-size:clamp(9px,1.15vw,15px);
  line-height:1.2;
  letter-spacing:.3em;
  text-transform:uppercase;
  color:rgba(234,223,200,.7);
  margin-top:.75em;
  margin-left:.3em;
}

@media (min-width:761px) and (max-width:1250px){
  .title-cartouche{width:min(92%,calc(76.8vw - 57.6px));}
}

/* ---------- stage ---------- */

.stage{
  display:grid;
  grid-template-columns:minmax(0,1.95fr) minmax(300px,1fr);
  gap:clamp(18px,2.2vw,34px);
  align-items:start;
  margin-top:clamp(10px,1.4vw,20px);
}
.board-col{min-width:0;}

/* ---------- board hud, small screens ---------- */

.board-hud{
  display:none;
  align-items:center;
  gap:12px;
  padding:7px 10px;
  margin-bottom:8px;
  border:1px solid rgba(42,61,107,.85);
  background:rgba(10,21,38,.7);
  font-family:var(--mono);
  font-size:9px;
  letter-spacing:.1em;
  color:rgba(234,223,200,.62);
  overflow:hidden;
  white-space:nowrap;
}
.hud-item b{color:var(--ivory);font-weight:400;margin-left:4px;}

/* ---------- the board ---------- */

.board{
  position:relative;
  width:100%;
  aspect-ratio:3/2;
  background:var(--ink-2);
  border:1px solid rgba(217,162,43,.22);
  box-shadow:var(--shadow),inset 0 0 0 1px rgba(14,27,46,.85);
  overflow:hidden;
  touch-action:manipulation;
  user-select:none;
  -webkit-user-select:none;
}
.board-art{
  position:absolute;inset:0;width:100%;height:100%;
  object-fit:cover;display:block;
}
.board::after{
  content:"";position:absolute;inset:0;z-index:2;pointer-events:none;
  box-shadow:inset 0 0 70px rgba(14,27,46,.55);
}

.landmark{position:absolute;z-index:3;pointer-events:none;}
.landmark img{
  display:block;width:100%;height:auto;
  filter:drop-shadow(0 14px 18px rgba(0,0,0,.38));
}
.landmark.gate{left:10%;top:3%;width:17%;}
.landmark.house{left:73%;top:2%;width:15.5%;}
.landmark.dock{left:55%;top:51%;width:40%;}
.landmark.gate.is-ringing{animation:bellShake .7s ease-in-out;}
@keyframes bellShake{
  0%,100%{transform:rotate(0deg);}
  18%{transform:rotate(-.55deg);}
  42%{transform:rotate(.45deg);}
  66%{transform:rotate(-.22deg);}
}
.gate-glow{
  position:absolute;left:10.5%;top:9%;width:16%;height:25%;
  z-index:4;pointer-events:none;opacity:0;
  background:radial-gradient(ellipse at 50% 55%,rgba(217,162,43,.3),rgba(217,162,43,0) 70%);
  transition:opacity .35s ease;
}
.gate-glow.is-open{opacity:1;}

.figure{
  position:absolute;
  transform:translate(-50%,-100%);
  pointer-events:none;
  z-index:6;
}
.figure img{
  display:block;height:100%;width:auto;
  filter:drop-shadow(0 9px 12px rgba(0,0,0,.36));
}
.figure.live{height:23%;left:5%;top:55%;z-index:9;}
.figure.live img{height:100%;}
.figure.attendant{height:27%;left:27%;top:38%;z-index:6;}
.figure.sibling{height:17%;left:86%;top:38%;z-index:6;}

.live-ring{
  position:absolute;left:50%;bottom:-2px;
  width:48%;height:8px;transform:translateX(-50%);
  border:1px solid rgba(217,162,43,.55);
  border-radius:50%;
  background:radial-gradient(ellipse,rgba(14,27,46,.35),rgba(14,27,46,0));
  z-index:-1;
}
.carry-chip{
  position:absolute !important;
  right:-18% !important;top:34% !important;
  width:32% !important;height:auto !important;
  display:none;
  filter:drop-shadow(0 0 7px rgba(217,162,43,.5)) !important;
}
.figure.live.has-carry .carry-chip{display:block;}

/* ghost layer: flat ivory silhouettes tinted by loop */

.ghost-layer{position:absolute;inset:0;z-index:7;pointer-events:none;}
.figure.ghost{height:23%;}
.ghost-body{
  position:relative;
  height:100%;
  aspect-ratio:166/436;
  background:var(--ghost-color,var(--ochre));
  opacity:.6;
  -webkit-mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  filter:drop-shadow(0 7px 9px rgba(0,0,0,.2));
}
.ghost-body::after{
  content:"";position:absolute;inset:0;
  transform:translate(1.5px,1.2px);
  background:rgba(234,223,200,.5);
  -webkit-mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  opacity:.55;
}
.ghost[data-loop="1"]{--ghost-color:var(--ochre);}
.ghost[data-loop="2"]{--ghost-color:var(--jade);}
.figure.ghost.is-broken .ghost-body{opacity:.42;}

/* lines on the mat */

.board-lines{
  position:absolute;inset:0;width:100%;height:100%;
  z-index:5;pointer-events:none;overflow:visible;
}
.board-lines polyline,.board-lines line{
  fill:none;stroke-linecap:round;stroke-linejoin:round;
  vector-effect:non-scaling-stroke;
}
.edge-line{stroke:rgba(234,223,200,.24);stroke-width:1.35;stroke-dasharray:2 5;}
.node-point{fill:rgba(234,223,200,.34);stroke:rgba(14,27,46,.65);stroke-width:.18;}
.door-line{stroke:rgba(168,52,46,.55);stroke-width:2.2;stroke-dasharray:4 4;}
.door-line.is-open{stroke:rgba(217,162,43,.85);stroke-dasharray:none;}
.trail-under{stroke:rgba(234,223,200,.2);stroke-width:1;}
.trail{stroke-width:2.6;opacity:.82;}
.trail.loop1{stroke:var(--ochre);}
.trail.loop2{stroke:var(--jade);stroke-dasharray:7 5;}

.board.is-rewinding .figure,
.board.is-rewinding .ghost-layer,
.board.is-rewinding .jar-token,
.board.is-rewinding .node-layer,
.board.is-rewinding .board-lines{opacity:.18;transition:opacity .2s ease;}
.board.is-won{box-shadow:var(--shadow),inset 0 0 100px rgba(217,162,43,.16);}
.board.is-failed{box-shadow:var(--shadow),inset 0 0 100px rgba(168,52,46,.18);}

.figure.sibling.is-lit img{filter:drop-shadow(0 0 12px rgba(233,166,180,.55)) drop-shadow(0 8px 10px rgba(0,0,0,.35));}

.restored-stitch{
  position:absolute;left:7%;right:7%;top:46%;height:2px;z-index:2;
  background:linear-gradient(90deg,rgba(234,223,200,0),rgba(234,223,200,.85),rgba(234,223,200,0));
  opacity:0;transition:opacity .9s ease;pointer-events:none;
}
.banner-wrap.is-restored .restored-stitch{
  opacity:.9;
  box-shadow:0 0 9px rgba(233,166,180,.55);
}

.board-token{
  position:absolute;z-index:4;pointer-events:none;height:auto;
  filter:drop-shadow(0 5px 8px rgba(0,0,0,.45));
}
.token-bell{left:22%;top:25%;width:3.8%;}
.token-knot{left:28.5%;top:47%;width:4.2%;}
.token-lamp{left:63%;top:55%;width:4.0%;}

.jar-token{
  position:absolute;z-index:6;width:4.6%;
  left:88.5%;top:45%;
  transform:translate(-50%,-100%);
  filter:drop-shadow(0 0 9px rgba(217,162,43,.45));
  pointer-events:none;
}

.node-layer{position:absolute;inset:0;z-index:10;pointer-events:none;}
.node-chip{
  position:absolute;
  width:clamp(34px,4.6%,46px);
  height:clamp(34px,4.6%,46px);
  transform:translate(-50%,-50%);
  background:transparent;border:0;padding:0;
  display:grid;place-items:center;
  cursor:pointer;pointer-events:auto;
  touch-action:manipulation;
}
.node-chip::before{
  content:"";width:58%;height:58%;
  border:1.5px solid rgba(217,162,43,.78);
  border-radius:50%;
  background:rgba(217,162,43,.1);
  box-shadow:0 0 0 2px rgba(14,27,46,.6);
  transition:background .15s ease,transform .15s ease;
}
.node-chip.is-blocked::before{
  border-color:rgba(168,52,46,.85);
  background:rgba(168,52,46,.14);
}
.node-chip:hover::before,.node-chip:focus-visible::before{background:rgba(217,162,43,.3);}
.node-chip:active::before{transform:scale(.9);}
.node-chip:focus-visible{outline:none;}
.node-chip:focus-visible::before{outline:2px solid var(--ochre);outline-offset:3px;}

.zone-tag{
  position:absolute;z-index:11;
  font-family:var(--mono);
  font-size:clamp(6px,.78vw,9px);
  letter-spacing:.15em;
  line-height:1.2;
  text-transform:uppercase;
  color:rgba(234,223,200,.92);
  background:rgba(14,27,46,.82);
  border:1px solid rgba(217,162,43,.22);
  padding:2px 5px;
  white-space:nowrap;
  pointer-events:none;
}
.zone-tag span{display:block;color:rgba(234,223,200,.52);letter-spacing:.05em;line-height:1.25;}
.tag-gate{left:1.5%;top:4%;}
.tag-house{left:66%;top:.8%;}
.tag-dock{left:55%;top:48.3%;}
.tag-start{left:1.4%;top:50.5%;}

.gate-tag{
  position:absolute;left:18.5%;top:22%;transform:translateX(-50%);
  z-index:12;pointer-events:none;
  font-family:var(--mono);font-size:8px;letter-spacing:.12em;
  color:var(--ochre);
  background:rgba(14,27,46,.88);
  border:1px solid rgba(217,162,43,.4);
  padding:2px 5px;white-space:nowrap;
}
.gate-tag b{color:var(--ivory);font-weight:400;}

.plate-tag{
  position:absolute;z-index:11;transform:translate(-50%,8px);
  font-family:var(--mono);font-size:7px;letter-spacing:.12em;
  color:rgba(234,223,200,.72);
  background:rgba(14,27,46,.78);
  border:1px solid rgba(42,61,107,.9);
  padding:1px 4px;white-space:nowrap;pointer-events:none;
}
.plate-tag.is-held{color:var(--ochre);border-color:rgba(217,162,43,.5);}

.ghost-tags{position:absolute;inset:0;z-index:13;pointer-events:none;}
.ghost-tag{
  position:absolute;transform:translate(-50%,-125%);
  background:rgba(14,27,46,.94);
  border:1px solid rgba(168,52,46,.75);
  padding:3px 6px;text-align:center;white-space:nowrap;
}
.ghost-tag b{
  display:block;font-family:var(--mono);font-size:8px;
  letter-spacing:.1em;color:var(--ivory);font-weight:400;
}
.ghost-tag span{
  display:block;font-family:var(--sans);font-size:9px;
  color:rgba(234,223,200,.68);letter-spacing:.02em;
}

.pause-tag{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  z-index:15;
  font-family:var(--mono);font-size:12px;letter-spacing:.16em;
  color:var(--ivory);
  background:rgba(14,27,46,.94);
  border:1px solid rgba(217,162,43,.55);
  padding:7px 13px;white-space:nowrap;
}
.pause-tag span{color:rgba(234,223,200,.55);letter-spacing:.06em;}
.board.is-paused .figure{opacity:.82;}

.rewind-weave{
  position:absolute;inset:0;z-index:14;pointer-events:none;opacity:0;
  background:repeating-linear-gradient(0deg,
    rgba(234,223,200,.16) 0,rgba(234,223,200,.16) 1px,
    transparent 1px,transparent 10px);
}
.rewind-weave.is-running{animation:rewindRun .95s ease-in-out;}
@keyframes rewindRun{
  0%{opacity:0;background-position:0 0;}
  18%{opacity:.85;}
  100%{opacity:0;background-position:0 260px;}
}

/* ---------- under the board ---------- */

.board-hint{
  display:flex;align-items:flex-start;gap:8px;
  min-height:2.7em;
  margin-top:10px;
  font-size:16px;line-height:1.45;
  color:rgba(234,223,200,.9);
}
.board-hint::before{
  content:"";flex:0 0 auto;width:7px;height:7px;margin-top:.48em;
  background:var(--ochre);transform:rotate(45deg);
}

.control-strip{
  display:flex;align-items:center;
  gap:clamp(2px,1vw,10px);
  margin-top:8px;
  padding:7px 10px;
  border:13px solid transparent;
  border-image:url(assets/weave_frame_01_title_cartouche.webp) 55 stretch;
  background:linear-gradient(180deg,rgba(16,31,52,.98),rgba(8,17,31,.98));
  background-clip:padding-box;
  box-shadow:0 10px 24px rgba(0,0,0,.35);
}
.strip-sep{width:1px;align-self:stretch;background:rgba(234,223,200,.16);margin:2px 2px;}
.glyph-btn{
  display:flex;flex-direction:column;align-items:center;gap:1px;
  min-width:clamp(38px,5.4vw,52px);
  padding:2px;background:none;border:0;cursor:pointer;
  border-radius:2px;
}
.glyph-btn img{
  width:clamp(28px,3.3vw,40px);height:auto;display:block;
  filter:drop-shadow(0 3px 4px rgba(0,0,0,.45));
  transition:filter .15s ease,opacity .15s ease;
}
.glyph-btn .key{
  font-family:var(--mono);font-size:8px;letter-spacing:.08em;
  color:rgba(234,223,200,.6);
}
.glyph-btn:hover img{filter:drop-shadow(0 0 6px rgba(217,162,43,.4));}
.glyph-btn.is-active img{filter:drop-shadow(0 0 7px rgba(217,162,43,.62));}
.glyph-btn.is-active .key{color:var(--ochre);}
.glyph-btn:disabled{opacity:.32;cursor:not-allowed;}

.under-controls{
  display:flex;align-items:flex-start;gap:10px;
  margin-top:10px;flex-wrap:wrap;
}
.context-actions{
  display:flex;gap:8px;flex:1 1 320px;flex-wrap:wrap;
}
.woven-btn{
  display:flex;align-items:center;justify-content:center;gap:9px;
  min-height:44px;
  padding:8px 11px;
  background:linear-gradient(180deg,rgba(42,61,107,.4),rgba(18,35,60,.55));
  border:1px solid rgba(217,162,43,.42);
  color:var(--ivory);
  font-size:13px;line-height:1.2;text-align:left;
  border-radius:2px;cursor:pointer;
}
.woven-btn b{
  font-family:var(--mono);font-size:9px;font-weight:400;
  color:var(--ochre);
  border:1px solid rgba(234,223,200,.28);
  padding:1px 4px;border-radius:2px;
}
.woven-btn:hover:not(:disabled){background:linear-gradient(180deg,rgba(58,83,135,.5),rgba(24,44,72,.6));}
.woven-btn:disabled{opacity:.38;cursor:not-allowed;}
.woven-btn span{font-weight:600;}

.rules-btn{
  display:flex;flex-direction:column;align-items:flex-start;justify-content:center;
  min-height:44px;padding:7px 12px;
  background:rgba(10,21,38,.6);
  border:1px solid rgba(42,61,107,.9);
  border-radius:2px;cursor:pointer;
  font-size:13px;font-weight:600;line-height:1.15;
}
.rules-btn small{
  font-family:var(--mono);font-size:8px;font-weight:400;
  letter-spacing:.09em;color:rgba(234,223,200,.58);margin-top:3px;
}

.pad-wrap{display:none;align-items:flex-start;gap:8px;}
.pad-label{
  font-family:var(--mono);font-size:8px;letter-spacing:.12em;
  color:rgba(234,223,200,.55);writing-mode:vertical-rl;transform:rotate(180deg);
  align-self:center;
}
.pad{
  display:grid;
  grid-template-columns:repeat(3,42px);
  grid-template-rows:repeat(3,42px);
  gap:4px;
}
.pad-btn{
  background:linear-gradient(180deg,rgba(42,61,107,.62),rgba(17,33,55,.7));
  border:1px solid rgba(217,162,43,.4);
  color:var(--ivory);font-size:13px;line-height:1;
  border-radius:2px;cursor:pointer;touch-action:manipulation;
}
.pad-btn:active{background:rgba(217,162,43,.28);}
.pad-up{grid-column:2;grid-row:1;}
.pad-left{grid-column:1;grid-row:2;}
.pad-right{grid-column:3;grid-row:2;}
.pad-down{grid-column:2;grid-row:3;}

/* ---------- rules and radio panels ---------- */

.rules-panel{
  margin-top:14px;
  padding:18px clamp(14px,2.2vw,26px);
  border:14px solid transparent;
  border-image:url(assets/weave_frame_01_title_cartouche.webp) 55 stretch;
  background:linear-gradient(180deg,rgba(16,31,52,.98),rgba(8,16,29,.98));
  background-clip:padding-box;
  box-shadow:0 14px 30px rgba(0,0,0,.35);
}
.rules-panel h2{
  font-family:var(--fraunces);font-weight:400;font-size:clamp(22px,2.4vw,30px);
  letter-spacing:.02em;margin-bottom:14px;
}
.rules-panel h2 small,.folk-panel h2 small{
  display:block;font-family:var(--mono);font-weight:400;
  font-size:9px;letter-spacing:.14em;text-transform:uppercase;
  color:rgba(234,223,200,.58);margin-top:4px;
}
.rules-panel h3,.folk-panel h3{
  font-family:var(--fraunces);font-weight:400;font-size:19px;line-height:1.2;
  color:var(--ivory);margin-bottom:5px;
}
.rules-panel h3 small,.folk-panel h3 small{
  font-family:var(--sans);font-weight:600;font-size:9px;letter-spacing:.16em;
  text-transform:uppercase;color:rgba(234,223,200,.55);margin-left:6px;
}
.rules-panel h3.tight{margin-top:16px;}
.rules-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px 26px;margin-bottom:20px;
}
.rules-grid p,.rules-tables p{
  font-size:16px;line-height:1.55;color:rgba(234,223,200,.92);
}
.rules-grid p + p,.rules-tables p + p{margin-top:5px;}
.rules-tables{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px 26px;
  padding-top:18px;border-top:1px solid rgba(42,61,107,.9);
}
.rules-tables ul{margin:0;padding-left:18px;font-size:16px;line-height:1.5;}
.rules-tables li{margin:2px 0;}
.rules-law{
  margin-top:20px;padding:14px 16px;
  border:1px solid rgba(217,162,43,.32);
  background:rgba(217,162,43,.055);
}
.rules-law .law-fil,.rules-law .law-en{font-size:16px;}
.law-fil{font-family:var(--sans);font-weight:600;color:var(--ivory);}
.law-en{font-size:14px;color:rgba(234,223,200,.7);margin-top:4px;}
.proto-note{
  margin-top:16px;font-size:12px;line-height:1.5;
  color:rgba(234,223,200,.58);
}
.proto-note .en{display:block;font-size:11px;}

.radio-log{
  margin-top:14px;padding:16px 18px;
  border:1px solid rgba(42,61,107,.9);
  background:rgba(10,21,38,.55);
}
.radio-log h3{
  font-family:var(--fraunces);font-weight:400;font-size:19px;margin-bottom:8px;
}
.radio-log h3 small{
  font-family:var(--mono);font-size:9px;letter-spacing:.14em;
  color:rgba(234,223,200,.55);margin-left:6px;text-transform:uppercase;
}
.radio-log ol{margin:0;padding-left:20px;font-size:16px;line-height:1.5;}
.radio-log li{margin:5px 0;}
.radio-log li .en{display:block;font-size:13px;}
.radio-log .empty{list-style:none;margin-left:-20px;color:rgba(234,223,200,.5);font-size:14px;}

/* ---------- desk rail ---------- */

.desk-rail{
  display:flex;flex-direction:column;gap:13px;
  min-width:0;
}
.rail-hero{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(96px,39%);
  gap:11px;align-items:start;
}
.rail-readouts{display:flex;flex-direction:column;gap:11px;min-width:0;}

.wpanel{
  position:relative;
  padding:9px 11px;
  border:13px solid transparent;
  border-image:url(assets/weave_frame_01_title_cartouche.webp) 55 stretch;
  background:linear-gradient(180deg,rgba(18,35,58,.98),rgba(8,16,29,.98));
  background-clip:padding-box;
  border-radius:2px;
  box-shadow:0 11px 24px rgba(0,0,0,.34);
}
.panel-kicker{
  display:block;
  font-family:var(--mono);font-size:8px;letter-spacing:.15em;
  color:rgba(234,223,200,.64);
  margin-bottom:3px;
}
.panel-kicker small{color:rgba(234,223,200,.42);letter-spacing:.06em;}
.panel-sub{
  font-size:11px;color:rgba(234,223,200,.55);margin-top:5px;
}
.panel-sub span{color:rgba(234,223,200,.38);}

.loop-number{
  display:flex;align-items:baseline;gap:5px;
  font-family:var(--mono);line-height:1;
}
.loop-number b{font-size:26px;font-weight:700;color:var(--ivory);}
.loop-number span{font-size:11px;color:rgba(234,223,200,.55);}
.clock{
  font-family:var(--mono);font-weight:700;
  font-size:clamp(22px,2.6vw,30px);
  letter-spacing:.04em;line-height:1;
  color:var(--ochre);margin-top:5px;
}
.clock-track{
  height:3px;margin-top:6px;background:rgba(42,61,107,.9);overflow:hidden;
}
.clock-track span{
  display:block;height:100%;width:100%;
  background:linear-gradient(90deg,var(--ochre),rgba(217,162,43,.55));
  transform-origin:left center;
}
.final-bell{
  margin-top:6px;font-family:var(--mono);font-size:7px;letter-spacing:.11em;
  color:var(--maroon);
}
.final-bell span{color:rgba(234,223,200,.5);}
.best-line{
  margin-top:6px;font-family:var(--mono);font-size:7px;letter-spacing:.1em;
  color:rgba(234,223,200,.5);
}
.best-line b{color:var(--ivory);font-weight:400;}
.best-line span{color:rgba(234,223,200,.35);}

.pag-value{
  display:flex;align-items:baseline;gap:5px;
  font-family:var(--mono);line-height:1;
}
.pag-value b{font-size:26px;font-weight:700;color:var(--ivory);}
.pag-value span{font-size:11px;color:rgba(234,223,200,.55);}
.pag-notches{display:flex;gap:5px;margin-top:7px;}
.pag-notches i{
  display:block;flex:1;height:4px;
  background:rgba(42,61,107,.95);
  border:1px solid rgba(234,223,200,.08);
}
.pag-notches i.is-on{
  background:var(--maroon);
  border-color:rgba(168,52,46,.9);
}
.pag-value b.is-forgetting{color:var(--maroon);}

.banner-wrap{
  position:relative;min-width:0;
  filter:drop-shadow(0 12px 22px rgba(0,0,0,.4));
}
.banner-wrap > img{
  display:block;width:100%;height:auto;
  transition:filter .6s ease;
}
.banner-wrap.pag-1 > img{filter:saturate(.8) brightness(.94);}
.banner-wrap.pag-2 > img{filter:saturate(.58) brightness(.86);}
.banner-wrap.pag-3 > img{filter:saturate(.3) brightness(.74);}
.banner-wrap.is-restored > img{filter:saturate(1.06) brightness(1.06);}
.banner-wrap.is-restored::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(ellipse at 50% 26%,rgba(233,166,180,.2),rgba(233,166,180,0) 60%);
}
.banner-threads{
  position:absolute;left:12%;right:12%;bottom:0;height:26%;
  opacity:0;pointer-events:none;transition:opacity .6s ease;
}
.banner-wrap.is-frayed .banner-threads{opacity:.5;}
.banner-threads i{
  position:absolute;top:0;width:1px;height:100%;
  background:linear-gradient(180deg,rgba(234,223,200,.62),rgba(234,223,200,0));
  transform-origin:top center;
  animation:threadDrift 7s ease-in-out infinite alternate;
}
.banner-threads i:nth-child(1){left:6%;height:82%;animation-delay:-1s;}
.banner-threads i:nth-child(2){left:28%;height:100%;animation-delay:-3s;}
.banner-threads i:nth-child(3){left:52%;height:74%;animation-delay:-5s;}
.banner-threads i:nth-child(4){left:74%;height:92%;animation-delay:-2s;}
.banner-threads i:nth-child(5){left:91%;height:66%;animation-delay:-4s;}
@keyframes threadDrift{
  from{transform:rotate(-2.4deg) translateY(0);}
  to{transform:rotate(2.2deg) translateY(5px);}
}

.baka-panel{padding:0 2px;}
.baka-head{
  display:flex;justify-content:space-between;align-items:baseline;
  font-family:var(--mono);font-size:9px;letter-spacing:.13em;
  color:rgba(234,223,200,.8);
  padding:0 2px;
}
.baka-head small{color:rgba(234,223,200,.42);letter-spacing:.06em;}
#baka-count{color:rgba(234,223,200,.55);letter-spacing:.06em;}
.baka-rail-wrap{position:relative;margin-top:5px;}
.baka-rail-wrap > img{display:block;width:100%;height:auto;}
.baka-slot{
  position:absolute;top:16%;width:17%;height:62%;
  transform:translateX(-50%);
  display:grid;place-items:center;
  pointer-events:none;
}
.baka-slot[data-slot="1"]{left:18.5%;}
.baka-slot[data-slot="2"]{left:48.5%;}
.baka-slot[data-slot="3"]{left:79%;}
.baka-slot::before{
  content:"";position:absolute;inset:8% -2%;
  border:1px solid transparent;border-radius:50%;
  transition:border-color .3s ease,box-shadow .3s ease;
}
.baka-slot.is-on::before{
  border-color:rgba(217,162,43,.9);
  box-shadow:inset 0 0 12px rgba(217,162,43,.16);
}
.baka-slot[data-slot="2"].is-on::before{
  border-color:rgba(62,127,107,.95);
  box-shadow:inset 0 0 12px rgba(62,127,107,.18);
}
.baka-slot .live-mark{
  position:absolute;width:55%;height:55%;border-radius:50%;
  border:1px solid rgba(217,162,43,.5);
}
.baka-slot .loop-tag{
  position:absolute;top:-3px;left:50%;transform:translateX(-50%);
  font-family:var(--mono);font-size:7px;letter-spacing:.08em;
  color:rgba(234,223,200,.45);
}
.baka-slot.is-on .loop-tag{color:var(--ochre);}
.baka-slot[data-slot="2"].is-on .loop-tag{color:rgba(140,196,174,.95);}
.baka-legend{
  display:flex;gap:14px;margin-top:4px;padding:0 2px;
  font-family:var(--mono);font-size:7px;letter-spacing:.07em;
  color:rgba(234,223,200,.5);
}
.baka-legend span{display:flex;align-items:center;gap:5px;}
.pat{display:inline-block;width:18px;height:3px;}
.pat.solid{background:var(--ochre);}
.pat.dash{background:repeating-linear-gradient(90deg,var(--jade) 0 4px,transparent 4px 7px);}
.pat.cross{background:repeating-linear-gradient(90deg,var(--ivory) 0 2px,transparent 2px 5px);}

.law-panel .law-fil{font-size:15px;line-height:1.45;}
.law-panel .law-en{font-size:12px;line-height:1.4;}
.law-status{
  display:flex;align-items:center;gap:5px;flex-wrap:wrap;
  margin-top:7px;
  font-family:var(--mono);font-size:7px;letter-spacing:.08em;
  color:rgba(234,223,200,.58);
}
.law-status span:last-child{color:rgba(234,223,200,.34);}
.law-status .dot{
  width:6px;height:6px;border-radius:50%;
  background:var(--jade);box-shadow:0 0 0 1px rgba(62,127,107,.4);
}
.law-status .dot.is-open{background:var(--ochre);}

.radio-row{
  display:grid;
  grid-template-columns:minmax(88px,41%) minmax(0,1fr);
  gap:9px;align-items:end;
}
.radio-wrap{position:relative;min-width:0;}
.radio-wrap > img{
  display:block;width:100%;height:auto;
  filter:drop-shadow(0 10px 16px rgba(0,0,0,.42));
}
.radio-glow{
  position:absolute;left:16%;top:30%;width:25%;height:26%;
  background:radial-gradient(ellipse,rgba(217,162,43,.55),rgba(217,162,43,0) 70%);
  mix-blend-mode:screen;
  animation:radioBreathe 9s ease-in-out infinite alternate;
  opacity:.45;
}
@keyframes radioBreathe{
  from{opacity:.26;transform:translateY(1px) scale(.98);}
  to{opacity:.58;transform:translateY(-1px) scale(1.02);}
}
.dialogue-panel{min-height:112px;display:flex;flex-direction:column;justify-content:center;}
.dialogue-fil{
  font-size:16px;line-height:1.4;color:var(--ivory);
  font-weight:600;
  transition:opacity .2s ease;
}
.dialogue-eng{
  font-size:12px;line-height:1.4;color:rgba(234,223,200,.72);
  margin-top:3px;
}
.dialogue-fil.is-flash{color:var(--ochre);}

.carried-panel{
  padding:9px 11px;
  border:1px solid rgba(42,61,107,.85);
  background:rgba(10,21,38,.42);
}
.carried-row{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;margin-top:6px;
}
.carried-item{
  display:flex;flex-direction:column;align-items:center;gap:4px;
  text-align:center;
  opacity:.32;filter:grayscale(.7);
  transition:opacity .3s ease,filter .3s ease;
}
.carried-item.is-on{opacity:1;filter:none;}
.carried-item img{width:clamp(26px,3.1vw,36px);height:auto;}
.carried-item span{
  font-size:9.5px;line-height:1.2;color:rgba(234,223,200,.85);
}
.carried-item small{
  display:block;font-size:8px;color:rgba(234,223,200,.48);
  letter-spacing:.02em;margin-top:1px;
}

/* ---------- pitch, stamps, pillars ---------- */

.pitch-band{margin-top:clamp(36px,5.4vw,70px);}

.stamps-row{
  display:grid;
  grid-template-columns:auto auto;
  justify-content:center;
  align-items:center;
  gap:14px clamp(12px,2vw,24px);
  margin-bottom:clamp(20px,3vw,34px);
}
.stamp{
  position:relative;
  width:clamp(132px,15vw,172px);
  aspect-ratio:267/281;
  background:url(assets/weave_frame_03_small_stamp.webp) center/100% 100% no-repeat;
  border:0;padding:0;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  cursor:pointer;
  filter:drop-shadow(0 10px 18px rgba(0,0,0,.35));
  transition:transform .18s ease;
}
.stamp:hover{transform:translateY(-2px);}
.stamp-fil{
  font-family:var(--fraunces);font-weight:700;
  font-size:clamp(13px,1.25vw,16px);line-height:1;
  color:var(--ivory);text-align:center;
  letter-spacing:.01em;
}
.stamp-eng{
  font-family:var(--mono);font-size:7px;letter-spacing:.13em;
  text-transform:uppercase;color:rgba(234,223,200,.62);
  margin-top:5px;
}
.stamp[aria-expanded="true"]{
  box-shadow:inset 0 0 0 2px rgba(217,162,43,.4);
}
.waray-note{
  grid-column:1 / -1;
  justify-self:center;
  max-width:60ch;
  margin:0;text-align:center;
  font-size:12px;line-height:1.5;
  color:rgba(234,223,200,.62);
}
.waray-note .en{display:block;font-size:11px;color:rgba(234,223,200,.46);margin-top:2px;}

.folk-panel{
  max-width:1000px;margin:0 auto clamp(24px,3vw,40px);
  padding:22px clamp(16px,2.4vw,30px);
  border:14px solid transparent;
  border-image:url(assets/weave_frame_01_title_cartouche.webp) 55 stretch;
  background:linear-gradient(180deg,rgba(16,31,52,.98),rgba(8,16,29,.98));
  background-clip:padding-box;
  box-shadow:0 16px 34px rgba(0,0,0,.4);
}
.folk-panel h2{
  font-family:var(--fraunces);font-weight:400;font-size:clamp(22px,2.4vw,30px);
  margin-bottom:16px;
}
.folk-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px 30px;}
.folk-grid p{font-size:16px;line-height:1.58;}
.folk-grid p + p{margin-top:6px;}
.folk-grid .en,.waray-block .en{font-size:14px;line-height:1.5;}
.waray-block{
  margin-top:20px;padding-top:18px;
  border-top:1px solid rgba(42,61,107,.9);
}
.waray-block p{font-size:16px;line-height:1.55;}
.waray-block p + p{margin-top:5px;}
.folk-close{margin-top:18px;}

.pitch{
  max-width:74ch;
  margin:0 auto clamp(26px,3.4vw,42px);
  text-align:center;
}
.pitch-fil{
  font-family:var(--fraunces);font-weight:400;
  font-size:clamp(20px,2.2vw,28px);
  line-height:1.42;
  color:var(--ivory);
}
.pitch-eng{
  max-width:66ch;margin:12px auto 0;
  font-size:16px;line-height:1.6;
  color:rgba(234,223,200,.72);
}

.pillars{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(14px,2vw,24px);
}
.pillar{
  border-width:16px;
  padding:20px clamp(14px,1.7vw,22px) 22px;
  min-width:0;
}
.pillar h2{
  font-family:var(--fraunces);font-weight:400;
  font-size:clamp(22px,2.2vw,30px);
  line-height:1.1;
}
.pillar h2 small{
  display:block;margin-top:4px;
  font-family:var(--mono);font-size:8px;font-weight:400;
  letter-spacing:.15em;text-transform:uppercase;
  color:rgba(234,223,200,.55);
}
.pillar p{
  margin-top:11px;
  font-size:16px;line-height:1.55;
  color:rgba(234,223,200,.92);
}
.pillar p.en{font-size:14px;line-height:1.5;color:rgba(234,223,200,.62);}

/* ---------- step rail, footer ---------- */

.step-rail{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
  gap:7px;
  margin-top:clamp(34px,4.6vw,58px);
  padding:7px 0;
  border-top:1px solid rgba(42,61,107,.85);
  border-bottom:1px solid rgba(42,61,107,.85);
}
.step{
  display:flex;align-items:center;gap:7px;
  min-width:0;padding:6px 9px;
  font-size:12.5px;line-height:1.2;
  color:rgba(234,223,200,.35);
  border:1px solid rgba(42,61,107,.4);
  background:rgba(10,21,38,.28);
}
.step b{
  font-family:var(--mono);font-size:10px;font-weight:400;
  color:rgba(234,223,200,.45);
}
.step span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.step em{
  font-style:normal;font-family:var(--mono);font-size:7px;
  letter-spacing:.08em;color:var(--ochre);margin-left:auto;
}
.step em small{color:rgba(234,223,200,.45);}
.step.is-current{
  color:var(--ivory);
  border-color:rgba(217,162,43,.58);
  background:linear-gradient(90deg,rgba(217,162,43,.17),rgba(217,162,43,.05));
}
.step.is-current b{color:var(--ochre);}

.footer{
  max-width:1480px;margin:0 auto;
  padding:22px clamp(14px,3vw,40px) 34px;
  text-align:center;
  border-top:1px solid rgba(42,61,107,.55);
  font-size:12px;line-height:1.6;
  color:rgba(234,223,200,.55);
}
.footer .en{display:block;font-size:11px;color:rgba(234,223,200,.4);}


/* ---------- title help ---------- */

.title-actions{
  max-width:1480px;
  margin:10px auto 0;
  padding:0 clamp(14px,3vw,40px);
  display:flex;
  justify-content:center;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
}
.title-help{
  min-height:48px;
  padding:8px 20px;
  border-color:rgba(217,162,43,.62);
  background:linear-gradient(180deg,rgba(42,61,107,.58),rgba(18,35,60,.72));
  font-size:14px;
}
.title-help .help-mark{
  display:grid;place-items:center;
  width:26px;height:26px;
  border:1px solid rgba(217,162,43,.7);
  border-radius:50%;
  font-family:var(--fraunces);
  font-size:16px;
  color:var(--ochre);
}
.title-help > span:last-child{
  display:flex;flex-direction:column;align-items:flex-start;line-height:1.1;
}
.title-help small{
  font-family:var(--mono);
  font-size:8px;font-weight:400;letter-spacing:.08em;
  color:rgba(234,223,200,.6);margin-top:3px;
}
.sound-btn{
  min-height:48px;
  padding:8px 16px;
  border-color:rgba(42,61,107,.95);
  background:rgba(10,21,38,.55);
}
.sound-btn > span{
  display:flex;flex-direction:column;align-items:flex-start;line-height:1.1;
}
.sound-btn small{
  font-family:var(--mono);font-size:8px;font-weight:400;
  letter-spacing:.06em;color:rgba(234,223,200,.6);margin-top:3px;
}
.sound-btn[aria-pressed="false"]{opacity:.72;}

/* ---------- pause menu ---------- */

.pause-menu{
  position:fixed;inset:0;z-index:30;
  display:grid;place-items:center;
  padding:16px;
  background:rgba(8,16,29,.8);
}
body.pause-open{overflow:hidden;}
.pause-panel{
  width:min(308px,96%);
  padding:12px;
  border:10px solid transparent;
  border-image:url(assets/weave_frame_01_title_cartouche.webp) 55 stretch;
  background:
    linear-gradient(180deg,rgba(10,21,38,.89),rgba(8,16,29,.93)),
    url(assets/banig_heist_board.webp) center 60%/cover no-repeat;
  background-clip:padding-box;
  text-align:center;
  box-shadow:0 18px 40px rgba(0,0,0,.5);
}
.pause-kicker{
  font-family:var(--mono);
  font-size:8px;letter-spacing:.13em;
  color:var(--ochre);margin-bottom:7px;
}
.pause-kicker span{color:rgba(234,223,200,.5);}
.pause-btn{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  width:100%;min-height:42px;
  margin-top:4px;padding:7px 10px;
  border:1px solid rgba(217,162,43,.4);
  border-radius:2px;
  background:rgba(42,61,107,.32);
  color:var(--ivory);
  font-size:13px;font-weight:600;text-align:left;
  cursor:pointer;
}
.pause-btn span{
  font-family:var(--mono);font-size:7px;font-weight:400;
  letter-spacing:.05em;color:rgba(234,223,200,.55);
}
.pause-btn:hover{background:rgba(58,83,135,.46);}
.pause-resume{
  background:rgba(217,162,43,.16);
  border-color:rgba(217,162,43,.72);
}
.pause-restart{border-color:rgba(168,52,46,.55);}

/* ---------- how to play tutorial ---------- */

body.tut-open{overflow:hidden;}
.tut-overlay{
  position:fixed;inset:0;z-index:80;
  display:grid;place-items:center;
  padding:16px;
  overflow-y:auto;
  background:
    radial-gradient(ellipse at 50% 30%,rgba(217,162,43,.12),rgba(8,16,29,0) 62%),
    rgba(8,16,29,.68);
}
.tut-panel{
  position:relative;
  width:min(780px,100%);
  max-height:calc(100vh - 32px);
  overflow-y:auto;
  padding:20px 20px 16px;
  border:15px solid transparent;
  border-image:url(assets/weave_frame_01_title_cartouche.webp) 55 stretch;
  background:
    linear-gradient(180deg,rgba(10,21,38,.88),rgba(8,16,29,.925)),
    url(assets/banig_heist_board.webp) center 58%/cover no-repeat;
  background-clip:padding-box;
  box-shadow:0 28px 65px rgba(0,0,0,.65);
  background-blend-mode:normal;
}
.tut-skip{
  position:absolute;top:8px;right:10px;z-index:3;
  padding:7px 8px;
  border:0;background:none;
  color:rgba(234,223,200,.72);
  font-family:var(--mono);font-size:9px;letter-spacing:.1em;
  text-transform:uppercase;cursor:pointer;
}
.tut-skip span{color:rgba(234,223,200,.42);}
.tut-skip:hover{color:var(--ivory);}
.tut-stage{
  position:relative;
  margin-top:14px;
  width:100%;
  aspect-ratio:16/9;
  min-height:200px;
  max-height:300px;
  overflow:hidden;
  border:1px solid rgba(217,162,43,.55);
  background:var(--ink-2);
  box-shadow:0 0 0 3px #0a1526,0 0 0 4px rgba(217,162,43,.2),0 12px 26px rgba(0,0,0,.48);
}
.tut-slide{
  position:absolute;inset:0;
  opacity:0;visibility:hidden;
  transition:opacity .25s ease;
}
.tut-slide.is-on{opacity:1;visibility:visible;}
.tut-mini{
  position:absolute;inset:0;
  background:url(assets/banig_heist_board.webp) center 48%/cover no-repeat;
}
.tut-mini::after{
  content:"";position:absolute;inset:0;pointer-events:none;z-index:0;
  background:radial-gradient(ellipse at 50% 62%,rgba(14,27,46,0) 42%,rgba(14,27,46,.42));
}

/* step 1 */

.tut-path{
  position:absolute;left:10%;right:30%;top:58%;height:0;
  z-index:2;
  border-top:3px dashed rgba(230,180,65,.92);
  filter:drop-shadow(0 1px 2px rgba(0,0,0,.85));
  transform:rotate(-3deg);
}
.tut-path-3{left:30%;right:38%;top:58%;transform:rotate(4deg);}
.tut-crew{
  position:absolute;left:14%;bottom:7%;
  height:48%;width:auto;z-index:2;
  filter:drop-shadow(0 8px 10px rgba(0,0,0,.4));
}
.tut-keys{
  position:absolute;right:5%;bottom:9%;z-index:3;
  display:grid;
  grid-template-columns:repeat(3,34px);
  grid-template-rows:repeat(2,34px);
  gap:4px;
}
.tut-keys span{
  display:grid;place-items:center;
  border:1px solid rgba(217,162,43,.55);
  background:rgba(14,27,46,.82);
  color:var(--ivory);
  font-size:15px;line-height:1;
  border-radius:2px;
}
.tut-keys .k-up{grid-column:2;grid-row:1;}
.tut-keys .k-left{grid-column:1;grid-row:2;}
.tut-keys .k-down{grid-column:2;grid-row:2;}
.tut-keys .k-right{grid-column:3;grid-row:2;}
.tut-step-pin{
  position:absolute;left:58%;top:54%;z-index:2;
  width:18px;height:18px;
  border:2px solid var(--ochre);border-radius:50%;
  background:rgba(14,27,46,.55);
  box-shadow:0 0 12px rgba(217,162,43,.35);
}

/* step 2 */

.tut-mini-record{
  background:url(assets/biringan_night_sky.webp) center 32%/cover no-repeat;
}
.tut-mat-strip{
  position:absolute;left:0;right:0;bottom:0;height:42%;z-index:1;
  background:url(assets/banig_heist_board.webp) center 48%/cover no-repeat;
  border-top:1px solid rgba(217,162,43,.45);
  box-shadow:0 -10px 22px rgba(14,27,46,.55);
}
.tut-crew-record{
  position:absolute;left:9%;bottom:5%;height:58%;width:auto;z-index:3;
  filter:drop-shadow(0 8px 10px rgba(0,0,0,.45));
}
.tut-stitch{
  position:absolute;left:20%;right:42%;top:67%;height:0;z-index:2;
  border-top:2px dashed rgba(230,180,65,.78);
  filter:drop-shadow(0 1px 2px rgba(0,0,0,.75));
}
.tut-mini-rail{
  position:absolute;right:4%;top:58%;
  width:55%;height:auto;z-index:2;
  filter:drop-shadow(0 8px 12px rgba(0,0,0,.45));
}
.tut-baka{
  position:absolute;left:51.2%;top:18%;z-index:2;
  height:40%;
  aspect-ratio:166/436;
  transform:translateX(-50%);
  background:var(--ochre);
  opacity:.72;
  -webkit-mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  filter:drop-shadow(0 0 4px rgba(14,27,46,.95)) drop-shadow(0 6px 9px rgba(0,0,0,.4));
}
.tut-baka::after{
  content:"";position:absolute;inset:0;
  transform:translate(1.5px,1.2px);
  background:rgba(234,223,200,.45);
  -webkit-mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  opacity:.5;
}
.tut-slot-lit{
  position:absolute;left:46.2%;top:59%;z-index:3;
  width:9%;height:12%;
  border:2px solid rgba(217,162,43,.95);
  border-radius:50%;
  box-shadow:inset 0 0 14px rgba(217,162,43,.3),0 0 10px rgba(217,162,43,.25);
}
.tut-slot-tag{
  position:absolute;left:51%;top:77%;z-index:3;
  transform:translateX(-50%);
  font-family:var(--mono);font-size:8px;letter-spacing:.1em;
  color:var(--ochre);
  white-space:nowrap;
  background:rgba(14,27,46,.8);
  border:1px solid rgba(217,162,43,.35);
  padding:1px 4px;
}
.tut-record-big{
  position:absolute;left:4%;bottom:5%;width:15%;height:auto;z-index:3;
  filter:drop-shadow(0 8px 12px rgba(0,0,0,.55));
}
.ctx-icon{
  width:24px;height:auto;flex:0 0 auto;display:block;
  filter:drop-shadow(0 3px 4px rgba(0,0,0,.5));
}
.tab-ico{width:11px;height:11px;object-fit:contain;vertical-align:-2px;margin-right:2px;}
.tab-move{font-family:var(--mono);font-size:10px;line-height:1;color:var(--ochre);}
.tab-ghost{
  display:inline-block;width:9px;height:11px;margin-right:2px;vertical-align:-2px;
  background:var(--ochre);opacity:.8;
  -webkit-mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
}
.tab-gate-ico{width:10px;height:12px;}
.tut-inline-glyph{
  display:inline-block;width:24px;height:auto;
  vertical-align:-6px;margin-right:4px;
  filter:drop-shadow(0 2px 3px rgba(0,0,0,.5));
}

/* step 3 */

.tut-path-2{left:14%;right:28%;top:62%;}
.tut-crew-live{
  position:absolute;left:8%;bottom:7%;
  height:46%;width:auto;z-index:2;
  filter:drop-shadow(0 8px 10px rgba(0,0,0,.4));
}
.tut-ghost{
  position:absolute;left:24%;bottom:7%;z-index:2;
  height:46%;
  aspect-ratio:166/436;
  background:var(--ochre);
  opacity:.65;
  -webkit-mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  animation:tutGhostMove 6s ease-in-out infinite;
}
.tut-ghost::after{
  content:"";position:absolute;inset:0;
  transform:translate(1.5px,1.2px);
  background:rgba(234,223,200,.5);
  -webkit-mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  opacity:.5;
}
@keyframes tutGhostMove{
  0%{left:24%;opacity:.65;}
  72%{opacity:.62;}
  100%{left:66%;opacity:0;}
}
.tut-looptag{
  position:absolute;top:7%;z-index:3;
  font-family:var(--mono);font-size:8px;letter-spacing:.09em;
  border:1px solid rgba(42,61,107,.9);
  background:rgba(14,27,46,.82);
  padding:2px 5px;
}
.tut-looptag span{color:rgba(234,223,200,.5);}
.tut-looptag-a{left:8%;color:var(--ivory);}
.tut-looptag-b{right:8%;color:var(--ochre);}

/* step 4 */

.tut-mini-gate{
  background:url(assets/banig_heist_board.webp) center 42%/cover no-repeat;
}
.tut-gate-art{
  position:absolute;left:6%;top:3%;
  height:90%;width:auto;z-index:2;
  filter:drop-shadow(0 10px 14px rgba(0,0,0,.5));
}
.tut-gate-glow{
  position:absolute;left:10%;top:8%;
  width:26%;height:54%;z-index:1;
  background:radial-gradient(ellipse at 50% 60%,rgba(217,162,43,.36),rgba(217,162,43,0) 70%);
}
.tut-crew-gate{
  position:absolute;left:58%;bottom:7%;
  height:46%;width:auto;z-index:2;
  filter:drop-shadow(0 8px 10px rgba(0,0,0,.4));
}
.tut-bell-chip{
  position:absolute;left:26%;top:22%;z-index:3;
  font-family:var(--mono);font-size:9px;letter-spacing:.1em;
  color:var(--ivory);
  border:1px solid rgba(217,162,43,.55);
  background:rgba(14,27,46,.85);
  padding:4px 7px;
}
.tut-bell-chip b{color:var(--ochre);font-weight:400;}
.tut-eight{
  position:absolute;left:36%;top:8%;z-index:3;
  font-family:var(--mono);font-size:clamp(18px,2.4vw,26px);
  color:var(--ochre);
  border:1px solid rgba(217,162,43,.45);
  background:rgba(14,27,46,.82);
  padding:2px 7px;
}

/* tutorial copy */

.tut-copy{margin-top:13px;text-align:center;}
.tut-copy::before{
  content:"";display:block;width:118px;height:5px;margin:0 auto 9px;
  background:repeating-linear-gradient(90deg,rgba(217,162,43,.78) 0 6px,transparent 6px 10px);
  opacity:.65;
}
.tut-stepbadge{
  width:76px;aspect-ratio:267/281;
  margin:0 auto 2px;
  background:url(assets/weave_frame_03_small_stamp.webp) center/100% 100% no-repeat;
  display:grid;place-items:center;
  filter:drop-shadow(0 6px 10px rgba(0,0,0,.4));
}
#tut-stepno{
  font-family:var(--mono);font-size:10px;letter-spacing:.1em;
  color:var(--ivory);
}
.tut-copy h2{
  font-family:var(--fraunces);font-weight:400;
  font-size:clamp(24px,3.1vw,34px);line-height:1.1;
  margin-top:3px;
}
.tut-copy h2 span{
  display:inline-block;
  font-family:var(--mono);font-weight:400;
  font-size:9px;letter-spacing:.12em;
  color:rgba(234,223,200,.55);
  vertical-align:middle;margin-left:7px;
}
.tut-fil{
  font-size:18px;line-height:1.4;font-weight:600;
  color:var(--ivory);margin-top:8px;
}
.tut-eng{
  font-size:16px;line-height:1.4;
  color:rgba(234,223,200,.75);margin-top:3px;
}
.tut-actions{
  display:flex;align-items:center;justify-content:space-between;
  gap:14px;margin-top:16px;
}
.tut-dots{display:flex;gap:5px;flex-wrap:wrap;}
.tut-dots i{
  display:flex;align-items:center;gap:3px;
  padding:2px 5px;
  font-family:var(--mono);font-size:7px;letter-spacing:.04em;
  font-style:normal;
  color:rgba(234,223,200,.4);
  border:1px solid rgba(234,223,200,.12);
  background:rgba(10,21,38,.5);
}
.tut-dots i b{font-weight:400;color:inherit;}
.tut-dots i.is-on{
  color:var(--ivory);
  border-color:rgba(217,162,43,.65);
  background:rgba(217,162,43,.14);
}
.tut-next{
  min-height:56px;
  padding:10px 30px;
  border:2px solid #f0cd76;
  border-radius:2px;
  background:
    repeating-linear-gradient(0deg,rgba(14,27,46,.10) 0 1px,transparent 1px 5px),
    linear-gradient(180deg,#e4b641,var(--ochre));
  color:var(--ink);
  font-family:var(--sans);font-size:19px;font-weight:700;line-height:1;
  cursor:pointer;
  box-shadow:0 0 0 2px rgba(14,27,46,.65),0 9px 20px rgba(0,0,0,.4);
}
.tut-next span{
  display:block;margin-top:3px;
  font-family:var(--mono);font-size:7px;font-weight:400;
  letter-spacing:.1em;color:rgba(14,27,46,.68);
}
.tut-next:hover{filter:brightness(1.06);}

/* ---------- responsive ---------- */

@media (max-width:1100px){
  .stage{grid-template-columns:minmax(0,1.7fr) minmax(286px,1fr);}
  .rules-tables{grid-template-columns:repeat(2,minmax(0,1fr));}
}

@media (max-width:980px){
  .stage{grid-template-columns:minmax(0,1fr);gap:22px;}
  .board-hud{display:flex;}
  .desk-rail{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    align-items:start;
  }
  .rail-hero{grid-column:1 / -1;}
  .baka-panel{grid-column:1 / -1;}
  .law-panel{grid-column:1 / -1;}
  .radio-row{grid-column:1 / -1;}
  .carried-panel{grid-column:1 / -1;}
}

@media (max-width:760px){
  .title-band{height:clamp(260px,64vw,340px);}
  .title-cartouche{top:54%;}
  .board-hint{font-size:16px;}
  .under-controls{gap:9px;}
  .context-actions{flex:1 1 100%;}
  .pad-wrap{display:flex;}
  .pad{grid-template-columns:repeat(3,40px);grid-template-rows:repeat(3,40px);}
  .rules-grid,.rules-tables,.folk-grid{grid-template-columns:1fr;}
  .pillars{grid-template-columns:1fr;}
    .step-rail{grid-template-columns:repeat(2,minmax(0,1fr));}
  .folk-panel{padding:16px 14px;border-width:12px;}
  .stamps-row{justify-content:center;}
  .waray-note{max-width:none;}
  .board-lines .edge-line{stroke-width:1;}
}

@media (pointer:coarse){
  .pad-wrap{display:flex;}
}

@media (max-width:560px){
  .title-ink h1{letter-spacing:.12em;}
  .tut-overlay{padding:10px;}
  .tut-panel{padding:14px 12px 12px;border-width:12px;}
  .tut-stage{min-height:190px;}
  .tut-copy h2{font-size:25px;}
  .tut-fil{font-size:17px;}
  .tut-eng{font-size:15px;}
  .tut-actions{flex-direction:column;align-items:stretch;gap:10px;}
  .tut-dots{order:2;justify-content:center;}
  .tut-next{order:1;width:100%;min-height:58px;}
  .tut-keys{grid-template-columns:repeat(3,30px);grid-template-rows:repeat(2,30px);}
  .tut-slot-tag{top:62%;}
  .control-strip{padding:6px 7px;border-width:11px;gap:2px;}
  .glyph-btn{min-width:38px;}
  .glyph-btn .key{font-size:7px;}
  .context-actions{flex-direction:column;}
  .woven-btn{width:100%;justify-content:space-between;text-align:left;}
  .rail-hero{grid-template-columns:minmax(0,1fr) minmax(88px,38%);}
  .radio-row{grid-template-columns:minmax(0,1fr);}
  .radio-wrap{width:58%;max-width:190px;}
  .dialogue-panel{min-height:96px;}
  .step em{display:none;}
  .tag-house{left:60%;}
  .tag-dock{left:47%;}
}

@media (max-height:620px) and (min-width:700px){
  .tut-overlay{padding:8px;}
  .tut-panel{
    width:min(920px,100%);
    height:calc(100vh - 16px);
    max-height:calc(100vh - 16px);
    overflow:hidden;
    display:grid;
    grid-template-columns:minmax(0,1.12fr) minmax(0,.88fr);
    grid-template-rows:auto 1fr auto;
    gap:6px 18px;
    padding:14px 16px 12px;
    border-width:12px;
  }
  .tut-skip{
    position:static;
    grid-column:2;grid-row:1;
    justify-self:end;align-self:start;
    padding:2px 4px;font-size:8px;
  }
  .tut-stage{
    grid-column:1;grid-row:1 / span 3;
    margin-top:0;width:100%;height:100%;
    min-height:0;max-height:none;aspect-ratio:auto;
  }
  .tut-copy{
    grid-column:2;grid-row:2;
    margin-top:0;text-align:left;align-self:center;
  }
  .tut-copy::before{margin:0 0 8px;}
  .tut-stepbadge{margin:0 0 2px;}
  .tut-copy h2{font-size:clamp(21px,2.5vw,28px);}
  .tut-fil{font-size:16px;margin-top:6px;}
  .tut-eng{font-size:14px;}
  .tut-actions{
    grid-column:2;grid-row:3;
    margin-top:0;flex-direction:column;align-items:stretch;gap:6px;
  }
  .tut-dots{order:2;justify-content:flex-start;}
  .tut-next{order:1;width:100%;min-height:48px;padding:8px 18px;font-size:17px;}
}

@media (max-width:390px){
  .zone-tag{font-size:6px;letter-spacing:.1em;padding:1px 3px;}
  .plate-tag{font-size:6px;}
  .baka-legend{gap:8px;}
  .baka-legend span{font-size:6px;}
}


/* ---------- tutorial sheet: keep the page and the heist in view ---------- */

.tut-overlay{
  position:relative; inset:auto; z-index:5;
  display:block; margin-top:16px;
  padding:0; background:transparent; pointer-events:auto; overflow:visible;
}
.tut-panel{
  display:block;
  pointer-events:auto;
  width:100%;
  max-height:none;
  overflow:visible;
  border-width:14px;
  padding:14px;
}

/* the tutorial sits in the page under the board, never over it */
.tut-skip{
  position:absolute; top:4px; right:6px; z-index:3;
  grid-column:auto; grid-row:auto;
  padding:5px 9px; font-size:9px; font-weight:600;
  background:var(--ivory); color:var(--ink);
  border:1px solid var(--ivory);
  border-radius:2px;
}
.tut-skip span{color:rgba(14,27,46,.6);}
.tut-stage{
  height:200px; min-height:0; max-height:200px; aspect-ratio:auto;
  grid-column:auto; grid-row:auto;
  margin-top:8px;
}
.tut-copy{
  margin-top:6px; text-align:center; align-self:auto;
  grid-column:auto; grid-row:auto;
}
.tut-copy::before{margin:0 auto 5px;}
.tut-stepbadge{width:44px; margin:0 auto 0;}
#tut-stepno{font-size:8px;}
.tut-copy h2{font-size:22px;}
.tut-fil{font-size:15px; margin-top:4px;}
.tut-eng{font-size:13px;}
.tut-actions{
  display:flex; flex-direction:column; align-items:stretch; gap:6px;
  margin-top:8px;
  grid-column:auto; grid-row:auto;
}
.tut-dots{order:1; justify-content:center;}
.tut-next{order:2; width:100%; min-height:46px; font-size:17px; padding:7px 18px;}

@media (min-width:981px){
  .tut-overlay{
    position:fixed;
    top:calc(clamp(280px,32vw,450px) + 82px);
    right:12px; bottom:12px; left:auto;
    display:flex; align-items:flex-start; justify-content:flex-end;
    padding:0; pointer-events:none; margin:0;
  }
  .tut-panel{
    width:400px;
    height:auto;
    max-height:calc(100vh - 500px);
    overflow-y:auto;
    border-width:14px;
    padding:14px;
  }
  .tut-stage{height:180px; max-height:180px; margin-top:8px;}
  .tut-stepbadge{width:56px;}
  .tut-copy h2{font-size:26px;}
  .tut-fil{font-size:16px;}
  .tut-eng{font-size:14px;}
  .tut-next{min-height:52px;}
}

@media (max-height:620px) and (min-width:700px) and (max-width:980px){
  .tut-overlay{
    position:fixed;
    inset:8px 8px 8px auto;
    align-items:flex-start; justify-content:flex-end; padding:0;
    pointer-events:none;
  }
  .tut-panel{
    width:370px;
    height:auto;
    max-height:calc(100vh - 16px);
    border-width:12px;
    padding:12px;
  }
  .tut-stage{height:160px; max-height:160px; margin-top:6px;}
  .tut-stepbadge{width:40px;}
  .tut-copy h2{font-size:21px;}
  .tut-fil{font-size:14px;}
  .tut-eng{font-size:12px;}
  .tut-next{min-height:44px; font-size:16px;}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
    scroll-behavior:auto !important;
  }
  .banner-threads,.radio-glow{display:none;}
  .tut-ghost{animation:none;left:60%;opacity:.6;}
  .tut-slide{transition:none;}
  .rewind-weave.is-running{animation:none;opacity:.5;}
}

/* =========================================================
   START SCREEN, PICTURE TUTORIAL, PHONE GAME BAR
   Later rules here replace the older tutorial sheet styles.
   ========================================================= */

/* ---------- start screen ---------- */

.start-screen{
  position:fixed;inset:0;z-index:90;
  display:flex;flex-direction:column;
  overflow-y:auto;
  background:var(--ink);
}
.start-sky{
  position:absolute;left:0;right:0;top:0;
  height:min(56vh,520px);
  overflow:hidden;
  border-bottom:1px solid rgba(217,162,43,.12);
}
.start-sky img{
  width:100%;height:100%;object-fit:cover;object-position:center 38%;
  display:block;
  filter:saturate(.98) contrast(1.02);
}
.start-shade{
  position:absolute;inset:0;
  background:
    linear-gradient(180deg,rgba(14,27,46,.06) 0%,rgba(14,27,46,.1) 55%,rgba(14,27,46,.82) 88%,var(--ink) 100%),
    radial-gradient(ellipse at 50% 42%,rgba(14,27,46,.02),rgba(14,27,46,.28) 74%);
}
.start-inner{
  position:relative;z-index:2;
  min-height:100%;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:clamp(12px,2vh,22px);
  padding:max(22px,env(safe-area-inset-top)) 20px max(22px,env(safe-area-inset-bottom));
  text-align:center;
}
.start-cartouche{
  position:relative;
  width:min(90vw,760px);
  aspect-ratio:648/270;
  background:url(assets/weave_frame_01_title_cartouche.webp) center/100% 100% no-repeat;
  filter:drop-shadow(0 24px 38px rgba(0,0,0,.6));
}
.start-cartouche::before{
  content:"";position:absolute;left:9.4%;right:9.4%;top:20.5%;bottom:20%;
  background:linear-gradient(180deg,rgba(14,27,46,.82),rgba(14,27,46,.65));
}
.start-cartouche h1{
  position:absolute;left:0;right:0;top:27%;
  font-family:var(--fraunces);font-weight:700;
  font-size:clamp(34px,8.2vw,86px);
  letter-spacing:.15em;line-height:.9;
  color:var(--ivory);
  font-variation-settings:"SOFT" 100,"WONK" 1;
  margin-left:.15em;
}
.start-fil{
  position:absolute;left:0;right:0;top:54%;
  font-family:var(--fraunces);font-weight:400;
  font-size:clamp(15px,3vw,34px);line-height:1.1;
  color:var(--ivory);
  font-variation-settings:"SOFT" 100,"WONK" 1;
}
.start-eng{
  position:absolute;left:0;right:0;top:70%;
  font-family:var(--sans);font-weight:600;
  font-size:clamp(8px,1.15vw,13px);letter-spacing:.3em;text-transform:uppercase;
  color:rgba(234,223,200,.7);
}
.start-line{
  font-family:var(--sans);font-size:clamp(16px,2vw,19px);
  color:var(--ivory);
  max-width:34ch;line-height:1.35;
}
.start-line span{display:block;font-size:.88em;color:rgba(234,223,200,.6);margin-top:2px;}
.start-actions{
  display:flex;flex-direction:column;gap:11px;
  width:min(420px,90vw);
}
.start-btn{
  display:flex;align-items:center;justify-content:center;gap:14px;
  min-height:64px;padding:10px 22px;
  border-radius:2px;cursor:pointer;
  font-family:var(--sans);font-size:22px;font-weight:700;line-height:1;
  transition:transform .16s ease,filter .16s ease;
}
.start-play{
  border:2px solid #f0cd76;
  background:
    repeating-linear-gradient(0deg,rgba(14,27,46,.10) 0 1px,transparent 1px 5px),
    linear-gradient(180deg,#e4b641,var(--ochre));
  color:var(--ink);
  box-shadow:0 0 0 2px rgba(14,27,46,.8),0 12px 24px rgba(0,0,0,.45);
}
.start-play img{width:44px;height:auto;filter:drop-shadow(0 3px 4px rgba(0,0,0,.4));}
.start-help{
  border:1px solid rgba(234,223,200,.45);
  background:linear-gradient(180deg,rgba(18,35,58,.86),rgba(8,16,29,.92));
  color:var(--ivory);
}
.start-help-mark{
  display:grid;place-items:center;
  width:38px;height:38px;border:1px solid var(--ochre);border-radius:50%;
  font-family:var(--fraunces);font-size:22px;color:var(--ochre);
}
.start-btn-label{display:flex;flex-direction:column;align-items:flex-start;gap:2px;}
.start-btn-label small{
  font-family:var(--mono);font-size:10px;font-weight:400;letter-spacing:.12em;
  opacity:.65;
}
.start-play .start-btn-label small{opacity:.72;}
.start-btn:hover{transform:translateY(-2px);filter:brightness(1.05);}
.start-sound{
  border:0;background:none;color:rgba(234,223,200,.72);
  font-family:var(--mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;
  padding:6px 10px;cursor:pointer;
}
.start-sound span{color:rgba(234,223,200,.45);}
.start-foot{
  font-family:var(--mono);font-size:9px;letter-spacing:.14em;text-transform:uppercase;
  color:rgba(234,223,200,.4);
}
body.start-open{overflow:hidden;}
body.start-open .skip-link,
body.tut-open .skip-link{display:none;}

@media (min-width:760px){
  .start-actions{flex-direction:row;width:min(640px,88vw);}
  .start-btn{flex:1 1 0;min-height:72px;font-size:24px;}
}
@media (max-height:620px){
  .start-inner{gap:8px;padding-top:12px;padding-bottom:12px;}
  .start-cartouche{width:min(70vw,560px);}
  .start-line{display:none;}
  .start-btn{min-height:52px;font-size:18px;}
  .start-foot{display:none;}
}

/* ---------- tutorial: its own screen, never over the board ---------- */

body.tut-open{overflow:hidden;}
body.tut-open .page,
body.tut-open .start-screen{display:none !important;}

.tut-overlay{
  position:fixed;inset:0;z-index:95;
  display:grid;place-items:center;
  justify-content:center;align-items:center;
  margin:0;
  padding:10px;
  overflow-y:auto;
  pointer-events:auto;
  background:
    radial-gradient(ellipse at 50% 28%,rgba(217,162,43,.12),rgba(8,16,29,0) 60%),
    linear-gradient(180deg,rgba(14,27,46,.8),rgba(8,16,29,.95)),
    url(assets/biringan_night_sky.webp) center 46%/cover no-repeat;
}
.tut-panel{
  position:relative;
  width:min(760px,calc(100vw - 20px));
  max-height:calc(100dvh - 20px);
  display:flex;flex-direction:column;
  gap:10px;
  padding:12px;
  border:12px solid transparent;
  border-image:url(assets/weave_frame_01_title_cartouche.webp) 55 stretch;
  background:
    linear-gradient(180deg,rgba(10,21,38,.94),rgba(8,16,29,.97)),
    url(assets/banig_heist_board.webp) center 58%/cover no-repeat;
  background-clip:padding-box;
  box-shadow:0 28px 65px rgba(0,0,0,.65);
  overflow:auto;
}
.tut-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:0 0 auto;}
.tut-count{
  font-family:var(--mono);font-size:11px;letter-spacing:.16em;color:var(--ochre);
}
.tut-skip{
  position:static;
  padding:10px 14px;min-height:40px;
  border:1px solid rgba(234,223,200,.4);
  background:rgba(10,21,38,.7);
  color:var(--ivory);
  font-family:var(--mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase;
  cursor:pointer;border-radius:2px;
}
.tut-skip span{color:rgba(234,223,200,.55);}
.tut-skip:hover{color:var(--ivory);border-color:var(--ochre);}
.tut-stage{
  position:relative;
  width:100%;
  height:clamp(230px,46vh,460px);
  height:clamp(230px,46dvh,460px);
  min-height:0;max-height:none;aspect-ratio:auto;
  margin:0;
  flex:0 0 auto;
  border:1px solid rgba(217,162,43,.55);
  background:var(--ink-2);
  box-shadow:0 0 0 3px #0a1526,0 0 0 4px rgba(217,162,43,.2),0 12px 26px rgba(0,0,0,.48);
  overflow:hidden;
}
.tut-mini{
  position:absolute;inset:0;
  background:url(assets/banig_heist_board.webp) center 45%/cover no-repeat;
}
.tut-mini::after{
  content:"";position:absolute;inset:0;pointer-events:none;z-index:0;
  background:radial-gradient(ellipse at 50% 62%,rgba(14,27,46,0) 42%,rgba(14,27,46,.46));
}

/* step 1: move */

.tut-path{
  position:absolute;left:14%;right:34%;top:62%;height:0;
  z-index:2;
  border-top:4px dashed rgba(230,180,65,.92);
  filter:drop-shadow(0 1px 2px rgba(0,0,0,.85));
  transform:rotate(-3deg);
}
.tut-crew{
  position:absolute;left:15%;bottom:8%;
  height:58%;width:auto;z-index:2;
  filter:drop-shadow(0 8px 10px rgba(0,0,0,.4));
}
.tut-step-pin{
  position:absolute;left:52%;top:56%;z-index:2;
  width:clamp(20px,4vw,28px);height:clamp(20px,4vw,28px);
  border:3px solid var(--ochre);border-radius:50%;
  background:rgba(14,27,46,.55);
  box-shadow:0 0 14px rgba(217,162,43,.4);
}
.tut-keys{
  position:absolute;right:5%;bottom:9%;z-index:3;
  display:grid;
  grid-template-columns:repeat(3,clamp(34px,10vw,54px));
  grid-template-rows:repeat(2,clamp(34px,10vw,54px));
  gap:5px;
}
.tut-keys span{
  display:grid;place-items:center;
  border:1px solid rgba(217,162,43,.55);
  background:rgba(14,27,46,.82);
  color:var(--ivory);
  font-size:clamp(17px,5vw,26px);line-height:1;
  border-radius:2px;
}
.tut-keys .k-up{grid-column:2;grid-row:1;}
.tut-keys .k-left{grid-column:1;grid-row:2;}
.tut-keys .k-down{grid-column:2;grid-row:2;}
.tut-keys .k-right{grid-column:3;grid-row:2;}

/* step 2: record */

.tut-mini-record{
  background:url(assets/biringan_night_sky.webp) center 32%/cover no-repeat;
}
.tut-mat-strip{
  position:absolute;left:0;right:0;bottom:0;height:42%;z-index:1;
  background:url(assets/banig_heist_board.webp) center 48%/cover no-repeat;
  border-top:1px solid rgba(217,162,43,.45);
  box-shadow:0 -10px 22px rgba(14,27,46,.55);
}
.tut-crew-record{
  position:absolute;left:8%;bottom:5%;height:62%;width:auto;z-index:3;
  filter:drop-shadow(0 8px 10px rgba(0,0,0,.45));
}
.tut-stitch{
  position:absolute;left:20%;right:44%;top:66%;height:0;z-index:2;
  border-top:2px dashed rgba(230,180,65,.78);
  filter:drop-shadow(0 1px 2px rgba(0,0,0,.75));
}
.tut-mini-rail{
  position:absolute;right:4%;top:57%;
  width:58%;height:auto;z-index:2;
  filter:drop-shadow(0 8px 12px rgba(0,0,0,.45));
}
.tut-baka{
  position:absolute;left:50%;top:13%;z-index:2;
  height:44%;
  aspect-ratio:166/436;
  transform:translateX(-50%);
  background:var(--ochre);
  opacity:.72;
  -webkit-mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  filter:drop-shadow(0 0 4px rgba(14,27,46,.95)) drop-shadow(0 6px 9px rgba(0,0,0,.4));
}
.tut-baka::after{
  content:"";position:absolute;inset:0;
  transform:translate(1.5px,1.2px);
  background:rgba(234,223,200,.45);
  -webkit-mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  opacity:.5;
}
.tut-slot-lit{
  position:absolute;left:46%;top:59%;z-index:3;
  width:10%;height:14%;
  border:2px solid rgba(217,162,43,.95);
  border-radius:50%;
  box-shadow:inset 0 0 14px rgba(217,162,43,.3),0 0 10px rgba(217,162,43,.25);
}
.tut-slot-tag{
  position:absolute;left:51%;top:79%;z-index:3;
  transform:translateX(-50%);
  font-family:var(--mono);font-size:9px;letter-spacing:.1em;
  color:var(--ochre);
  white-space:nowrap;
  background:rgba(14,27,46,.8);
  border:1px solid rgba(217,162,43,.35);
  padding:1px 5px;
}
.tut-record-big{
  position:absolute;left:6%;top:7%;width:19%;height:auto;z-index:3;
  filter:drop-shadow(0 8px 12px rgba(0,0,0,.55));
}
.tut-record-word{
  position:absolute;left:5.5%;top:29%;z-index:3;
  font-family:var(--mono);font-size:clamp(8px,1.4vw,11px);letter-spacing:.12em;
  color:var(--ochre);
  background:rgba(14,27,46,.8);
  border:1px solid rgba(217,162,43,.35);
  padding:1px 4px;
}

/* step 3: the trace returns */

.tut-mini-loop{background:url(assets/banig_heist_board.webp) center 45%/cover no-repeat;}
.tut-path-2{left:14%;right:28%;top:64%;}
.tut-crew-live{
  position:absolute;left:9%;bottom:7%;
  height:50%;width:auto;z-index:2;
  filter:drop-shadow(0 8px 10px rgba(0,0,0,.4));
}
.tut-ghost{
  position:absolute;left:24%;bottom:7%;z-index:2;
  height:50%;
  aspect-ratio:166/436;
  background:var(--ochre);
  opacity:.65;
  -webkit-mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  animation:tutGhostMove 6s ease-in-out infinite;
}
.tut-ghost::after{
  content:"";position:absolute;inset:0;
  transform:translate(1.5px,1.2px);
  background:rgba(234,223,200,.5);
  -webkit-mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  mask:url(assets/baka_echo_01_idle.webp) center bottom/contain no-repeat;
  opacity:.5;
}
@keyframes tutGhostMove{
  0%{left:24%;opacity:.65;}
  72%{opacity:.62;}
  100%{left:66%;opacity:0;}
}
.tut-looptag{
  position:absolute;top:8%;z-index:3;
  font-family:var(--mono);font-size:clamp(8px,1.5vw,11px);letter-spacing:.09em;
  border:1px solid rgba(42,61,107,.9);
  background:rgba(14,27,46,.82);
  padding:2px 6px;
}
.tut-looptag span{color:rgba(234,223,200,.5);}
.tut-looptag-a{left:8%;color:var(--ivory);}
.tut-looptag-b{right:8%;color:var(--ochre);}

/* step 4: the gate before the bell */

.tut-mini-gate{background:url(assets/banig_heist_board.webp) center 42%/cover no-repeat;}
.tut-gate-art{
  position:absolute;left:4%;top:2%;
  height:94%;width:auto;z-index:2;
  filter:drop-shadow(0 10px 14px rgba(0,0,0,.5));
}
.tut-gate-glow{
  position:absolute;left:8%;top:7%;
  width:28%;height:56%;z-index:1;
  background:radial-gradient(ellipse at 50% 60%,rgba(217,162,43,.38),rgba(217,162,43,0) 70%);
}
.tut-crew-gate{
  position:absolute;left:27%;bottom:9%;
  height:42%;width:auto;z-index:2;
  filter:drop-shadow(0 8px 10px rgba(0,0,0,.4));
}
.tut-path-3{display:none;}
.tut-bell-chip{
  position:absolute;left:24%;top:20%;z-index:3;
  font-family:var(--mono);font-size:clamp(8px,1.5vw,11px);letter-spacing:.1em;
  color:var(--ivory);
  border:1px solid rgba(217,162,43,.55);
  background:rgba(14,27,46,.85);
  padding:4px 8px;
}
.tut-bell-chip b{color:var(--ochre);font-weight:400;}
.tut-eight{
  position:absolute;left:43%;top:7%;z-index:3;
  font-family:var(--mono);font-size:clamp(22px,5vw,34px);
  color:var(--ochre);
  border:1px solid rgba(217,162,43,.45);
  background:rgba(14,27,46,.82);
  padding:2px 9px;
}

/* tutorial copy and controls */

.tut-copy{margin:0;text-align:center;flex:0 0 auto;}
.tut-copy::before{display:none;}
.tut-copy h2{
  font-family:var(--fraunces);font-weight:700;
  font-size:clamp(26px,5.6vw,42px);line-height:1.05;
  color:var(--ivory);
}
.tut-copy h2 span{
  display:inline-block;
  font-family:var(--fraunces);font-weight:400;
  font-size:.55em;
  color:rgba(234,223,200,.62);
  letter-spacing:.01em;margin-left:.35em;
}
.tut-eng{
  font-size:clamp(16px,2.4vw,20px);line-height:1.35;
  color:var(--ivory);margin-top:6px;font-weight:600;
}
.tut-fil{
  font-size:clamp(16px,2vw,18px);line-height:1.4;
  color:rgba(234,223,200,.72);margin-top:2px;font-weight:400;
}
.tut-dots{
  display:flex;justify-content:center;gap:8px;
  margin:0;flex:0 0 auto;
}
.tut-dots i{
  width:34px;height:34px;
  display:grid;place-items:center;
  border:1px solid rgba(234,223,200,.18);
  background:rgba(10,21,38,.5);
  color:rgba(234,223,200,.45);
  font-style:normal;
  font-family:var(--mono);font-size:11px;
  border-radius:50%;
}
.tut-dots i b{font-weight:400;color:inherit;}
.tut-dots i.is-on{
  border-color:var(--ochre);
  color:var(--ochre);
  background:rgba(217,162,43,.14);
}
.tut-next{
  width:100%;min-height:64px;margin:0;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  border:2px solid #f0cd76;
  border-radius:2px;
  background:
    repeating-linear-gradient(0deg,rgba(14,27,46,.10) 0 1px,transparent 1px 5px),
    linear-gradient(180deg,#e4b641,var(--ochre));
  color:var(--ink);
  font-family:var(--sans);font-size:22px;font-weight:700;line-height:1;
  cursor:pointer;
  box-shadow:0 0 0 2px rgba(14,27,46,.65),0 9px 20px rgba(0,0,0,.4);
  flex:0 0 auto;
}
.tut-next span{
  display:block;margin-top:3px;
  font-family:var(--mono);font-size:8px;font-weight:400;
  letter-spacing:.1em;color:rgba(14,27,46,.68);
}
.tut-next:hover{filter:brightness(1.06);}

@media (max-height:620px) and (min-width:700px){
  .tut-panel{
    width:min(900px,calc(100vw - 16px));
    display:grid;
    grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);
    grid-template-rows:auto 1fr auto auto;
    gap:8px 18px;
    max-height:calc(100dvh - 16px);
  }
  .tut-head{grid-column:1 / -1;grid-row:1;}
  .tut-stage{
    grid-column:1;grid-row:2 / span 3;
    height:auto;min-height:0;
  }
  .tut-copy{grid-column:2;grid-row:2;text-align:left;align-self:center;}
  .tut-dots{grid-column:2;grid-row:3;justify-content:flex-start;}
  .tut-next{grid-column:2;grid-row:4;min-height:52px;font-size:18px;}
  .tut-copy h2{font-size:clamp(22px,2.8vw,30px);}
  .tut-eng{font-size:16px;}
  .tut-fil{font-size:14px;}
}

/* ---------- phone game bar and larger touch controls ---------- */

.game-bar{display:none;}

@media (max-width:760px){
  body.in-game .title-band,
  body.in-game .title-actions{display:none !important;}
  body.in-game .game-bar{
    display:flex;align-items:center;justify-content:space-between;gap:8px;
    position:fixed;left:0;right:0;top:0;z-index:25;
    margin:0;
    padding:7px clamp(14px,3vw,40px);
    border-bottom:1px solid rgba(217,162,43,.28);
    background:rgba(10,21,38,.97);
  }
  .game-bar-title{
    font-family:var(--fraunces);font-weight:700;
    font-size:15px;letter-spacing:.13em;line-height:1;
  }
  .game-bar-title small{
    display:block;margin-top:2px;
    font-family:var(--sans);font-size:8px;font-weight:600;
    letter-spacing:.13em;text-transform:uppercase;
    color:rgba(234,223,200,.58);
  }
  .game-bar-actions{display:flex;gap:6px;}
  .pagebar-btn{
    display:flex;align-items:center;gap:6px;
    min-height:42px;padding:4px 10px;
    border:1px solid rgba(217,162,43,.5);
    border-radius:2px;
    background:rgba(42,61,107,.35);
    color:var(--ivory);
    font-family:var(--sans);font-size:12px;font-weight:600;
    cursor:pointer;
  }
  .help-dot{
    display:grid;place-items:center;
    width:21px;height:21px;
    border:1px solid var(--ochre);border-radius:50%;
    font-family:var(--fraunces);font-size:13px;color:var(--ochre);
  }
  .mono-key{font-family:var(--mono);font-size:9px;color:var(--ochre);}
  body.in-game main{padding-top:64px;}
  body.in-game .stage{margin-top:0;}

  .board-hud{display:flex;font-size:11px;gap:9px;padding:8px 10px;}
  .control-strip{padding:8px;border-width:12px;gap:2px;}
  .glyph-btn{min-width:44px;}
  .glyph-btn img{width:34px;}
  .glyph-btn .key{font-size:8px;}
  .pad{grid-template-columns:repeat(3,48px);grid-template-rows:repeat(3,48px);}
  .pad-btn{font-size:17px;}
  .context-actions{flex-direction:row;flex-wrap:wrap;}
  .context-actions .woven-btn{flex:1 1 45%;width:auto;justify-content:center;min-height:48px;font-size:14px;}
  .pad-wrap{order:2;flex:1 1 100%;justify-content:center;}
  .rules-btn{order:3;flex:1 1 100%;flex-direction:row;align-items:center;justify-content:center;gap:8px;min-height:46px;}

  .pause-panel{width:min(344px,94%);padding:16px 14px;}
  .pause-kicker{font-size:10px;margin-bottom:10px;}
  .pause-btn{min-height:52px;font-size:15px;padding:9px 12px;}
  .pause-btn span{font-size:8px;}

  .rail-hero{grid-template-columns:minmax(0,1fr) minmax(86px,33%);}
  .loop-number b,.pag-value b{font-size:30px;}
  .dialogue-fil{font-size:16px;}
}

@media (max-width:560px){
  #heist{scroll-margin-top:64px;}
  .zone-tag{font-size:7px;letter-spacing:.08em;padding:2px 4px;line-height:1.15;}
  .zone-tag span{display:none;}
  .plate-tag{display:none;}
  .tag-house{left:62%;}
  .tag-dock{left:52%;top:50%;}
  .board-token{display:none;}
}

/* bilingual hint under the board */
.board-hint-wrap{margin-top:10px;}
.board-hint-wrap .board-hint{margin-top:0;min-height:0;}
.board-hint-en{
  margin:2px 0 0;
  padding-left:15px;
  font-size:16px;line-height:1.4;
  color:rgba(234,223,200,.68);
}
@media (max-width:560px){
  .board-hint{font-size:16px;}
  .board-hint-en{font-size:16px;}
}

@media (max-width:560px){
  .board-hud{font-size:9.5px;letter-spacing:.05em;justify-content:space-between;gap:6px;padding:7px 8px;}
  .hud-item b{margin-left:2px;}
}

/* tablet rail: keep the banner a strip, not a wall */
@media (min-width:561px) and (max-width:980px){
  .rail-hero{grid-template-columns:minmax(0,1fr) minmax(150px,180px);}
  .banner-wrap{max-width:180px;justify-self:end;}
  .radio-wrap{max-width:190px;}
}

/* game bar text styles, used on narrow screens and short landscape */
.game-bar-title{
  font-family:var(--fraunces);font-weight:700;
  font-size:15px;letter-spacing:.13em;line-height:1;
}
.game-bar-title small{
  display:block;margin-top:2px;
  font-family:var(--sans);font-size:8px;font-weight:600;
  letter-spacing:.13em;text-transform:uppercase;
  color:rgba(234,223,200,.58);
}
.game-bar-actions{display:flex;gap:6px;}
.pagebar-btn{
  display:flex;align-items:center;gap:6px;
  min-height:42px;padding:4px 10px;
  border:1px solid rgba(217,162,43,.5);
  border-radius:2px;
  background:rgba(42,61,107,.35);
  color:var(--ivory);
  font-family:var(--sans);font-size:12px;font-weight:600;
  cursor:pointer;
}
.help-dot{
  display:grid;place-items:center;
  width:21px;height:21px;
  border:1px solid var(--ochre);border-radius:50%;
  font-family:var(--fraunces);font-size:13px;color:var(--ochre);
}
.mono-key{font-family:var(--mono);font-size:9px;color:var(--ochre);}

@media (orientation:landscape) and (max-height:560px) and (min-width:761px){
  body.in-game .title-band,
  body.in-game .title-actions{display:none !important;}
  body.in-game .game-bar{
    display:flex;align-items:center;justify-content:space-between;gap:8px;
    position:fixed;left:0;right:0;top:0;z-index:25;
    margin:0;padding:7px clamp(14px,3vw,40px);
    border-bottom:1px solid rgba(217,162,43,.28);
    background:rgba(10,21,38,.97);
  }
  body.in-game main{padding-top:64px;}
  body.in-game .stage{margin-top:0;}
  body.in-game .board-col{display:flex;flex-direction:column;align-items:center;}
  body.in-game .board-hud{width:100%;}
  body.in-game .board{
    flex:0 0 auto;
    width:auto;
    height:calc(100vh - 72px);
    height:calc(100dvh - 72px);
    max-width:100%;
  }
  body.in-game .board-hint-wrap,
  body.in-game .control-strip,
  body.in-game .under-controls{width:100%;}
}

@media (max-height:680px) and (max-width:760px){
  .tut-panel{gap:7px;padding:10px;}
  .tut-stage{height:clamp(170px,36vh,270px);height:clamp(170px,36dvh,270px);}
  .tut-copy h2{font-size:26px;}
  .tut-eng{font-size:16px;margin-top:4px;}
  .tut-fil{font-size:15px;margin-top:1px;}
  .tut-dots{gap:6px;}
  .tut-dots i{width:28px;height:28px;font-size:10px;}
  .tut-next{min-height:56px;font-size:20px;}
  .tut-skip{min-height:36px;padding:8px 12px;}
}

@media (max-width:380px){
  .board-hud{font-size:8.5px;letter-spacing:.02em;gap:4px;padding:6px 7px;}
  .tag-house{left:50%;}
  .tag-dock{left:46%;}
  .control-strip{border-width:10px;padding:6px;gap:1px;}
  .glyph-btn{min-width:38px;}
  .glyph-btn img{width:30px;}
  .strip-sep{margin:1px;}
}

@media (prefers-reduced-motion:reduce){
  .tut-ghost{animation:none !important;left:56%;opacity:.6;}
  .tut-next,.start-btn,.tut-skip{transition:none !important;}
}

#tut-stepno{font-size:11px;letter-spacing:.16em;color:var(--ochre);}

/* ---------- the mat at night: painted light, not a flat grid ---------- */

.board-art{filter:saturate(.98) contrast(1.05) brightness(.93);}
.landmark img{
  filter:drop-shadow(0 14px 18px rgba(0,0,0,.4)) saturate(.97) contrast(1.04) brightness(.94);
}
.board::after{
  box-shadow:inset 0 0 96px rgba(8,16,29,.6),inset 0 0 26px rgba(42,61,107,.22);
}
.gate-glow{z-index:6;}

.night-lights{
  position:absolute;inset:0;z-index:5;pointer-events:none;
  overflow:hidden;
}
.night-lights span{position:absolute;display:block;}

.night-wash{
  inset:0;
  background:
    linear-gradient(180deg,rgba(14,27,46,.56) 0%,rgba(14,27,46,.2) 28%,rgba(14,27,46,.16) 56%,rgba(14,27,46,.55) 100%),
    radial-gradient(110% 85% at 52% 42%,rgba(42,61,107,.04),rgba(14,27,46,.34) 74%);
  mix-blend-mode:multiply;
}
.night-cool{
  inset:0;
  background:
    radial-gradient(85% 70% at 44% 26%,rgba(105,138,196,.18),rgba(42,61,107,0) 64%),
    radial-gradient(90% 80% at 82% 78%,rgba(62,127,107,.14),rgba(42,61,107,0) 60%);
  mix-blend-mode:screen;
  opacity:.75;
}
.night-vignette{
  inset:0;
  background:
    radial-gradient(ellipse at 50% 48%,rgba(14,27,46,0) 52%,rgba(14,27,46,.42) 100%),
    linear-gradient(180deg,rgba(14,27,46,.05),rgba(14,27,46,0) 22%,rgba(8,16,29,.12));
  mix-blend-mode:multiply;
}
.lamp{
  border-radius:50%;
  transform:translate(-50%,-50%);
  mix-blend-mode:screen;
  filter:blur(1px);
}
.lamp-gate{
  left:19%;top:15%;width:28%;height:28%;
  background:radial-gradient(circle,rgba(255,220,140,.82) 0%,rgba(240,180,70,.5) 18%,rgba(217,162,43,.18) 46%,rgba(217,162,43,0) 72%);
}
.lamp-house{
  left:82%;top:23%;width:26%;height:24%;
  background:radial-gradient(circle,rgba(255,222,146,.7) 0%,rgba(240,178,64,.38) 20%,rgba(217,162,43,.12) 48%,rgba(217,162,43,0) 72%);
}
.lamp-dock-a{
  left:69.5%;top:59%;width:20%;height:18%;
  background:radial-gradient(circle,rgba(255,214,128,.9) 0%,rgba(240,178,64,.48) 18%,rgba(217,162,43,.14) 46%,rgba(217,162,43,0) 72%);
}
.lamp-dock-b{
  left:82%;top:57%;width:20%;height:18%;
  background:radial-gradient(circle,rgba(255,214,128,.8) 0%,rgba(240,178,64,.42) 18%,rgba(217,162,43,.12) 46%,rgba(217,162,43,0) 72%);
}
.lamp-center{
  left:52%;top:47%;width:52%;height:46%;opacity:.5;
  background:radial-gradient(circle,rgba(255,206,112,.2) 0%,rgba(217,162,43,.08) 34%,rgba(217,162,43,0) 66%);
}
.water-glow{
  left:58%;top:54%;width:42%;height:36%;
  background:
    radial-gradient(ellipse at 32% 24%,rgba(255,196,90,.28),rgba(217,162,43,0) 56%),
    radial-gradient(ellipse at 66% 34%,rgba(255,196,90,.18),rgba(217,162,43,0) 56%);
  mix-blend-mode:screen;
  filter:blur(4px);
  opacity:.85;
}
.water-glints{
  left:56%;right:2%;bottom:4%;height:24%;
  background:repeating-linear-gradient(180deg,rgba(255,205,120,.08) 0 1px,rgba(255,205,120,0) 1px 7px);
  transform:skewX(-9deg);
  filter:blur(1px);
  opacity:.65;
  mix-blend-mode:screen;
}
.mat-shadow{
  inset:0;
  background:
    radial-gradient(ellipse at 18% 26%,rgba(14,27,46,.26),rgba(14,27,46,0) 42%),
    radial-gradient(ellipse at 86% 66%,rgba(14,27,46,.2),rgba(14,27,46,0) 40%),
    linear-gradient(118deg,rgba(14,27,46,.2) 0%,rgba(14,27,46,0) 32%,rgba(14,27,46,0) 62%,rgba(14,27,46,.2) 100%);
  mix-blend-mode:multiply;
  opacity:.9;
}
.night-weave{
  inset:0;
  background:
    repeating-linear-gradient(0deg,rgba(234,223,200,.045) 0,rgba(234,223,200,.045) 1px,transparent 1px,transparent 7px),
    repeating-linear-gradient(90deg,rgba(14,27,46,.06) 0,rgba(14,27,46,.06) 1px,transparent 1px,transparent 9px);
  mix-blend-mode:soft-light;
  opacity:.7;
}
.night-grain{
  inset:0;
  background:url(assets/board_grain.png) repeat;
  background-size:128px 128px;
  mix-blend-mode:overlay;
  opacity:.12;
}

.figure.attendant img{filter:drop-shadow(0 9px 12px rgba(0,0,0,.42)) brightness(.92) saturate(.92);}
.figure.sibling img{filter:drop-shadow(0 9px 12px rgba(0,0,0,.4)) brightness(.98) saturate(.98);}
.figure.live img{filter:drop-shadow(0 9px 14px rgba(0,0,0,.48)) drop-shadow(0 0 6px rgba(217,162,43,.22));}
.figure.ghost .ghost-body{filter:drop-shadow(0 7px 9px rgba(0,0,0,.28)) brightness(1.05);}

.edge-line{stroke:rgba(234,223,200,.32);}
.node-point{fill:rgba(234,223,200,.46);}
.door-line{stroke:rgba(200,74,64,.7);}
.trail{stroke-width:3;opacity:.95;}

@media (max-width:760px){
  .figure.live{height:26%;}
  .figure.attendant{height:30%;}
  .figure.sibling{height:19%;}
  .figure.ghost{height:26%;}
}

/* brighten the points of play and the person, not the whole mat */
.lamp-house{
  left:81%;top:17%;width:28%;height:26%;
  background:radial-gradient(circle,rgba(255,224,150,.88) 0%,rgba(242,182,70,.52) 20%,rgba(217,162,43,.18) 48%,rgba(217,162,43,0) 74%);
}
.lamp-center{
  left:52%;top:48%;width:66%;height:58%;opacity:.65;
  background:radial-gradient(circle,rgba(255,206,112,.24) 0%,rgba(217,162,43,.09) 36%,rgba(217,162,43,0) 68%);
}
.figure.live::before{
  content:"";position:absolute;left:50%;bottom:-2%;width:190%;height:64%;
  transform:translateX(-50%);
  background:radial-gradient(ellipse at 50% 72%,rgba(255,210,130,.34),rgba(217,162,43,.08) 48%,rgba(217,162,43,0) 72%);
  mix-blend-mode:screen;z-index:-1;pointer-events:none;
}
.figure.live img{
  filter:drop-shadow(0 9px 14px rgba(0,0,0,.48)) drop-shadow(0 0 7px rgba(217,162,43,.3)) brightness(1.06);
}
.edge-line{stroke:rgba(234,223,200,.38);}
.node-point{fill:rgba(234,223,200,.52);}

@media (max-width:760px){
  .figure.live{height:28%;}
  .figure.attendant{height:33%;}
  .figure.sibling{height:19%;}
  .figure.ghost{height:28%;}
}

/* the tutorial pictures sit in the same night */
.tut-mini::after{
  background:
    radial-gradient(ellipse at 50% 58%,rgba(217,162,43,.16),rgba(217,162,43,0) 52%),
    linear-gradient(180deg,rgba(14,27,46,.44),rgba(14,27,46,.1) 40%,rgba(14,27,46,.5));
  mix-blend-mode:multiply;
}
.tut-mini-gate::after{
  background:
    radial-gradient(ellipse at 24% 34%,rgba(255,208,120,.22),rgba(217,162,43,0) 42%),
    radial-gradient(ellipse at 50% 58%,rgba(217,162,43,.14),rgba(217,162,43,0) 52%),
    linear-gradient(180deg,rgba(14,27,46,.4),rgba(14,27,46,.08) 40%,rgba(14,27,46,.48));
}

.lamp-house{
  left:80%;top:17%;width:32%;height:30%;
  background:radial-gradient(circle,rgba(255,226,154,.96) 0%,rgba(244,184,72,.62) 20%,rgba(217,162,43,.24) 48%,rgba(217,162,43,0) 76%);
}
.figure.live::before{
  width:220%;height:76%;
  background:radial-gradient(ellipse at 50% 70%,rgba(255,212,136,.4),rgba(217,162,43,.1) 48%,rgba(217,162,43,0) 74%);
}
.figure.live img{
  filter:drop-shadow(0 0 9px rgba(255,214,138,.4)) drop-shadow(0 9px 14px rgba(0,0,0,.5)) brightness(1.18) saturate(1.06);
}

.figure.live::after{
  content:"";position:absolute;left:50%;top:50%;width:165%;height:115%;
  transform:translate(-50%,-50%);
  background:radial-gradient(ellipse at 50% 48%,rgba(255,220,160,.2),rgba(255,220,160,0) 62%);
  mix-blend-mode:screen;z-index:2;pointer-events:none;
}

/* tutorial illustrations are part of the same night */
.tut-mini::before{
  content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
  background:
    radial-gradient(circle at 18% 28%,rgba(255,214,130,.24),rgba(217,162,43,0) 44%),
    radial-gradient(circle at 78% 30%,rgba(255,214,130,.2),rgba(217,162,43,0) 44%),
    radial-gradient(circle at 70% 68%,rgba(255,214,130,.2),rgba(217,162,43,0) 44%);
  mix-blend-mode:screen;
}
.tut-mini::after{
  z-index:0;
  background:
    radial-gradient(ellipse at 50% 58%,rgba(217,162,43,.12),rgba(217,162,43,0) 50%),
    linear-gradient(180deg,rgba(14,27,46,.58),rgba(14,27,46,.28) 40%,rgba(14,27,46,.66));
  mix-blend-mode:multiply;
}

/* final light balance: keep the straw readable under the night */
.board-art{filter:saturate(1) contrast(1.04) brightness(.98);}
.night-wash{
  background:
    linear-gradient(180deg,rgba(14,27,46,.52) 0%,rgba(14,27,46,.16) 28%,rgba(14,27,46,.1) 56%,rgba(14,27,46,.52) 100%),
    radial-gradient(110% 85% at 52% 42%,rgba(42,61,107,.03),rgba(14,27,46,.3) 74%);
}
.lamp-center{
  opacity:.8;width:74%;height:66%;
  background:radial-gradient(circle,rgba(255,210,120,.28) 0%,rgba(217,162,43,.1) 38%,rgba(217,162,43,0) 70%);
}

.tut-mini::after{
  background:
    radial-gradient(ellipse at 50% 58%,rgba(217,162,43,.1),rgba(217,162,43,0) 50%),
    radial-gradient(ellipse at 20% 20%,rgba(42,61,107,.26),rgba(42,61,107,0) 60%),
    linear-gradient(180deg,rgba(14,27,46,.62),rgba(14,27,46,.32) 40%,rgba(14,27,46,.68));
  mix-blend-mode:multiply;
}

.figure.live::after{
  background:radial-gradient(ellipse at 50% 50%,rgba(255,224,170,.28),rgba(255,224,170,.06) 45%,rgba(255,224,170,0) 66%);
}
@media (max-width:560px){
  .tag-dock{left:58%;top:52%;}
}

.mat-wash{
  inset:0;
  background:
    radial-gradient(ellipse at 36% 40%,rgba(217,162,43,.1),rgba(217,162,43,0) 38%),
    radial-gradient(ellipse at 64% 58%,rgba(62,127,107,.08),rgba(62,127,107,0) 34%),
    radial-gradient(ellipse at 48% 72%,rgba(168,52,46,.06),rgba(168,52,46,0) 30%),
    radial-gradient(ellipse at 22% 66%,rgba(42,61,107,.1),rgba(42,61,107,0) 38%);
  mix-blend-mode:soft-light;
  opacity:.9;
}
.lamp-house{
  left:79%;top:16%;width:28%;height:26%;
  background:radial-gradient(circle,rgba(255,224,150,.82) 0%,rgba(242,182,70,.5) 22%,rgba(217,162,43,.16) 50%,rgba(217,162,43,0) 76%);
}

/* short portrait frame, the size the mindblown phone frame gives the game */
@media (max-height:760px) and (max-width:760px){
  body.in-game .game-bar{padding:4px 10px;}
  .game-bar .pagebar-btn{min-height:36px;padding:2px 8px;font-size:11px;}
  .game-bar .help-dot{width:18px;height:18px;font-size:11px;}
  .game-bar-title{font-size:13px;}
  .game-bar-title small{font-size:7px;}
  .board-hud{font-size:9.5px;padding:5px 8px;gap:5px;}
  .board-hint-wrap{margin-top:6px;}
  .board-hint{font-size:14px;line-height:1.3;}
  .board-hint-en{font-size:13px;line-height:1.3;margin-top:0;}
  .control-strip{margin-top:4px;padding:5px 6px;border-width:10px;gap:1px;}
  .glyph-btn{min-width:38px;}
  .glyph-btn img{width:28px;}
  .glyph-btn .key{font-size:7px;}
  .under-controls{margin-top:6px;gap:6px;}
  .context-actions{gap:6px;}
  .context-actions .woven-btn{min-height:44px;font-size:12px;padding:4px 6px;}
  .pad{grid-template-columns:repeat(3,42px);grid-template-rows:repeat(3,42px);gap:3px;}
  .pad-btn{font-size:15px;}
  .pad-wrap{order:2;flex:1 1 100%;justify-content:center;}
  .rules-btn{order:3;flex:1 1 100%;min-height:38px;font-size:12px;}
}

/* the D-pad and page bar are woven too, not plain UI chrome */
.pad-btn{
  background:
    repeating-linear-gradient(0deg,rgba(234,223,200,.06) 0,rgba(234,223,200,.06) 1px,transparent 1px,transparent 5px),
    repeating-linear-gradient(90deg,rgba(14,27,46,.16) 0,rgba(14,27,46,.16) 1px,transparent 1px,transparent 7px),
    linear-gradient(180deg,rgba(42,61,107,.62),rgba(17,33,55,.7));
  box-shadow:inset 0 0 0 1px rgba(234,223,200,.07),0 2px 0 rgba(0,0,0,.35);
}
.pagebar-btn{
  background:
    repeating-linear-gradient(0deg,rgba(234,223,200,.05) 0,rgba(234,223,200,.05) 1px,transparent 1px,transparent 5px),
    linear-gradient(180deg,rgba(42,61,107,.4),rgba(17,33,55,.5));
}

/* portrait game: the board leads, the controls are compact */
@media (max-width:760px){
  body.in-game main{padding-top:56px;}
  .board-hint-wrap{margin-top:6px;}
  .board-hint{font-size:15px;line-height:1.3;}
  .board-hint-en{font-size:14px;line-height:1.3;margin-top:0;}
  .control-strip{margin-top:4px;padding:5px 6px;border-width:9px;gap:1px;}
  .glyph-btn{min-width:38px;}
  .glyph-btn img{width:27px;}
  .glyph-btn .key{font-size:7px;}
  .under-controls{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px;margin-top:6px;}
  .context-actions{flex:1 1 auto;flex-direction:column;gap:6px;min-width:0;}
  .context-actions .woven-btn{width:100%;min-height:44px;font-size:13px;padding:4px 8px;justify-content:flex-start;}
  .pad-wrap{order:2;flex:0 0 auto;justify-content:flex-end;}
  .pad{grid-template-columns:repeat(3,42px);grid-template-rows:repeat(3,42px);gap:3px;}
  .pad-btn{font-size:15px;}
  .rules-btn{display:flex;order:3;flex:1 1 100%;min-height:34px;font-size:12px;flex-direction:row;align-items:center;justify-content:center;gap:8px;}
  .game-bar-title small{display:none;}
  #rules{scroll-margin-top:64px;}
}
@media (max-width:380px){
  .game-bar-title{display:none;}
}

@media (max-width:760px){
  .pagebar-btn{white-space:nowrap;flex:0 0 auto;}
  .game-bar-title{white-space:nowrap;}
}

/* landscape phone: the board and the desk rail together fill the frame */
@media (orientation:landscape) and (max-height:560px){
  body.in-game .title-band,
  body.in-game .title-actions{display:none !important;}
  body.in-game .game-bar{
    display:flex;align-items:center;justify-content:space-between;gap:8px;
    position:fixed;left:0;right:0;top:0;z-index:25;
    margin:0;padding:5px 12px;
    border-bottom:1px solid rgba(217,162,43,.28);
    background:rgba(10,21,38,.97);
  }
  body.in-game .game-bar-title{font-size:13px;letter-spacing:.12em;}
  body.in-game .game-bar-title small{font-size:7px;}
  body.in-game .pagebar-btn{min-height:34px;padding:2px 8px;font-size:11px;}
  body.in-game .help-dot{width:18px;height:18px;font-size:11px;}
  body.in-game main{padding-top:58px;}
  body.in-game .stage{
    display:grid;
    grid-template-columns:minmax(0,1.7fr) minmax(200px,1fr);
    gap:12px;
    align-items:start;
    margin-top:0;
  }
  body.in-game .board-col{display:flex;flex-direction:column;align-items:stretch;min-width:0;}
  body.in-game .board-hud{display:flex;width:100%;font-size:9px;padding:5px 8px;gap:6px;letter-spacing:.05em;}
  body.in-game .board{
    flex:0 0 auto;
    width:auto;
    height:calc(100vh - 100px);
    height:calc(100dvh - 100px);
    max-height:calc(100vh - 100px);
    max-width:100%;
    align-self:center;
  }
  body.in-game .figure.live{height:26%;}
  body.in-game .figure.attendant{height:31%;}
  body.in-game .figure.sibling{height:19%;}
  body.in-game .figure.ghost{height:26%;}
  body.in-game .board-hint-wrap{margin-top:5px;}
  body.in-game .board-hint{font-size:13px;line-height:1.25;}
  body.in-game .board-hint-en{font-size:12px;line-height:1.25;}
  body.in-game .control-strip{margin-top:4px;padding:4px 6px;border-width:8px;gap:1px;}
  body.in-game .glyph-btn{min-width:34px;}
  body.in-game .glyph-btn img{width:25px;}
  body.in-game .glyph-btn .key{font-size:6px;}
  body.in-game .under-controls{margin-top:5px;gap:6px;}
  body.in-game .context-actions{flex:1 1 auto;flex-direction:row;flex-wrap:wrap;}
  body.in-game .context-actions .woven-btn{flex:1 1 45%;min-height:36px;font-size:11px;padding:4px 6px;}
  body.in-game .pad-wrap{order:2;flex:0 0 auto;}
  body.in-game .pad{grid-template-columns:repeat(3,34px);grid-template-rows:repeat(3,34px);gap:2px;}
  body.in-game .pad-btn{font-size:13px;}
  body.in-game .rules-btn{display:flex;order:3;flex:1 1 100%;min-height:32px;font-size:11px;flex-direction:row;align-items:center;justify-content:center;gap:8px;}
  body.in-game .desk-rail{display:flex;flex-direction:column;gap:9px;min-width:0;}
  body.in-game .rail-hero{grid-template-columns:minmax(0,1fr) minmax(78px,36%);gap:8px;}
  body.in-game .rail-readouts{gap:8px;}
  body.in-game .wpanel{padding:6px 8px;border-width:10px;}
  body.in-game .loop-number b,.pag-value b{font-size:21px;}
  body.in-game .clock{font-size:17px;}
  body.in-game #rules{scroll-margin-top:56px;}
}

@media (orientation:landscape) and (max-height:560px){
  body.in-game #heist{scroll-margin-top:64px;}
  body.in-game .board{
    height:calc(100vh - 110px);
    height:calc(100dvh - 110px);
    max-height:calc(100vh - 110px);
  }
}

@media (orientation:landscape) and (max-height:560px){
  body.in-game .board{
    width:min(100%,calc((100vh - 110px) * 1.5));
    width:min(100%,calc((100dvh - 110px) * 1.5));
    height:auto;
    max-height:calc(100vh - 110px);
    max-height:calc(100dvh - 110px);
    aspect-ratio:3/2;
  }
}

@media (orientation:landscape) and (max-height:560px) and (min-width:560px){
  .tut-overlay{padding:8px;}
  .tut-panel{
    width:min(900px,calc(100vw - 16px));
    display:grid;
    grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);
    grid-template-rows:auto 1fr auto auto;
    gap:6px 16px;
    max-height:calc(100dvh - 16px);
    padding:10px;
  }
  .tut-head{grid-column:1 / -1;grid-row:1;}
  .tut-stage{grid-column:1;grid-row:2 / span 3;height:auto;min-height:0;}
  .tut-copy{grid-column:2;grid-row:2;text-align:left;align-self:center;}
  .tut-dots{grid-column:2;grid-row:3;justify-content:flex-start;}
  .tut-next{grid-column:2;grid-row:4;min-height:46px;font-size:17px;}
  .tut-copy h2{font-size:clamp(20px,2.6vw,26px);}
  .tut-eng{font-size:15px;}
  .tut-fil{font-size:13px;}
}

/* the page chrome is woven and painted, not flat navy */
.game-bar{
  background:
    repeating-linear-gradient(0deg,rgba(234,223,200,.05) 0,rgba(234,223,200,.05) 1px,transparent 1px,transparent 6px),
    linear-gradient(180deg,rgba(42,61,107,.32),rgba(10,21,38,.97));
}
.context-actions .woven-btn{
  background:
    repeating-linear-gradient(0deg,rgba(234,223,200,.05) 0,rgba(234,223,200,.05) 1px,transparent 1px,transparent 6px),
    linear-gradient(180deg,rgba(42,61,107,.4),rgba(18,35,60,.55));
}
.rules-panel{
  background:
    linear-gradient(180deg,rgba(10,21,38,.93),rgba(8,16,29,.96)),
    url(assets/banig_heist_board.webp) center 60%/cover no-repeat;
  background-clip:padding-box;
}

body.in-game .game-bar{
  background:
    repeating-linear-gradient(0deg,rgba(234,223,200,.05) 0,rgba(234,223,200,.05) 1px,transparent 1px,transparent 6px),
    linear-gradient(180deg,rgba(42,61,107,.35),rgba(10,21,38,.97));
}

.rules-btn{
  background:
    repeating-linear-gradient(0deg,rgba(234,223,200,.05) 0,rgba(234,223,200,.05) 1px,transparent 1px,transparent 6px),
    linear-gradient(180deg,rgba(42,61,107,.35),rgba(10,21,38,.7));
  border-color:rgba(217,162,43,.35);
}
.rules-btn small{color:rgba(234,223,200,.6);}

/* ============================================================
   PORTRAIT FINISH
   The phone view is a painted mat under lamplight: a lit city
   ledge at the top, a thick woven mat around the board, and
   warm woven panels down the rail. Later rules win.
   ============================================================ */

@media (max-width:760px){
  body.in-game{
    background-color:#0b1728;
    background-image:
      radial-gradient(ellipse at 50% -8%,rgba(217,162,43,.22),rgba(217,162,43,0) 46%),
      radial-gradient(ellipse at 94% 44%,rgba(62,127,107,.13),rgba(62,127,107,0) 42%),
      radial-gradient(ellipse at 6% 94%,rgba(168,52,46,.11),rgba(168,52,46,0) 44%),
      linear-gradient(180deg,rgba(14,27,46,.93),rgba(8,16,29,.97)),
      url(assets/biringan_night_sky.webp);
    background-size:auto,auto,auto,cover,cover;
    background-position:center top,center,center,center,center 34%;
  }

  /* the top bar is a lit ledge of the city, not a strip of flat navy */
  body.in-game .game-bar{
    padding:8px 12px 7px;
    border-bottom:0;
    background:
      linear-gradient(180deg,rgba(8,16,29,.18),rgba(8,16,29,.86) 74%,rgba(8,16,29,.97)),
      url(assets/biringan_night_sky.webp) center 18%/cover no-repeat;
    box-shadow:0 1px 0 rgba(217,162,43,.5),0 9px 22px rgba(0,0,0,.55);
  }
  body.in-game .game-bar::after{
    content:"";position:absolute;left:0;right:0;bottom:-4px;height:4px;
    background:
      repeating-linear-gradient(90deg,rgba(217,162,43,.85) 0 5px,rgba(42,61,107,.9) 5px 9px,rgba(234,223,200,.45) 9px 12px,rgba(42,61,107,.9) 12px 17px);
    opacity:.9;
  }
  body.in-game .game-bar-title{font-size:16px;letter-spacing:.15em;text-shadow:0 2px 6px rgba(0,0,0,.85);}
  body.in-game .game-bar-title small{color:rgba(234,223,200,.72);}
  body.in-game .pagebar-btn{
    min-height:38px;padding:3px 9px;font-size:11px;gap:5px;
    border-color:rgba(217,162,43,.62);
    background:
      repeating-linear-gradient(0deg,rgba(234,223,200,.06) 0,rgba(234,223,200,.06) 1px,transparent 1px,transparent 5px),
      linear-gradient(180deg,rgba(42,61,107,.82),rgba(13,26,46,.94));
    box-shadow:inset 0 1px 0 rgba(255,224,160,.16),0 3px 8px rgba(0,0,0,.4);
  }
  body.in-game .mono-key{color:var(--ochre);}
  #btn-restart-top{flex:0 0 auto;white-space:nowrap;}
  #btn-restart-top .mono-key{display:none;}

  /* the board sits in a thick straw and indigo mat border, pinned with brass */
  .board{
    border:9px solid transparent;
    border-image:repeating-linear-gradient(45deg,
      #caa04a 0 5px,#8a6526 5px 8px,
      #e7cf8e 8px 12px,#33466f 12px 16px) 10;
    box-shadow:
      0 0 0 2px #0a1526,
      0 0 0 3px rgba(217,162,43,.45),
      0 16px 40px rgba(0,0,0,.55),
      0 0 46px rgba(217,162,43,.10);
  }
  .board::before{
    content:"";position:absolute;inset:0;z-index:9;pointer-events:none;
    background:
      radial-gradient(circle at 7px 7px,#e9c877 0 3px,#7a5a22 3px 5px,transparent 6px),
      radial-gradient(circle at calc(100% - 7px) 7px,#e9c877 0 3px,#7a5a22 3px 5px,transparent 6px),
      radial-gradient(circle at 7px calc(100% - 7px),#e9c877 0 3px,#7a5a22 3px 5px,transparent 6px),
      radial-gradient(circle at calc(100% - 7px) calc(100% - 7px),#e9c877 0 3px,#7a5a22 3px 5px,transparent 6px);
  }
  .board-art{filter:saturate(1.06) contrast(1.04) brightness(1.09);}
  .night-wash{
    background:
      linear-gradient(180deg,rgba(14,27,46,.38) 0%,rgba(14,27,46,.08) 30%,rgba(14,27,46,.06) 58%,rgba(14,27,46,.4) 100%),
      radial-gradient(120% 90% at 52% 42%,rgba(42,61,107,.02),rgba(14,27,46,.22) 76%);
  }
  .lamp-center{opacity:.9;}

  /* the readouts become one lit woven ribbon */
  .board-hud{
    margin-bottom:7px;
    padding:7px 9px;
    border:1px solid rgba(217,162,43,.55);
    background:
      repeating-linear-gradient(0deg,rgba(234,223,200,.05) 0,rgba(234,223,200,.05) 1px,transparent 1px,transparent 5px),
      linear-gradient(180deg,rgba(35,53,88,.9),rgba(10,21,38,.92));
    box-shadow:inset 0 1px 0 rgba(255,224,160,.12),0 4px 12px rgba(0,0,0,.35);
    color:rgba(234,223,200,.78);
  }
  .hud-item b{color:var(--ivory);}
  #hud-loop{color:#f0cd76;}
  #hud-pag{color:var(--rose);}

  /* controls and small buttons gain a woven face */
  .control-strip{border-image:url(assets/weave_frame_02_panel_border.webp) 28 stretch;}
  .under-controls{margin-top:7px;}
  .woven-btn{
    border-color:rgba(217,162,43,.55);
    background:
      repeating-linear-gradient(90deg,rgba(234,223,200,.04) 0,rgba(234,223,200,.04) 1px,transparent 1px,transparent 7px),
      linear-gradient(180deg,rgba(52,72,112,.58),rgba(16,31,54,.72));
    box-shadow:inset 0 1px 0 rgba(255,224,160,.1),0 4px 10px rgba(0,0,0,.3);
  }
  .pad-btn{
    border-color:rgba(217,162,43,.35);
    background:
      repeating-linear-gradient(0deg,rgba(234,223,200,.07) 0,rgba(234,223,200,.07) 1px,transparent 1px,transparent 5px),
      linear-gradient(180deg,rgba(62,82,124,.62),rgba(18,35,58,.78));
  }
  .rules-btn{
    border-color:rgba(217,162,43,.5);
    background:
      repeating-linear-gradient(0deg,rgba(234,223,200,.05) 0,rgba(234,223,200,.05) 1px,transparent 1px,transparent 5px),
      linear-gradient(180deg,rgba(35,53,88,.8),rgba(10,21,38,.9));
  }

  /* the desk rail reads as woven panels pinned to the dark, lit from above */
  .desk-rail{gap:16px;}
  .wpanel{
    border-image:url(assets/weave_frame_02_panel_border.webp) 30 stretch;
    background:
      radial-gradient(ellipse at 50% -20%,rgba(217,162,43,.14),rgba(217,162,43,0) 55%),
      repeating-linear-gradient(0deg,rgba(234,223,200,.035) 0,rgba(234,223,200,.035) 1px,transparent 1px,transparent 6px),
      repeating-linear-gradient(90deg,rgba(234,223,200,.025) 0,rgba(234,223,200,.025) 1px,transparent 1px,transparent 8px),
      linear-gradient(180deg,rgba(24,44,72,.98),rgba(8,16,29,.98));
    background-clip:padding-box;
    box-shadow:
      inset 0 1px 0 rgba(255,224,160,.12),
      inset 0 0 26px rgba(0,0,0,.4),
      0 10px 24px rgba(0,0,0,.42);
  }
  .panel-kicker{color:rgba(234,223,200,.8);}
  .panel-kicker small{color:rgba(234,223,200,.5);}
  .law-panel{box-shadow:inset 0 1px 0 rgba(255,224,160,.12),inset 0 0 30px rgba(62,127,107,.14),0 10px 24px rgba(0,0,0,.42);}
  .dialogue-panel{box-shadow:inset 0 1px 0 rgba(255,224,160,.12),inset 0 0 30px rgba(217,162,43,.12),0 10px 24px rgba(0,0,0,.42);}
  .banner-wrap,.baka-rail-wrap,.radio-wrap{filter:drop-shadow(0 12px 20px rgba(0,0,0,.5));}
}

/* keep body copy legible at phone size */
@media (max-width:760px){
  .tut-eng,.tut-fil,.board-hint,.board-hint-en{font-size:16px;line-height:1.42;}
  .board-hint-en{color:rgba(234,223,200,.74);}
}

/* portrait play view: keep the painted city band above the mat so the
   frame reads as the concept picture, not a bare board. */
@media (max-width:760px) and (orientation:portrait){
  body.in-game .page{padding-top:54px;}
  body.in-game main{padding-top:0;}
  body.in-game .title-band{
    display:block !important;
    height:156px;
    margin:0 auto 8px;
  }
  body.in-game .sky-strip{display:none;}
  body.in-game .sky{top:0;}
  body.in-game .sky img{object-position:center 44%;}
  body.in-game .title-cartouche{width:min(84%,334px);top:50%;}
  body.in-game .title-ink h1{
    font-size:clamp(26px,7.4vw,36px);
    letter-spacing:.13em;
    margin-left:.13em;
  }
  body.in-game .title-fil{font-size:clamp(12px,3.3vw,17px);margin-top:.2em;}
  body.in-game .title-eng{font-size:8px;margin-top:.55em;letter-spacing:.24em;}
}

/* first-visit coach: the four steps dock under the board, so the board
   stays visible and the tutorial is in the same frame as play. */
body.tut-coach{overflow:hidden;}
body.tut-coach .start-screen{display:none !important;}
body.tut-coach .page{display:block !important;}

body.tut-coach #tutorial{
  position:fixed;
  left:0;right:0;bottom:0;top:auto;
  z-index:95;
  display:block;
  padding:0;margin:0;
  overflow:visible;
  pointer-events:none;
  background:linear-gradient(180deg,rgba(8,16,29,0) 0%,rgba(8,16,29,.22) 18%,rgba(8,16,29,.88) 100%);
}
body.tut-coach .tut-panel{
  pointer-events:auto;
  position:relative;
  width:100%;max-width:100%;max-height:none;
  margin:0;
  padding:9px 12px calc(10px + env(safe-area-inset-bottom));
  border:10px solid transparent;
  border-image:url(assets/weave_frame_02_panel_border.webp) 24 stretch;
  background:
    radial-gradient(ellipse at 50% -20%,rgba(217,162,43,.16),rgba(217,162,43,0) 55%),
    linear-gradient(180deg,rgba(14,27,46,.97),rgba(8,16,29,.99));
  background-clip:padding-box;
  box-shadow:0 -14px 34px rgba(0,0,0,.6);
  display:grid;
  grid-template-columns:minmax(92px,34%) minmax(0,1fr);
  grid-template-rows:auto 1fr auto auto;
  gap:4px 11px;
  overflow:visible;
}
body.tut-coach .tut-head{grid-column:1 / -1;grid-row:1;margin:0;}
body.tut-coach .tut-count{font-size:10px;}
body.tut-coach .tut-skip{min-height:34px;padding:6px 10px;font-size:9px;}
body.tut-coach .tut-stage{
  grid-column:1;grid-row:2 / span 2;
  width:100%;height:148px;min-height:0;max-height:none;
  margin:0;aspect-ratio:auto;
}
body.tut-coach .tut-copy{
  grid-column:2;grid-row:2;
  margin:0;text-align:left;align-self:start;
}
body.tut-coach .tut-copy::before{display:none;}
body.tut-coach .tut-copy h2{font-size:22px;line-height:1.08;}
body.tut-coach .tut-eng{font-size:16px;line-height:1.28;margin-top:3px;}
body.tut-coach .tut-fil{font-size:16px;line-height:1.28;margin-top:2px;}
body.tut-coach .tut-dots{
  grid-column:2;grid-row:3;
  justify-content:flex-start;align-self:end;margin:0;gap:4px;
}
body.tut-coach .tut-dots i{width:22px;height:22px;font-size:9px;}
body.tut-coach .tut-next{
  grid-column:1 / -1;grid-row:4;
  width:100%;min-height:52px;font-size:20px;margin-top:4px;
}
body.tut-coach #tut-stepno{font-size:10px;}

@media (max-width:760px) and (max-height:640px){
  body.tut-coach .title-band{display:none !important;}
  body.tut-coach .tut-stage{height:112px;}
  body.tut-coach .tut-copy h2{font-size:19px;}
  body.tut-coach .tut-eng,body.tut-coach .tut-fil{font-size:14px;line-height:1.22;}
  body.tut-coach .tut-next{min-height:46px;font-size:18px;}
}

/* while the coach sheet is open it carries the teaching line, so the
   board hint does not tell the child to press a control under the sheet */
body.tut-coach .board-hint-wrap{display:none;}

/* ============================================================
   Revision: the play view is the painted city, not a flat field.
   The mat is the hero; the rail and controls are woven on top.
   ============================================================ */

/* the whole play page sits inside the painted night */
body.in-game{
  background-color:#0a1422;
  background-image:
    linear-gradient(180deg,rgba(10,21,38,.58) 0%,rgba(10,21,38,.76) 46%,rgba(8,16,29,.9) 100%),
    url("assets/biringan_night_sky.webp");
  background-size:cover,cover;
  background-position:center top,center 34%;
  background-attachment:fixed,fixed;
  background-repeat:no-repeat,no-repeat;
}
body.in-game .page{background:transparent;}

/* the landing title lives on the start screen; play begins at the mat */
body.in-game .title-band,
body.in-game .title-actions{display:none !important;}

/* let the painted light show through: a lighter night wash and vignette */
body.in-game .night-wash{
  background:
    linear-gradient(180deg,rgba(14,27,46,.3) 0%,rgba(14,27,46,.06) 30%,rgba(14,27,46,.05) 62%,rgba(14,27,46,.32) 100%),
    radial-gradient(112% 88% at 52% 42%,rgba(42,61,107,.02),rgba(14,27,46,.18) 78%);
}
body.in-game .board::after{
  box-shadow:inset 0 0 54px rgba(8,16,29,.4),inset 0 0 16px rgba(42,61,107,.12);
}

/* a clear player figure: bigger, and named so a child can find themself */
body.in-game .figure.live{height:30%;}
body.in-game .figure.attendant{height:31%;}
body.in-game .figure.sibling{height:20%;}
body.in-game .figure.ghost{height:30%;}

.live-tag{
  position:absolute;left:50%;top:-19px;transform:translateX(-50%);
  z-index:3;white-space:nowrap;pointer-events:none;
  font-family:var(--mono);font-size:8px;font-weight:700;letter-spacing:.1em;
  color:#1a1204;
  background:linear-gradient(180deg,#f0bf55,var(--ochre));
  border:1px solid rgba(14,27,46,.55);
  border-radius:2px;
  padding:2px 5px;
  box-shadow:0 2px 6px rgba(0,0,0,.45);
}
.live-tag small{font-size:6.5px;font-weight:400;color:rgba(26,18,4,.72);letter-spacing:.04em;}
.live-tag::after{
  content:"";position:absolute;left:50%;top:100%;transform:translateX(-50%);
  border:4px solid transparent;border-top-color:var(--ochre);
}
.figure.live .live-ring{
  width:58%;height:9px;
  border-color:rgba(255,214,138,.8);
  box-shadow:0 0 10px rgba(255,214,138,.5);
}

/* a phone held sideways: the mat fills the height, the rail is woven beside it */
@media (orientation:landscape) and (max-height:560px){
  body.in-game .game-bar{
    position:fixed;left:0;right:0;top:0;z-index:45;
    display:flex;align-items:center;justify-content:space-between;
    height:40px;margin:0;padding:3px 10px;
    border-bottom:1px solid rgba(217,162,43,.26);
    background:linear-gradient(180deg,rgba(10,21,38,.95),rgba(10,21,38,.6));
  }
  body.in-game .game-bar-title{font-size:12px;letter-spacing:.1em;}
  body.in-game .game-bar-title small{font-size:6.5px;}
  body.in-game .pagebar-btn{min-height:30px;padding:1px 8px;font-size:10px;}
  body.in-game .help-dot{width:16px;height:16px;font-size:10px;}

  body.in-game main{max-width:none;padding:44px 8px 6px;}
  body.in-game .stage{
    display:grid;
    grid-template-columns:minmax(0,1fr) clamp(168px,27vw,236px);
    gap:10px;
    height:calc(100dvh - 50px);
    margin:0;
    align-items:stretch;
  }
  body.in-game .board-col{
    position:relative;
    height:100%;min-height:0;
    display:flex;flex-direction:column;align-items:center;justify-content:center;
  }
  body.in-game .board{
    width:auto;height:100%;max-width:100%;max-height:100%;
    aspect-ratio:3/2;
    margin:0 auto;
    align-self:center;
  }
  body.in-game .board-hud{
    position:absolute;left:50%;top:2px;transform:translateX(-50%);
    z-index:31;display:flex;width:auto;max-width:calc(100% - 12px);
    margin:0;padding:4px 9px;gap:10px;
    border:1px solid rgba(217,162,43,.3);
    background:rgba(6,13,24,.93);
    box-shadow:0 4px 12px rgba(0,0,0,.45);
    font-size:8.5px;letter-spacing:.08em;
  }

  /* the teaching line and controls ride on the top of the mat */
  body.in-game .board-hint-wrap{
    position:absolute;left:0;right:0;bottom:98px;z-index:30;
    margin:0;padding:0 10px;text-align:center;pointer-events:none;
  }
  body.in-game .board-hint{
    display:inline-flex;justify-content:center;align-items:center;
    min-height:0;margin:0;font-size:12px;line-height:1.2;
    padding:3px 9px;
    background:rgba(6,13,24,.9);
    border:1px solid rgba(217,162,43,.26);
    color:var(--ivory);
  }
  body.in-game .board-hint-en{display:none;}

  body.in-game .control-strip{
    position:absolute;left:50%;bottom:36px;transform:translateX(-50%);
    z-index:31;width:auto;max-width:calc(100% - 12px);
    margin:0;padding:2px 8px;
    border-width:6px;gap:2px;
    background:rgba(6,13,24,.92);
  }
  body.in-game .glyph-btn{min-width:34px;}
  body.in-game .glyph-btn img{width:23px;}
  body.in-game .glyph-btn .key{font-size:6px;}

  body.in-game .under-controls{
    position:absolute;left:0;right:0;bottom:2px;transform:none;
    z-index:32;display:flex;align-items:center;justify-content:center;
    width:100%;max-width:none;height:34px;
    margin:0;padding:0;gap:8px;
    flex-wrap:nowrap;
    background:transparent;
  }
  body.in-game .context-actions{
    display:flex;flex-direction:row;flex-wrap:nowrap;gap:6px;flex:0 0 auto;
  }
  body.in-game .context-actions .woven-btn{
    min-height:30px;font-size:10px;padding:2px 9px;flex:0 0 auto;
  }
  body.in-game .context-actions .woven-btn img{width:22px;}
  /* the rings on the mat are the movement control in this shape */
  body.in-game .pad-wrap{display:none;}
  body.in-game .rules-btn{min-height:30px;font-size:10px;flex:0 0 auto;}

  /* the readouts are in the mat HUD now, so the rail carries the story */
  body.in-game .rail-hero{display:none;}
  body.in-game .desk-rail{
    gap:8px;height:100%;overflow:auto;padding-right:2px;
    scrollbar-width:thin;
  }
  body.in-game .baka-head{font-size:8px;}
  body.in-game .baka-legend{font-size:6px;gap:8px;}
  body.in-game .carried-panel{padding:5px 7px;}
  body.in-game .carried-row{gap:4px;margin-top:3px;}
  body.in-game .carried-item img{width:24px;}
  body.in-game .carried-item span{font-size:8.5px;}
  body.in-game .carried-item small{font-size:6.5px;}
  body.in-game .radio-row{grid-template-columns:minmax(48px,34%) minmax(0,1fr);gap:6px;}
  body.in-game .dialogue-panel{min-height:0;padding:5px 7px;}
  body.in-game .dialogue-fil{font-size:11px;line-height:1.25;}
  body.in-game .dialogue-eng{font-size:9px;line-height:1.25;}
  body.in-game .panel-kicker{font-size:6.5px;}

  /* the rules and the radio log open as a sheet over the game */
  body.in-game .rules-panel,
  body.in-game .radio-log{
    position:fixed;left:8px;right:8px;top:44px;bottom:8px;z-index:60;
    overflow:auto;margin:0;padding:14px;
    background:rgba(8,16,29,.975);
    border:10px solid transparent;
    border-image:url("assets/weave_frame_02_panel_border.webp") 24 stretch;
  }
}

/* the coach sheet on a sideways phone: it docks over the bottom of the mat,
   so the steps and the board are always in one frame */
@media (orientation:landscape) and (max-height:560px){
  body.tut-coach #tutorial{
    background:linear-gradient(180deg,rgba(8,16,29,0) 0%,rgba(8,16,29,.3) 22%,rgba(8,16,29,.92) 100%);
  }
  body.tut-coach .tut-panel{
    grid-template-columns:minmax(84px,20%) minmax(0,1fr) auto;
    grid-template-rows:auto 1fr;
    gap:2px 9px;
    padding:5px 9px calc(5px + env(safe-area-inset-bottom));
    border-width:8px;
  }
  body.tut-coach .tut-head{grid-column:1 / -1;grid-row:1;}
  body.tut-coach .tut-count{font-size:9px;}
  body.tut-coach .tut-skip{min-height:28px;padding:4px 8px;font-size:8px;}
  body.tut-coach .tut-stage{
    grid-column:1;grid-row:2;
    height:104px;min-height:0;
  }
  body.tut-coach .tut-copy{
    grid-column:2;grid-row:2;
    align-self:center;
  }
  body.tut-coach .tut-copy h2{font-size:18px;line-height:1.05;}
  body.tut-coach .tut-eng{font-size:14px;line-height:1.22;margin-top:2px;}
  body.tut-coach .tut-fil{font-size:13px;line-height:1.22;margin-top:1px;}
  body.tut-coach .tut-dots{display:none;}
  body.tut-coach .tut-next{
    grid-column:3;grid-row:2;
    align-self:center;
    width:auto;min-width:104px;min-height:44px;
    padding:6px 12px;font-size:15px;margin:0;
  }
}

/* the board painting now carries the gate, the House and the landing, so
   the loose landmark cut-outs would double them */
.landmark{display:none !important;}

/* on a sideways phone the mat HUD already names the three stops, so the
   loose zone labels would run under it */
@media (orientation:landscape) and (max-height:560px){
  body.in-game .zone-tag{display:none;}
}

/* portrait: the mat becomes a tall painted panel, not a letterboxed strip.
   The square painting puts the night city above the gate and House, so the
   whole illustrated scene fills the frame above the tutorial. */
.board-art-tall{display:none;}
@media (max-width:760px){
  body.in-game .board{aspect-ratio:1/1;}
  .board-art-wide{display:none;}
  .board-art-tall{display:block;}

  /* while the four steps are open the game is paused, so the flat control
     furniture steps aside and the painting and the step sheet share the frame */
  body.tut-coach .control-strip,
  body.tut-coach .under-controls,
  body.tut-coach .board-hint-wrap{display:none !important;}
}

/* during the four steps the rail is paused furniture too: keep the frame
   to the painted mat and the step sheet */
body.tut-coach .desk-rail{display:none !important;}

@media (max-width:760px){
  /* the coach is a focused first-visit state: only the mat and the steps */
  body.tut-coach .pitch-band,
  body.tut-coach .step-rail,
  body.tut-coach .footer{display:none !important;}
}

/* portrait: the mat is the page, not a card on it. The painted scene runs
   edge to edge on a tall phone, and shrinks on a short one so the step sheet
   never has to cover it. */
@media (max-width:760px){
  body.in-game .board{
    width:min(100vw, calc(100dvh - 360px));
    max-width:none;
    margin:0 auto;
    border:0;
    box-shadow:0 0 0 1px rgba(217,162,43,.28),0 18px 40px rgba(0,0,0,.5);
  }
  body.in-game .board::before{display:none;}
}

/* the live self leaves a faint ivory stitch on the mat, showing its path */
.trail.live-trail{
  stroke:rgba(240,220,180,.6);
  stroke-width:1.7;
  stroke-dasharray:3 5;
}

/* the threshold label sits under the gate, so the player standing there and
   their IKAW tag never collide with it */
@media (max-width:760px){
  body.in-game .tag-gate{left:2%;top:46%;}
}
