/* Chapter II only (body.ch2 is set by the game when the version has a ladder).
   Everything here is presentation. Placeholder looks are drawn with gradients until the Chapter II art arrives;
   each block names the image that will replace it. */

/* --- 1. hold on the gates: everything but the scatters steps back --- */
body.gatehold .sym { transition: opacity 0.35s, filter 0.35s; }
body.gatehold .sym:not([data-name="SC"]) { opacity: 0.32; filter: saturate(0.5); }
body.gatehold .sym[data-name="SC"] { animation: ch2gate 0.36s ease-in-out infinite; z-index: 4; } /* 0.8 -> 0.36 s: the gates flash fast while they are held (Founder, 2026-11-18) */
@keyframes ch2gate { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(255, 70, 70, 0.7)); } 50% { transform: scale(1.14); filter: drop-shadow(0 0 26px rgba(255, 90, 80, 1)); } }

/* --- 2. push in towards the gate --- */
body.ch2 #board { transition: transform 0.8s cubic-bezier(0.5, 0, 0.9, 0.6), opacity 0.8s ease-in; }
body.pushin #board { transform: scale(1.35); opacity: 0; }

/* --- 3 and 9. the full-screen scene (gate / total). Art later: scene_gate_portrait, scene_total_portrait, guardian_* --- */
#scene { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; padding: 0 70px; text-align: center; overflow: hidden; }
#scene.hidden { display: none; }
#scene[data-kind="gate"] {
  background:
    radial-gradient(ellipse 46% 26% at 50% 21%, rgba(255, 214, 170, 0.95) 0, rgba(214, 48, 58, 0.75) 38%, rgba(90, 10, 26, 0) 100%),
    repeating-linear-gradient(180deg, rgba(212, 160, 70, 0.16) 0 3px, rgba(0, 0, 0, 0) 3px 54px),
    linear-gradient(180deg, #03060f 0, #1c0a14 34%, #120812 62%, #03060f 100%);
}
#scene[data-kind="total"] {
  background:
    radial-gradient(ellipse 60% 30% at 50% 30%, rgba(212, 160, 70, 0.4) 0, rgba(120, 20, 34, 0.35) 45%, rgba(10, 6, 14, 0) 100%),
    repeating-linear-gradient(180deg, rgba(212, 160, 70, 0.1) 0 3px, rgba(0, 0, 0, 0) 3px 54px),
    linear-gradient(180deg, #03060f 0, #130a12 50%, #03060f 100%);
}
#scene[data-kind="total"][data-calm="1"] { background: linear-gradient(180deg, #03060f 0, #0c0d1a 50%, #03060f 100%); }
#scenetitle { font: 900 76px var(--f-display); letter-spacing: var(--track); color: #f3d9a0; text-shadow: 0 3px 0 #2a0a0a, 0 0 26px rgba(220, 60, 60, 0.7); }
#scenebig { height: 230px; display: flex; align-items: center; justify-content: center; max-width: 100%; }
#scenebig span { font: 800 150px var(--f-num); }
#scene[data-kind="total"] #scenebig { height: 170px; }
#scene[data-calm="1"] #scenetitle { color: #b9bfd6; text-shadow: none; font-size: 54px; }
#scene[data-calm="1"] #scenebig { height: 110px; filter: grayscale(1) brightness(0.9); }
#scenerule { font: 600 40px var(--f-text); line-height: 1.35; color: #e9e2d4; max-width: 880px; text-shadow: 0 2px 6px #000; }
#scenebtn { margin-top: 44px; min-width: 460px; padding: 30px 60px; border-radius: 26px; border: 4px solid #d6a44a; background: linear-gradient(180deg, #8a1a26, #4a0c16); color: #fff0cf; font: 900 58px var(--f-display); letter-spacing: var(--track); box-shadow: inset 0 0 0 3px #2a0a0a, 0 10px 30px rgba(0, 0, 0, 0.6); cursor: pointer; }
#scenebtn:active { transform: translateY(3px); filter: brightness(1.15); }
body:not(.portrait) #scene { gap: 14px; }
body:not(.portrait) #scenebig { height: 150px; }
body:not(.portrait) #scenebtn { margin-top: 12px; padding: 18px 50px; font-size: 44px; }

/* --- 4 and 10. the rift flash (art later: fx_rift_flash) --- */
body.ch2 #flash { background: linear-gradient(115deg, rgba(255, 240, 210, 0) 30%, rgba(255, 236, 200, 0.98) 47%, rgba(230, 40, 50, 0.95) 53%, rgba(120, 0, 20, 0) 72%), radial-gradient(ellipse at 50% 45%, rgba(200, 30, 40, 0.75), rgba(60, 0, 10, 0.4)); z-index: 45; }

/* --- 5. the shattered hall: crimson instead of Chapter I's purple (art later: bg_free_portrait, frame_lit) --- */
body.ch2.free #tint { background: radial-gradient(ellipse at center, rgba(170, 24, 40, 0.2), rgba(70, 0, 18, 0.62)); }
body.ch2.free #frame { filter: drop-shadow(0 0 14px rgba(230, 50, 60, 0.75)); }

/* --- 5. controls step aside, one bar says how many free spins are left (art later: bar_freespins) --- */
#fsbar { display: none; }
body.portrait.ch2.free #spin, body.portrait.ch2.free #betbox, body.portrait.ch2.free #auto, body.portrait.ch2.free #turbo, body.portrait.ch2.free #fs { visibility: hidden; pointer-events: none; }
body.portrait.ch2.free #fsbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; position: absolute; left: 370px; top: 1504px; width: 680px; height: 150px; padding: 0 44px; border-radius: 30px; border: 4px solid #d6a44a; background: linear-gradient(180deg, #5c101c, #26070d); box-shadow: inset 0 0 0 3px #2a0a0a, 0 0 26px rgba(220, 50, 60, 0.45); z-index: 6; }
#fsbarlabel { font: 800 34px var(--f-display); letter-spacing: var(--track); color: #f3d9a0; text-align: left; line-height: 1.15; }
#fsbarnum { font: 800 104px var(--f-num); color: #fff0cf; text-shadow: 0 3px 0 #2a0a0a; }
#fsbar.last { border-color: #ff6a52; box-shadow: inset 0 0 0 3px #2a0a0a, 0 0 34px rgba(255, 90, 60, 0.8); }
#fsbar.last #fsbarnum { display: none; }
#fsbar.last #fsbarlabel { width: 100%; text-align: center; font-size: 50px; color: #ffd9c9; }

/* --- 5. the ladder dial is larger and lit in the free round --- */
body.portrait.ch2.free #mult { width: 214px; left: 14px; top: 1130px; filter: drop-shadow(0 0 16px rgba(230, 50, 60, 0.85)); }

@media (prefers-reduced-motion: reduce) {
  body.ch2 #board { transition: opacity 0.3s; }
  body.pushin #board { transform: none; }
  body.gatehold .sym[data-name="SC"] { animation: none; }
}

/* the scene must own the whole screen: the background above and below the stage steps out while it is up */
body.scening #bgfull { visibility: hidden; }
/* the full-height background takes the crimson of the shattered hall, not Chapter I's purple */
body.ch2.fullbg.portrait #bgfull::after { background: radial-gradient(ellipse at center, rgba(170, 24, 40, 0.2), rgba(70, 0, 18, 0.62)); }

/* ======================= Chapter II CANDIDATE art (installed 2026-11-17, local playtest only) =======================
   Pictures are in /art/ch2/ (masters in art/ch2/src, built by tools/build_ch2_art.py). Nothing in /art/web/ is replaced.
   Everything is under body.ch2, so a game without a ladder looks exactly as before. Roll back: delete from this line down. */
#scenekeeper, #paneltitle { display: none; }

/* --- backgrounds: the hall, and the shattered hall in the free round (portrait; landscape still uses Chapter I's) --- */
body.ch2.fullbg.portrait #bgfull { background-image: url(/art/ch2/bg_full.webp); }
body.ch2.fullbg.portrait #bgfull::after { background: linear-gradient(180deg, rgba(3, 6, 18, 0) 0, rgba(3, 6, 18, 0) 56%, rgba(3, 6, 18, 0.5) 62%, rgba(3, 6, 18, 0.62) 100%), url(/art/ch2/bg_free_full_rays.webp) center / 100% 100% no-repeat; }

/* --- logo: the Chapter II mark is almost square, so it is centred in the band above the board --- */
body.ch2 #logo img { content: url(/art/ch2/logo.webp); }
body.ch2 #logo .sweep { -webkit-mask-image: url(/art/ch2/logo.webp); mask-image: url(/art/ch2/logo.webp); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
body.ch2.portrait #logo { width: 336px; left: 372px; top: 8px; }

/* --- reel frame 1402x1122. Its 30 cells were measured from the picture: x 97-1303, y 129-1009, 14-15 px bars between --- */
body.ch2 #frame { content: url(/art/ch2/frame.webp); }
body.ch2.free #frame { content: url(/art/ch2/frame_lit.webp); filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55)); }
body.ch2.portrait #board { left: 26px; width: 1028px; height: 823px; }
body.ch2 #grid { left: 6.42%; top: 10.83%; width: 87.02%; height: 79.77%; }
body.ch2 #gridbg { left: 5.6%; top: 9.6%; width: 88.8%; height: 82.2%; border-radius: 22px; background: linear-gradient(180deg, rgba(8, 12, 30, 0.9), rgba(5, 8, 22, 0.94)); }
body.ch2 #board .gem, body.ch2 #framerun { display: none; }   /* the new frame has its own rubies and rim */
body.ch2 #frameglow { left: 5.6%; top: 9.6%; width: 88.8%; height: 82.2%; }
body.ch2 #scmeter img { content: url(/art/ch2/sym_scatter.webp); }

/* --- buttons --- */
body.ch2 #spin, body.ch2 #spin:active, body.ch2 #spin.busy { background-image: url(/art/ch2/btn_spin.webp); }
body.ch2 #spindisc { background-image: url(/art/ch2/btn_spin.webp); clip-path: circle(30% at 50% 50%); transform-origin: 50% 50%; }
body.ch2 #spin .jewel { display: none; }
body.ch2 #spin.busy { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 18px rgba(255, 90, 70, 0.8)); }
body.ch2 #info, body.ch2 #info:active { background-image: url(/art/ch2/btn_menu.webp); }
body.ch2 #turbo, body.ch2 #turbo.on, body.ch2 #turbo:active { background-image: url(/art/ch2/btn_fast.webp); }
body.ch2 #auto, body.ch2 #auto.on, body.ch2 #auto:active { background-image: url(/art/ch2/btn_auto.webp); aspect-ratio: 1; }
body.ch2 .mini, body.ch2 #betdown:active { background-image: url(/art/ch2/btn_minus.webp); }
body.ch2 #betup, body.ch2 #betup:active { background-image: url(/art/ch2/btn_plus.webp); }
body.ch2 .art:active, body.ch2 .mini:active { filter: brightness(1.3); }
/* "on" has no picture of its own: the same button, lit */
body.ch2 #turbo.on, body.ch2 #auto.on { filter: brightness(1.25) drop-shadow(0 0 10px rgba(255, 210, 110, 0.95)) drop-shadow(0 0 22px rgba(255, 90, 60, 0.7)); }
body.ch2.portrait #auto { width: 122px; left: 831px; }   /* round now; centred under BET (x 892) */

