:root {
  --ink: #141018; --paper: #fffdf6; --paper-2: #f4eedd; --line: #d9d2c0; --grey: #625b6b;
  --yellow: #ffe033; --pink: #ff3d8b; --pink-ink: #c4005a; --cyan: #35d9ff; --lime: #b9f53c; --violet: #7b4dff; --orange: #ff8a1f;
  --display: "Bricolage Grotesque", "Arial Black", Arial, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, Menlo, Consolas, monospace;
  --bw: 3px; --sh: 5px; --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.45 var(--body); }
a { color: var(--pink-ink); }
code { font-family: var(--mono); font-size: .9em; background: var(--paper-2); padding: 1px 5px; border-radius: 5px; }
.muted { color: var(--grey); }
button { font: 700 16px var(--body); color: var(--ink); background: var(--yellow); border: var(--bw) solid var(--ink); border-radius: 999px;
  padding: 10px 22px; box-shadow: 3px 3px 0 var(--ink); cursor: pointer; transition: transform .08s, box-shadow .08s; }
button:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
button.ghost { background: var(--paper); }
button.pink { background: var(--pink); color: #fff; }
button:disabled { opacity: .5; cursor: default; }

header.top { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: var(--bw) solid var(--ink); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.brand { font: 800 22px var(--display); color: var(--ink); text-decoration: none; background: var(--pink); color: #fff; padding: 0 8px; border-radius: 8px; }
.crumb { font: 500 13px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--grey); }
.streak { margin-left: auto; display: flex; gap: 6px; }
.streak i { width: 18px; height: 18px; border-radius: 50%; border: var(--bw) solid var(--ink); background: var(--paper-2); }
.streak i.on { background: var(--lime); box-shadow: 0 0 0 3px #b9f53c66; }

main { max-width: 980px; margin: 0 auto; padding: 22px 16px 40px; min-height: 70vh; }
footer.foot { border-top: var(--bw) solid var(--ink); padding: 14px 20px; font-size: 14px; background: var(--paper-2); }
footer.foot p { margin: 4px 0; max-width: 980px; margin-inline: auto; }

.panel { border: var(--bw) solid var(--ink); border-radius: var(--r); background: #fff; box-shadow: var(--sh) var(--sh) 0 var(--ink); padding: 22px; }
.kicker { font: 500 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--grey); }
h1, h2, h3 { font-family: var(--display); margin: 0 0 8px; line-height: 1.05; }
h1 { font-size: clamp(36px, 6vw, 64px); }
h2 { font-size: 32px; }

/* the door */
.doorwrap { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: center; }
.doorwrap .door { height: 400px; border: var(--bw) solid var(--ink); border-radius: 10px 10px 0 0; background: linear-gradient(#8f8a96, #6f6a77); position: relative; box-shadow: var(--sh) var(--sh) 0 var(--ink); }
.doorwrap .door .sign { position: absolute; top: 46px; left: 50%; transform: translateX(-50%); background: var(--yellow); border: var(--bw) solid var(--ink); font: 800 22px var(--display); padding: 6px 14px; white-space: nowrap; }
.doorwrap .door .knob { position: absolute; right: 26px; top: 210px; width: 22px; height: 22px; border-radius: 50%; background: var(--yellow); border: var(--bw) solid var(--ink); }
.doorwrap .door .pad { position: absolute; right: 22px; top: 140px; width: 34px; height: 46px; background: #222; border-radius: 4px; border: 2px solid var(--ink); }
.doorwrap .door .pad::after { content: ""; position: absolute; left: 12px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.doorwrap .door.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.bubble { position: relative; background: #fff; border: var(--bw) solid var(--ink); border-radius: 18px; padding: 14px 18px; font-size: 19px; box-shadow: 3px 3px 0 var(--ink); margin: 10px 0 18px; }
.bubble::before { content: "DOORMAN"; position: absolute; top: -12px; left: 14px; font: 500 12px var(--mono); background: var(--ink); color: var(--paper); padding: 1px 7px; border-radius: 6px; letter-spacing: .08em; }

/* test card */
.panel.card { max-width: 640px; margin: 10px auto; }
.panel.card .num { font: 800 64px var(--display); color: var(--pink); line-height: 1; }
.panel.card .weak { display: inline-block; font: 500 15px/1.35 var(--mono); background: var(--cyan); border: 2px solid var(--ink); border-radius: 12px; padding: 5px 12px; margin: 6px 0 12px; }
.panel.card .rules { font-size: 20px; margin: 8px 0 18px; }
.panel.card .meta { font: 500 15px var(--mono); color: var(--grey); margin-bottom: 16px; }

/* stage */
.stagehead { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.stagehead h3 { margin: 0; font-size: 24px; }
.timer { flex: 1; height: 14px; border: var(--bw) solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--paper-2); }
.timer i { display: block; height: 100%; width: 100%; background: var(--pink); transform-origin: left; }
.stage { position: relative; width: 100%; max-width: 940px; aspect-ratio: 900 / 540; margin: 0 auto; border: var(--bw) solid var(--ink); border-radius: var(--r);
  background: #fff; overflow: hidden; box-shadow: var(--sh) var(--sh) 0 var(--ink); user-select: none; -webkit-user-select: none; touch-action: none; }
.stage .inner { position: absolute; left: 0; top: 0; width: 900px; height: 540px; transform-origin: 0 0; }
.status { text-align: center; font: 500 15px var(--mono); color: var(--grey); min-height: 22px; margin-top: 10px; }
.stagerules { text-align: center; color: #453f4d; margin: 0 auto 8px; font-size: 16px; }

/* result */
.result { max-width: 680px; margin: 10px auto; text-align: center; }
.result .stamp { display: inline-block; font: 800 46px var(--display); border: 6px solid currentColor; padding: 4px 18px; transform: rotate(-4deg); border-radius: 10px; margin: 6px 0 12px; }
.result .stamp.fail { color: var(--pink-ink); }
.result .stamp.pass { color: #2a8a00; }
.meter { height: 26px; border: var(--bw) solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--paper-2); margin: 8px 0 4px; position: relative; }
.meter i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--orange), var(--lime)); }
.meter span { position: relative; font: 700 14px var(--mono); line-height: 20px; }
.detail { font-size: 16px; color: var(--grey); margin: 6px 0 14px; }

/* debug ratings */
.rate { text-align: left; margin-top: 18px; border-top: 2px dashed var(--line); padding-top: 14px; }
.rate h4 { margin: 0 0 8px; font: 700 15px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.rate .row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 10px; margin: 5px 0; }
.rate .row small { display: block; color: var(--grey); font-size: 13px; line-height: 1.2; }
.rate .opts { display: flex; gap: 6px; }
.rate .opts button { padding: 4px 12px; font-size: 14px; background: var(--paper); box-shadow: 2px 2px 0 var(--ink); }
.rate .opts button.sel { background: var(--violet); color: #fff; }
.rate textarea { width: 100%; min-height: 54px; font: 14px var(--body); border: 2px solid var(--ink); border-radius: 8px; padding: 6px; }

/* wall */
.wall { margin-top: 34px; }
.glass { position: relative; border: var(--bw) solid var(--ink); border-radius: var(--r); padding: 16px; background: linear-gradient(135deg, #eef6fb, #dfeaf2); }
.glass::before { content: "FROSTED GLASS · STAFF ROOM"; position: absolute; top: -12px; left: 14px; font: 500 12px var(--mono); background: var(--ink); color: var(--paper); padding: 1px 7px; border-radius: 6px; }
.glass .note { background: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: 10px 12px; margin: 8px 0; box-shadow: 2px 2px 0 var(--ink); }
.glass .note .who { font: 500 13px var(--mono); color: var(--grey); }
.glass .note .msg { font-size: 17px; margin-top: 2px; }

/* debug gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 14px; }
.gallery button { border-radius: 10px; font-size: 14px; padding: 8px; text-align: left; background: var(--paper); box-shadow: 2px 2px 0 var(--ink); }
.gallery button.rated { background: var(--lime); }
.gallery button b { font-family: var(--mono); color: var(--pink-ink); margin-right: 4px; }
table.ratings { border-collapse: collapse; width: 100%; font-size: 14px; margin-top: 10px; }
table.ratings td, table.ratings th { border: 1px solid var(--line); padding: 4px 6px; text-align: left; }

@media (max-width: 720px) { .doorwrap { grid-template-columns: 1fr; } .doorwrap .door { height: 260px; } }

/* signatures and stats */
.glass .note .sig { display: flex; gap: 6px; align-items: baseline; font-size: 15px; }
.glass .note .sig b { font-family: var(--display); font-size: 18px; }
.glass .note .sig .total { margin-left: auto; font: 700 15px var(--mono); background: var(--lime); border: 2px solid var(--ink); border-radius: 999px; padding: 0 8px; }
.glass .runs, .result .runs { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.glass .runs span, .result .runs span { font: 500 13px var(--mono); background: var(--paper-2); border: 1.5px solid var(--ink); border-radius: 6px; padding: 1px 6px; }
.glass .runs i, .result .runs i { font-style: normal; color: var(--pink-ink); }
#stats .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
#stats .tiles div { border: var(--bw) solid var(--ink); border-radius: 12px; background: #fff; padding: 10px 12px; box-shadow: 3px 3px 0 var(--ink); font-size: 14px; color: var(--grey); }
#stats .tiles b { display: block; font: 800 28px var(--display); color: var(--ink); }
#stats h3 { margin: 16px 0 6px; font-size: 20px; }
.glass .note .sig .kind { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; border: 2px solid var(--ink); border-radius: 999px; padding: 0 7px; }
.glass .note .sig .kind.thinking { background: var(--cyan); }
.glass .note .sig .kind.scripted { background: var(--yellow); }
.status .hold { display: flex; align-items: center; justify-content: center; gap: 14px; font: 600 15px var(--body); color: var(--ink); }
.status .hold button { padding: 8px 18px; }

/* juice: doorman heckles, floating words, stage shake, late timer */
.hecklerow { height: 34px; display: flex; justify-content: center; align-items: flex-start; margin-top: 8px; pointer-events: none; }
.heckle { position: relative; font: 600 16px var(--body); background: #fff; border: var(--bw) solid var(--ink); border-radius: 14px; padding: 3px 14px 3px 12px; box-shadow: 3px 3px 0 var(--ink);
  opacity: 0; transform: translateY(-6px) scale(.9); transition: opacity .18s, transform .18s cubic-bezier(.2,.9,.3,1.5); max-width: 92%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heckle::before { content: "DOORMAN "; font: 500 11px var(--mono); letter-spacing: .08em; color: var(--pink-ink); margin-right: 4px; }
.heckle.on { opacity: 1; transform: none; }
.status { margin-top: 4px; }
.stage .burst { position: absolute; z-index: 90; pointer-events: none; font: 800 20px var(--display); color: var(--ink); text-shadow: 0 2px 0 #fff, 2px 0 0 #fff, -2px 0 0 #fff, 0 -2px 0 #fff; white-space: nowrap;
  transform: translate(-50%, -50%); animation: burst .85s ease-out forwards; }
@keyframes burst { from { opacity: 1; transform: translate(-50%, -50%) scale(.6); } 25% { transform: translate(-50%, -90%) scale(1.15); } to { opacity: 0; transform: translate(-50%, -220%) scale(1); } }
.stage.shake { animation: stageshake .28s; }
@keyframes stageshake { 20% { transform: translate(-5px, 2px); } 40% { transform: translate(5px, -2px); } 60% { transform: translate(-3px, 1px); } 80% { transform: translate(3px, 0); } }
.timer.late { animation: late .5s steps(2) infinite; }
.timer.late i { background: var(--pink-ink); }
@keyframes late { 50% { background: var(--yellow); } }
.mute { margin-left: 12px; padding: 3px 12px; font: 500 13px var(--mono); background: var(--paper); box-shadow: 2px 2px 0 var(--ink); }

/* verdict, card and door extras */
.result .stamp.slam { animation: slam .32s cubic-bezier(.2,.8,.3,1.3) both; }
@keyframes slam { from { transform: rotate(-14deg) scale(3.2); opacity: 0; } 70% { opacity: 1; } to { transform: rotate(-4deg) scale(1); opacity: 1; } }
.meter i { transition: width .9s cubic-bezier(.2,.8,.2,1); }
.meter .goal { position: absolute; right: 10px; top: 0; font: 500 13px/20px var(--mono); color: var(--grey); }
.field { font: 500 14px var(--mono); color: var(--grey); margin: 6px 0; }
.field.hot { color: var(--ink); background: var(--lime); display: inline-block; padding: 1px 10px; border: 2px solid var(--ink); border-radius: 999px; }
.panel.card .field { margin: -8px 0 16px; }
.panel.card .field.hot { margin: 0 0 16px; }
.resultbtns { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.resultbtns .xlink { font: 600 14px var(--body); }
.me { font-size: 15px; background: var(--paper-2); border: 2px dashed var(--ink); border-radius: 10px; padding: 6px 10px; }

/* the whole stage stays on screen: width is limited by the window height too */
:root { --stagew: clamp(420px, calc((100dvh - 252px) * 1.6667), 1200px); }
.stage { max-width: var(--stagew); }
body.playing main { max-width: 1240px; }
.stagerules { max-width: var(--stagew); }
@media (max-height: 820px) { body.playing header.top { display: none; } :root { --stagew: clamp(420px, calc((100dvh - 198px) * 1.6667), 1200px); } }
.stagehead .giveup { padding: 3px 14px; font: 600 14px var(--body); box-shadow: 2px 2px 0 var(--ink); white-space: nowrap; }
.stagehead { max-width: var(--stagew); margin-inline: auto; }

/* phones: sideways, nothing but the stage */
@media (orientation: landscape) and (max-height: 520px) {
  html.phone body.playing header.top, html.phone body.playing footer.foot, html.phone body.playing .stagerules { display: none; }
  html.phone body.playing main { padding: 4px 8px 0; min-height: 0; }
  html.phone body.playing .stagehead { margin-bottom: 3px; gap: 8px; max-width: none; }
  html.phone body.playing .stagehead h3 { font-size: 15px; }
  html.phone body.playing .timer { height: 9px; border-width: 2px; }
  html.phone body.playing .stage { max-width: calc((100dvh - 62px) * 1.6667); border-width: 2px; box-shadow: none; }
  html.phone body.playing .hecklerow { position: fixed; left: 210px; right: 96px; top: 0; height: auto; margin: 0; z-index: 30; }
  html.phone body.playing .stagehead h3 { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.phone body.playing .stagehead h3 .no { display: none; }
  html.phone body.playing .heckle { font-size: 13px; padding: 1px 10px; }
  html.phone body.playing .status { margin-top: 2px; min-height: 18px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.phone body.playing .status .hold { font-size: 12px; gap: 8px; } html.phone body.playing .status .hold button { padding: 2px 12px; font-size: 13px; }
}

/* your file: rank and the shelf of fifty */
.me .merow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 2px; }
.me .rank { font: 800 15px var(--display); background: var(--ink); color: var(--paper); padding: 1px 9px; border-radius: 6px; transform: rotate(-1.5deg); }
button.small { padding: 3px 12px; font-size: 13px; box-shadow: 2px 2px 0 var(--ink); margin-left: auto; }
.shelf { display: grid; grid-template-columns: repeat(25, 1fr); gap: 3px; margin-top: 6px; }
.shelf i { font: 500 12px/1 var(--mono); font-style: normal; aspect-ratio: 1; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 4px; background: #fff; cursor: default; }
.shelf i.unmet { border-style: dashed; color: var(--grey); background: transparent; }
.shelf i.won { background: var(--lime); font-weight: 700; }
@media (max-width: 720px) { .shelf { grid-template-columns: repeat(10, 1fr); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 15px; animation: confetti 2s ease-in forwards; }
@keyframes confetti { to { top: 105%; transform: rotate(720deg) translateX(40px); } }
.me { margin-bottom: 14px; }

/* ---------- xp9 accessibility pass (Robots Only) ---------- */
.skip { position: fixed; top: 6px; left: 12px; z-index: 40; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  background: var(--yellow); color: var(--ink); border: var(--bw) solid var(--ink); border-radius: 999px; box-shadow: 3px 3px 0 var(--pink);
  font: 800 15px/1 var(--display); text-decoration: none; transform: translateY(-90px); transition: transform .13s; }
.skip:focus { transform: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
main:focus, h1:focus, h2:focus { outline: none; }
.brand:focus-visible { outline-color: var(--ink); }
input, textarea { font: 16px var(--body); color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: 8px 10px; }
.fieldlabel { display: block; font: 500 13px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--grey); margin: 8px 0 4px; }
.nojs { max-width: 980px; margin: 20px auto; padding: 0 16px; font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .confetti { display: none; }
}
@media (forced-colors: active) {
  .streak i.on { background: Highlight; }
  button { border-color: ButtonText; }
}
