/* ---- fonts ----
   Five open-source fonts (SIL Open Font License), packed by tools/build_fonts.py so every phone shows the same thing:
     display  Cinzel            — titles and labels in Latin scripts (a carved, monumental capital face)
     serif    Noto Serif        — running text, and all Vietnamese (Cinzel has no Vietnamese accents)
     chinese  Noto Serif SC     — 思源宋体, only the characters the game uses
     thai     Noto Serif Thai
     numbers  Oswald            — tall, even-height digits that stay readable when small
   The system fonts after them are only a fallback for a character that is not in the packed files. */
@font-face { font-family: "CF Display"; src: url(fonts/cinzel.woff2) format("woff2"); font-weight: 500 900; font-display: swap; }
@font-face { font-family: "CF Serif"; src: url(fonts/notoserif.woff2) format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "CF SC"; src: url(fonts/notoserifsc.woff2) format("woff2"); font-weight: 500 900; font-display: swap; }
@font-face { font-family: "CF Thai"; src: url(fonts/notoserifthai.woff2) format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "CF Num"; src: url(fonts/oswald.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
:root {
  --f-display: "CF Display", "CF Serif", "CF SC", "CF Thai", Georgia, "Songti SC", serif;
  --f-text: "CF Serif", "CF SC", "CF Thai", Georgia, "Songti SC", serif;
  --f-num: "CF Num", "Avenir Next Condensed", "DIN Alternate", "Helvetica Neue", Arial, sans-serif;
  --track: 1.5px; /* letter spacing of labels */
}
/* Chinese: the Chinese face first, so letters and digits inside Chinese text match it; wider spacing suits it */
:lang(zh-Hans) { --f-display: "CF SC", "CF Display", "Songti SC", serif; --f-text: "CF SC", "CF Serif", "Songti SC", serif; --track: 4px; }
/* Vietnamese: one face for everything, so accented and plain letters match */
:lang(vi) { --f-display: "CF Serif", Georgia, serif; --track: 0.5px; }
/* Thai: its own face, no extra spacing (it would pull the marks apart), and more room above and below */
:lang(th) { --f-display: "CF Thai", "CF Serif", serif; --f-text: "CF Thai", "CF Serif", serif; --track: 0; }
:lang(th) .lab, :lang(th) .pill, :lang(th) #combo, :lang(th) #banner, :lang(th) #panelsub, :lang(th) #toast { line-height: 1.55; }

/* The stage is drawn at a fixed design size and scaled to fit the window:
   1920×1080 in landscape, 1080×1920 in portrait (class "portrait" on <body>). */
:root { --gold: #f5c451; --gold2: #b67a1c; --navy: #0a1430; --ink: #071024; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #03060f; overflow: hidden; font-family: var(--f-display); color: #fff; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; outline: none; }
button:focus, button:focus-visible { outline: none; }
.hidden { display: none !important; }

#stage { position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: hidden; }
body.portrait #stage { width: 1080px; height: 1920px; }
#bg { position: absolute; inset: 0; background: url(/art/web/bg.webp) center / cover no-repeat; }
#tint { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(120, 40, 200, 0.0), rgba(40, 0, 90, 0.0)); transition: background 0.6s; pointer-events: none; }
body.free #tint { background: radial-gradient(ellipse at center, rgba(120, 40, 200, 0.18), rgba(40, 0, 90, 0.55)); }

#logo { position: absolute; width: 470px; left: 725px; top: -6px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6)); pointer-events: none; }
#board { position: absolute; left: 490px; top: 122px; width: 940px; height: 724px; }
#frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55)); }
/* inner play area of frame.png, measured from the image */
#gridbg, #grid { position: absolute; left: 8.47%; top: 10.9%; width: 83%; height: 78.95%; }
#gridbg { background: linear-gradient(180deg, rgba(8, 16, 40, 0.93), rgba(5, 10, 28, 0.96)); left: 5%; top: 6.5%; width: 90%; height: 87.5%; border-radius: 28px; }
#grid { overflow: hidden; }
.sym { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
.sym img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); }
.sym b { position: absolute; left: 0; right: 0; top: 50%; height: calc(var(--s) * 0.38); margin-top: calc(var(--s) * -0.19); display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.9)); }
.sym { transition: opacity 0.18s; }
.sym.lift { z-index: 3; }
/* the others are dimmed by ONE veil over the grid, not by making each symbol see-through (that froze phones) */
#veil { position: absolute; inset: 0; background: rgba(6, 9, 28, 0.66); opacity: 0; transition: opacity 0.18s; pointer-events: none; z-index: 1; }
#veil.on { opacity: 1; }