/* --- the full-screen scenes: picture, Guardian above, words in the calm dark middle, button below --- */
#scene[data-kind="gate"] { background: url(/art/ch2/scene_gate.webp) center / cover no-repeat; }
#scene[data-kind="total"] { background: url(/art/ch2/scene_total.webp) center / cover no-repeat; }
#scene[data-kind="total"][data-calm="1"] { background: linear-gradient(rgba(3, 6, 15, 0.55), rgba(3, 6, 15, 0.55)), url(/art/ch2/scene_total.webp) center / cover no-repeat; }
body.portrait #scene { justify-content: flex-start; padding-top: 700px; gap: 22px; }
body.portrait #scenekeeper { display: block; position: absolute; left: 50%; top: 24px; width: 640px; margin-left: -320px; pointer-events: none; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.7)); }
body.portrait #scene[data-calm="1"] #scenekeeper { filter: saturate(0.6) brightness(0.8); }
#scenetitle, #scenerule { position: relative; }
#scenerule { text-shadow: 0 2px 6px #000, 0 0 18px #000; }
#scenebtn { min-width: 0; width: 620px; height: 164px; padding: 0 90px 6px; border: 0; border-radius: 0; box-shadow: none; background: url(/art/ch2/bar_crimson.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.7)); }
#scenebtn:active { filter: brightness(1.2) drop-shadow(0 10px 24px rgba(0, 0, 0, 0.7)); }
body:not(.portrait) #scenebtn { width: 480px; height: 126px; padding: 0 70px 4px; }

/* --- the rift --- */
body.ch2 #flash { background: url(/art/ch2/fx_rift.webp) center / cover no-repeat, radial-gradient(ellipse at 50% 45%, rgba(200, 30, 40, 0.6), rgba(60, 0, 10, 0.35)); }

/* --- free spins left: the crimson bar --- */
body.portrait.ch2.free #fsbar { top: 1492px; height: 174px; padding: 0 86px 6px 80px; border: 0; border-radius: 0; box-shadow: none; background: url(/art/ch2/bar_crimson.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6)); }
#fsbar.last { box-shadow: none; filter: brightness(1.2) drop-shadow(0 0 22px rgba(255, 90, 60, 0.85)); }
body.portrait.ch2.free #fsbar #fsbarnum { font-size: 92px; }
body.portrait.ch2.free #fsbar #fsbarlabel { font-size: 30px; }

/* --- Big Win: one blank panel; the page writes the title (never baked into the picture) --- */
body.ch2 #panel[data-kind="bigwin"] { background-image: url(/art/ch2/panel_bigwin.webp); aspect-ratio: 2.117; width: 980px; }
body.ch2 #panel[data-kind="bigwin"] #paneltitle { display: block; position: absolute; left: 12%; right: 12%; top: 17%; text-align: center; font: 900 74px var(--f-display); letter-spacing: var(--track); color: #f3d9a0; text-shadow: 0 3px 0 #2a0a0a, 0 0 22px rgba(220, 60, 60, 0.6); white-space: nowrap; }
body.ch2 #panel[data-kind="bigwin"] #panelvalue { left: 14%; right: 14%; top: 44%; height: 30%; }
/* the slow sweep of light behind the board in the free round: crimson, not Chapter I's purple */
body.ch2 #board::before { background: repeating-conic-gradient(rgba(255, 90, 80, 0.13) 0 8deg, rgba(255, 90, 80, 0) 8deg 24deg); }
body.ch2 #board.tense #frameglow { box-shadow: 0 0 60px 18px rgba(255, 80, 70, 0.6), inset 0 0 60px rgba(255, 80, 70, 0.5); }

/* --- Founder, 2026-11-18: the reel area is plain in the normal game (outer frame only, no bars or rubies between the
       cells) and becomes the ornate lit grid only inside the free round. ?grid=full shows the bars in the normal game too,
       for comparison. Display only. --- */
body.ch2 #frame { content: url(/art/ch2/frame_open.webp); }
body.ch2.gridfull #frame { content: url(/art/ch2/frame.webp); }
body.ch2.free #frame { content: url(/art/ch2/frame_lit.webp); }

/* --- Founder, 2026-11-18: the picture symbols were hard to make out next to the letters. In every Chapter II layout the
       letters A K Q J 10 are drawn smaller and a little calmer, and the four picture symbols a little larger. Display only. --- */
body.ch2 .sym[data-name^="L"] img { width: 80%; height: 80%; margin: 10%; filter: saturate(0.85) brightness(0.86) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); }
/* (sizes, not transforms: the win animations use transform. The picture symbols stay at 100%: at 110% tall ones touched.) */
body.ch2 .sym[data-name="SC"] img { filter: drop-shadow(0 0 10px rgba(255, 80, 70, 0.85)) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); }

/* ======================= 2026-11-18: ladder strip instead of the Chapter I dial (portrait) =======================
   The strip sits above the board, where the eye already is; the logo is smaller, to its left. The Chapter I dial and the
   dim "free spins" placeholder are not shown in Chapter II portrait (the crimson bar says how many are left). */
#ladder { display: none; }
body.ch2.portrait #ladder { display: block; position: absolute; left: 262px; top: 40px; width: 796px; height: 235px; z-index: 2; pointer-events: none; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6)); transition: filter 0.4s; }
#ladder img { width: 100%; height: 100%; display: block; }
#ladsteps { position: absolute; left: 33%; right: 6.5%; top: 27%; bottom: 27%; display: flex; align-items: center; justify-content: space-around; }
#ladsteps b { font: 700 46px var(--f-num); color: #a9b0c8; text-shadow: 0 2px 0 #000; transition: all 0.25s; }
#ladsteps b.past { opacity: 0.32; }
#ladsteps b.cur { font-size: 78px; color: #ffe9a8; text-shadow: 0 3px 0 #3a1404, 0 0 18px rgba(255, 190, 80, 0.9); }
/* free round: the strip is lit from the page (crimson rim and glow); no second picture */
body.ch2.portrait #ladder.free { filter: drop-shadow(0 0 3px rgba(255, 70, 60, 0.95)) drop-shadow(0 0 16px rgba(230, 40, 50, 0.8)) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6)); }
#ladder.free #ladsteps b.cur { color: #fff0c8; text-shadow: 0 3px 0 #4a0808, 0 0 20px rgba(255, 90, 60, 1); }
body.ch2.portrait #mult, body.ch2.portrait #fs { display: none; }
body.ch2.portrait #logo { width: 232px; left: 20px; top: 52px; }
body.ch2.portrait #winbox, body.ch2.portrait #netbox { left: 130px; width: 820px; }

/* ---- scene numbers: warm gold text (the painted Chapter I digits carry a blue glow that does not belong here) ---- */
#scenebig { font: 700 190px var(--f-num); line-height: 1; letter-spacing: 2px; color: #ffd978; background: linear-gradient(180deg, #fff3c0 0, #ffcf5a 45%, #c8841c 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 4px 0 #3a1404) drop-shadow(0 0 18px rgba(255, 120, 60, 0.55)); }
#scene[data-kind="total"] #scenebig { font-size: 150px; }
#scene[data-calm="1"] #scenebig { font-size: 96px; }
body:not(.portrait) #scenebig { font-size: 120px; }

/* ======================= 2026-11-18: one palette (Founder: "你先做你的想法") — portrait, Chapter II only =======================
   Page-drawn parts that were still Chapter I blue / purple take the Chapter II colours: near-black, antique gold, crimson. */
