@font-face { font-family: "Patrick Hand"; src: url(assets/fonts/PatrickHand-Regular.ttf); font-display: swap; }
@font-face { font-family: "Luckiest Guy"; src: url(assets/fonts/LuckiestGuy-Regular.ttf); font-display: swap; }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url("../../../assets/manrope-600.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 800; font-display: swap; src: url("../../../assets/manrope-700.woff2") format("woff2"); }
/* Chrome (header, HUD, soundboard, footer) uses the Scene-Flix site tokens, same values as the pages around it.
   The --bm-* paper tokens stay for everything inside the play area (.frame): puppets, tags, cards, captions. */
:root {
  --bg: #12100e; --raise: #1d1a17; --edge: #2e2924; --ink: #f4ead5; --ink-2: #b3a894; --red: #e0463c; --game: #f2b830; --radius: 8px;
  --sf-font: Manrope, system-ui, sans-serif; color-scheme: dark;
  --bm-ink: #2a1e14; --bm-paper: #f4ead2; --bm-paper-2: #e8dcb8; --bm-kraft: #c9a46a; --bm-bog: #4a5a28;
  --bm-night: #1f1c18; --bm-glow: #f2c94c; --bm-focus: #ffe066; --bm-radius: 6px;
  --bm-font: "Patrick Hand", "Comic Neue", system-ui, sans-serif; --bm-display: "Luckiest Guy", "Patrick Hand", sans-serif;
  --bm-shadow: 3px 5px 0 rgba(20, 12, 6, .35);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 600 20px/1.4 var(--sf-font); }
body { min-height: 100vh; }
/* chrome controls: site look */
button, select { font: inherit; font-size: .9rem; color: var(--ink); background: var(--raise); border: 1px solid var(--edge); border-radius: var(--radius); padding: .35em .9em; min-height: 44px; cursor: pointer; }
button:hover:not(:disabled), select:hover { border-color: var(--ink-2); }
button[aria-pressed="true"] { background: var(--game); border-color: var(--game); color: var(--bg); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid var(--game); outline-offset: 3px; }
/* inside the play area: paper look kept */
.card button { font-family: var(--bm-font); font-size: 1rem; font-weight: 400; color: var(--bm-ink); background: var(--bm-paper); border: 0; border-radius: var(--bm-radius); box-shadow: var(--bm-shadow); clip-path: polygon(0 4%, 3% 0, 97% 2%, 100% 0, 99% 96%, 100% 100%, 2% 98%, 0 100%); }
.card button:focus-visible { outline: 4px solid var(--bm-focus); }
.card .big-btn { background: var(--bm-glow); font-size: 1.3rem; }
.frame .card, .frame .caption { font-family: var(--bm-font); font-weight: 400; }
.bar { display: flex; flex-wrap: wrap; gap: .6em 1.2em; align-items: center; padding: .6em 1.2em; }
.bar h1 { font-weight: 800; font-size: 1.5rem; margin: 0; letter-spacing: -0.01em; color: var(--ink); }
.bar h1 span { color: var(--game); }
.setpick { color: var(--ink-2); font-size: .9rem; }
.modes, .opts { display: flex; gap: .5em; }
.setpick { display: flex; gap: .4em; align-items: center; }
.opts { margin-left: auto; }
main { max-width: 1500px; margin: 0 auto; padding: 0 1em 1em; }
.hud { display: flex; gap: .8em; align-items: center; margin-bottom: .6em; flex-wrap: wrap; }
.chip { background: var(--raise); color: var(--ink); border: 1px solid var(--edge); border-radius: var(--radius); padding: .15em .9em; display: flex; gap: .5em; align-items: baseline; min-height: 44px; }
.chip small { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.chip b { font-weight: 800; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.chip:first-child b { color: var(--game); }
.chip i { font-style: normal; color: var(--red); font-weight: 800; }
.chip.name { background: transparent; border-color: transparent; color: var(--ink-2); font-size: .95rem; align-items: center; }
body:not([data-mode="soundboard"]) .sbonly { display: none; }
body[data-mode="soundboard"] #pause, body[data-mode="soundboard"] .hud .chip:nth-child(-n+2) { display: none; }

.frame { position: relative; border: 14px solid var(--bm-kraft); border-radius: 4px; box-shadow: 0 10px 30px #000, inset 0 0 0 3px #a8834a; background: #000; }
.stage { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.row { position: absolute; inset: 0; }
.slotclip { position: absolute; overflow: hidden; pointer-events: none; }
.pup { position: absolute; left: 0; width: 100%; height: 100%; transform: translateY(105%); transition: transform .16s cubic-bezier(.3, 1.5, .5, 1); will-change: transform; }
.pup img { position: absolute; left: 0; top: 0; width: 100%; height: auto; transform-origin: 50% 64%; }
.pup.up { transform: translateY(0); }
.pup.up img { animation: wobble 1.6s ease-in-out infinite; }
.pup.bonked { transform: translateY(14%); transition-duration: .08s; }
.pup.bonked img { animation: squash .2s ease-out both; }
.pup.bob img { animation: bob .35s ease-out; }
@keyframes wobble { 0%, 100% { rotate: -2.5deg; } 50% { rotate: 2.5deg; } }
@keyframes squash { 0% { scale: 1.15 .8; } 60% { scale: .95 1.06; } 100% { scale: 1 .92; } }
@keyframes bob { 0% { translate: 0 0; } 40% { translate: 0 -6%; } 100% { translate: 0 0; } }

.hit { position: absolute; border: 0; background: transparent; box-shadow: none; clip-path: none; padding: 0; border-radius: 12px; min-height: 0; }
/* The z rule (Tony, 2026-10-31: "front row blocks back row clicks even when hidden"): an empty slot answers taps only on its
   hole (the bottom strip with its key tag); while a puppet is up it answers over the puppet's full height, so a front-row
   slot blocks the back row only while someone is standing in it. */
.hit:not(.up) { clip-path: inset(72% 0 0 0); }
/* The rows are full-stage layers: they let taps through, and only the slot buttons (and the door) catch them. */
.row { pointer-events: none; }
.row .hit, .row .door-tile { pointer-events: auto; }
.hit .tag { position: absolute; left: 50%; bottom: 2%; translate: -50% 0; font-size: clamp(13px, 1.5vw, 24px); background: var(--bm-paper); color: var(--bm-ink); padding: 0 .45em; box-shadow: 2px 3px 0 rgba(0, 0, 0, .35); opacity: .85; display: flex; gap: .35em; align-items: baseline; rotate: -3deg; }
.hit .tag small { font-size: .75em; opacity: .7; }
.hit.cursor { outline: 4px dashed var(--bm-focus); outline-offset: -6px; }
.hit:focus-visible { outline: 4px solid var(--bm-focus); outline-offset: -6px; }
.door-tile { position: absolute; border: 0; background: transparent; box-shadow: none; clip-path: none; }
.door-tile:hover { outline: 3px dashed var(--bm-focus); }

.fx { position: absolute; inset: 0; pointer-events: none; }
.star { position: absolute; width: 15%; translate: -50% -50%; animation: pop .5s ease-out forwards; }
.star.big { width: 19%; }
.star svg, .sparkle svg { width: 100%; display: block; }
@keyframes pop { 0% { scale: .4; opacity: 1; } 30% { scale: 1.05; opacity: 1; } 100% { scale: 1; opacity: 0; } }
.sparkle { position: absolute; width: 5%; translate: -50% -50%; animation: twinkle .9s ease-out forwards; }
@keyframes twinkle { 0% { scale: .2; rotate: 0deg; opacity: 0; } 30% { opacity: 1; } 100% { scale: 1; rotate: 90deg; opacity: 0; } }

[data-set="lift"] .door { transition: transform .9s ease-in-out; }
[data-set="lift"].doors-open .door-l { transform: translateX(-205px); }
[data-set="lift"].doors-open .door-r { transform: translateX(205px); }
.flame { animation: flick 1.4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes flick { to { transform: scaleY(1.12) skewX(4deg); } }
.stage.paused .pup img { animation-play-state: paused; }
.stage.paused { filter: saturate(.6) brightness(.8); }

.card { position: absolute; left: 50%; top: 46%; translate: -50% -50%; width: min(560px, 80%); background: var(--bm-paper); color: var(--bm-ink); padding: 1em 1.4em 1.2em; text-align: center; box-shadow: 8px 12px 0 rgba(0, 0, 0, .45); rotate: -1.2deg; clip-path: polygon(0 2%, 4% 0, 30% 1.5%, 60% 0, 96% 1%, 100% 3%, 99% 50%, 100% 97%, 94% 100%, 50% 98.5%, 4% 100%, 0 97%, 1% 50%); }
.card::before { content: ""; position: absolute; left: 50%; top: -6px; width: 120px; height: 30px; translate: -50% 0; rotate: 3deg; background: rgba(239, 227, 180, .85); }
.card h2 { font-family: var(--bm-display); font-weight: 400; font-size: 2.2rem; margin: .2em 0; }
.card .big { font-family: var(--bm-display); font-size: 4rem; margin: 0; }
.card kbd { background: var(--bm-ink); color: var(--bm-paper); padding: 0 .35em; border-radius: 4px; margin: 0 .1em; }
.big-btn { background: var(--bm-glow); font-size: 1.3rem; padding: .4em 1.4em; margin: .3em; }
.caption { position: absolute; left: 50%; bottom: 3%; translate: -50% 0; max-width: 86%; background: rgba(20, 14, 8, .88); color: #fff8e6; padding: .3em .9em; font-size: clamp(16px, 1.9vw, 30px); border-radius: 6px; opacity: 0; transition: opacity .15s; pointer-events: none; text-align: center; }
.caption.on { opacity: 1; }
.caption b { color: var(--bm-glow); }
.caption .sfx { font-style: italic; opacity: .9; }

.board { margin-top: 1em; }
.board .hint { margin: .2em 0 .8em; opacity: .85; }
#tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1em; }
.board .hint { color: var(--ink-2); }
.grp { background: var(--raise); border: 1px solid var(--edge); border-radius: var(--radius); padding: .6em .8em .9em; }
.grp h3 { margin: 0 0 .5em; display: flex; align-items: center; gap: .5em; font-weight: 800; font-size: 1.1rem; color: var(--ink); }
.grp h3 img { width: 44px; height: 70px; object-fit: cover; object-position: top; }
.grp h3 .vo { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; background: var(--edge); color: var(--ink-2); border-radius: 4px; padding: .1em .5em; }
.tl { display: flex; flex-wrap: wrap; gap: .5em; }
.tile { font-size: .9rem; text-align: left; min-height: 48px; background: var(--bg); }
.tile:active { background: var(--game); border-color: var(--game); color: var(--bg); }
.tile.sfxt { border-style: dashed; color: var(--ink-2); }
.foot { text-align: center; font-size: .8rem; color: var(--ink-2); padding: 0 1em 1.2em; }

/* calm motion: no wobble, slides become quick fades, nothing shakes or spins */
body.reduced .pup { transform: none; opacity: 0; transition: opacity .12s linear; }
body.reduced .pup.up { opacity: 1; }
body.reduced .pup.bonked { transform: none; }
body.reduced .pup img, body.reduced .flame, body.reduced .pup.bob img, body.reduced .pup.bonked img { animation: none !important; }
body.reduced .star { animation: fadeout .5s linear forwards; }
body.reduced .sparkle { animation: fadeout .9s linear forwards; }
body.reduced [data-set="lift"] .door { transition: opacity .4s linear; }
body.reduced [data-set="lift"].doors-open .door { transform: none; opacity: 0; }
@keyframes fadeout { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 760px) { html { font-size: 17px; } .opts { margin-left: 0; }
  .card { width: 92%; padding: 1em .8em .6em; font-size: .72rem; } .card h2 { font-size: 1.3rem; margin: 0; } .card p { margin: .3em 0; } .card .keys { display: none; } .card .big { font-size: 2.2rem; } .card .big-btn { font-size: .95rem; min-height: 40px; } }
