/* Carnival Express: the machine is a full-screen PixiJS scene. The real controls below stay
   in the page for keyboard and screen-reader players; the scene draws a focus ring for them. */
html:has(body.ce-page),body.ce-page{height:100%;overflow:hidden;overscroll-behavior:none}
body.ce-page{margin:0;background:#140a24;color:#fff0d0;min-height:0;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
body.ce-page:before{display:none}
.ce-main{position:fixed;inset:0}
.ce-stage{position:absolute;inset:0;overflow:hidden;background:#140a24 radial-gradient(ellipse at 50% 40%,#3a2152,#140a24 70%)}
.ce-stage canvas{display:block;width:100%;height:100%}
.ce-page .skip:not(:focus){position:absolute;left:-9999px}
.ce-sr,.ce-a11y,.ce-page .bw-settings{position:absolute!important;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;margin:-1px;padding:0;border:0}
.ce-a11y button,.ce-a11y select,.ce-a11y a{min-height:44px}
/* loading veil until the scene is ready */
.ce-page:not(.ce-ready):not(.ce-fallback) .ce-stage:after{content:'All aboard…';position:absolute;inset:0;display:grid;place-items:center;font:700 1.4rem 'Roboto Slab',Georgia,serif;letter-spacing:.12em;color:#f0be59;text-shadow:0 2px 12px #000}
/* age gate on a parchment board */
.ce-page .age-gate{position:absolute;z-index:5;left:50%;top:50%;transform:translate(-50%,-50%);width:min(560px,calc(100vw - 32px));box-sizing:border-box;margin:0;padding:34px 30px 26px;color:#3b1d0d;background:#ecd6a6 url('assets/express-scene/panel-about.webp') center/100% 100% no-repeat;border:0;border-radius:6px;box-shadow:0 30px 80px #000c}
.ce-page .age-gate h2{color:#5a2a10;margin-top:28px;font-family:'Roboto Slab',Georgia,serif}
.ce-page .age-gate button,.ce-page .ce-dialog button,.ce-page #auto-dialog button{font:700 1rem 'Roboto Slab',Georgia,serif;color:#ffe7b0;background:linear-gradient(#6b3d1f,#3d2112);border:2px solid #c8954a;border-radius:10px;padding:10px 20px;min-height:46px;cursor:pointer;box-shadow:inset 0 1px #ffffff22,0 2px 4px #0005}
.ce-page .age-gate button:hover,.ce-page .ce-dialog button:hover,.ce-page #auto-dialog button:hover{background:linear-gradient(#83502a,#4a2914)}
.ce-page .ce-dialog button:disabled{opacity:.45;cursor:default}
/* dialogs: the kit's plank as the title bar over a 9-slice parchment that stretches to any height */
.ce-page dialog.ce-dialog,.ce-page #auto-dialog{--side:34px;--pad:26px;width:min(720px,calc(100vw - 24px));max-height:none;box-sizing:border-box;overflow:visible;padding:0 var(--pad) 20px;color:#3b1d0d;background:transparent;border-style:solid;border-width:0 var(--side) 40px;border-color:transparent;border-image:url('assets/express-scene/panel-parchment.webp') 70 fill / 0 var(--side) 40px stretch;border-radius:0;box-shadow:none;font-family:Georgia,serif;filter:drop-shadow(0 24px 40px #000b)}
.ce-page dialog.ce-dialog::backdrop,.ce-page #auto-dialog::backdrop{background:#0b0614c7}
.ce-page .ce-dialog>h2:first-child,.ce-page #auto-dialog>h2:first-child{position:relative;margin:0 calc(-1 * (var(--side) + var(--pad) + 14px)) 14px;height:54px;line-height:52px;text-align:center;background:url('assets/express-scene/panel-plank.webp') center/100% 100% no-repeat;color:#fbe8c2;font:900 1.55rem 'Roboto Slab',Georgia,serif;letter-spacing:.06em;text-transform:uppercase;text-shadow:-2px -2px 0 #2a1206,2px -2px 0 #2a1206,-2px 2px 0 #2a1206,2px 2px 0 #2a1206,0 4px 6px #000a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 40px}
.ce-dialog h3{color:#5a2a10;font-family:'Roboto Slab',Georgia,serif;margin:.6em 0 .4em}
.ce-dialog a{color:#7a2f0e}
.ce-scroll,.ce-page #game-settings-body{max-height:calc(90dvh - 190px);overflow:auto;overscroll-behavior:contain;padding-right:4px}
.ce-dialog table{width:100%;border-collapse:collapse}.ce-dialog td,.ce-dialog th{padding:7px;border-bottom:1px solid #b88d5866;text-align:left;color:#3b1d0d}
.ce-symbol{display:inline-block;width:56px;height:56px;background-size:500% 600%;background-repeat:no-repeat}
.ce-dialog .ce-symbol{width:44px;height:44px;vertical-align:middle;margin-right:10px;border-radius:6px}
/* paytable pages (built by slot-paytable.js) */
.ce-page .pay-pages{height:min(470px,calc(90dvh - 260px));overflow:auto;overscroll-behavior:contain}
.ce-page .pay-page[hidden]{display:none}
.ce-page .pay-page th,.ce-page .pay-page td{text-align:center}.ce-page .pay-page td:first-child,.ce-page .pay-page th:first-child{text-align:left}
.ce-page .pay-page p{line-height:1.6}.ce-page .pay-page small{display:block;opacity:.8}
.ce-page .pay-page .pay-feature-art{display:block;width:120px;height:120px;margin:14px auto}
.ce-page .pay-lines{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.ce-page .pay-lines figure{margin:0;padding:8px;border-radius:8px;background:#f3e3c2aa;border:1px solid #c79c62}
.ce-page .pay-lines figcaption{font-size:.85rem;margin-bottom:4px}
.ce-page .pay-lines svg{width:100%;max-height:72px;display:block}
.ce-page .pay-page>svg{width:70%;max-height:130px}
.ce-page #pay-dialog nav{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px}
.ce-page #pay-dialog>button{margin-top:10px}
/* settings */
.ce-page #game-settings-body .bw-settings{position:static!important;width:auto;height:auto;overflow:visible;clip-path:none;white-space:normal;margin:0;display:block;color:#3b1d0d}
.ce-set{padding:4px 2px 14px;border-bottom:1px solid #b88d5866}
.ce-set:last-of-type{border-bottom:0}
.ce-set h3{font-size:.8rem;letter-spacing:.14em;text-transform:uppercase;color:#7a4317;margin:.4em 0 .7em}
.ce-page .ce-row{display:flex;width:100%;box-sizing:border-box;align-items:center;justify-content:space-between;gap:14px;min-height:46px;font:700 1rem 'Roboto Slab',Georgia,serif}
.ce-page #slot-audio-controls{border:0;margin:0;padding:0;display:grid;gap:6px}
.ce-page #slot-audio-controls label{display:grid;grid-template-columns:auto 1fr minmax(110px,46%);align-items:center;gap:12px;min-height:46px;font:700 1rem 'Roboto Slab',Georgia,serif}
.ce-page #slot-audio-controls label input[type=checkbox]{order:0}
/* brass toggle switches */
.ce-page .ce-dialog input[type=checkbox]{appearance:none;-webkit-appearance:none;width:52px;height:30px;margin:0;border-radius:15px;background:#5a3a24;border:2px solid #c8954a;position:relative;cursor:pointer;flex:none;transition:background .2s;box-shadow:inset 0 2px 4px #0006}
.ce-page .ce-dialog input[type=checkbox]:after{content:'';position:absolute;top:2px;left:2px;width:22px;height:22px;border-radius:50%;background:radial-gradient(circle at 35% 35%,#fff3cf,#d9a650 60%,#8a5a24);box-shadow:0 1px 3px #0008;transition:transform .2s}
.ce-page .ce-dialog input[type=checkbox]:checked{background:#39b7b0}
.ce-page .ce-dialog input[type=checkbox]:checked:after{transform:translateX(22px)}
/* volume sliders */
.ce-page .ce-dialog input[type=range]{appearance:none;-webkit-appearance:none;width:100%;height:30px;background:transparent;cursor:pointer}
.ce-page .ce-dialog input[type=range]::-webkit-slider-runnable-track{height:8px;border-radius:4px;background:linear-gradient(#5a3a24,#7a5434);border:1px solid #c8954a}
.ce-page .ce-dialog input[type=range]::-moz-range-track{height:8px;border-radius:4px;background:#6a4630;border:1px solid #c8954a}
.ce-page .ce-dialog input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:24px;height:24px;margin-top:-9px;border-radius:50%;background:radial-gradient(circle at 35% 35%,#fff3cf,#d9a650 60%,#8a5a24);border:1px solid #5a3a24}
.ce-page .ce-dialog input[type=range]::-moz-range-thumb{width:22px;height:22px;border-radius:50%;background:#d9a650;border:1px solid #5a3a24}
/* pace as three buttons */
.ce-pace{display:inline-flex;border:2px solid #c8954a;border-radius:12px;overflow:hidden}
.ce-page .ce-dialog .ce-pace button{border:0;border-radius:0;min-height:42px;padding:8px 14px;background:#6a4630;color:#f3dcae;box-shadow:none}
.ce-page .ce-dialog .ce-pace button[aria-pressed=true]{background:linear-gradient(#f0be59,#b8822e);color:#2a1206}
.ce-page #table-speed{display:none}
.ce-page #game-settings-body .bw-tools{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-start;margin:0}
.ce-page .ce-scroll:focus-visible,.ce-page #game-settings-body:focus-visible,.ce-page .pay-pages:focus-visible,.ce-page .ce-dialog:focus-visible{outline:none}
.ce-page #game-settings-body .bw-tools[hidden]{display:none}
.ce-page #game-settings-body #refresh{margin-top:8px}
.ce-page #game-settings-body #account-strip{background:transparent;border:0;padding:0;color:#3b1d0d}
.ce-page #game-settings-body #account-strip:empty{display:none}
.ce-dialog-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
.ce-page #auto-dialog label{display:flex;align-items:center;gap:12px;min-height:46px;font:700 1rem 'Roboto Slab',Georgia,serif}
.ce-page #auto-dialog select,.ce-page #auto-dialog input[type=number],.ce-page .pay-page select{font:700 1rem Georgia;padding:8px;border-radius:8px;border:2px solid #c8954a;background:#fff4dc;color:#3b1d0d}
@media (max-width:600px){
 .ce-page dialog.ce-dialog,.ce-page #auto-dialog{--side:16px;--pad:12px;width:calc(100vw - 16px)}
 .ce-page .ce-dialog>h2:first-child,.ce-page #auto-dialog>h2:first-child{height:46px;line-height:44px;font-size:1.15rem}
 .ce-page #slot-audio-controls label{grid-template-columns:auto 1fr;}.ce-page #slot-audio-controls label input[type=range]{grid-column:1/-1}
}
/* no WebGL: the accessible layer becomes a plain, usable control panel */
.ce-fallback .ce-a11y{position:absolute!important;width:auto;height:auto;clip-path:none;white-space:normal;margin:0;inset:auto 12px 12px 12px;padding:16px;background:#21172ef2;border:2px solid #c69b58;border-radius:16px;display:flex;flex-wrap:wrap;gap:10px;align-items:center;max-height:80dvh;overflow:auto}
.ce-fallback .ce-a11y .game-bar{display:none}
.ce-fallback .ce-stage:after{content:'Carnival Express';position:absolute;inset:0 0 auto;padding:28px;text-align:center;font:700 2rem Georgia;color:#ffe3a0}
.ce-fallback-grid:empty{display:none}
@media (prefers-reduced-motion:reduce){.ce-page *{scroll-behavior:auto}}
.ce-page #game-settings-body{display:flex;flex-direction:column}
.ce-page #game-settings-body>.deck-open{order:2;align-self:flex-start;margin-top:10px}
.ce-page #game-settings-body #account-strip,.ce-page #game-settings-body #account-strip *{color:#5a2a10!important;background:transparent!important}