/* 1. the three boxes and the line under WIN */
body.ch2.portrait .box { background: linear-gradient(180deg, #17121a, #08070c); border: 3px solid #b98a34; box-shadow: inset 0 0 0 2px #1d1206, inset 0 0 20px rgba(170, 40, 44, 0.14), 0 0 0 2px #4d360e, 0 8px 16px rgba(0, 0, 0, 0.5); }
body.ch2.portrait #netbox { background: linear-gradient(180deg, #130f15, #07060a); }
body.ch2.portrait .lab { color: #cdbf9f; }
body.ch2.portrait #msg, body.ch2.portrait #msg[data-tone="down"] { color: #cfc6b4; }
body.ch2.portrait #msg[data-tone="up"] { color: #e9d9a8; }
body.ch2.portrait #winbox::before { background: linear-gradient(105deg, rgba(255, 255, 255, 0) 40%, rgba(255, 210, 150, 0.16) 50%, rgba(255, 255, 255, 0) 60%); background-size: 300% 100%; }
body.ch2.portrait #winbox::after { background: linear-gradient(180deg, #ffd9c2 0, #e2463e 45%, #7a0f16 100%); }   /* the two small gems: rubies, not sapphires */
body.ch2 #winbox.pending { box-shadow: inset 0 0 22px rgba(255, 110, 70, 0.5); }
body.ch2 #winbox.pending #win { background: linear-gradient(180deg, #ffffff, #ffd9b9); -webkit-background-clip: text; background-clip: text; }
body.ch2 #winq { color: #ffb48a; text-shadow: 0 0 12px rgba(255, 110, 70, 0.95); }
/* the scatter lights: crimson */
body.ch2 #scmeter { background: linear-gradient(180deg, #17121a, #08070c); border-color: #b98a34; }
body.ch2 #scmeter img { filter: drop-shadow(0 0 8px rgba(255, 80, 70, 0.8)); }
body.ch2 #sclights i { background: #120a0c; }
body.ch2 #sclights i.on { background: radial-gradient(circle at 35% 35%, #fff, #ffb9a6 30%, #d8262e 75%); box-shadow: 0 0 14px 4px rgba(255, 80, 70, 0.95); }
body.ch2.portrait #scmeter.full, body.ch2.portrait.suspense #scmeter { box-shadow: 0 0 0 2px #ffe9a6, 0 0 34px 8px rgba(255, 80, 70, 0.9); }
/* 2. the top of the hall is darkened so the ladder strip reads (the bright window is behind it) */
body.ch2.ui-v33.portrait #bgfull::before { background: linear-gradient(180deg, #03060f 0, rgba(3, 6, 18, 0.5) 4%, rgba(3, 6, 18, 0.58) 10%, rgba(3, 6, 18, 0.52) 20%, rgba(3, 6, 18, 0.2) 25%, rgba(3, 6, 18, 0.42) 40%, rgba(3, 6, 18, 0.45) 53.7%, rgba(3, 6, 18, 0.4) 58.3%, rgba(3, 6, 18, 0.34) 76%, rgba(3, 6, 18, 0.55) 91%, #03060f 100%); }
body.ch2.fullbg.portrait #bgfull::after { background: linear-gradient(180deg, rgba(3, 6, 18, 0.35) 0, rgba(3, 6, 18, 0.4) 20%, rgba(3, 6, 18, 0) 26%, rgba(3, 6, 18, 0) 56%, rgba(3, 6, 18, 0.3) 62%, rgba(3, 6, 18, 0.36) 90%, rgba(3, 6, 18, 0.6) 100%), url(/art/ch2/bg_free_full_rays.webp) center / 100% 100% no-repeat; }
/* 3. the lower half is lighter: WIN narrower, the spin button about a tenth smaller */
body.ch2.portrait #winbox, body.ch2.portrait #netbox { left: 215px; width: 650px; }
body.ch2.portrait #spin { width: 314px; }

/* 2026-11-18, Founder: "背景是否可以再调亮一点" — the hall behind the controls is darkened about 0.37 instead of 0.64
   (changed in the two gradients above). The faint light behind the spin button is warm, not Chapter I's blue. */
body.ch2.ui-v31.portrait #dock { background: radial-gradient(ellipse 460px 300px at 50% 590px, rgba(255, 120, 80, 0.12), rgba(255, 120, 80, 0) 70%); }

/* ======================= 2026-11-18: the gate scene is alive, and the rift takes its time =======================
   Founder: 这边要有动画；闪电慢一点（延迟、期待）；要有雷声；不要 0.5 秒。 Page-drawn only; no new pictures. */
/* the picture is on its own layer so it can drift slowly towards the viewer */
#scene[data-kind="gate"], #scene[data-kind="total"], #scene[data-kind="total"][data-calm="1"] { background: #03060f; }
#scene::before { content: ""; position: absolute; inset: 0; background: center / cover no-repeat; animation: ch2drift 14s ease-out both; }
#scene[data-kind="gate"]::before { background-image: url(/art/ch2/scene_gate.webp); }
#scene[data-kind="total"]::before { background-image: url(/art/ch2/scene_total.webp); }
#scene[data-kind="total"][data-calm="1"]::before { filter: brightness(0.5); }
@keyframes ch2drift { from { transform: scale(1); } to { transform: scale(1.08); } }
#scene::after { content: ""; position: absolute; inset: 0; background: rgba(2, 3, 10, 0.62); opacity: 0; transition: opacity 0.9s ease-in; pointer-events: none; }
#scenebig, #scenebtn { position: relative; }
#scenetitle, #scenebig, #scenerule, #scenebtn, #scenekeeper { z-index: 1; }
/* the Guardian breathes; the pendulum glows */
body.portrait #scenekeeper { animation: ch2rise 0.7s ease-out both, ch2float 5s ease-in-out 0.7s infinite alternate; }
@keyframes ch2rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes ch2float { from { transform: translateY(0); } to { transform: translateY(-9px); } }
#sceneglow { display: none; }
body.portrait #sceneglow { display: block; position: absolute; z-index: 2; width: 190px; height: 190px; margin: -95px 0 0 -95px; border-radius: 50%; pointer-events: none; mix-blend-mode: screen; background: radial-gradient(circle, rgba(255, 214, 140, 0.85) 0, rgba(255, 150, 60, 0.4) 34%, rgba(255, 120, 40, 0) 70%); animation: ch2pulse 2.4s ease-in-out infinite alternate; }
#scene[data-calm="1"] #sceneglow { display: none; }
@keyframes ch2pulse { from { opacity: 0.25; transform: scale(0.85); } to { opacity: 0.9; transform: scale(1.12); } }
/* embers */
.ember { position: absolute; bottom: -10px; z-index: 1; width: 5px; height: 5px; border-radius: 50%; background: #ffb070; box-shadow: 0 0 8px 2px rgba(255, 90, 50, 0.8); opacity: 0; pointer-events: none; animation: ch2ember linear infinite; }
@keyframes ch2ember { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: 0.8; } 80% { opacity: 0.5; } 100% { transform: translate(var(--d), -1500px); opacity: 0; } }
#scene[data-calm="1"] .ember { display: none; }
/* the words arrive one after another; the button waits, then glows gently */
#scenetitle { animation: ch2in 0.5s ease-out 0.35s both; }
#scenebig { animation: ch2pop 0.6s cubic-bezier(0.2, 1.5, 0.4, 1) 0.6s both; }
#scenerule { animation: ch2in 0.5s ease-out 1s both; }
#scenebtn { animation: ch2in 0.5s ease-out 1.3s both, ch2btn 1.8s ease-in-out 1.8s infinite alternate; }
@keyframes ch2in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes ch2pop { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }
@keyframes ch2btn { from { filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.7)); } to { filter: brightness(1.14) drop-shadow(0 0 18px rgba(255, 90, 60, 0.75)) drop-shadow(0 10px 24px rgba(0, 0, 0, 0.7)); } }
/* START was pressed: the words step back, the scene darkens, the rift gathers */
body.striking #scene::after { opacity: 1; }
body.striking #scenetitle, body.striking #scenebig, body.striking #scenerule, body.striking #scenebtn { animation: none; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
body.striking #sceneglow { animation-duration: 0.35s; }
/* the rift and the white of the strike: above everything on the stage */
#rift, #whiteout { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
#burst { position: absolute; left: 59.3%; top: 22.4%; width: 3400px; height: 3400px; margin: -1700px 0 0 -1700px; z-index: 45; opacity: 0; pointer-events: none; border-radius: 50%; background: radial-gradient(circle, rgba(255, 244, 214, 0.95) 0, rgba(255, 190, 110, 0.5) 6%, rgba(255, 150, 80, 0) 16%), repeating-conic-gradient(from 0deg, rgba(255, 214, 150, 0) 0deg, rgba(255, 226, 170, 0.6) 3.5deg, rgba(255, 150, 90, 0.18) 7deg, rgba(255, 214, 150, 0) 10deg, rgba(255, 214, 150, 0) 20deg); -webkit-mask: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0.7) 14%, transparent 52%); mask: radial-gradient(circle, #000 0, rgba(0, 0, 0, 0.7) 14%, transparent 52%); mix-blend-mode: screen; filter: blur(4px); }   /* centred on the pendulum: that is where the light comes from */
#rift { z-index: 46; background: url(/art/ch2/fx_rift.webp) center / cover no-repeat; transform-origin: 50% 50%; }
#whiteout { z-index: 47; background: radial-gradient(ellipse at 50% 48%, #fffaf0 0, #ffe9d2 40%, #ffb9a0 100%); }
@media (prefers-reduced-motion: reduce) {
  #scene::before, body.portrait #scenekeeper, #sceneglow, .ember, #scenetitle, #scenebig, #scenerule, #scenebtn { animation: none; }
  .ember { display: none; }
}
/* 2026-11-18, Founder: the words on the START / COLLECT button ran over the crimson field. The field is about 42% of the
   bar's height: smaller letters, one line, sitting in the middle of it. */
#scenebtn { font-size: 42px; line-height: 1; letter-spacing: 3px; padding: 0 96px 4px; white-space: nowrap; display: flex; align-items: center; justify-content: center; }
body:not(.portrait) #scenebtn { font-size: 32px; }
/* 2026-11-18, Founder: the same on the free-spins bar — the number ran over the crimson field (about 73 px high). */
body.portrait.ch2.free #fsbar { padding: 0 104px 4px 96px; }
body.portrait.ch2.free #fsbar #fsbarnum { font-size: 60px; line-height: 1; text-shadow: 0 2px 0 #2a0a0a; }
body.portrait.ch2.free #fsbar #fsbarlabel { font-size: 27px; line-height: 1.05; }
body.portrait.ch2.free #fsbar.last #fsbarlabel { font-size: 36px; }

/* ======================= 2026-11-18: the ladder runs hot (Founder: 倍数很大时要一直震，要有快爆炸的感觉) =======================
   data-heat is set from the lit step only: 1 from x10, 2 from x25, 3 from x50, 4 from x100. The lit step keeps trembling
   after its pop, harder the higher it is; the strip glows hotter and, from x50, shakes with it. */
#ladsteps b.cur { will-change: transform; }
#ladder[data-heat="1"] #ladsteps b.cur { animation: ladheat1 1.1s ease-in-out infinite alternate; }
#ladder[data-heat="2"] #ladsteps b.cur { color: #fff3d0; text-shadow: 0 3px 0 #4a0808, 0 0 14px #ffb347, 0 0 30px rgba(255, 90, 40, 0.95); animation: ladshake 0.16s linear infinite, ladheat2 0.7s ease-in-out infinite alternate; --j: 1.6px; --r: 0.8deg; }
#ladder[data-heat="3"] #ladsteps b.cur { color: #fffbea; text-shadow: 0 3px 0 #5a0a0a, 0 0 12px #fff0b0, 0 0 26px #ff8a2a, 0 0 46px rgba(255, 50, 30, 1); animation: ladshake 0.11s linear infinite, ladheat3 0.45s ease-in-out infinite alternate; --j: 3px; --r: 1.6deg; }
#ladder[data-heat="4"] #ladsteps b.cur { color: #ffffff; text-shadow: 0 3px 0 #6a0a0a, 0 0 10px #ffffff, 0 0 24px #ffd24a, 0 0 44px #ff5a1a, 0 0 70px rgba(255, 30, 20, 1); animation: ladshake 0.075s linear infinite, ladheat4 0.3s ease-in-out infinite alternate; --j: 4.6px; --r: 2.6deg; }
@keyframes ladshake { 0% { translate: 0 0; rotate: 0deg; } 20% { translate: var(--j) calc(var(--j) * -0.6); rotate: var(--r); } 40% { translate: calc(var(--j) * -1) calc(var(--j) * 0.5); rotate: calc(var(--r) * -1); } 60% { translate: calc(var(--j) * 0.7) var(--j); rotate: calc(var(--r) * 0.6); } 80% { translate: calc(var(--j) * -0.8) calc(var(--j) * -0.9); rotate: calc(var(--r) * -0.7); } 100% { translate: 0 0; rotate: 0deg; } }
@keyframes ladheat1 { from { scale: 1; filter: brightness(1); } to { scale: 1.05; filter: brightness(1.2); } }
@keyframes ladheat2 { from { scale: 1; filter: brightness(1); } to { scale: 1.09; filter: brightness(1.3); } }
@keyframes ladheat3 { from { scale: 1.02; filter: brightness(1.05); } to { scale: 1.15; filter: brightness(1.45); } }
@keyframes ladheat4 { from { scale: 1.04; filter: brightness(1.1); } to { scale: 1.24; filter: brightness(1.7); } }
/* the strip itself */
body.ch2.portrait #ladder[data-heat="2"] { filter: drop-shadow(0 0 4px rgba(255, 110, 60, 1)) drop-shadow(0 0 22px rgba(240, 50, 40, 0.9)) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6)); }
body.ch2.portrait #ladder[data-heat="3"] { filter: drop-shadow(0 0 5px rgba(255, 170, 80, 1)) drop-shadow(0 0 30px rgba(255, 60, 40, 1)) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6)); animation: ladstrip 0.13s linear infinite; --j: 1.5px; }
body.ch2.portrait #ladder[data-heat="4"] { filter: drop-shadow(0 0 6px rgba(255, 230, 150, 1)) drop-shadow(0 0 38px rgba(255, 70, 30, 1)) drop-shadow(0 0 70px rgba(255, 30, 20, 0.8)); animation: ladstrip 0.09s linear infinite; --j: 3px; }
@keyframes ladstrip { 0% { translate: 0 0; } 25% { translate: var(--j) calc(var(--j) * -0.7); } 50% { translate: calc(var(--j) * -1) calc(var(--j) * 0.6); } 75% { translate: calc(var(--j) * 0.6) var(--j); } 100% { translate: 0 0; } }
/* three- and four-figure steps: a little smaller so five of them still fit the field */
#ladder[data-heat="3"] #ladsteps b { font-size: 38px; }
#ladder[data-heat="3"] #ladsteps b.cur { font-size: 68px; }
#ladder[data-heat="4"] #ladsteps b { font-size: 27px; letter-spacing: -0.5px; }
#ladder[data-heat="4"] #ladsteps b.cur { font-size: 50px; }
#ladder[data-heat="4"] #ladsteps { left: 31.5%; right: 5.5%; }
@media (prefers-reduced-motion: reduce) {
  #ladder #ladsteps b.cur, body.ch2.portrait #ladder { animation: none !important; }
}

/* ======================= 2026-11-18: Chapter II big win — one panel that climbs BIG → SUPER → LEGENDARY =======================
   Fixes with it: the rays are their own layer BEHIND the panel (they used to draw over it); the amount is warm gold text
   (not the painted Chapter I digits with their blue glow); the line under the panel says only "N× bet"; the rays are warm. */
body.ch2 #panel.rays::before { display: none; }
#winrays { position: absolute; left: 50%; top: 46%; width: 2200px; height: 2200px; margin: -1100px 0 0 -1100px; z-index: 29; border-radius: 50%; opacity: 0; pointer-events: none; transition: opacity 0.5s; background: repeating-conic-gradient(rgba(255, 196, 96, 0.3) 0 7deg, rgba(255, 196, 96, 0) 7deg 18deg); -webkit-mask: radial-gradient(circle, #000 14%, transparent 62%); mask: radial-gradient(circle, #000 14%, transparent 62%); animation: turn 16s linear infinite; }
#winrays.on { opacity: 1; }
#winrays[data-tier="1"] { background: repeating-conic-gradient(rgba(255, 150, 70, 0.4) 0 7deg, rgba(255, 150, 70, 0) 7deg 16deg); animation-duration: 10s; }
#winrays[data-tier="2"] { background: repeating-conic-gradient(rgba(255, 236, 190, 0.5) 0 6deg, rgba(255, 70, 50, 0.28) 6deg 10deg, rgba(255, 70, 50, 0) 10deg 15deg); animation-duration: 6s; }
body.ch2 #panel[data-kind="bigwin"] { width: 1000px; transition: filter 0.3s; }
body.ch2 #panel[data-kind="bigwin"] #panelvalue { left: 10%; right: 10%; top: 45%; height: 30%; font: 700 150px var(--f-num); line-height: 1; letter-spacing: 1px; white-space: nowrap; background: linear-gradient(180deg, #fff3c0 0, #ffcf5a 45%, #c8841c 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 4px 0 #3a1404) drop-shadow(0 0 16px rgba(255, 150, 60, 0.5)); }
body.ch2 #panel[data-kind="bigwin"] #paneltitle { top: 15%; font-size: 70px; }
body.ch2 #panel[data-kind="bigwin"] #panelsub { top: 103%; color: #f3d9a0; }
/* SUPER: hotter */
body.ch2 #panel[data-tier="1"] { filter: drop-shadow(0 0 26px rgba(255, 120, 50, 0.75)) drop-shadow(0 24px 40px rgba(0, 0, 0, 0.7)); }
body.ch2 #panel[data-tier="1"] #paneltitle { color: #ffe2a6; text-shadow: 0 3px 0 #3a0a06, 0 0 18px #ff9a3a, 0 0 40px rgba(255, 70, 40, 0.9); }
/* LEGENDARY: white-hot, and it does not sit still */
body.ch2 #panel[data-tier="2"] { filter: drop-shadow(0 0 14px rgba(255, 236, 190, 0.9)) drop-shadow(0 0 44px rgba(255, 60, 40, 0.95)) drop-shadow(0 24px 40px rgba(0, 0, 0, 0.7)); }
body.ch2 #panel[data-tier="2"] #paneltitle { color: #ffffff; text-shadow: 0 3px 0 #4a0808, 0 0 12px #fff0b0, 0 0 30px #ff7a2a, 0 0 60px rgba(255, 40, 30, 1); font-size: 62px; animation: ladshake 0.09s linear infinite; --j: 2.4px; --r: 0.6deg; }
body.ch2 #panel[data-tier="2"] #panelvalue { animation: ladshake 0.1s linear infinite; --j: 2px; --r: 0.4deg; }
body.ch2 #panel.landed #paneltitle, body.ch2 #panel.landed #panelvalue { animation: none; }
@media (prefers-reduced-motion: reduce) { #winrays, body.ch2 #panel[data-tier="2"] #paneltitle, body.ch2 #panel[data-tier="2"] #panelvalue { animation: none; } }

/* ======================= 2026-11-18: number face (Founder: "FONT STYLE 可能要改") =======================
   Numbers were set in a condensed sans (made for Chapter I's console). Chapter II sets them in the same engraved serif
   as the logo and the labels, so the screen has one voice. It is wider, so sizes come down a little. ?num=old compares. */
/* The digit 1 in Cinzel Decorative is drawn like a capital I ("I00,062.80"), which must not happen on a money display:
   that one character is left out here, so it comes from plain Cinzel (same family, a real 1). ?font=2 shows the raw face. */
@font-face { font-family: "CF Deco"; src: url(fonts/cinzeldecorative-bold.ttf) format("truetype"); font-weight: 400 900; font-display: swap; unicode-range: U+0000-0030, U+0032-10FFFF; }
/* Founder, 2026-11-18: "我选2号" — numbers are set in Cinzel Decorative Bold. ?font=1 shows plain Cinzel for comparison. */
body.ch2:not(.numold) { --f-num: "CF Deco", "CF Display", "CF Serif", Georgia, serif; }
body.ch2.font-1:not(.numold) { --f-num: "CF Display", "CF Serif", Georgia, serif; }
body.ch2:not(.numold) .num { font-weight: 800; letter-spacing: 0; }
body.ch2.portrait:not(.numold) .num { font-size: 40px; }
body.ch2.portrait:not(.numold) #winbox .num { font-size: 72px; }
body.ch2.portrait:not(.numold) #betbox .num { font-size: 38px; }
body.ch2:not(.numold) #ladsteps b { font-weight: 800; font-size: 38px; }
body.ch2:not(.numold) #ladsteps b.cur { font-size: 64px; }
body.ch2:not(.numold) #ladder[data-heat="3"] #ladsteps b { font-size: 31px; }
body.ch2:not(.numold) #ladder[data-heat="3"] #ladsteps b.cur { font-size: 54px; }
body.ch2:not(.numold) #ladder[data-heat="4"] #ladsteps b { font-size: 21px; letter-spacing: -0.5px; }
body.ch2:not(.numold) #ladder[data-heat="4"] #ladsteps b.cur { font-size: 38px; }
body.ch2.portrait.free:not(.numold) #fsbar #fsbarnum { font-size: 54px; font-weight: 800; }
body.ch2:not(.numold) #scenebig { font-weight: 800; font-size: 170px; }
body.ch2:not(.numold) #scene[data-kind="total"] #scenebig { font-size: 124px; }
body.ch2:not(.numold) #panel[data-kind="bigwin"] #panelvalue { font-weight: 800; font-size: 124px; }
body.ch2:not(.numold) .pop { font-family: var(--f-num); }

/* ======================= 2026-11-18: soul pass — the Fracture, and the Guardian's reactions =======================*/
/* the Fracture: a crack of light through the winning symbols (drawn by the page, six shapes) */
.fracture { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 5; }
.fracture path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; }
.fracture .g { stroke: #e0262e; stroke-width: 18; opacity: 0.55; filter: blur(7px); }
.fracture.cheap .g { filter: none; opacity: 0.3; stroke-width: 12; }   /* phones: no blur */
.fracture .m { stroke: #ffb84a; stroke-width: 6; }
.fracture .c { stroke: #fffbe8; stroke-width: 2.4; }
/* the pendulum's glow follows whichever picture of the Guardian is up */
#scene[data-face="gate"] #sceneglow { left: 640px; top: 430px; }
#scene[data-face="total"] #sceneglow { left: 668px; top: 372px; animation-duration: 3.6s; }
/* his halo: off for a quiet round, soft for a strong one, blazing for a great one */
#scenehalo { display: none; }
body.portrait #scene[data-mood="approve"] #scenehalo, body.portrait #scene[data-mood="awe"] #scenehalo { display: block; position: absolute; left: 50%; top: 330px; width: 1500px; height: 1500px; margin: -750px 0 0 -750px; border-radius: 50%; pointer-events: none; mix-blend-mode: screen; background: repeating-conic-gradient(rgba(255, 214, 150, 0.32) 0 6deg, rgba(255, 214, 150, 0) 6deg 18deg); -webkit-mask: radial-gradient(circle, #000 10%, transparent 58%); mask: radial-gradient(circle, #000 10%, transparent 58%); animation: turn 26s linear infinite; opacity: 0.55; }
body.portrait #scene[data-mood="awe"] #scenehalo { background: repeating-conic-gradient(rgba(255, 244, 214, 0.6) 0 5deg, rgba(255, 110, 70, 0.3) 5deg 9deg, rgba(255, 110, 70, 0) 9deg 15deg); animation-duration: 12s; opacity: 1; }
body.portrait #scene[data-mood="approve"] #scenekeeper { filter: drop-shadow(0 0 26px rgba(255, 180, 90, 0.55)) drop-shadow(0 12px 30px rgba(0, 0, 0, 0.7)); }
body.portrait #scene[data-mood="awe"] #scenekeeper { width: 690px; margin-left: -345px; top: 4px; filter: brightness(1.12) drop-shadow(0 0 20px rgba(255, 236, 190, 0.8)) drop-shadow(0 0 54px rgba(255, 80, 50, 0.8)); }
#scene[data-mood="awe"] #scenetitle { color: #ffffff; text-shadow: 0 3px 0 #4a0808, 0 0 12px #fff0b0, 0 0 30px #ff7a2a, 0 0 60px rgba(255, 40, 30, 1); }
#scene[data-mood="awe"] #scenebig { animation: ch2pop 0.6s cubic-bezier(0.2, 1.5, 0.4, 1) 0.6s both, ladheat3 0.5s ease-in-out 1.3s infinite alternate; }
#scene[data-mood="awe"] .ember { width: 7px; height: 7px; animation-duration: 4s !important; }
@media (prefers-reduced-motion: reduce) { #scenehalo { animation: none !important; } }
/* the great-round halo was too heavy over the doors: smaller and softer */
body.portrait #scene[data-mood="awe"] #scenehalo { opacity: 0.7; -webkit-mask: radial-gradient(circle, #000 8%, transparent 46%); mask: radial-gradient(circle, #000 8%, transparent 46%); }

/* ======================= 2026-11-18: layout B (preview, only with ?lay=b) =======================
   Founder: 控制台压缩、缩短，腾出上面的部分，想看背景露出来的效果。
   The console is 210 px shorter; everything above it moves down by 210, so the top 250 px of the stage show the hall
   (the great clock window). Stage pixels, 1080x1920. Nothing else changes; without ?lay=b the page is as before. */
body.ch2.portrait.lay-b #logo { top: 262px; }
body.ch2.portrait.lay-b #ladder { top: 250px; }
body.ch2.portrait.lay-b #board { top: 502px; }
body.ch2.portrait.lay-b #scmeter { top: 1332px; }
body.ch2.portrait.lay-b #dock { top: 146px; }
body.ch2.portrait.lay-b #winbox { top: 280px; height: 110px; left: 250px; width: 580px; }
body.ch2.portrait.lay-b:not(.numold) #winbox .num, body.ch2.portrait.lay-b #winbox .num { font-size: 60px; }
body.ch2.portrait.lay-b #winbox .lab { font-size: 22px; }
body.ch2.portrait.lay-b #netbox { top: 398px; height: 56px; left: 250px; width: 580px; }
body.ch2.portrait.lay-b #msg { font-size: 26px; }
body.ch2.portrait.lay-b #balbox, body.ch2.portrait.lay-b #betbox { top: 476px; height: 100px; }
body.ch2.portrait.lay-b #balbox { left: 24px; width: 330px; }
body.ch2.portrait.lay-b #betbox { left: 726px; width: 330px; }
body.ch2.portrait.lay-b #spin { top: 626px; width: 290px; }
body.ch2.portrait.lay-b #info, body.ch2.portrait.lay-b #turbo, body.ch2.portrait.lay-b #auto { top: 664px; width: 112px; }
body.ch2.portrait.lay-b #info { left: 62px; }
body.ch2.portrait.lay-b #turbo { left: 198px; }
body.ch2.portrait.lay-b #auto { left: 835px; }
body.ch2.portrait.lay-b.free #fsbar { top: 1612px; }
/* the darkening follows: clear over the top of the hall, a band behind the strip, the board, then the console */
body.ch2.ui-v33.portrait.lay-b #bgfull::before { background: linear-gradient(180deg, #03060f 0, rgba(3, 6, 18, 0.18) 4%, rgba(3, 6, 18, 0.05) 9%, rgba(3, 6, 18, 0.08) 18%, rgba(3, 6, 18, 0.5) 22%, rgba(3, 6, 18, 0.46) 30%, rgba(3, 6, 18, 0.42) 48%, rgba(3, 6, 18, 0.45) 63%, rgba(3, 6, 18, 0.4) 67%, rgba(3, 6, 18, 0.36) 80%, rgba(3, 6, 18, 0.55) 92%, #03060f 100%); }
body.ch2.fullbg.portrait.lay-b #bgfull::after { background: linear-gradient(180deg, rgba(3, 6, 18, 0.1) 0, rgba(3, 6, 18, 0.05) 18%, rgba(3, 6, 18, 0.4) 22%, rgba(3, 6, 18, 0.3) 31%, rgba(3, 6, 18, 0) 34%, rgba(3, 6, 18, 0) 63%, rgba(3, 6, 18, 0.3) 67%, rgba(3, 6, 18, 0.36) 90%, rgba(3, 6, 18, 0.6) 100%), url(/art/ch2/bg_free_full_rays.webp) center / 100% 100% no-repeat; }

/* ======================= 2026-11-18: layout B, second pass (still only with ?lay=b) =======================
   Top opening 250 -> 200 and the 50 goes back to the console; WIN larger and as wide as the reel area; the status line
   smaller and paler. */
body.ch2.portrait.lay-b #logo { top: 212px; }
body.ch2.portrait.lay-b #ladder { top: 200px; }
body.ch2.portrait.lay-b #board { top: 452px; }
body.ch2.portrait.lay-b #scmeter { top: 1282px; }
body.ch2.portrait.lay-b #dock { top: 96px; }
body.ch2.portrait.lay-b #winbox { top: 232px; height: 124px; left: 96px; width: 888px; }
body.ch2.portrait.lay-b:not(.numold) #winbox .num, body.ch2.portrait.lay-b #winbox .num { font-size: 74px; }
body.ch2.portrait.lay-b #netbox { top: 364px; left: 96px; width: 888px; }
body.ch2.portrait.lay-b #balbox, body.ch2.portrait.lay-b #betbox { top: 440px; }
body.ch2.portrait.lay-b #spin { top: 598px; }
body.ch2.portrait.lay-b #info, body.ch2.portrait.lay-b #turbo, body.ch2.portrait.lay-b #auto { top: 642px; }
body.ch2.portrait.lay-b.free #fsbar { top: 1584px; }
body.ch2.portrait.lay-b #status { font-size: 17px; bottom: 6px; background: none; color: rgba(255, 255, 255, 0.5); }

/* ======================= 2026-11-18: number faces to compare (?font=2 … 5; none = Cinzel, ?num=old = the condensed one) ===========
   The files are open-licence fonts that were already on this computer, copied to web/fonts/try/ for the preview only.
   Before any of them ships: subset to woff2 with tools/build_fonts.py and confirm the licence file. */
@font-face { font-family: "Try Cinzel Deco"; src: url(fonts/try/cinzeldecorative-bold.ttf) format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Try Cormorant"; src: url(fonts/try/cormorantgaramond-vf.ttf) format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Try Bebas"; src: url(fonts/try/bebasneue.ttf) format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Try Anton"; src: url(fonts/try/anton.ttf) format("truetype"); font-weight: 400 900; font-display: swap; }
body.ch2.font-2 { --f-num: "Try Cinzel Deco", "CF Display", serif; }
body.ch2.font-3 { --f-num: "Try Cormorant", "CF Display", serif; }
body.ch2.font-3 .num, body.ch2.font-3 #ladsteps b, body.ch2.font-3 #scenebig, body.ch2.font-3 #panelvalue, body.ch2.font-3 #fsbarnum { font-weight: 700 !important; }
body.ch2.portrait.font-3:not(.numold) .num { font-size: 48px; }
body.ch2.portrait.font-3:not(.numold) #winbox .num { font-size: 86px; }
body.ch2.portrait.font-3.lay-b:not(.numold) #winbox .num { font-size: 88px; }
body.ch2.font-3:not(.numold) #ladsteps b { font-size: 46px; }
body.ch2.font-3:not(.numold) #ladsteps b.cur { font-size: 76px; }
body.ch2.font-4 { --f-num: "Try Bebas", "CF Num", sans-serif; }
body.ch2.font-5 { --f-num: "Try Anton", "CF Num", sans-serif; }
body.ch2.font-4 .num, body.ch2.font-5 .num, body.ch2.font-4 #ladsteps b, body.ch2.font-5 #ladsteps b { font-weight: 400 !important; letter-spacing: 1px; }
body.ch2.portrait.font-4:not(.numold) .num { font-size: 54px; }
body.ch2.portrait.font-4:not(.numold) #winbox .num, body.ch2.portrait.font-4.lay-b:not(.numold) #winbox .num { font-size: 92px; }
body.ch2.font-4:not(.numold) #ladsteps b { font-size: 48px; }
body.ch2.font-4:not(.numold) #ladsteps b.cur { font-size: 82px; }
body.ch2.portrait.font-5:not(.numold) .num { font-size: 46px; }
body.ch2.portrait.font-5:not(.numold) #winbox .num, body.ch2.portrait.font-5.lay-b:not(.numold) #winbox .num { font-size: 78px; }
body.ch2.font-5:not(.numold) #ladsteps b { font-size: 40px; }
body.ch2.font-5:not(.numold) #ladsteps b.cur { font-size: 68px; }

/* ======================= 2026-11-18: layout B, third pass (Founder: 布局再微调，上面的再调一点) =======================
   More of the hall above (opening 200 -> 240) without taking anything from the console: the ladder strip is 12% smaller
   and sits closer to the board, and the logo, which had become too small, is larger. */
body.ch2.portrait.lay-b #ladder { zoom: 0.88; left: 372px; top: 273px; }   /* zoom scales its own offsets too: 372 x 0.88 = 327, 273 x 0.88 = 240 */
body.ch2.portrait.lay-b #logo { width: 276px; left: 22px; top: 226px; }

/* ======================= 2026-11-18: two leftovers in the free round (Founder: 改掉) =======================*/
/* 1. the rays behind a scatter were still Chapter I's purple */
body.ch2 .fx-sc i { background: repeating-conic-gradient(rgba(255, 120, 90, 0.5) 0 9deg, rgba(255, 120, 90, 0) 9deg 22.5deg); }
/* 2. the bottom of the free round: with spin, bet, auto and fast put away, the menu button sat alone and the lower right
      was empty. Balance on the left and menu on the right share one row; the spins-left bar is larger and centred below,
      where the spin button was. (Layout B, portrait.) */
body.ch2.portrait.lay-b.free #fsbar { left: 130px; top: 1676px; width: 820px; height: 208px; padding: 0 128px 6px 118px; }
body.ch2.portrait.lay-b.free #fsbar #fsbarnum { font-size: 74px; }
body.ch2.portrait.lay-b.free #fsbar #fsbarlabel { font-size: 34px; }
body.ch2.portrait.lay-b.free #fsbar.last #fsbarlabel { font-size: 46px; }
body.ch2.portrait.lay-b.free #info { left: 944px; top: 490px; }
body.ch2.portrait.lay-b.free #balbox { left: 24px; }

/* ======================= 2026-11-18: words on the crimson bar were not in the middle of its field (Founder: 这个不对) ==========
   Measured from the picture: the bar's top ornament is taller than the bottom one, so the flat crimson field runs from
   32% to 82% of the picture's height — its middle is at 57%, not 50%. The words were being pushed UP by a small bottom
   padding; they are now pushed DOWN by 14% of the bar's height (twice the 7% offset), so they sit on the field's middle.
   The two uses of the bar also share one letter style now. */
#scenebtn { padding: 23px 96px 0; font-weight: 800; letter-spacing: 3px; }
body:not(.portrait) #scenebtn { padding: 18px 70px 0; }
body.portrait.ch2.free #fsbar { padding-top: 24px; padding-bottom: 0; }
body.ch2.portrait.lay-b.free #fsbar { padding: 29px 128px 0 118px; }
#fsbarlabel { letter-spacing: 3px; }
/* 2026-11-18, Founder: the words "FREE SPINS LEFT" should sit nearer the middle. The label and the number are now one
   group in the centre of the field (they used to be pushed to its two ends). */
body.portrait.ch2.free #fsbar { justify-content: center; gap: 44px; }
body.ch2.portrait.lay-b.free #fsbar { padding-left: 110px; padding-right: 110px; }

/* ======================= 2026-11-18: three requests (Founder) =======================*/
/* 1. 人物向下移动: the Guardian sits lower in the gate / total scene, and the words follow him down */
body.portrait #scenekeeper { top: 110px; }
body.portrait #scene { padding-top: 786px; }
#scene[data-face="gate"] #sceneglow { top: 516px; }
#scene[data-face="total"] #sceneglow { top: 458px; }
body.portrait #scene[data-mood="approve"] #scenehalo, body.portrait #scene[data-mood="awe"] #scenehalo { top: 416px; }
body.portrait #scene[data-mood="awe"] #scenekeeper { top: 90px; }
/* 2. Free Spin 时转轴框要会动、会震、颜色更多: in the free round the frame breathes, a light runs round its rim, the glow
      behind it drifts through crimson, gold and rose, and it jolts with every Fracture (in game.js). Only the frame picture
      moves, not the symbols, so phones are not asked to redraw the board. */
body.ch2.free #frame { animation: ch2framebreath 2.2s ease-in-out infinite alternate; transform-origin: 50% 50%; }
@keyframes ch2framebreath { from { transform: scale(1); } to { transform: scale(1.009); } }
body.ch2.free #frameglow { opacity: 0.5; animation: ch2frameglow 6s linear infinite; }
@keyframes ch2frameglow {
  0%, 100% { box-shadow: 0 0 56px 14px rgba(255, 60, 50, 0.6), inset 0 0 46px rgba(255, 60, 50, 0.4); }
  33% { box-shadow: 0 0 60px 16px rgba(255, 190, 80, 0.62), inset 0 0 46px rgba(255, 190, 80, 0.38); }
  66% { box-shadow: 0 0 60px 16px rgba(255, 70, 150, 0.58), inset 0 0 46px rgba(255, 70, 150, 0.36); }
}
body.ch2.free #framerun { display: block; left: 5%; top: 8.8%; width: 90%; height: 83.8%; border-radius: 26px; padding: 8px; }
body.ch2.free #framerun::before { background: conic-gradient(from 0deg, rgba(255, 255, 255, 0) 0 70%, rgba(255, 90, 70, 0.9) 82%, rgba(255, 226, 150, 1) 92%, rgba(255, 255, 255, 0) 100%); animation-duration: 3.4s; }
/* 3. Free Spin 时金额要放大放小、会律动: the amount keeps a beat while the round is above the bet (class set in game.js) */
body.ch2.free #winbox.beat #win { animation: ch2winbeat 0.62s ease-in-out infinite alternate; }
@keyframes ch2winbeat { from { transform: scale(1); } to { transform: scale(1.08); } }
body.ch2.free #winbox.beat { box-shadow: inset 0 0 0 2px #1d1206, inset 0 0 26px rgba(255, 90, 60, 0.35), 0 0 0 2px #4d360e, 0 0 22px rgba(255, 90, 60, 0.45); }
@media (prefers-reduced-motion: reduce) { body.ch2.free #frame, body.ch2.free #frameglow, body.ch2.free #winbox.beat #win { animation: none; } body.ch2.free #framerun { display: none; } }
/* pacing review, problem 5: coins of the closing scene fall in front of it, not behind */
body.scening .coin { z-index: 42; }

/* ======================= 2026-11-18: the big win waits for the player's press =======================*/
#panelbtn { display: none; }
body.ch2 #panel[data-kind="bigwin"] #panelbtn { display: flex; align-items: center; justify-content: center; position: absolute; left: 50%; top: 124%; transform: translateX(-50%); width: 560px; height: 148px; padding: 21px 80px 0; border: 0; background: url(/art/ch2/bar_crimson.webp) center / 100% 100% no-repeat; color: #fff0cf; font: 800 40px var(--f-display); letter-spacing: 3px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.3s; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.7)); }
body.ch2 #panel[data-kind="bigwin"] #panelbtn.on { opacity: 1; pointer-events: auto; animation: ch2btn 1.6s ease-in-out 0.3s infinite alternate; }
@media (prefers-reduced-motion: reduce) { body.ch2 #panel[data-kind="bigwin"] #panelbtn.on { animation: none; } }

/* ======================= 2026-11-18: wide windows (a computer, a phone held sideways) =======================
   Chapter II always shows its portrait stage (see fit() in game.js). On a wide window the space left and right of it is
   the same hall, blurred and dark, instead of black; in the free round it is the shattered hall. */
@media (min-aspect-ratio: 3/4) {
  body.ch2 { background: transparent; }   /* the page colour stays on <html>; this lets the layer below show */
  body.ch2::before { content: ""; position: fixed; inset: -60px; z-index: -1; background: url(/art/ch2/bg_full.webp) center / cover no-repeat; filter: blur(22px) brightness(0.55); }
  body.ch2.free::before { background-image: url(/art/ch2/bg_free_full_rays.webp); }
  body.ch2.fullbg.portrait #bgfull { box-shadow: 0 0 60px 20px rgba(0, 0, 0, 0.6); }
}

/* ======================= 2026-11-18: the light behind the Keeper (Founder: "会不会太像耶稣？背后还有发光") =======================
   Sun rays behind the head plus a glowing outline round a long-haired, bearded man with an open hand read as a holy picture.
   Both are gone. What moves now is a clock: a dial of minute marks turning slowly round the PENDULUM (not the head), with
   an inner ring of hour marks turning the other way. It is shown at the gate (faint), for a strong round and for a great one. */
body.portrait #scene #scenehalo { display: none; }
body.portrait #scene[data-kind="gate"] #scenehalo, body.portrait #scene[data-mood="approve"] #scenehalo, body.portrait #scene[data-mood="awe"] #scenehalo {
  display: block; position: absolute; left: 640px; top: 516px; width: 700px; height: 700px; margin: -350px 0 0 -350px; border-radius: 50%; pointer-events: none; mix-blend-mode: screen; opacity: 0.34; z-index: 0;
  background: repeating-conic-gradient(rgba(255, 214, 150, 0.95) 0 0.7deg, rgba(255, 214, 150, 0) 0.7deg 6deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent 0 86%, #000 87% 94%, transparent 95%); mask: radial-gradient(circle closest-side, transparent 0 86%, #000 87% 94%, transparent 95%);
  animation: turn 60s linear infinite; }
body.portrait #scene[data-face="total"] #scenehalo { left: 668px; top: 458px; }
body.portrait #scene[data-mood="approve"] #scenehalo { opacity: 0.55; animation-duration: 40s; }
body.portrait #scene[data-mood="awe"] #scenehalo { opacity: 0.9; animation-duration: 18s; left: 652px; top: 520px;
  background: repeating-conic-gradient(rgba(255, 240, 205, 1) 0 0.8deg, rgba(255, 110, 70, 0.5) 0.8deg 1.6deg, rgba(255, 110, 70, 0) 1.6deg 6deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent 0 86%, #000 87% 94%, transparent 95%); mask: radial-gradient(circle closest-side, transparent 0 86%, #000 87% 94%, transparent 95%); }
/* the hour ring: twelve heavier marks and a hairline, turning the other way. It is a second element so it is not cut by the mask above. */
#scenehalo2 { display: none; }
body.portrait #scene[data-kind="gate"] #scenehalo2, body.portrait #scene[data-mood="approve"] #scenehalo2, body.portrait #scene[data-mood="awe"] #scenehalo2 {
  display: block; position: absolute; left: 640px; top: 516px; width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%; pointer-events: none; mix-blend-mode: screen; opacity: 0.3; z-index: 0;
  background: repeating-conic-gradient(rgba(255, 196, 110, 1) 0 1.6deg, rgba(255, 196, 110, 0) 1.6deg 30deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent 0 84%, #000 85% 97%, transparent 98%); mask: radial-gradient(circle closest-side, transparent 0 84%, #000 85% 97%, transparent 98%);
  animation: turn 90s linear infinite reverse; }
body.portrait #scene[data-face="total"] #scenehalo2 { left: 668px; top: 458px; }
body.portrait #scene[data-mood="approve"] #scenehalo2 { opacity: 0.5; animation-duration: 55s; }
body.portrait #scene[data-mood="awe"] #scenehalo2 { opacity: 0.85; animation-duration: 24s; left: 652px; top: 520px; }
#scene[data-calm="1"] #scenehalo, #scene[data-calm="1"] #scenehalo2 { display: none !important; }
/* no glowing outline round the figure: only his shadow, and a little more light on him for a great round */
body.portrait #scene[data-mood="approve"] #scenekeeper { filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.7)); }
body.portrait #scene[data-mood="awe"] #scenekeeper { filter: brightness(1.08) drop-shadow(0 12px 30px rgba(0, 0, 0, 0.7)); }
@media (prefers-reduced-motion: reduce) { #scenehalo2 { animation: none !important; } }
/* the dial centred on the pendulum showed only as half a ring at his right shoulder: it now stands behind the whole figure,
   centred on his chest (not his head), wide enough to show on both sides — a great clock he stands in front of */
body.portrait #scene #scenehalo, body.portrait #scene[data-mood="awe"] #scenehalo, body.portrait #scene[data-face="total"] #scenehalo { left: 540px; top: 500px; width: 860px; height: 860px; margin: -430px 0 0 -430px; }
body.portrait #scene #scenehalo2, body.portrait #scene[data-mood="awe"] #scenehalo2, body.portrait #scene[data-face="total"] #scenehalo2 { left: 540px; top: 500px; width: 740px; height: 740px; margin: -370px 0 0 -370px; }

/* ======================= 2026-11-18: the lit number grows and trembles from the first climb (Founder) =======================
   Free round only. --lg (size), --lj / --lr (tremble) and --ls (speed) are set by setLadder from the step that is lit: nothing
   at x3, a little more at every step, meeting the x25 tier where the stronger effects above take over. */
#ladder.free #ladsteps b.cur { transform: scale(var(--lg, 1)); transform-origin: 50% 55%; transition: transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
#ladder.free[data-heat="0"] #ladsteps b.cur, #ladder.free[data-heat="1"] #ladsteps b.cur { animation: ladshake var(--ls, 0.24s) linear infinite, ladheat1 1.1s ease-in-out infinite alternate; --j: var(--lj, 0px); --r: var(--lr, 0deg); }
#ladder.free[data-heat="0"] #ladsteps b.cur { text-shadow: 0 3px 0 #3a0a0a, 0 0 calc(var(--lj, 0px) * 10) rgba(255, 150, 70, 0.9); }
@media (prefers-reduced-motion: reduce) { #ladder.free #ladsteps b.cur { animation: none !important; } }

/* ======================= 2026-11-18: the ladder says hello when the free round opens (Founder) ======================= */
#ladder.enter { animation: ladenter 1.5s ease-out; }
@keyframes ladenter { 0% { filter: brightness(1) drop-shadow(0 0 0 rgba(255, 200, 110, 0)); } 22% { filter: brightness(1.9) drop-shadow(0 0 34px rgba(255, 190, 100, 1)) drop-shadow(0 0 70px rgba(255, 70, 40, 0.9)); } 100% { filter: brightness(1) drop-shadow(0 0 0 rgba(255, 200, 110, 0)); } }
/* the lit number makes room for itself as it grows, so it does not sit on its neighbours (seen at x30) */
#ladder.free #ladsteps b.cur { margin: 0 calc((var(--lg, 1) - 1) * 0.6em); }

/* ======================= 2026-11-18: the free round ends — time stops before the closing scene (Founder) ======================= */
/* (the board keeps its push-in transition: listing only `filter` here had switched it off — fixed the same day; push-in is 0.5 s now) */
body.ch2 #board { transition: transform 0.5s cubic-bezier(0.5, 0, 0.9, 0.6), opacity 0.5s ease-in, filter 0.5s ease-out; }
body.ch2 #frame { transition: filter 0.5s ease-out; }
body.ch2.stilled #board { filter: grayscale(0.8) brightness(0.68); }
body.ch2.stilled #frame { filter: grayscale(0.6) brightness(0.8); animation-play-state: paused; }
body.ch2.stilled #framerun, body.ch2.stilled #ladder, body.ch2.stilled #ladsteps b.cur, body.ch2.stilled #winbox { animation-play-state: paused; }

/* ======================= 2026-11-18: the free round moves with the beat (Founder: 外框为主，钟面为辅) =======================
   --beat (0…1) is set every frame by beatLoop() in game.js from the music's clock: 1 on the first beat of a bar, 0.55 on the
   others, falling away between beats. The frame's own slow "breathing" is replaced by it. */
#ladclock { display: none; }
body.ch2.free:not(.stilled) #frame { animation: none; transition: none; transform: scale(calc(1 + var(--beat, 0) * 0.012)); filter: brightness(calc(1 + var(--beat, 0) * 0.32)) saturate(calc(1 + var(--beat, 0) * 0.4)); }
body.ch2.free #frameglow { opacity: calc(0.32 + var(--beat, 0) * 0.6); }
/* the cracked clock: a second copy of the strip picture, cut to the clock, swelling and flaring like a heartbeat */
body.ch2.free #ladclock { display: block; position: absolute; inset: 0; background: url(/art/ch2/ladder_strip.webp) 0 0 / 100% 100% no-repeat; -webkit-clip-path: ellipse(12.6% 43% at 13% 51%); clip-path: ellipse(12.6% 43% at 13% 51%); transform-origin: 13% 51%; transform: scale(calc(1 + var(--beat, 0) * 0.085)); filter: brightness(calc(1 + var(--beat, 0) * 0.7)); }

/* ======================= 2026-11-18: the console joins the beat in the free round (Founder: 控制台很"安静冷清") =======================
   Quieter than the frame, so the top half still leads: the boxes do not move or change size, they only take a crimson-gold
   glow on each beat. The spins-left bar is the strongest of them. Its "last spin" look keeps its own style. */
body.portrait.ch2.free #fsbar:not(.last) { filter: brightness(calc(1 + var(--beat, 0) * 0.2)) drop-shadow(0 0 calc(6px + var(--beat, 0) * 26px) rgba(255, 90, 55, calc(0.25 + var(--beat, 0) * 0.7))) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6)); }
body.ch2.free:not(.stilled) #winbox { filter: drop-shadow(0 0 calc(4px + var(--beat, 0) * 20px) rgba(255, 110, 60, calc(0.15 + var(--beat, 0) * 0.65))); }
body.ch2.free:not(.stilled) #balbox, body.ch2.free:not(.stilled) #status { filter: drop-shadow(0 0 calc(var(--beat, 0) * 14px) rgba(255, 110, 60, calc(var(--beat, 0) * 0.55))); }

/* ======================= 2026-11-18: embers rise behind the console in the free round (Founder) ======================= */
#cembers { display: none; }
/* it sits inside #controls, straight after the console's dark backing (#dock) and before its boxes: above the one, below the others.
   (At the stage level it was either under the backing and invisible, or — with a z-index — in front of the boxes.) #controls starts at y 1120. */
body.ch2.portrait.free #cembers { display: block; position: absolute; left: 0; top: 70px; width: 1080px; height: 730px; overflow: hidden; pointer-events: none;
  -webkit-mask: linear-gradient(to bottom, transparent 0, #000 22%, #000 100%); mask: linear-gradient(to bottom, transparent 0, #000 22%, #000 100%); }
#cembers u { position: absolute; bottom: -20px; border-radius: 50%; background: radial-gradient(circle, #fff6dc 0, #ffc070 45%, #ff7a3a 100%); box-shadow: 0 0 12px 4px rgba(255, 170, 90, 0.95), 0 0 34px 12px rgba(255, 70, 35, 0.75); /* 2026-11-18: a size larger, a white-hot core and a second, wider glow */ opacity: 0; animation: cember linear infinite; will-change: transform, opacity; }
@keyframes cember { 0% { transform: translate(0, 0) scale(1); opacity: 0; } 10% { opacity: 1; } 70% { opacity: 0.7; } 100% { transform: translate(var(--d), var(--h)) scale(0.4); opacity: 0; } }
body.ch2.stilled #cembers u { animation-play-state: paused; }
body.scening #cembers { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { #cembers { display: none !important; } }

/* ============================================================================================================================
   2026-11-18 — PHONE DRAWING (body.lite-fx): the same effects, drawn the cheap way.
   Set on touch devices, on any device found to be slow, or with ?fx=lite. Rule (docs: mobile checklist): while something is
   moving, only its position, size and transparency change — never a glow, a shadow or a brightness that has to be worked out
   again on every frame. Glows are fixed pictures that are shown more or less.
   ============================================================================================================================ */
.beatglow { display: none; }
/* --- the beat --- */
body.ch2.lite-fx.free:not(.stilled) #frame { filter: none; transform: scale(calc(1 + var(--beat, 0) * 0.012)); }
body.ch2.lite-fx.free #frameglow { animation: none; box-shadow: 0 0 56px 14px rgba(255, 80, 50, 0.62), inset 0 0 46px rgba(255, 80, 50, 0.4); opacity: calc(0.32 + var(--beat, 0) * 0.6); will-change: opacity; }
body.ch2.lite-fx.free #framerun { display: none; }
body.ch2.lite-fx.free #ladclock { filter: none; will-change: transform; }
body.portrait.ch2.lite-fx.free #fsbar:not(.last) { filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6)); }
body.ch2.lite-fx.free:not(.stilled) #winbox, body.ch2.lite-fx.free:not(.stilled) #balbox, body.ch2.lite-fx.free:not(.stilled) #status { filter: none; }
body.ch2.lite-fx.free #winbox { isolation: isolate; }
body.ch2.lite-fx.free .beatglow { display: block; position: absolute; left: -34px; right: -34px; top: -30px; bottom: -30px; z-index: -1; pointer-events: none; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 110, 60, 0.8) 0, rgba(255, 70, 40, 0.38) 46%, rgba(255, 60, 40, 0) 72%); opacity: calc(var(--beat, 0) * 0.85); will-change: opacity; }
body.ch2.lite-fx.free #winbox .beatglow { opacity: calc(var(--beat, 0) * 0.5); }
body.ch2.lite-fx.stilled .beatglow, body.ch2.lite-fx #fsbar.last .beatglow { opacity: 0; }
/* --- embers: one soft dot each, no computed glow --- */
body.ch2.lite-fx #cembers u { box-shadow: none; background: radial-gradient(circle, #fff6dc 0, #ffb868 14%, rgba(255, 96, 44, 0.6) 34%, rgba(255, 60, 30, 0) 68%); }
body.ch2.lite-fx .ember { width: 16px; height: 16px; box-shadow: none; background: radial-gradient(circle, #ffd9a8 0, #ff9a58 22%, rgba(255, 80, 40, 0.5) 42%, rgba(255, 60, 30, 0) 70%); }
/* --- the ladder: its heat is a fixed glow behind it; the lit number only shakes and swells --- */
body.ch2.portrait.lite-fx #ladder, body.ch2.portrait.lite-fx #ladder[data-heat] { filter: none; isolation: isolate; }
body.ch2.portrait.lite-fx #ladder::before { content: ""; position: absolute; left: -40px; right: -40px; top: -46px; bottom: -46px; z-index: -1; pointer-events: none; border-radius: 50%; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(ellipse at center, rgba(255, 120, 60, 0.85) 0, rgba(255, 60, 40, 0.45) 45%, rgba(255, 40, 30, 0) 72%); }
body.ch2.portrait.lite-fx #ladder[data-heat="1"]::before { opacity: 0.25; }
body.ch2.portrait.lite-fx #ladder[data-heat="2"]::before { opacity: 0.5; }
body.ch2.portrait.lite-fx #ladder[data-heat="3"]::before { opacity: 0.8; }
body.ch2.portrait.lite-fx #ladder[data-heat="4"]::before { opacity: 1; }
body.ch2.lite-fx #ladder #ladsteps b.cur { animation-name: ladshake, ladsize; will-change: transform; }
@keyframes ladsize { from { scale: 1; } to { scale: 1.1; } }
/* --- scenes: no blending of layers --- */
body.lite-fx #scenehalo, body.lite-fx #scenehalo2, body.lite-fx #sceneglow { mix-blend-mode: normal !important; will-change: transform; }

/* 2026-11-18: nobody is playing (25 s without a touch, nothing running): every decoration stands still. See pokeIdle() in game.js. */
body.idle #stage *, body.idle #stage *::before, body.idle #stage *::after, body.idle #bgfull { animation-play-state: paused !important; }

/* 2026-11-18: single effects switched off by the phone test (?fxtest) while it looks for the one a phone cannot take */
body.off-winrays #winrays { display: none !important; }
body.off-scenefx #scenehalo, body.off-scenefx #scenehalo2, body.off-scenefx #sceneglow, body.off-scenefx .ember { display: none !important; }
body.off-rift #rift, body.off-rift #burst { display: none !important; }

/* ============================================================================================================================
   2026-11-18 — the two giant light layers (found with the phone test on an iPhone: Safari threw the page away on the way into
   the free round, five times out of five; with #winrays off it survived until #burst came on).
   A layer is kept in memory at its own size times the screen's pixel ratio squared: #winrays (2200 px square) is about 170 MB
   on a x3 phone, #burst (3400 px square) about 415 MB. Both are soft rays, so they are now drawn at a quarter of the size and
   enlarged four times by the browser (`scale`, which does not take memory): about 11 MB and 26 MB. They look the same.
   #winrays also no longer turns while it is not shown.
   ============================================================================================================================ */
#winrays { width: 550px; height: 550px; margin: -275px 0 0 -275px; scale: 4; animation-play-state: paused; }
#winrays.on { animation-play-state: running; }
#burst { width: 850px; height: 850px; margin: -425px 0 0 -425px; scale: 4; }
/* the dials behind the Keeper: half size, enlarged twice (27 MB + 20 MB -> 7 MB + 5 MB on a x3 phone) */
body.portrait #scene #scenehalo, body.portrait #scene[data-mood="awe"] #scenehalo, body.portrait #scene[data-face="total"] #scenehalo { width: 430px; height: 430px; margin: -215px 0 0 -215px; scale: 2; }
body.portrait #scene #scenehalo2, body.portrait #scene[data-mood="awe"] #scenehalo2, body.portrait #scene[data-face="total"] #scenehalo2 { width: 370px; height: 370px; margin: -185px 0 0 -185px; scale: 2; }
#panel.rays::before { width: 500px; height: 500px; margin: -250px 0 0 -250px; scale: 3; }

/* ============================================================================================================================
   2026-11-18 — phones (body.phone, every touch device): the layers that cover the whole stage are held small and enlarged.
   The stage is laid out at 1080 x 1920 and shrunk by a transform, so a phone with a x3 screen keeps every stage-sized layer at
   3240 x 5760 = about 75 MB. Lights and backgrounds do not need that: the rift and the scene's background at half size
   (19 MB), plain washes of colour at a tenth (under 1 MB). Text and the Keeper are not touched.
   Found with the phone test: after the two giant ray layers were fixed, the iPhone still lost the page one second into the charge.
   ============================================================================================================================ */
body.phone #rift { inset: auto; left: 270px; top: 480px; width: 540px; height: 960px; scale: 2; }
body.phone #whiteout { inset: auto; left: 486px; top: 864px; width: 108px; height: 192px; scale: 10; }
body.phone #scene::before { inset: auto; left: 270px; top: 480px; width: 540px; height: 960px; scale: 2; animation: none; }
body.phone #scene::after { inset: auto; left: 486px; top: 864px; width: 108px; height: 192px; scale: 10; }
body.phone.portrait #flash { inset: auto; left: 270px; top: 480px; width: 540px; height: 960px; scale: 2; }
body.phone.portrait #shade { inset: auto; left: 486px; top: 864px; width: 108px; height: 192px; scale: 10; }

/* ============================================================================================================================
   2026-11-18 — the rays and the dials are PICTURES now (art/ch2/fx_*.webp, drawn by tools/build_ch2_fx.py from the recipes
   above). Same look; the phone no longer has to work out gradients, masks, a blur and a blend on layers thousands of pixels
   wide. Established with the phone test (known code version): with the burst and the rift switched off, an iPhone that lost
   the page 0.7 s into the charge got through the whole charge and the strike. #burst had been: 3400 px, two gradients, a mask,
   mix-blend-mode: screen and filter: blur(4px).
   The earlier "draw small, enlarge" rules are undone here: a picture costs the same whatever size it is shown at.
   ============================================================================================================================ */
#burst { width: 3400px; height: 3400px; margin: -1700px 0 0 -1700px; scale: none; background: none; -webkit-mask: none; mask: none; mix-blend-mode: normal; filter: none; border-radius: 0; }
#winrays { width: 2200px; height: 2200px; margin: -1100px 0 0 -1100px; scale: none; background: none !important; -webkit-mask: none; mask: none; border-radius: 0; }
#winrays[data-tier="1"] { content: url(/art/ch2/fx_rays_1.webp); }
#winrays[data-tier="2"] { content: url(/art/ch2/fx_rays_2.webp); }
body.portrait #scene #scenehalo, body.portrait #scene[data-mood="awe"] #scenehalo, body.portrait #scene[data-face="total"] #scenehalo { width: 860px; height: 860px; margin: -430px 0 0 -430px; scale: none; background: none; -webkit-mask: none; mask: none; mix-blend-mode: normal; border-radius: 0; }
body.portrait #scene[data-mood="awe"] #scenehalo { content: url(/art/ch2/fx_dial_min_awe.webp); }
body.portrait #scene #scenehalo2, body.portrait #scene[data-mood="awe"] #scenehalo2, body.portrait #scene[data-face="total"] #scenehalo2 { width: 740px; height: 740px; margin: -370px 0 0 -370px; scale: none; background: none; -webkit-mask: none; mask: none; mix-blend-mode: normal; border-radius: 0; }
body.off-burstfx #burst { display: none !important; }
body.off-riftfx #rift { display: none !important; }

/* ============================================================================================================================
   2026-11-18 (evening) — PHONE DRAWING, RICH. Every touch device uses body.lite-fx now, so it must not look poorer than the full
   drawing: the pieces that the first phone drawing simply left out are back, each drawn without a filter, a mask or a shadow
   that has to be worked out again on every frame. (iPhone, build 4421890: the page was lost within a second of the free hall
   coming up, every time, with the full drawing of the hall.)
   ============================================================================================================================ */
/* 1. the frame flares on the beat: a brighter picture of the lit frame over it, more or less transparent */
#frameflare { display: none; }
body.ch2.lite-fx.free #frameflare { display: block; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: calc(var(--beat, 0) * 0.6); transform: scale(calc(1 + var(--beat, 0) * 0.012)); will-change: opacity; }
body.ch2.lite-fx.stilled #frameflare { opacity: 0; }
/* 2. the glow behind the frame drifts through crimson, gold and rose again: three fixed glows fading in and out */
body.ch2.lite-fx.free #frameglow::before, body.ch2.lite-fx.free #frameglow::after { content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: 0; }
body.ch2.lite-fx.free #frameglow::before { box-shadow: 0 0 60px 16px rgba(255, 190, 80, 0.7), inset 0 0 46px rgba(255, 190, 80, 0.4); animation: glowgold 6s linear infinite; }
body.ch2.lite-fx.free #frameglow::after { box-shadow: 0 0 60px 16px rgba(255, 70, 150, 0.66), inset 0 0 46px rgba(255, 70, 150, 0.38); animation: glowrose 6s linear infinite; }
@keyframes glowgold { 0%, 66%, 100% { opacity: 0; } 33% { opacity: 1; } }
@keyframes glowrose { 0%, 33%, 100% { opacity: 0; } 66% { opacity: 1; } }
/* 3. the light that runs round the rim: two soft lights travelling along the edge (no mask, no turning gradient) */
body.ch2.lite-fx.free #framerun { display: block; -webkit-mask: none; mask: none; overflow: visible; padding: 0; }
body.ch2.lite-fx.free #framerun::before, body.ch2.lite-fx.free #framerun::after { content: ""; position: absolute; left: 0; top: 0; width: 190px; height: 190px; margin: -95px 0 0 -95px; aspect-ratio: auto; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 200, 0.95) 0, rgba(255, 150, 80, 0.6) 24%, rgba(255, 70, 50, 0.25) 44%, rgba(255, 60, 40, 0) 66%); animation: rimrun 3.4s linear infinite; }
body.ch2.lite-fx.free #framerun::after { animation-delay: -1.7s; }
@keyframes rimrun { 0% { left: 0; top: 0; } 28.6% { left: 100%; top: 0; } 50% { left: 100%; top: 100%; } 78.6% { left: 0; top: 100%; } 100% { left: 0; top: 0; } }
/* 4. all four boxes of the console take the glow (balance box and status line were left out before) */
body.ch2.lite-fx.free #balbox, body.ch2.lite-fx.free #status { isolation: isolate; }
body.ch2.lite-fx.free #balbox .beatglow, body.ch2.lite-fx.free #status .beatglow { opacity: calc(var(--beat, 0) * 0.42); }
/* 5. the cracked clock: a flare inside it on the beat */
body.ch2.lite-fx.free #ladclock::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 13% 51%, rgba(255, 226, 170, 0.6) 0, rgba(255, 120, 70, 0.3) 7%, rgba(255, 90, 50, 0) 13%); opacity: var(--beat, 0); }
/* 6. the ladder's hello on entering the free round: its fixed glow comes up full and fades (no filter animation) */
body.ch2.lite-fx #ladder.enter { animation: none; }
body.ch2.portrait.lite-fx #ladder.enter::before { opacity: 1 !important; transition: none; }
/* 7. "time stops": the board and the frame dim instead of being run through a grey filter */
body.ch2.lite-fx #board, body.ch2.lite-fx #frame { transition: transform 0.5s cubic-bezier(0.5, 0, 0.9, 0.6), opacity 0.5s ease-out; }
body.ch2.lite-fx.stilled #board { filter: none; opacity: 0.55; }
body.ch2.lite-fx.stilled #frame { filter: none; opacity: 0.75; }
/* the phone test: parts of the free hall switched off one at a time */
body.off-rim #framerun { display: none !important; }
body.off-flare #frameflare, body.off-flare #frameglow { display: none !important; }
body.off-embers #cembers { display: none !important; }
body.off-boxglow .beatglow { display: none !important; }

/* 2026-11-18 (evening): the sweep of light behind the board in the free round was the last turning gradient-with-a-mask left
   (Chapter I's, 170% of the board). It switches on at the very moment the free hall comes up — the moment an iPhone lost the page
   in every valid run, with the sound exonerated (18 s wait survived) and the other free-hall effects off. A picture now. */
body.ch2 #board::before { background: url(/art/ch2/fx_sweep.webp) center / 100% 100% no-repeat; -webkit-mask: none; mask: none; border-radius: 0; }
body.off-sweep #board::before { display: none !important; }
body.off-tint #tint { display: none !important; }
body.off-bgfree #bgfull::after { display: none !important; }

/* ============================================================================================================================
   2026-11-18 (evening) — FOUND. The sweep of light behind the board (#board::before) is what made an iPhone throw the page away
   on entering the free round: build 6405169, everything on -> lost half a second after the free hall came up; the same with the
   sweep alone switched off -> the whole free round ran to its end (108 s) and the result came up.
   It was already a picture by then, so its cost was not the gradient: it is a layer that TURNS, lying UNDER the whole board.
   A browser must then keep everything that lies over it — the grid, the thirty symbols, the frame, the glows — as separate
   layers of its own, and on a x3 screen that is more memory than the page is allowed.
   On phones it now lies still (at 40 s a turn its movement could hardly be seen) and appears without a fade. Computers keep
   the turning one.
   ============================================================================================================================ */
body.phone #board::before, body.phone.free #board::before { animation: none !important; transition: none !important; }

/* 2026-11-18 (evening), build 6889360: with the sweep lying still (but still the board's own ::before, 170% of the board) the
   iPhone lost the page again; with it off the free round ran. So it is not the turning: it is this element being part of the
   board at all — it reaches far outside the board, and whatever the browser has to keep for the board then has to be that big.
   On phones the light is now a picture of its own in the stage, behind the board, still; the board's ::before is gone there. */
#sweep { display: none; }
body.phone.ch2 #board::before { display: none !important; }
body.phone.ch2.free #sweep { display: block; position: absolute; pointer-events: none; }
body.off-sweep #sweep { display: none !important; }

/* 2026-11-18 (late): the light behind the board is painted into the free hall's background (bg_free_full_rays.webp) for every
   device. In real Safari on an iPhone (build 7098133) the page was lost even with that light as a separate still picture in the
   stage, and ran with it off — fourth run of that kind. No element, no layer, nothing to animate: it cannot do harm any more.
   Computers lose its very slow turning (one turn in 40 s). */
body.ch2 #board::before { display: none !important; }
#sweep, body.phone.ch2.free #sweep { display: none !important; }

/* ============================================================================================================================
   2026-11-19 — CANVAS DRAWING, step 1 (trial, only with ?draw=canvas; canvas.js). The reel area's backing, the symbols, the column
   light, the darkening toward the corners and the frame are painted on one canvas inside #board; the page's own copies are
   hidden. They keep their place in the layout, because the canvas reads its positions from them.
   ============================================================================================================================ */
body.cv #gridbg, body.cv #frame, body.cv #spot { visibility: hidden; }
body.cv #grid::after { display: none; }

/* CANVAS DRAWING, step 3 (2026-11-19): the way into the free round. The rift, the burst and the white light are painted on a canvas
   over the stage; while the gate scene is up (body.cvscene) its picture, dials, Keeper, pendulum light and embers are painted too. */
body.cv #burst, body.cv #rift, body.cv #whiteout { display: none !important; }
body.cvscene #scene::before, body.cvscene #scene::after { display: none !important; }
body.cvscene #scenehalo, body.cvscene #scenehalo2, body.cvscene #sceneglow, body.cvscene #scenekeeper, body.cvscene .ember { display: none !important; }

/* CANVAS DRAWING, step 4 (2026-11-19): the free hall and the closing scene. The frame's flare and glow, the rim light, the clock's
   heartbeat, the console's glow and embers are painted; "time stops" is done on the canvas (no filter, no fading of #board). */
body.cv.free #frameglow, body.cv #framerun, body.cv #frameflare, body.cv #cembers, body.cv #ladclock, body.cv .beatglow { display: none !important; }
body.cv.ch2.stilled #board { filter: none !important; opacity: 1 !important; }
body.cv.ch2.free #fsbar:not(.last) { filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6)) !important; }
body.cv.ch2.free #winbox, body.cv.ch2.free #balbox, body.cv.ch2.free #status { filter: none !important; }

/* CANVAS DRAWING, step 5 (2026-11-19): the big win's darkening, turning rays and coins, and the flash over the stage, are painted.
   (#shade keeps its class: the background outside the stage still darkens with it.) */
body.cv #winrays, body.cv #shade, body.cv #flash, body.cv .coin { display: none !important; }

/* CANVAS DRAWING, the two effects still owed (2026-11-19): the light behind the board turns again, and the ladder burns hotter
   with the multiplier. With the canvas drawing the free hall's background is the one WITHOUT the light painted in
   (bg_free_full.webp): the light is painted on a canvas under the board, turning once in 40 s as it was first made. */
body.cv.ch2.fullbg.portrait #bgfull::after { background: linear-gradient(180deg, rgba(3, 6, 18, 0) 0, rgba(3, 6, 18, 0) 56%, rgba(3, 6, 18, 0.5) 62%, rgba(3, 6, 18, 0.62) 100%), url(/art/ch2/bg_free_full.webp) center / 100% 100% no-repeat; }
body.cv.ch2.fullbg.portrait #bgfull::after { background: linear-gradient(180deg, rgba(3, 6, 18, 0.35) 0, rgba(3, 6, 18, 0.4) 20%, rgba(3, 6, 18, 0) 26%, rgba(3, 6, 18, 0) 56%, rgba(3, 6, 18, 0.3) 62%, rgba(3, 6, 18, 0.36) 90%, rgba(3, 6, 18, 0.6) 100%), url(/art/ch2/bg_free_full.webp) center / 100% 100% no-repeat; }
body.cv.ch2.fullbg.portrait.lay-b #bgfull::after { background: linear-gradient(180deg, rgba(3, 6, 18, 0.1) 0, rgba(3, 6, 18, 0.05) 18%, rgba(3, 6, 18, 0.4) 22%, rgba(3, 6, 18, 0.3) 31%, rgba(3, 6, 18, 0) 34%, rgba(3, 6, 18, 0) 63%, rgba(3, 6, 18, 0.3) 67%, rgba(3, 6, 18, 0.36) 90%, rgba(3, 6, 18, 0.6) 100%), url(/art/ch2/bg_free_full.webp) center / 100% 100% no-repeat; }
@media (min-aspect-ratio: 3/4) { body.cv.ch2.free::before { background-image: url(/art/ch2/bg_free_full.webp); } }
/* the ladder: its fire is painted behind the strip in the strip's own shape (the phone drawing's fixed oval is not used), and the
   lit number gets its brightening back */
body.cv.ch2.portrait #ladder::before { display: none !important; }
body.cv.ch2.portrait #ladder { isolation: isolate; }   /* so the fire's canvas, placed under the strip, stays inside the ladder */
body.cv.ch2.portrait #ladder, body.cv.ch2.portrait #ladder[data-heat] { filter: none !important; }
body.cv.ch2 #ladder.enter { animation: none; }
body.cv.ch2.lite-fx #ladder[data-heat="1"] #ladsteps b.cur { animation-name: ladheat1; }
body.cv.ch2.lite-fx #ladder.free[data-heat="0"] #ladsteps b.cur, body.cv.ch2.lite-fx #ladder.free[data-heat="1"] #ladsteps b.cur { animation-name: ladshake, ladheat1; }
body.cv.ch2.lite-fx #ladder[data-heat="2"] #ladsteps b.cur { animation-name: ladshake, ladheat2; }
body.cv.ch2.lite-fx #ladder[data-heat="3"] #ladsteps b.cur { animation-name: ladshake, ladheat3; }
body.cv.ch2.lite-fx #ladder[data-heat="4"] #ladsteps b.cur { animation-name: ladshake, ladheat4; }

/* Canvas drawing, 2026-11-19: while a full-screen scene stands (the gate scene, the closing scene) everything under it is
   covered (body.cvcover is set once the scene has finished fading in, and taken off the instant it goes), but the phone still put all of it together on every frame
   (iPhone: closing scene 27–35 fps over the free hall, entry scene 60 over the normal game). What is covered is not drawn.
   Nothing is removed or re-laid: positions and running animations stay as they are, and it is all back the instant the scene goes. */
body.cvcover :is(#bg, #motes, #tint, #logo, #top, #sweep, #board, #ladder, #mult, #scmeter, #fs, #controls, #fsbar, #winrays, #shade, #status, #ladsteps b, canvas.cvunder) { visibility: hidden !important; }

/* The hall check-up (?draw=canvas&dev=1&probe=1, local development only): game.js puts one of these on <body> for a second
   at a time during the free round and compares the frame rate with the second next to it. Never set outside that test. */
body.pb-sweep #cvu { visibility: hidden !important; }
body.pb-console #cvc { visibility: hidden !important; }
body.pb-ladfx #cvl, body.pb-ladfx #cvf { visibility: hidden !important; }
body.pb-wintext :is(.fly, .pop, #combo, #banner, .wave, .void) { display: none !important; }
body.pb-ladnum #ladsteps b { animation: none !important; filter: none !important; text-shadow: none !important; }
body.pb-ladder #ladder { visibility: hidden !important; }
body.pb-fsbar #fsbar { filter: none !important; }
body.pb-tint #tint { visibility: hidden !important; }
body.pb-small :is(#motes, #bg .glow, .sweep, .gem, #logo) { visibility: hidden !important; }
body.pb-bg #bgfull { visibility: hidden !important; }
body.pb-controls #controls { visibility: hidden !important; }

/* Graphics-card drawing, step 1 (?draw=canvas&gl=1): the ladder's strip is painted on the one canvas, between its fire and its clock */
body.cvgl #ladderimg { visibility: hidden !important; }
/* step 2: the console's backing is painted on the graphics canvas, under the console's glows (canvas.js paintDockGL) */
body.cvgl.cvdock #dock { visibility: hidden !important; }
/* step 2: once a scene covers the hall, its picture is on the graphics canvas under #scene: the scene's dark backing is painted there too */
body.cvgl.cvcover #scene { background: transparent !important; }
