* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #e6dccb; color: #3a342d;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif, "Noto Color Emoji";
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
canvas#c { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; }
#over { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.em { font-family: "Noto Color Emoji", sans-serif; }

#hud { position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: min(100vw, 560px); z-index: 2;
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px;
  padding: max(6px, env(safe-area-inset-top)) 8px 4px; pointer-events: none; }
#hud > * { pointer-events: auto; }
#floor { display: flex; align-items: center; gap: 4px; font-size: 18px; background: #3a342d; color: #f3e6c4; border-radius: 12px; padding: 0 10px; height: 44px; }
#floor b { font-size: 20px; min-width: 22px; text-align: center; }
#pips { display: flex; gap: 3px; justify-content: center; min-width: 0; }
#pips i { flex: 1; max-width: 22px; height: 8px; border-radius: 4px; background: rgba(58, 52, 45, 0.16); }
#pips i.done { background: rgba(58, 52, 45, 0.45); }
#pips i.pin { background: #8fbf22; }
#pips i.now { background: #3a342d; }
#pips .endless { font-size: 13px; font-weight: 700; }
#strikes { font-size: 19px; letter-spacing: -1px; white-space: nowrap; }
#strikes i { font-style: normal; filter: grayscale(1); opacity: 0.28; }
#strikes i.hit { filter: none; opacity: 1; }
.btns { display: flex; gap: 4px; }
.btns button { width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(255, 250, 238, 0.9); font-size: 18px; font-weight: 800; color: #3a342d; cursor: pointer; }
#mute.off { text-decoration: line-through; opacity: 0.6; }

/* speech bubbles and suspicion meters, pinned to heads */
.bubble { position: absolute; left: 0; top: 0; max-width: 170px; padding: 5px 9px; border-radius: 12px; background: #fffdf6; color: #3a342d; font-size: 13px; font-weight: 700; line-height: 1.2;
  text-align: center; box-shadow: 0 2px 0 rgba(58, 52, 45, 0.25); white-space: nowrap; will-change: transform; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.bubble.sniff { font-weight: 600; font-style: italic; font-size: 12px; background: rgba(255, 253, 246, 0.9); color: #6b6355; }
.bubble.blame { background: #3a342d; color: #fff7e2; }
.bubble.deny { background: #fffdf6; border: 2px solid #b5503f; color: #b5503f; }
.bubble.bad { background: #b5503f; color: #fff; }
.bubble.you { background: #f4eee0; border: 2px solid #3a342d; }
.meter { position: absolute; left: 0; top: 0; width: 46px; height: 8px; border-radius: 5px; background: rgba(58, 52, 45, 0.3); border: 1.5px solid #fffdf6; overflow: hidden; will-change: transform; }
.meter i { display: block; height: 100%; width: 0; background: #8c8273; transition: width .25s; }
.meter.lead i { background: #b5503f; }
.meter.me { border-color: #3a342d; }

#caption { position: fixed; left: 50%; top: 64px; transform: translate(-50%, -8px); z-index: 2; width: min(94vw, 520px); text-align: center; pointer-events: none; opacity: 0; transition: opacity .25s, transform .25s; }
#caption.show { opacity: 1; transform: translate(-50%, 0); }
#caption b { display: block; font: 900 26px/1.1 Georgia, serif; color: #3a342d; text-shadow: 0 2px 0 #fffdf6, 0 -1px 0 #fffdf6, 1px 0 0 #fffdf6, -1px 0 0 #fffdf6; }
#caption b em { font-style: normal; color: #b5503f; }
#caption.good b em { color: #5d8a00; }
#caption span { display: inline-block; margin-top: 4px; font-size: 14px; font-weight: 800; background: #3a342d; color: #f3e6c4; padding: 3px 10px; border-radius: 10px; }

#toast { position: fixed; left: 50%; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 150px); transform: translate(-50%, 12px); z-index: 3;
  width: max-content; max-width: min(94vw, 460px); background: rgba(58, 52, 45, 0.94); color: #fff7e2; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.3; text-align: center;
  opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

#pad { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 2; width: min(100vw, 560px); display: grid; grid-template-columns: 1.5fr 1fr; gap: 8px;
  padding: 8px 10px max(14px, env(safe-area-inset-bottom)); }
#pad button { position: relative; overflow: hidden; height: 72px; border-radius: 18px; border: 3px solid #3a342d; background: #fffdf6; color: #3a342d; font-size: 17px; font-weight: 900; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; box-shadow: 0 4px 0 #3a342d; }
#pad button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #3a342d; }
#pad button:disabled { opacity: 0.55; cursor: default; box-shadow: 0 2px 0 #3a342d; }
#pad button > span { position: relative; }
#pad kbd { position: relative; font: 700 11px system-ui, sans-serif; color: #6b6355; border: 1px solid #b9ae98; border-radius: 5px; padding: 0 5px; background: rgba(255,255,255,.6); }
body.touch #pad kbd { display: none; }
#gofill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #e9dfc8, #d9867a); }
#go.hot { animation: throb .28s infinite alternate; border-color: #b5503f; }
@keyframes throb { from { transform: scale(1); } to { transform: scale(1.03); } }
#nose .em { font-size: 24px; line-height: 1; }
#nose #noselabel { font-size: 13px; }
#nose.cue { background: #eef6d4; animation: throb .3s infinite alternate; }
#nose.ok { background: #e3efc4; }
#nose.bad { background: #f0d2cc; }

#panel { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(58, 52, 45, 0.4); padding: 14px; overflow-y: auto; }
#panel.hidden { display: none; }
.card { width: min(100%, 430px); background: #fffaf0; border-radius: 20px; padding: 18px 18px 14px; box-shadow: 0 10px 40px rgba(0,0,0,.25); text-align: center; }
.card h1 { margin: 0 0 2px; font: 900 32px Georgia, serif; color: #3a342d; letter-spacing: -0.5px; }
.card .one { margin: 4px 0 12px; font-size: 16px; line-height: 1.35; }
.card .sub { margin: 0 0 10px; color: #6b6355; line-height: 1.35; }
.card p { margin: 8px 0; line-height: 1.4; }
.rules { text-align: left; margin: 8px 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.35; }
.rules li { margin: 7px 0; padding-left: 28px; position: relative; }
.rules .ic { position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: #3a342d; color: #fff7e2; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.result { font-size: 15px; font-weight: 700; margin: 10px 0; }
.result.big { font-size: 20px; }
.unlock { color: #5d8a00; font-weight: 700; }
.row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.row button { min-height: 48px; padding: 0 18px; border-radius: 14px; border: 2px solid #3a342d; background: #fff; font-size: 16px; font-weight: 800; color: #3a342d; cursor: pointer; }
.row button.big { background: #c9e36a; }
.row button:hover { filter: brightness(0.96); }
pre.share { white-space: pre-wrap; font: 13px/1.4 ui-monospace, monospace, "Noto Color Emoji"; background: #f1ead8; border-radius: 10px; padding: 8px; margin: 12px 0 4px; user-select: text; -webkit-user-select: text; }
#ask { border-top: 1px solid #eadfc6; margin-top: 10px; padding-top: 4px; }
#ask .q { font-size: 13px; color: #6b6355; margin: 6px 0; }
#ask .q a, .foot a { color: #5d6f86; }
#ask .chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
#ask .chips button { min-height: 44px; padding: 0 12px; border-radius: 22px; border: 1px solid #c9bfa6; background: #fff; color: #3a342d; font-size: 13px; font-weight: 700; cursor: pointer; }
#door button { min-height: 44px; width: 100%; margin: 8px 0 2px; padding: 6px 12px; border-radius: 14px; border: 1px dashed #a79a7c; background: #f6efdc; color: #5a5040; font-size: 13px; font-weight: 700; cursor: pointer; }
.foot { font-size: 13px; color: #8c8273; }
.card .mark { margin: 0 0 4px; font-size: 12px; color: #8c8273; }
.studio-row { margin-top: 12px; }

@media (min-width: 700px) {
  #hud { width: 640px; }
  #pad { width: 520px; padding-bottom: 18px; }
  #toast { bottom: 128px; }
  #caption b { font-size: 34px; }
  .bubble { font-size: 15px; max-width: 220px; }
}
@media (max-height: 520px) { #pad button { height: 54px; } #toast { bottom: 84px; } }

/* blame lines: voter -> suspect */
#over svg.lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 1.5px #fffdf6) drop-shadow(0 0 1px #fffdf6); }
#over svg.lines path { fill: none; stroke: #3a342d; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 9 5; opacity: 0.85; }
#over svg.lines path.me { stroke: #b5503f; stroke-width: 4.5; opacity: 0.95; }
