:root { --ink: #f1eee6; --dim: #a39fb3; --amber: #ffb347; --pumpkin: #ff7518; --slime: #8fdc3c; --ghost: #8ff3ff; --danger: #ff6b6b; --bg: #0a0b14; --card: #171624; --line: rgba(255,255,255,.12); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.plain { padding: 24px; max-width: 60ch; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
[hidden] { display: none !important; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 700; letter-spacing: .01em; margin: 0; }
button { font: 600 15px/1 system-ui, sans-serif; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.07); color: var(--ink); cursor: pointer; }
button:hover { background: rgba(255,255,255,.14); }
button.go { background: var(--amber); color: #1b1505; border-color: transparent; }
a { color: var(--amber); }

/* the lobby from the kit, in this game's colours */
.mp-lobby { --mp-bg: rgba(7,8,15,.8); --mp-card: #171624; --mp-accent: #ffc857; }
.mp-lobby .mp-card h1 { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 30px; }

#hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; text-shadow: 0 1px 4px rgba(0,0,0,.9); }
#top { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); text-align: center; }
#timer { font: 700 34px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .04em; }
#timer.low { color: var(--danger); }
#phase { color: var(--dim); font-size: 14px; margin-top: 4px; text-transform: uppercase; letter-spacing: .12em; }
#role { position: absolute; top: 14px; left: 18px; max-width: 30ch; }
#role b { display: block; font: italic 700 24px/1.1 Georgia, serif; color: var(--amber); }
#role.ghost b { color: var(--ghost); }
#role span { color: var(--dim); font-size: 14px; }
#feed { position: absolute; top: 14px; right: 18px; text-align: right; display: grid; gap: 4px; font-size: 15px; max-width: 34ch; }
#feed div { animation: fade 6s forwards; }
@keyframes fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
#cross { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: rgba(255,255,255,.75); box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
#cross.hot { width: 14px; height: 14px; margin: -7px; background: transparent; border: 2px solid var(--ghost); }
#cross.tag { background: var(--amber); }
#prompt { position: absolute; left: 50%; bottom: 23%; transform: translateX(-50%); font-size: 17px; white-space: nowrap; text-align: center; }
#prompt kbd, #keys kbd, #card kbd { font: 700 13px/1 ui-monospace, Menlo, monospace; padding: 4px 7px; border-radius: 6px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); margin: 0 3px; text-shadow: none; }
#prompt .no { color: var(--danger); }
#meters { position: absolute; left: 18px; bottom: 18px; display: grid; gap: 8px; width: 220px; }
.meter span { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); }
.bar { height: 10px; border-radius: 6px; background: rgba(255,255,255,.14); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--amber); transition: width .12s linear; }
#m-fear .bar i { background: linear-gradient(90deg, #ffc857, #ff6b6b); }
#m-energy .bar i { background: var(--ghost); }
#m-fear.high span { color: var(--danger); }
#fx { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 8px; }
#fx div { width: 96px; padding: 8px 6px 7px; border-radius: 10px; background: rgba(10,14,22,.7); border: 1px solid rgba(143,243,255,.25); text-align: center; text-shadow: none; }
#fx div b { display: block; font-size: 14px; }
#fx div small { color: var(--dim); font-size: 12px; }
#fx div kbd { font: 700 11px/1 ui-monospace, monospace; color: var(--ghost); }
#fx div.on { border-color: var(--ghost); background: rgba(40,80,95,.75); box-shadow: 0 0 14px rgba(143,243,255,.35); }
#fx div.poor { opacity: .45; }
#keys { position: absolute; right: 18px; bottom: 18px; color: var(--dim); font-size: 13px; text-align: right; line-height: 2; max-width: 300px; }
#toast { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); font: italic 700 26px/1.2 Georgia, serif; text-align: center; opacity: 0; transition: opacity .25s; max-width: 80vw; }
#toast.on { opacity: 1; }
#lit { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .15s; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 22%;
  font: 700 22px/1.2 system-ui, sans-serif; color: #fff6dc; text-shadow: 0 0 8px #000, 0 0 2px #000;
  box-shadow: inset 0 0 calc(40px + 120px * var(--lit, 0)) rgba(255, 240, 200, calc(.25 + .6 * var(--lit, 0))); }