#banner { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font: 900 86px var(--f-display); color: #fff3c4; text-shadow: 0 4px 0 #6b3d00, 0 0 30px rgba(255, 190, 60, 0.9), 0 0 6px #000; opacity: 0; pointer-events: none; z-index: 6; }
.ring { position: absolute; border-radius: 50%; border: 5px solid #ffe9a6; box-shadow: 0 0 22px rgba(255, 215, 110, 0.95), inset 0 0 18px rgba(255, 215, 110, 0.7); pointer-events: none; z-index: 3; }
.spark { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle, #fff 0, #ffe08a 40%, rgba(255, 190, 60, 0) 70%); pointer-events: none; z-index: 4; }
.fly { position: absolute; left: 0; top: 0; font: 800 54px var(--f-num); color: #fff3c4; text-shadow: 0 3px 0 #4a2a00, 0 0 18px rgba(120, 200, 255, 0.95); pointer-events: none; z-index: 25; }
.pop.plain { color: #dfe6ff; font-size: 32px; text-shadow: 0 2px 0 #000, 0 0 8px #000; }
.pop { position: absolute; font: 900 40px var(--f-display); color: #fff3c4; text-shadow: 0 2px 0 #000, 0 0 10px #000; pointer-events: none; z-index: 7; transform: translate(-50%, -50%); white-space: nowrap; }

#mult { position: absolute; left: 248px; top: 300px; width: 214px; filter: saturate(0.75) brightness(0.8); transition: filter 0.3s; }
#mult.on { filter: none; }
#mult img { width: 100%; display: block; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.6)); }
#multval { position: absolute; left: 14%; right: 14%; top: 46.2%; height: 15%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 0 10px rgba(120, 200, 255, 0.9)); }
#fs { position: absolute; left: 1470px; top: 340px; width: 210px; padding: 18px 10px; text-align: center; border-radius: 22px; background: linear-gradient(180deg, #2a1458, #0e0828); border: 3px solid #d39a2c; box-shadow: inset 0 0 0 2px #2a1a04, inset 0 0 26px rgba(190, 110, 255, 0.45), 0 0 0 2px #6b4a10, 0 10px 20px rgba(0, 0, 0, 0.5); opacity: 0; transform: scale(0.9); transition: opacity 0.3s, transform 0.3s cubic-bezier(.2, 1.5, .4, 1); }
body.free #fs { opacity: 1; transform: scale(1); }
#fsleft { font: 800 88px var(--f-num); color: var(--gold); line-height: 1.05; text-shadow: 0 3px 0 #3a2200; }
.lab { font: 700 22px var(--f-display); color: #cdd7f5; letter-spacing: var(--track); white-space: nowrap; }
/* numbers: even-height digits (Georgia's old-style figures look uneven) with a gold face */
.num { font: 800 36px var(--f-num); letter-spacing: 1px; font-variant-numeric: lining-nums tabular-nums; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6); }
#win { background: linear-gradient(180deg, #fff6c9 10%, #f7c64d 55%, #c9871a); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 2px 0 rgba(60, 30, 0, 0.9)); }
#winbox.lit #win { filter: drop-shadow(0 2px 0 rgba(60, 30, 0, 0.9)) drop-shadow(0 0 14px rgba(255, 205, 90, 0.95)); }
#dock { display: none; }

/* ---- controls: landscape sits on bar.png (slot positions measured from the image) ---- */
#controls { position: absolute; left: 110px; top: 788px; width: 1700px; height: 302px; }
#bar { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.box { position: absolute; top: 38%; height: 31%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
#balbox { left: 12.7%; width: 16%; }
#betbox { left: 29.5%; width: 13.5%; flex-direction: row; justify-content: space-between; padding: 0 0.6%; }
#netbox { left: 57.1%; width: 13.4%; }
#winbox { left: 71.3%; width: 16.2%; }
#spin { position: absolute; left: 50%; top: 53%; width: 12%; aspect-ratio: 1; transform: translate(-50%, -50%); background: url(/art/web/btn_spin.webp) center / contain no-repeat; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
#spin:active, #spin.busy { background-image: url(/art/web/btn_spin_down.webp); }
#spin:active { transform: translate(-50%, -50%) scale(0.95); }
/* while a spin plays: the lit artwork, with a light running round the rim (no greying out) */
#spin.busy { animation: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 18px rgba(90, 190, 255, 0.75)); }
#spin::after { content: ""; position: absolute; inset: 9%; border-radius: 50%; opacity: 0; background: conic-gradient(from 0deg, rgba(255, 255, 255, 0) 0 62%, rgba(190, 235, 255, 0.95) 80%, rgba(255, 255, 255, 0) 100%); -webkit-mask: radial-gradient(circle, transparent 60%, #000 62%, #000 70%, transparent 72%); mask: radial-gradient(circle, transparent 60%, #000 62%, #000 70%, transparent 72%); pointer-events: none; transition: opacity 0.2s; }
#spin.busy::after { opacity: 1; animation: turn 0.9s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.round { position: absolute; top: 53.5%; transform: translateY(-50%); width: 4.3%; aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--gold); background: radial-gradient(circle at 40% 30%, #1d2f66, #070f28); font: 900 30px var(--f-display); color: var(--gold); box-shadow: 0 0 0 2px #5a3b08; }
.art { position: absolute; top: 53.5%; transform: translateY(-50%); background: center / contain no-repeat; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); }
.art:active { transform: translateY(-50%) scale(0.94); }
#info { left: 2.9%; width: 5%; aspect-ratio: 1; background-image: url(/art/web/btn_menu.webp); }
#info:active { background-image: url(/art/web/btn_menu_down.webp); }
#turbo { left: 8%; width: 5%; aspect-ratio: 1; background-image: url(/art/web/btn_turbo.webp); }
#turbo.on, #turbo:active { background-image: url(/art/web/btn_turbo_down.webp); }
#auto { left: 88.2%; width: 8.4%; aspect-ratio: 1.33; background-image: url(/art/web/btn_auto.webp); }
#auto.on, #auto:active { background-image: url(/art/web/btn_auto_down.webp); }
.round.on { background: radial-gradient(circle at 40% 30%, #ffe08a, #b9770f); color: #2a1600; }
.mini { width: 62px; height: 62px; flex: none; background: url(/art/web/btn_minus.webp) center / contain no-repeat; }
#betup { background-image: url(/art/web/btn_plus.webp); }
#betup:active { background-image: url(/art/web/btn_plus_down.webp); }
#betdown:active { background-image: url(/art/web/btn_minus_down.webp); }

#top { position: absolute; left: 24px; top: 20px; right: 24px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
#top > * { pointer-events: auto; }
#versions { display: flex; gap: 10px; flex-wrap: wrap; max-width: 620px; }
.pill { font-family: var(--f-display); font-weight: 700; white-space: nowrap; padding: 8px 18px; border-radius: 999px; border: 2px solid rgba(245, 196, 81, 0.75); background: rgba(6, 12, 34, 0.7); color: #e9ecff; font-size: 22px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.pill.on { background: linear-gradient(180deg, #ffe08a, #c58a1a); color: #2a1600; font-weight: 700; }
#status { position: absolute; left: 50%; transform: translateX(-50%); bottom: 4px; z-index: 3; padding: 2px 16px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); white-space: nowrap; font: 500 18px var(--f-text); color: rgba(255, 255, 255, 0.82); pointer-events: none; }
#toast { font-family: var(--f-text); font-weight: 600; position: absolute; left: 50%; top: 14%; transform: translateX(-50%); padding: 12px 28px; border-radius: 999px; background: rgba(0, 0, 0, 0.78); border: 2px solid var(--gold); font-size: 30px; opacity: 0; pointer-events: none; z-index: 20; white-space: nowrap; }

/* painted panels: the title is part of the art, the number sits in the dark window */
#panel { position: absolute; left: 50%; top: 46%; width: 1180px; aspect-ratio: 3; transform: translate(-50%, -50%); background: center / contain no-repeat; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.7)); z-index: 30; }
#panel[data-kind="bigwin"] { background-image: url(/art/web/panel_bigwin.webp); }
#panel[data-kind="totalwin"] { background-image: url(/art/web/panel_totalwin.webp); }
#panel[data-kind="freespins"] { background-image: url(/art/web/panel_freespins.webp); }
#panelvalue { position: absolute; left: 17%; right: 17%; top: 43%; height: 36%; display: flex; align-items: center; justify-content: center; }
.gfx img { height: 100%; width: auto; margin: 0 -1.2%; display: block; }
.gfx span { font: 800 80px var(--f-num); color: var(--gold); }
#panelsub { position: absolute; left: 0; right: 0; top: 101%; text-align: center; font: 700 34px var(--f-display); color: #fff3c4; text-shadow: 0 2px 0 #000, 0 0 12px #000; letter-spacing: var(--track); }

#modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
#modalbody { width: min(560px, 100%); max-height: 90%; overflow: auto; padding: 22px; border-radius: 18px; background: #0d1838; border: 2px solid var(--gold); font-family: -apple-system, "PingFang SC", sans-serif; font-size: 16px; line-height: 1.6; user-select: text; -webkit-user-select: text; }
#modalbody h2 { margin: 0 0 10px; color: var(--gold); font-size: 20px; }
#modalbody textarea { width: 100%; min-height: 90px; margin: 10px 0; padding: 10px; border-radius: 10px; border: 1px solid #40508a; background: #070f28; color: #fff; font: inherit; }
#modalbody .stars button { font-size: 34px; color: #55628f; padding: 0 4px; }
#modalbody .stars button.on { color: var(--gold); }
#modalbody .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
#modalbody .row button { padding: 8px 18px; border-radius: 10px; border: 1px solid var(--gold); color: #fff; }
#modalbody .row button.main { background: var(--gold); color: #2a1600; font-weight: 700; }

/* ---- portrait: 1080×1920. The controls are one console under the board instead of sitting on bar.png ---- */
body.portrait #top { top: 14px; left: 18px; right: 18px; }
body.portrait #versions { max-width: 860px; gap: 8px; }
body.portrait .pill { font-size: 26px; padding: 8px 20px; }
body.portrait #logo { width: 650px; left: 215px; top: 70px; }
body.portrait #board { left: 6px; top: 292px; width: 1068px; height: 823px; }
body.portrait #controls { left: 0; top: 1120px; width: 1080px; height: 800px; }
body.portrait #bar { display: none; }
/* dark console behind the controls so they read against the busy background */
body.portrait #dock { display: block; position: absolute; left: 0; right: 0; top: -70px; bottom: 0; background: linear-gradient(180deg, rgba(3, 6, 18, 0) 0, rgba(3, 6, 18, 0.82) 110px, rgba(3, 6, 18, 0.95) 100%); pointer-events: none; }
body.portrait #dock::after { content: ""; position: absolute; left: 24px; right: 24px; top: 96px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, #f5c451 20%, #fff0b8 50%, #f5c451 80%, transparent); box-shadow: 0 0 12px rgba(245, 196, 81, 0.8); }
body.portrait .box { border-radius: 20px; background: linear-gradient(180deg, #14224f, #070e27); border: 3px solid #d39a2c; box-shadow: inset 0 0 0 2px #2a1a04, inset 0 0 22px rgba(70, 150, 255, 0.28), 0 0 0 2px #6b4a10, 0 8px 16px rgba(0, 0, 0, 0.5); }
body.portrait .lab { font-size: 26px; color: #b9c6ee; }
body.portrait .num { font-size: 50px; }
body.portrait #mult { left: 30px; top: 1168px; width: 168px; z-index: 2; }
body.portrait #fs { left: 882px; top: 1176px; width: 170px; padding: 12px 6px; z-index: 2; }
body.portrait #fsleft { font-size: 76px; }
body.portrait #winbox { left: 214px; top: 56px; width: 652px; height: 150px; }
body.portrait #winbox .num { font-size: 84px; line-height: 1; }
body.portrait #netbox { left: 214px; top: 222px; width: 652px; height: 76px; flex-direction: row; gap: 18px; }
body.portrait #netbox .num { font-size: 42px; }
body.portrait #balbox { left: 30px; top: 388px; width: 316px; height: 116px; }
body.portrait #betbox { left: 734px; top: 388px; width: 316px; height: 116px; padding: 0 12px; }
body.portrait .mini { width: 84px; height: 84px; }
body.portrait #spin { left: 540px; top: 520px; width: 350px; }
body.portrait .round { width: 100px; top: 640px; font-size: 40px; }
body.portrait #info { left: 46px; width: 122px; top: 640px; }
body.portrait #turbo { left: 186px; width: 122px; top: 640px; }
body.portrait #auto { left: 842px; width: 196px; top: 640px; }
body.portrait #status { bottom: 10px; font-size: 22px; }
body.portrait #toast { font-size: 38px; top: 17%; }
body.portrait #panel { width: 1060px; }
body.portrait #panelsub { font-size: 40px; }

/* ---- polish ---- */
#grid::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.35) 100%); z-index: 1; }
#bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0) 45%, rgba(2, 4, 14, 0.55) 100%); }
.sym[data-name="SC"] img { filter: drop-shadow(0 0 10px rgba(190, 110, 255, 0.85)) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); }
.sym[data-mult] img { filter: drop-shadow(0 0 10px rgba(120, 200, 255, 0.7)) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); }
#spin:not(.busy) { animation: ready 2.4s ease-in-out infinite; }
@keyframes ready { 0%, 100% { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); } 50% { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 16px rgba(255, 205, 90, 0.85)); } }
#panel.rays::before { content: ""; position: absolute; left: 50%; top: 50%; width: 1500px; height: 1500px; margin: -750px 0 0 -750px; z-index: -1; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 215, 110, 0.22) 0 9deg, rgba(255, 215, 110, 0) 9deg 18deg); -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%); animation: turn 14s linear infinite; pointer-events: none; }
#shade { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 46%, rgba(2, 4, 14, 0.35), rgba(2, 4, 14, 0.8)); opacity: 0; transition: opacity 0.25s; pointer-events: none; z-index: 28; }
#shade.on { opacity: 1; }

/* ---- motion pass ---- */
.sym img { transform-origin: 50% 88%; }
.halo { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(255, 236, 160, 0.95) 0, rgba(255, 200, 80, 0.55) 35%, rgba(255, 190, 60, 0) 68%); pointer-events: none; z-index: 2; }
.ring.sc { border-color: #e7b6ff; box-shadow: 0 0 22px rgba(200, 120, 255, 0.95), inset 0 0 18px rgba(200, 120, 255, 0.7); }
.ring.mu { border-color: #bfe8ff; box-shadow: 0 0 22px rgba(110, 200, 255, 0.95), inset 0 0 18px rgba(110, 200, 255, 0.7); }
#frameglow { position: absolute; left: 6%; top: 8%; width: 88%; height: 84.5%; border-radius: 26px; box-shadow: 0 0 60px 18px rgba(255, 205, 90, 0.55), inset 0 0 50px rgba(255, 205, 90, 0.5); opacity: 0; pointer-events: none; }
#flash { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, #fff 0, rgba(190, 150, 255, 0.9) 45%, rgba(120, 60, 220, 0.6) 100%); opacity: 0; pointer-events: none; z-index: 27; }
/* the scene breathes: slow drift of the background, a gentle bob of the title, specks of light */
#bg { animation: drift 38s ease-in-out infinite alternate; transform-origin: 50% 40%; }
@keyframes drift { from { transform: scale(1.03) translate(0, 0); } to { transform: scale(1.09) translate(-0.8%, -1%); } }
#logo { animation: bob 6.5s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
#motes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#motes i { position: absolute; width: var(--w); height: var(--w); border-radius: 50%; background: radial-gradient(circle, #fff 0, rgba(150, 215, 255, 0.9) 35%, rgba(150, 215, 255, 0) 70%); opacity: 0; animation: mote var(--d) linear infinite; }
@keyframes mote { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 0.85; } 85% { opacity: 0.6; } 100% { transform: translate(40px, -260px); opacity: 0; } }
/* the dial comes alive when a multiplier is in play */
#mult::after { content: ""; position: absolute; left: 49.7%; top: 46.2%; width: 74%; aspect-ratio: 1; margin: -37% 0 0 -37%; border-radius: 50%; opacity: 0; transition: opacity 0.3s; background: conic-gradient(from 0deg, rgba(255, 255, 255, 0) 0 55%, rgba(170, 230, 255, 0.95) 78%, rgba(255, 255, 255, 0) 100%); -webkit-mask: radial-gradient(circle, transparent 60%, #000 63%, #000 69%, transparent 72%); mask: radial-gradient(circle, transparent 60%, #000 63%, #000 69%, transparent 72%); pointer-events: none; }
#mult.on::after { opacity: 1; animation: turn 2.2s linear infinite; }
/* buttons spring back when released */
.art, .mini, #spin { transition: transform 0.18s cubic-bezier(.2, 1.6, .4, 1); }
.mini:active { transform: scale(0.9); }
.pill { transition: background 0.2s, color 0.2s, transform 0.18s cubic-bezier(.2, 1.6, .4, 1); }
.pill:active { transform: scale(0.94); }
@media (prefers-reduced-motion: reduce) { #bg, #logo, #motes i { animation: none; } }

/* ---- feel pass: held beat, combo, heat, scatter hold ---- */
#combo { position: absolute; left: 0; right: 0; top: 12%; text-align: center; font: 900 44px var(--f-display); color: #fff3c4; letter-spacing: var(--track); text-shadow: 0 4px 0 #6b3d00, 0 0 24px rgba(255, 190, 60, 0.95), 0 0 6px #000; opacity: 0; pointer-events: none; z-index: 8; }
.pop { font-size: 52px; font-family: var(--f-num); font-weight: 800; color: #fff3c4; text-shadow: 0 3px 0 #6b3d00, 0 0 18px rgba(255, 190, 60, 0.95), 0 0 6px #000; }
.pop.plain { font-size: 30px; color: #dfe6ff; text-shadow: 0 2px 0 #000, 0 0 8px #000; }
#board.hot #frameglow { opacity: 0.55; animation: heat 0.9s ease-in-out infinite alternate; }
@keyframes heat { from { opacity: 0.35; } to { opacity: 0.75; } }
#board.tense #frameglow { opacity: 0.7; box-shadow: 0 0 60px 18px rgba(190, 110, 255, 0.6), inset 0 0 60px rgba(190, 110, 255, 0.55); }
#modalbody .opt { margin: 6px 6px 0 0; padding: 8px 14px; border-radius: 10px; border: 1px solid #40508a; color: #cdd7f5; }
#modalbody .opt.on { background: var(--gold); border-color: var(--gold); color: #2a1600; font-weight: 700; }

/* ---- one scatter short (only when it is really the case) ---- */
#spot { position: absolute; top: 0; bottom: 0; left: 0; width: 0; opacity: 0; transition: opacity 0.2s, left 0.25s; pointer-events: none; z-index: 0; background: linear-gradient(180deg, rgba(200, 130, 255, 0.5), rgba(150, 70, 240, 0.18) 60%, rgba(150, 70, 240, 0.4)); box-shadow: 0 0 30px rgba(190, 110, 255, 0.8); }
body.suspense #tint { background: radial-gradient(ellipse at 50% 45%, rgba(30, 0, 60, 0.15) 30%, rgba(4, 0, 14, 0.82) 100%); transition: background 0.35s; }
body.suspense #logo, body.suspense #mult, body.suspense #controls { filter: brightness(0.6); transition: filter 0.35s; }
#logo, #mult, #controls { transition: filter 0.3s; }
#board.tense #frameglow { animation: tense 0.44s ease-in-out infinite alternate; }
@keyframes tense { from { opacity: 0.45; } to { opacity: 0.95; } }

/* ---- detail pass ---- */
/* each cell gets a soft pool of light so the symbols sit in something */
#gridbg::after { content: ""; position: absolute; left: 3.86%; top: 5.03%; width: 92.2%; height: 90.2%; background: radial-gradient(ellipse at center, rgba(60, 100, 200, 0.22) 0, rgba(60, 100, 200, 0) 68%); background-size: 16.667% 20%; pointer-events: none; }
.gfx.small img { margin: 0 -2%; }
/* loading screen */
#loading { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: radial-gradient(ellipse at center, #0d1838, #03060f 75%); transition: opacity 0.5s; font-family: -apple-system, "PingFang SC", sans-serif; color: #b9c6ee; }
#loading.gone { opacity: 0; pointer-events: none; }
#loading img { width: min(78vw, 560px); }
#loadbar { width: min(60vw, 380px); height: 8px; border-radius: 8px; background: #101c44; box-shadow: 0 0 0 2px #6b4a10; overflow: hidden; }
#loadbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c9871a, #fff0b8); transition: width 0.2s; }
#loading p { margin: 0; font-size: 14px; letter-spacing: 2px; }
/* menu */
#modalbody { background: linear-gradient(180deg, #14224f, #070e27); border: 2px solid #d39a2c; box-shadow: 0 0 0 2px #6b4a10, 0 20px 50px rgba(0, 0, 0, 0.7); }
#modalbody h2 { font-family: var(--f-display); font-weight: 700; letter-spacing: var(--track); margin-top: 14px; }
#modalbody h2:first-child { margin-top: 0; }
#modalbody .pays { width: 100%; border-collapse: collapse; margin: 6px 0 10px; font-variant-numeric: tabular-nums; }
#modalbody .pays th { font-weight: 400; color: #9fb0e0; font-size: 13px; padding: 4px; }
#modalbody .pays td { text-align: center; padding: 3px 4px; border-top: 1px solid rgba(255, 255, 255, 0.08); color: #fff3c4; }
#modalbody .pays td img { width: 38px; height: 38px; object-fit: contain; display: block; margin: auto; }
#modalbody .ic { width: 26px; height: 26px; object-fit: contain; vertical-align: middle; }
/* the gold digit pictures must not pick up the sizing meant for symbol and dial artwork */
.sym .gfx img, #mult .gfx img { width: auto; height: 100%; object-fit: initial; filter: none; margin: 0 -1.2%; transform-origin: 50% 50%; }

/* ---- the multiplier dial is alive ---- */
#mult { transform-origin: 50% 46%; }
#multflash { position: absolute; left: 49.7%; top: 46.2%; width: 70%; aspect-ratio: 1; margin: -35% 0 0 -35%; border-radius: 50%; opacity: 0; pointer-events: none; background: radial-gradient(circle, #fff 0, rgba(170, 230, 255, 0.95) 30%, rgba(90, 170, 255, 0) 70%); }
.wave { position: absolute; width: 230px; height: 230px; border-radius: 50%; border: 6px solid rgba(190, 235, 255, 0.95); box-shadow: 0 0 26px rgba(120, 200, 255, 0.9); pointer-events: none; z-index: 24; }
/* armed: a multiplier is on the grid — the dial wakes up and breathes */
#mult.armed { filter: none; animation: breathe 1.1s ease-in-out infinite; }
#mult.armed::after { opacity: 0.8; animation: turn 2.6s linear infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
/* charged: there is a win too, so the multiplier WILL be applied — faster, brighter, trembling */
#mult.charged { animation: tremble 0.16s linear infinite; filter: drop-shadow(0 0 18px rgba(120, 200, 255, 0.95)); }
#mult.charged::after { opacity: 1; animation: turn 0.7s linear infinite; }
@keyframes tremble { 0% { transform: translate(0, 0) scale(1.04); } 25% { transform: translate(1.5px, -1px) scale(1.04); } 50% { transform: translate(-1.5px, 1px) scale(1.04); } 75% { transform: translate(1px, 1.5px) scale(1.04); } 100% { transform: translate(0, 0) scale(1.04); } }
/* the total that is stored (free spins) glows hotter the bigger it is */
#mult[data-tier="2"].on { filter: drop-shadow(0 0 16px rgba(120, 255, 170, 0.85)); }
#mult[data-tier="3"].on { filter: drop-shadow(0 0 22px rgba(255, 190, 60, 0.95)); }
#mult[data-tier="3"].on::after { background: conic-gradient(from 0deg, rgba(255, 255, 255, 0) 0 45%, rgba(255, 220, 130, 0.98) 75%, rgba(255, 255, 255, 0) 100%); animation-duration: 1.1s; }
/* multiplier symbols on the grid pulse while they are waiting to be used */
.sym[data-mult] b { animation: beat 0.9s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }

/* ---- scatter progress lights ---- */
#scmeter { position: absolute; left: 1462px; top: 236px; width: 226px; height: 84px; padding: 0 16px 0 8px; display: flex; align-items: center; gap: 10px; border-radius: 42px; background: linear-gradient(180deg, #1a1040, #0b0722); border: 3px solid #d39a2c; box-shadow: inset 0 0 0 2px #2a1a04, 0 0 0 2px #6b4a10, 0 8px 16px rgba(0, 0, 0, 0.5); z-index: 2; transition: box-shadow 0.3s; }
#scmeter img { width: 66px; height: 66px; object-fit: contain; flex: none; filter: drop-shadow(0 0 8px rgba(190, 110, 255, 0.8)); }
#sclights { flex: 1; display: flex; justify-content: space-around; align-items: center; }
#sclights i { width: 20px; height: 20px; transform: rotate(45deg); border-radius: 4px; background: #150d33; border: 2px solid #7a5a1c; box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.9); transition: background 0.15s, box-shadow 0.15s, border-color 0.15s; }
#sclights i.on { background: radial-gradient(circle at 35% 35%, #fff, #e9b6ff 30%, #a848f0 75%); border-color: #ffe9a6; box-shadow: 0 0 14px 4px rgba(200, 120, 255, 0.95); }
#scmeter.full { box-shadow: inset 0 0 0 2px #2a1a04, 0 0 0 2px #ffe9a6, 0 0 34px 8px rgba(200, 120, 255, 0.9); animation: full 0.5s ease-in-out infinite alternate; }
@keyframes full { from { transform: scale(1); } to { transform: scale(1.06); } }
.fly.orb { font-size: 34px; color: #f3d6ff; text-shadow: 0 0 14px #c070ff, 0 0 30px #a040f0; }
body.suspense #scmeter { filter: none; box-shadow: inset 0 0 0 2px #2a1a04, 0 0 0 2px #ffe9a6, 0 0 26px 6px rgba(200, 120, 255, 0.7); }
body.portrait #scmeter { left: 395px; top: 1122px; width: 290px; height: 60px; padding: 0 18px 0 6px; z-index: 3; }
body.portrait #scmeter img { width: 54px; height: 54px; }
body.portrait #sclights i { width: 22px; height: 22px; }
/* make room under the lights */
body.portrait #winbox { top: 78px; height: 140px; }
body.portrait #netbox { top: 232px; height: 70px; }

/* ---- the last free spins ---- */
#fs[data-last="2"] { border-color: #ffb347; animation: pulse 0.9s ease-in-out infinite; }
#fs[data-last="1"] { border-color: #ff7a45; background: linear-gradient(180deg, #58201a, #280c0c); animation: pulse 0.6s ease-in-out infinite; }
#fs[data-last="0"] { border-color: #ff4d3d; background: linear-gradient(180deg, #7a1616, #300808); box-shadow: inset 0 0 0 2px #2a1a04, 0 0 0 2px #ff9d7a, 0 0 30px 6px rgba(255, 90, 60, 0.75); animation: pulse 0.38s ease-in-out infinite; }
#fs[data-last="0"] #fsleft, #fs[data-last="1"] #fsleft { color: #ffd9c9; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
/* ---- the win is still going to be multiplied ---- */
.winrow { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
#winq { display: none; font: 800 30px var(--f-num); color: #8fd8ff; text-shadow: 0 0 12px rgba(120, 200, 255, 0.95); animation: beat 0.5s ease-in-out infinite; }
#winbox.pending #winq { display: inline-block; }
#winbox.pending #win { background: linear-gradient(180deg, #ffffff, #b9d8ff); -webkit-background-clip: text; background-clip: text; opacity: 0.8; }
#winbox.pending { box-shadow: inset 0 0 22px rgba(90, 180, 255, 0.55); border-radius: 18px; }
body.portrait #winq { font-size: 56px; }
/* ---- the gap before new symbols fall ---- */
.void { position: absolute; border-radius: 18%; background: radial-gradient(circle, rgba(150, 215, 255, 0.5) 0, rgba(110, 170, 255, 0.18) 45%, rgba(110, 170, 255, 0) 72%); box-shadow: inset 0 0 18px rgba(150, 215, 255, 0.45); opacity: 0; pointer-events: none; z-index: 0; }

/* ---- language detail ---- */
#modalbody { font-family: var(--f-text); font-weight: 400; }
#modalbody b { font-weight: 700; color: #fff3c4; }
#modalbody .opt, #modalbody .row button, #modalbody textarea { font-family: var(--f-text); }
#modalbody .opt.lang { min-width: 96px; }
#loading { font-family: var(--f-text); }
#banner { font-weight: 900; }
:lang(zh-Hans) #banner, :lang(zh-Hans) #combo { font-weight: 900; }

/* ---- symbol life: light sweep, shatter, coins ---- */
.shine { position: absolute; inset: 0; overflow: hidden; pointer-events: none; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; z-index: 1; }
.shine i { position: absolute; top: -20%; bottom: -20%; left: 0; width: 55%; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9) 50%, rgba(255, 255, 255, 0)); transform: translateX(-130%) skewX(-20deg); }
.shard { position: absolute; background-size: contain; background-repeat: no-repeat; background-position: center; pointer-events: none; z-index: 4; will-change: transform, opacity; filter: brightness(1.25); }
.coin { position: absolute; top: 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c9, #f7c64d 45%, #a86a0c 100%); box-shadow: inset 0 0 0 3px #c9871a, inset 0 0 0 5px rgba(255, 240, 180, 0.6), 0 4px 8px rgba(0, 0, 0, 0.45); pointer-events: none; z-index: 29; opacity: 0; }
/* free spins: a slow sweep of light behind the board */
#board::before { content: ""; position: absolute; left: 50%; top: 50%; width: 170%; aspect-ratio: 1; margin: -85% 0 0 -85%; border-radius: 50%; opacity: 0; transition: opacity 0.8s; pointer-events: none; z-index: -1; background: repeating-conic-gradient(rgba(200, 140, 255, 0.16) 0 8deg, rgba(200, 140, 255, 0) 8deg 24deg); -webkit-mask: radial-gradient(circle, #000 25%, transparent 68%); mask: radial-gradient(circle, #000 25%, transparent 68%); }
body.free #board::before { opacity: 1; animation: turn 40s linear infinite; }
#board { isolation: isolate; }

/* ---- each symbol has a little life of its own (code-drawn, no extra artwork) ---- */
.fx { position: absolute; inset: 0; pointer-events: none; }
.fx u, .fx i { position: absolute; display: block; text-decoration: none; }
/* a four-point sparkle */
.fx u { width: 16%; height: 16%; margin: -8% 0 0 -8%; background: #fff; clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%); opacity: 0; }
@keyframes twinkle { 0%, 60%, 100% { opacity: 0; transform: scale(0.3) rotate(0deg); } 75% { opacity: 1; transform: scale(1) rotate(45deg); } 90% { opacity: 0; transform: scale(0.5) rotate(90deg); } }
/* astrolabe: a point of light travels round the ring */
.fx-h1 i { left: 50%; top: 50%; width: 78%; height: 78%; margin: -39% 0 0 -39%; transform: rotate(-22deg) scaleY(0.42); }
.fx-h1 u { left: 50%; top: 0; width: 13%; height: 30%; opacity: 1; background: radial-gradient(ellipse, #fff 0, rgba(255, 240, 180, 0.9) 35%, rgba(255, 220, 120, 0) 70%); clip-path: none; transform-origin: 50% 167%; animation: orbit 3.4s linear infinite; animation-delay: var(--o); }
@keyframes orbit { to { transform: rotate(360deg); } }
/* hourglass: grains of sand falling through the neck */
.fx-h2 u { left: 50%; top: 50%; width: 5%; height: 5%; margin: -2.5% 0 0 -2.5%; border-radius: 50%; clip-path: none; background: #bfeaff; box-shadow: 0 0 4px #8fd8ff; animation: sand 1.1s linear infinite; }
.fx-h2 u:nth-child(1) { animation-delay: var(--o); }
.fx-h2 u:nth-child(2) { animation-delay: calc(var(--o) + 0.37s); }
.fx-h2 u:nth-child(3) { animation-delay: calc(var(--o) + 0.74s); }
@keyframes sand { 0% { transform: translateY(-40%); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(420%); opacity: 0; } }
/* compass: the star at the centre turns and breathes */
.fx-h3 u { left: 50%; top: 50%; width: 44%; height: 44%; margin: -22% 0 0 -22%; opacity: 0.55; background: rgba(255, 250, 220, 0.9); animation: compass 5s ease-in-out infinite; animation-delay: var(--o); }
@keyframes compass { 0%, 100% { transform: rotate(0deg) scale(0.7); opacity: 0.25; } 50% { transform: rotate(180deg) scale(1.05); opacity: 0.7; } }
/* crystal: glints on three facets, one after another */
.fx-h4 u { animation: twinkle 2.6s ease-in-out infinite; }
.fx-h4 u:nth-child(1) { left: 36%; top: 30%; animation-delay: var(--o); }
.fx-h4 u:nth-child(2) { left: 63%; top: 46%; animation-delay: calc(var(--o) + 0.9s); }
.fx-h4 u:nth-child(3) { left: 47%; top: 70%; animation-delay: calc(var(--o) + 1.7s); }
/* scatter: rays turning behind it */
.fx-sc { inset: -22%; z-index: -1; }
.fx-sc i { inset: 0; border-radius: 50%; background: repeating-conic-gradient(rgba(215, 150, 255, 0.5) 0 9deg, rgba(215, 150, 255, 0) 9deg 22.5deg); -webkit-mask: radial-gradient(circle, #000 30%, transparent 68%); mask: radial-gradient(circle, #000 30%, transparent 68%); animation: turn 9s linear infinite; animation-delay: var(--o); }
/* multiplier orb: energy swirling inside the glass */
.fx-mult i { left: 50%; top: 50%; width: 56%; height: 56%; margin: -28% 0 0 -28%; border-radius: 50%; mix-blend-mode: screen; background: conic-gradient(from 0deg, rgba(255, 255, 255, 0) 0 40%, rgba(255, 255, 255, 0.55) 62%, rgba(255, 255, 255, 0) 80%, rgba(255, 255, 255, 0.35) 92%, rgba(255, 255, 255, 0) 100%); animation: turn 2.2s linear infinite; animation-delay: var(--o); }
.sym[data-mult] b { z-index: 2; }
.sym { isolation: isolate; }
@media (prefers-reduced-motion: reduce) { .fx { display: none; } }

/* ---- the whole interface is alive, not only the symbols ---- */
/* letter symbols: a glint somewhere on the gem face now and then */
.fx-low u { left: var(--x); top: var(--y); width: 20%; height: 20%; margin: -10% 0 0 -10%; animation: twinkle 4.6s ease-in-out infinite; animation-delay: var(--o); }
/* a band of light that follows a picture's own outline (title, control bar) */
.sweep { position: absolute; inset: 0; overflow: hidden; pointer-events: none; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.sweep i { position: absolute; top: -10%; bottom: -10%; left: 0; width: 22%; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.85) 50%, rgba(255, 255, 255, 0)); transform: translateX(-160%) skewX(-22deg); animation: sweep 7s ease-in-out infinite; }
@keyframes sweep { 0%, 70% { transform: translateX(-160%) skewX(-22deg); } 100% { transform: translateX(620%) skewX(-22deg); } }
#logo img { width: 100%; display: block; }
#logo .sweep { -webkit-mask-image: url(/art/web/logo.webp); mask-image: url(/art/web/logo.webp); }
#barsweep { -webkit-mask-image: url(/art/web/bar.webp); mask-image: url(/art/web/bar.webp); }
#barsweep i { width: 10%; animation-duration: 11s; animation-delay: 3s; }
body.portrait #barsweep { display: none; }
/* a light runs round the edge of the frame */
#framerun { position: absolute; left: 4.6%; top: 6%; width: 90.8%; height: 88.4%; border-radius: 30px; padding: 7px; pointer-events: none; overflow: hidden; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
#framerun::before { content: ""; position: absolute; left: 50%; top: 50%; width: 180%; aspect-ratio: 1; margin: -90% 0 0 -90%; background: conic-gradient(from 0deg, rgba(255, 255, 255, 0) 0 80%, rgba(190, 235, 255, 0.95) 92%, rgba(255, 255, 255, 0) 100%); animation: turn 6.5s linear infinite; }
#board.hot #framerun::before { animation-duration: 1.6s; background: conic-gradient(from 0deg, rgba(255, 255, 255, 0) 0 70%, rgba(255, 225, 140, 0.98) 90%, rgba(255, 255, 255, 0) 100%); }
#board.tense #framerun::before { animation-duration: 1.1s; background: conic-gradient(from 0deg, rgba(255, 255, 255, 0) 0 70%, rgba(220, 150, 255, 0.98) 90%, rgba(255, 255, 255, 0) 100%); }
/* the four jewels on the frame catch the light in turn */
.gem { position: absolute; width: 5%; aspect-ratio: 1; margin: -2.5% 0 0 -2.5%; background: #fff; clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%); opacity: 0; pointer-events: none; animation: twinkle 5.2s ease-in-out infinite; text-decoration: none; }
.gem.t { left: 50%; top: 2.6%; }
.gem.r { left: 97.3%; top: 50%; animation-delay: 1.3s; }
.gem.b { left: 50%; top: 97.2%; animation-delay: 2.6s; }
.gem.l { left: 2.7%; top: 50%; animation-delay: 3.9s; }
/* the scenery: the two crystals at the foot of the hall and the great hourglass pulse with light (landscape picture) */
#bg .glow { position: absolute; border-radius: 50%; pointer-events: none; mix-blend-mode: screen; background: radial-gradient(circle, rgba(140, 220, 255, 0.75) 0, rgba(90, 170, 255, 0.3) 40%, rgba(90, 170, 255, 0) 70%); animation: glow 3.6s ease-in-out infinite alternate; }
@keyframes glow { from { opacity: 0.25; transform: scale(0.85); } to { opacity: 0.95; transform: scale(1.15); } }
#bg .g1 { left: 2.5%; top: 68%; width: 9%; aspect-ratio: 1; }
#bg .g2 { left: 88.5%; top: 68%; width: 9%; aspect-ratio: 1; animation-delay: 1.4s; }
#bg .g3 { left: 86.5%; top: 42%; width: 10%; aspect-ratio: 1; animation-delay: 0.7s; animation-duration: 5s; }
#bg .g4 { left: 44%; top: 18%; width: 12%; aspect-ratio: 1; animation-duration: 6s; opacity: 0.5; }
body.portrait #bg .glow { display: none; } /* the picture is cropped in portrait, so these would be in the wrong place */

/* ---- light mode: the game is identical, only the ambient extras are switched off ---- */
body.lite .fx, body.lite #motes, body.lite .sweep, body.lite #framerun, body.lite .gem, body.lite #bg .glow, body.lite #board::before { display: none; }
body.lite #bg, body.lite #logo, body.lite .sym[data-mult] b { animation: none; }

/* the tumble counter sits on the top edge of the frame with a dark cushion, clear of the first row of symbols */
#combo { top: 0.4%; left: 22%; right: 22%; padding: 6px 0 10px; line-height: 1.1; background: radial-gradient(ellipse at center, rgba(3, 6, 18, 0.92) 0, rgba(3, 6, 18, 0.75) 45%, rgba(3, 6, 18, 0) 72%); }

/* ---- spin button: ONE picture in every state (swapping pictures made it jump); states are shown with light and scale ---- */
#spin, #spin:active, #spin.busy { background-image: url(/art/web/btn_spin_down.webp); }
#spin.busy { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 14px rgba(90, 190, 255, 0.6)); }
/* ---- the middle of the console: less flat ---- */
#winbox.zero #win { opacity: 0.45; filter: none; }
#win { transition: opacity 0.2s; }
#msg { font-weight: 700; color: #cdd7f5; }
#msg[data-tone="up"] { color: #8dffa0; text-shadow: 0 0 12px rgba(90, 255, 140, 0.6); }
#msg[data-tone="down"] { color: #ffb3b3; }
/* a slow sheen crosses the WIN box, and it carries a jewel at each end like the frame does */
body.portrait #winbox { overflow: visible; }
body.portrait #winbox::before { content: ""; position: absolute; inset: 0; border-radius: 17px; pointer-events: none; background: linear-gradient(105deg, rgba(255, 255, 255, 0) 40%, rgba(160, 210, 255, 0.22) 50%, rgba(255, 255, 255, 0) 60%); background-size: 300% 100%; animation: sheen 6s ease-in-out infinite; }
@keyframes sheen { 0%, 55% { background-position: 120% 0; } 100% { background-position: -60% 0; } }
body.portrait #winbox::after { content: ""; position: absolute; left: -12px; right: -12px; top: 50%; height: 24px; margin-top: -12px; pointer-events: none; background: linear-gradient(180deg, #ffffff 0, #7fcfff 45%, #2a7fe0 100%); clip-path: polygon(0 50%, 12px 0, 24px 50%, 12px 100%, 0 50%, calc(100% - 24px) 50%, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, calc(100% - 24px) 50%); }
body.portrait #netbox { background: linear-gradient(180deg, #101c44, #060c22); }
body.portrait #msg { font-size: 30px; }

/* the turning middle of the spin button: same picture, cut to the blue disc. Centre and radius were measured
   on the artwork by fitting a circle to the inside edge of the gold rim: 49.8% across, 48.3% down. */
#spindisc { position: absolute; inset: 0; pointer-events: none; background: url(/art/web/btn_spin_down.webp) center / contain no-repeat; clip-path: circle(31.5% at 49.8% 48.3%); transform-origin: 49.8% 48.3%; will-change: transform; }

/* the four jewels round the spin button glow in turn — slowly at rest, chasing round while a spin plays */
#spin .jewel { position: absolute; width: 22%; aspect-ratio: 1; margin: -11% 0 0 -11%; border-radius: 50%; pointer-events: none; mix-blend-mode: screen; background: radial-gradient(circle, #fff 0, rgba(150, 225, 255, 0.95) 22%, rgba(80, 170, 255, 0.45) 45%, rgba(80, 170, 255, 0) 70%); opacity: 0.15; animation: jewel 3.2s ease-in-out infinite; }
#spin .jewel::after { content: ""; position: absolute; inset: 18%; background: #fff; clip-path: polygon(50% 0, 57% 43%, 100% 50%, 57% 57%, 50% 100%, 43% 57%, 0 50%, 43% 43%); }
#spin .jewel.t { left: 50%; top: 6%; }
#spin .jewel.r { left: 91.1%; top: 49.2%; animation-delay: 0.8s; }
#spin .jewel.b { left: 50%; top: 89.6%; animation-delay: 1.6s; }
#spin .jewel.l { left: 8.7%; top: 49.1%; animation-delay: 2.4s; }
@keyframes jewel { 0%, 55%, 100% { opacity: 0.15; transform: scale(0.7); } 18% { opacity: 1; transform: scale(1.25); } 35% { opacity: 0.5; transform: scale(1); } }
#spin.busy .jewel { animation-duration: 0.62s; }
#spin.busy .jewel.r { animation-delay: 0.155s; }
#spin.busy .jewel.b { animation-delay: 0.31s; }
#spin.busy .jewel.l { animation-delay: 0.465s; }
body.lite #spin .jewel { animation: none; opacity: 0.35; }

/* ---------- phones ---------- */
/* A long press must not bring up "save image" or start dragging a picture, and the page must not bounce or pull-to-refresh. */
html, body { overscroll-behavior: none; -webkit-touch-callout: none; }
img { -webkit-user-drag: none; -webkit-touch-callout: none; }
/* On a touch screen the two effects below were redrawn on every frame, all the time, even with nothing happening:
   the spin button's glow was an animated shadow filter, and the WIN box sheen slid a background. The button keeps a steady glow. */
@media (pointer: coarse) {
  #spin:not(.busy) { animation: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 12px rgba(255, 205, 90, 0.55)); }
  body.portrait #winbox::before { animation: none; }

  /* Tumble chains froze phones for up to a second. Each of these made the phone draw something large and soft from scratch
     at the very moment a win was celebrated:
     - the glow around the frame: a huge blurred shadow, drawn anew every time it faded in → smaller blur, and kept ready */
  #frameglow { box-shadow: 0 0 26px 8px rgba(255, 205, 90, 0.6), inset 0 0 22px rgba(255, 205, 90, 0.5); will-change: opacity; }
  #board.tense #frameglow { box-shadow: 0 0 26px 8px rgba(190, 110, 255, 0.65), inset 0 0 24px rgba(190, 110, 255, 0.55); }
  /* - the light running round the frame changed to a different gradient during a chain → it only speeds up, the picture stays */
  #framerun::before, #board.hot #framerun::before, #board.tense #framerun::before { background: conic-gradient(from 0deg, rgba(255, 255, 255, 0) 0 80%, rgba(190, 235, 255, 0.95) 92%, rgba(255, 255, 255, 0) 100%); will-change: transform; }
  /* - the chain label and the banner: wide soft glow behind text that is scaled every frame → a tight glow, kept ready */
  #combo, #banner { text-shadow: 0 3px 0 #6b3d00, 0 0 8px rgba(255, 190, 60, 0.9); will-change: transform, opacity; }
  .pop { text-shadow: 0 3px 0 #6b3d00, 0 0 6px #000; }
  /* - every symbol had a soft shadow worked out live, redrawn whenever the symbol bounced or popped → no live shadow on the
       plain symbols (the cells are dark, it was barely visible); scatters and multipliers keep their coloured glow */
  .sym:not([data-name="SC"]):not([data-mult]) img { filter: none; }
  .sym b { filter: none; }
}

/* 2026-11-19: music and sound-effect switches on the game screen (Founder). Top right, under the top row. A dimmed button with a
   stroke through it is off. The touch area is larger than the button. */
#sndbtns { position: absolute; right: 24px; top: 76px; display: flex; gap: 14px; z-index: 20; }
#sndbtns button { position: relative; width: 84px; height: 84px; border-radius: 50%; border: 3px solid #d6a44a; background: radial-gradient(circle at 50% 35%, rgba(28, 34, 66, 0.92), rgba(6, 9, 24, 0.94)); color: #ffe2a6; padding: 0; cursor: pointer; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.55); }
#sndbtns button::before { content: ""; position: absolute; inset: -12px; }
#sndbtns svg { width: 46px; height: 46px; display: block; margin: auto; pointer-events: none; }
#sndbtns button.off { color: #8089a8; border-color: #6a6f86; }
#sndbtns button.off::after { content: ""; position: absolute; left: 14px; right: 14px; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: #c9ccda; transform: rotate(-45deg); box-shadow: 0 0 0 2px rgba(6, 9, 24, 0.9); }
#sndbtns button:active { transform: scale(0.94); }
body.scening #sndbtns { visibility: hidden; }
