* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #3fa7c9; color: #23313a;
  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; }

#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; }
#haul { display: flex; gap: 6px; font-size: 18px; background: rgba(255, 250, 235, 0.88); border-radius: 12px; padding: 4px 8px; }
#haul span { display: inline-flex; align-items: center; gap: 1px; }
#haul b { font-size: 15px; min-width: 9px; }
#haul .dim { opacity: 0.4; }
#sun { min-width: 0; }
#clock { font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); text-align: center; }
#sun .track { height: 7px; border-radius: 4px; background: rgba(255,255,255,.35); overflow: hidden; }
#sunbar { height: 100%; width: 0; background: linear-gradient(90deg, #ffe14d, #ff9a5c); }
#swats { font-size: 17px; letter-spacing: -2px; }
#swats .gone { filter: grayscale(1); opacity: 0.25; }
.btns { display: flex; gap: 4px; }
.btns button { width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(255, 250, 235, 0.88); font-size: 18px; font-weight: 800; color: #23313a; cursor: pointer; }
#mute.off { text-decoration: line-through; opacity: 0.6; }
#carry { grid-column: 1 / -1; text-align: center; font-size: 13px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); min-height: 0; margin-top: -2px; font-family: system-ui, sans-serif, "Noto Color Emoji"; }
#carry:empty { display: none; }

#toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 3;
  max-width: min(92vw, 460px); background: rgba(35, 49, 58, 0.92); color: #fff; padding: 10px 14px; border-radius: 14px; font-size: 15px; text-align: center;
  opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.float { position: fixed; z-index: 2; transform: translate(-50%, -50%); font-weight: 900; font-size: 18px; color: #fff; pointer-events: none;
  text-shadow: 0 2px 0 rgba(0,0,0,.35); animation: rise 1.1s ease-out forwards; white-space: nowrap; font-family: system-ui, sans-serif, "Noto Color Emoji"; }
.float.good { color: #fffbd0; }
.float.bad { color: #ffdcd6; font-size: 20px; }
@keyframes rise { from { opacity: 1; margin-top: 0; } 70% { opacity: 1; } to { opacity: 0; margin-top: -50px; } }

#panel { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(20, 50, 70, 0.35); padding: 14px; overflow-y: auto; }
#panel.hidden { display: none; }
.card { width: min(100%, 420px); 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 34px Georgia, serif; color: #c2361f; letter-spacing: -0.5px; }
.card .sub { margin: 0 0 10px; color: #4a5a63; }
.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: 6px 0; padding-left: 26px; position: relative; }
.rules .ic { position: absolute; left: 0; top: 0; font-size: 15px; }
.sw { position: absolute; left: 0; top: 2px; width: 18px; height: 14px; border-radius: 3px 9px 9px 3px; }
.sw.y { background: rgba(255, 225, 77, 0.8); }
.sw.r { border: 3px solid #ff4d3d; border-radius: 50%; width: 16px; height: 16px; }
.result { font-size: 18px; font-weight: 700; margin: 10px 0; }
.result.big { font-size: 24px; }
.unlock { color: #2a7a4a; 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 #23313a; background: #fff; font-size: 16px; font-weight: 800; color: #23313a; cursor: pointer; }
.row button.big { background: #ffd34d; }
.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; }
/* the vote and the fake door (result card) */
#ask { border-top: 1px solid #eadfc6; margin-top: 10px; padding-top: 4px; }
#ask .q { font-size: 13px; color: #4a5a63; margin: 6px 0; }
#ask .q a { color: #2f7fa5; }
#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: #23313a; 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 #c79a1e; background: #fff6d6; color: #6b4e00; font-size: 13px; font-weight: 700; cursor: pointer; }
.foot { font-size: 13px; color: #6b7a83; }
.foot a { color: #2f7fa5; }

@media (min-width: 900px) {
  #hud { width: 640px; }
}