#lit.on { opacity: 1; }

/* hiding: you peek out between slats */
#peek { position: fixed; inset: 0; pointer-events: none; z-index: 1; background:
  radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,.7) 90%),
  repeating-linear-gradient(90deg, rgba(8,5,6,.9) 0 7vw, transparent 7vw 11.5vw); }
#count { position: fixed; inset: 0; z-index: 2; background: #05050a; display: grid; place-items: center; text-align: center; }
#count b { display: block; font: 700 120px/1 ui-monospace, Menlo, monospace; color: var(--amber); }
#count span { color: var(--dim); }

#card, #click, #end { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; padding: 16px; }
#card { pointer-events: none; background: radial-gradient(ellipse at center, rgba(7,8,15,.75), rgba(7,8,15,.2) 70%); animation: cardin .3s; }
@keyframes cardin { from { opacity: 0; transform: scale(1.04); } }
#card > div { max-width: 520px; text-align: center; }
#card small, #end small { text-transform: uppercase; letter-spacing: .16em; color: var(--dim); font-size: 13px; }
#card h2 { font-size: 54px; line-height: 1.05; color: var(--amber); margin: 6px 0 12px; }
#card.ghost h2 { color: var(--ghost); }
#card ul { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; font-size: 18px; }
#card p { color: var(--dim); font-size: 14px; line-height: 2.1; margin: 0; }
#click { background: rgba(7,8,15,.6); }
#click > div, #end .panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.5); text-align: center; }
#click > div { display: grid; gap: 10px; min-width: 280px; }
#click p { color: var(--dim); font-size: 13px; margin: 0; }
#end { background: rgba(7,8,15,.72); overflow: auto; }
#end .panel { width: min(560px, 100%); margin: auto; }
#end h2 { font-size: 34px; margin: 4px 0; }
#end h2.win { color: var(--amber); }
#end p { color: var(--dim); margin: 6px 0; }
#end table { width: 100%; border-collapse: collapse; margin: 12px 0 8px; text-align: left; font-size: 15px; }
#end th { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); font-weight: 600; padding: 4px 8px; }
#end td { padding: 6px 8px; border-top: 1px solid var(--line); }
#end td:nth-child(n+3), #end th:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
#end tr.me td { color: var(--amber); font-weight: 600; }
#end .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
#after { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
#vote p { margin: 0 0 8px; color: var(--ink); }
#vote button, #door-btn { min-height: 44px; font-size: 14px; }
#door-btn { border-style: dashed; color: var(--dim); width: 100%; }
.links { font-size: 14px; }

