:root { --cream: #f3e6cf; --terracotta: #d9734e; --sage: #9db59a; --mustard: #e3b23c; --ink: #2b2a33; --paper: #fffaf0; --line: rgba(43,42,51,.14); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--ink); font: 16px/1.4 "Trebuchet MS", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif, "Noto Color Emoji"; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.plain { padding: 24px; max-width: 60ch; color: var(--cream); }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
[hidden] { display: none !important; }
h2 { font: 800 28px/1.1 "Trebuchet MS", system-ui, sans-serif; margin: 0; letter-spacing: -.01em; }
button { font: 700 15px/1 "Trebuchet MS", system-ui, sans-serif, "Noto Color Emoji"; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
button.go { background: var(--mustard); }
a { color: var(--terracotta); }
kbd { font: 700 12px/1 ui-monospace, Menlo, monospace; padding: 3px 6px; border-radius: 5px; background: var(--paper); border: 1px solid var(--ink); margin: 0 2px; }
.touch-only, .pad-only { display: none !important; }
body.touch .touch-only { display: flex !important; }
body.touch .desk-only { display: none !important; }
body.pad .pad-only { display: block !important; }
body.pad .desk-only, body.pad .touch-only { display: none !important; }

/* the kit's lobby, in this game's colours */
.mp-lobby { --mp-bg: rgba(43,42,51,.55); --mp-card: #2b2a33; --mp-accent: #e3b23c; --mp-accent-ink: #2b2a33; font-family: "Trebuchet MS", system-ui, sans-serif, "Noto Color Emoji"; }
.mp-lobby .mp-card h1 { font: 800 30px/1.1 "Trebuchet MS", system-ui, sans-serif; color: #f3e6cf; }
#mark { position: fixed; left: 12px; bottom: 10px; z-index: 30; }

#hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
#top { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 8px; right: 8px; display: flex; align-items: flex-start; justify-content: center; gap: 10px; }
#scores { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; flex: 1; }
.chip { display: flex; align-items: center; gap: 6px; background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 10px 3px 4px; font-size: 14px; box-shadow: 0 2px 0 var(--ink); }
.chip i { width: 18px; height: 18px; border-radius: 50%; background: var(--c); border: 2px solid var(--ink); }
.chip span { max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip b { font-size: 17px; min-width: 2ch; text-align: right; }
.chip em { font-style: normal; font-weight: 800; color: var(--terracotta); }
.chip.me { background: var(--mustard); }
#timer { order: -1; font: 800 22px/1 ui-monospace, Menlo, Consolas, monospace; background: var(--ink); color: var(--cream); padding: 7px 10px; border-radius: 10px; min-width: 70px; text-align: center; }
#timer.low { background: var(--terracotta); animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
.tag { position: absolute; left: 0; top: 0; font: 800 12px/1 "Trebuchet MS", sans-serif; color: var(--ink); background: var(--paper); border: 2px solid var(--c, var(--ink)); border-radius: 8px; padding: 3px 6px; white-space: nowrap; opacity: .9; }
.tag.me { background: var(--c); }
.tag.scared { background: var(--terracotta); color: #fff; font-size: 16px; }
.float { position: absolute; transform: translate(-50%, -50%); font: 900 18px/1 "Trebuchet MS", sans-serif; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; animation: rise 1.1s ease-out forwards; white-space: nowrap; }
.float.mine { font-size: 22px; }
@keyframes rise { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
#toast { position: absolute; left: 50%; top: 70px; transform: translateX(-50%) scale(.9); background: var(--ink); color: var(--cream); font-weight: 800; padding: 8px 14px; border-radius: 12px; opacity: 0; transition: opacity .15s, transform .15s; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
#toast.on { opacity: 1; transform: translateX(-50%) scale(1); }
#hint { position: absolute; left: 14px; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 90px); max-width: min(360px, calc(100vw - 28px)); background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 0 3px 0 var(--ink); padding: 7px 11px; font-size: 14px; font-weight: 700; line-height: 1.3; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
#hint.on { opacity: 1; transform: none; }
body:not(.touch) #hint { left: 24px; bottom: 160px; }
#clip:disabled { opacity: .6; cursor: default; }
/* a phone: score chips stay on one line; with 3 or 4 cats, the name tags over the cats carry the names */
@media (max-width: 520px) {
  #top { gap: 6px; left: 6px; right: 6px; }
  #scores { gap: 4px; flex-wrap: nowrap; }
  .chip { gap: 4px; padding: 2px 7px 2px 3px; font-size: 13px; white-space: nowrap; flex: none; }
  .chip span { max-width: 6ch; }
  .chip b { font-size: 15px; }
  #scores.many .chip span { display: none; }
  #scores.many .chip i { width: 14px; height: 14px; }
  #timer { font-size: 19px; min-width: 58px; padding: 6px 7px; }
  #end .row:not(.scroll) { flex-wrap: nowrap; gap: 6px; }
  #end .row:not(.scroll) button { padding: 0 8px; font-size: 13px; flex: 1 1 auto; white-space: nowrap; }
}
#placing { position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%); background: var(--mustard); border: 2px solid var(--ink); border-radius: 10px; padding: 6px 12px; font-weight: 800; }
#stick { position: absolute; width: 110px; height: 44px; margin: -22px 0 0 -55px; border-radius: 22px; background: rgba(255,250,240,.35); border: 2px solid rgba(43,42,51,.5); }
#knob { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
#card, #paw, #jump-btn { pointer-events: auto; position: absolute; bottom: max(14px, env(safe-area-inset-bottom)); width: 78px; height: 78px; padding: 0; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
#card { left: 14px; background: #cfe3c9; }
#card .ico { font-size: 32px; line-height: 1; }
#card .ico.wait { font: 800 24px/1 ui-monospace, monospace; }
#card small, #paw small, #jump-btn small { font-size: 11px; }
#card.empty { background: #ddd3c3; opacity: .85; }
#card.armed { background: var(--mustard); outline: 3px solid var(--terracotta); }
#paw { right: 14px; font-size: 32px; background: var(--mustard); }
#jump-btn { right: 102px; width: 72px; height: 72px; font-size: 28px; }
#card, #paw, #jump-btn { touch-action: none; }
#card.down, #paw.down, #jump-btn.down { transform: translateY(2px) scale(.95); filter: brightness(.92); }
#keys, #padkeys { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: rgba(255,250,240,.88); border: 2px solid var(--ink); border-radius: 10px; padding: 5px 10px; font-size: 13px; white-space: nowrap; }
body:not(.touch) #card { left: 24px; bottom: 60px; width: 110px; height: 86px; }
body:not(.touch) #card::after { content: "E"; position: absolute; top: 4px; right: 6px; font: 700 11px/1 ui-monospace, monospace; opacity: .6; }
body.pad #card::after { content: "Y"; }

#count { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; pointer-events: none; }
#count > div { display: grid; justify-items: center; gap: 6px; background: rgba(255,250,240,.92); border: 3px solid var(--ink); border-radius: 18px; padding: 14px 22px; box-shadow: 0 5px 0 var(--ink); max-width: 86vw; text-align: center; }
#count b { font: 900 64px/1 "Trebuchet MS", sans-serif; color: var(--terracotta); }
#count small { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
#count span { font-size: 14px; }

#end { position: fixed; inset: 0; z-index: 5; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
#end .panel { pointer-events: auto; width: min(520px, 100%); max-height: 64%; overflow-y: auto; background: var(--paper); border: 3px solid var(--ink); border-bottom: 0; border-radius: 20px 20px 0 0; padding: 14px 16px 10px; display: grid; gap: 8px; box-shadow: 0 -4px 0 rgba(43,42,51,.25); }
#replay-label { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); margin: 0; background: var(--ink); color: var(--cream); padding: 6px 12px; border-radius: 10px; font-weight: 800; font-size: 14px; white-space: nowrap; max-width: 94vw; overflow: hidden; text-overflow: ellipsis; }
#replay-label:empty { display: none; }
#end small { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #7a6f60; }
#end p { margin: 0; }
#end-table { width: 100%; border-collapse: collapse; font-size: 14px; }
#end-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7a6f60; padding: 2px 4px; }
#end-table td { padding: 5px 4px; border-top: 1px solid var(--line); }
#end-table td:first-child { border-left: 6px solid var(--c); padding-left: 8px; font-weight: 700; }
#end-table tr.me td { background: #fbefc9; }
#end-match { font-weight: 800; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.row.scroll button { flex: none; font-size: 13px; min-height: 40px; }
.next { font-size: 13px; color: #7a6f60; }
#door-btn { width: 100%; background: #e9e1d2; font-size: 14px; }
#vote p { font-weight: 700; margin-bottom: 4px; }
@media (min-width: 900px) {
  #end { align-items: center; justify-content: flex-end; padding-right: 3vw; }
  #end .panel { max-height: 92vh; border-radius: 20px; border-bottom: 3px solid var(--ink); width: 420px; }
  #replay-label { left: 34%; }
}