/* Halloween (studio#131): the spooky display font, pumpkin buttons, and the low tier's CSS vignette and jolt. */
h1, h2, #role b { font-family: Creepster, Georgia, serif; font-style: normal; font-weight: 400; letter-spacing: .04em; }
.mp-lobby.mp-lobby { --mp-bg: rgba(10,9,24,.55); --mp-accent: #ff7518; }
.mp-lobby h2 { font-family: system-ui, sans-serif; font-weight: 700; letter-spacing: .1em; }
.mp-lobby .mp-card h1 { font-family: Creepster, Georgia, serif; font-style: normal; font-size: 44px; line-height: 1; color: var(--pumpkin); text-shadow: 0 0 18px rgba(255,117,24,.55), 0 2px 0 #3b1600; }
button.go { background: var(--pumpkin); color: #1b0d02; }
#card h2 { color: var(--pumpkin); font-size: 58px; }
#role b { color: var(--pumpkin); }
#vignette { position: fixed; inset: 0; pointer-events: none; display: none; background: radial-gradient(ellipse at center, transparent 45%, rgba(4,3,12,.78) 100%); }
body.q-low #vignette { display: block; }
#game.jolt { animation: jolt .35s linear; }
@keyframes jolt { 0%,100% { transform: none; filter: none; } 20% { transform: translate(6px,-3px); filter: hue-rotate(25deg) saturate(1.6); } 45% { transform: translate(-5px,4px); } 70% { transform: translate(3px,1px); } }

/* Phones (studio#131 round 2): the touch buttons, the floating stick, and a HUD that fits 375×812.
   The buttons only show on touch (body.touch), never on a mouse. */
#touch { display: none; }
body.touch #touch { display: block; }
body.touch #keys { display: none; }
#touch button { position: absolute; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  min-width: 48px; min-height: 48px; padding: 0; border-radius: 50%; background: rgba(10,12,20,.62); border: 1.5px solid rgba(255,255,255,.28); font-size: 22px; line-height: 1; text-shadow: none; }
#touch button small { display: block; font: 700 10px/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; margin-top: 3px; }
#touch button.on { background: var(--amber); color: #1b0d02; border-color: transparent; }
#t-pause { top: calc(10px + env(safe-area-inset-top)); left: 10px; }
#t-sound { top: calc(10px + env(safe-area-inset-top)); right: 10px; }
#t-tag, #t-crouch, #t-psst, #t-floor { width: 64px; height: 64px; right: 20px; }
#t-floor { bottom: calc(104px + env(safe-area-inset-bottom)); border-color: var(--ghost) !important; color: var(--ghost); }
#t-tag { bottom: calc(104px + env(safe-area-inset-bottom)); border-color: var(--amber) !important; font-size: 26px; }
#t-psst { bottom: calc(104px + env(safe-area-inset-bottom)); }
#t-crouch { bottom: calc(178px + env(safe-area-inset-bottom)); }
#t-act { left: 14px; bottom: calc(112px + env(safe-area-inset-bottom)); border-radius: 28px !important; min-height: 52px !important; padding: 0 20px !important;
  font: 700 16px/1 system-ui, sans-serif !important; background: var(--pumpkin) !important; color: #1b0d02; border-color: transparent !important; white-space: nowrap; max-width: calc(100vw - 120px); overflow: hidden; text-overflow: ellipsis; box-shadow: 0 0 18px rgba(255,117,24,.45); }
#stick { position: fixed; left: 0; top: 0; z-index: 4; width: 112px; height: 112px; border-radius: 50%; border: 2px solid rgba(255,255,255,.28); background: rgba(255,255,255,.05); pointer-events: none; }
#stick i { position: absolute; left: 34px; top: 34px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,200,87,.55); }
body.touch #fx div { pointer-events: auto; touch-action: none; }

@media (max-width: 640px) {
  #top { top: calc(12px + env(safe-area-inset-top)); }
  #timer { font-size: 28px; }
  #phase { font-size: 11px; }
  #role { top: calc(66px + env(safe-area-inset-top)); left: 12px; max-width: 46vw; }
  #role b { font-size: 19px; }
  #role span { font-size: 12px; }
  #feed { top: calc(66px + env(safe-area-inset-top)); right: 12px; max-width: 46vw; font-size: 13px; }
  #feed div:nth-child(n+4) { display: none; }
  #meters { left: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); width: 150px; gap: 6px; }
  #prompt { bottom: calc(184px + env(safe-area-inset-bottom)); font-size: 15px; white-space: normal; width: 90vw; }
  #toast { font-size: 21px; top: 26%; }
  #fx { bottom: calc(14px + env(safe-area-inset-bottom)); gap: 5px; }
  #fx div { width: 64px; min-height: 56px; padding: 7px 3px 6px; }
  #fx div b { font-size: 12px; }
  #fx div small { font-size: 10px; }
  body.touch #fx div kbd { display: none; }
  #card h2 { font-size: 44px; }
  #card ul { font-size: 15px; }
  #card p { line-height: 1.6; font-size: 13px; }
  #count b { font-size: 96px; }
  #end h2 { font-size: 28px; }
  #end table { font-size: 13px; }
  #end th, #end td { padding: 4px 5px; }
  #end .panel { padding: 16px; }
}
@media (max-width: 640px) { #meters:has(> #m-energy:not([hidden])) { bottom: calc(84px + env(safe-area-inset-bottom)); } }
