:root {
  --bg: #ffd400;
  --ink: #141414;
  --red: #e8261c;
  --red-d: #9e120b;
  --plate: #1d1d1f;
  --cream: #fff6d6;
  --size: min(74vw, 380px);
  --ease: cubic-bezier(.2, .9, .3, 1.2);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); }
body {
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 13px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* top */
.top { width: 100%; max-width: 640px; display: flex; justify-content: space-between; align-items: center; padding: 16px 16px 0; }
.mark { font-family: "Bungee", sans-serif; font-size: 22px; letter-spacing: 1px; }
.ca { display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--bg); border-radius: 999px; padding: 7px 12px; font-size: 11px; max-width: 60vw; }
.ca span { font-weight: 700; opacity: .7; }
.ca b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.panel { width: 100%; max-width: 640px; padding: 0 16px; display: flex; flex-direction: column; align-items: center; }

/* readout */
.readout { text-align: center; margin: 22px 0 18px; }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 8px; }
.odo { display: inline-flex; align-items: center; gap: 3px; background: var(--ink); padding: 8px 10px; border-radius: 10px; box-shadow: inset 0 2px 0 #000, 0 3px 0 rgba(0,0,0,.25); font-family: "Bungee", sans-serif; font-size: clamp(30px, 10vw, 54px); line-height: 1; color: var(--cream); }
.odo .wait { letter-spacing: 6px; opacity: .5; padding: 0 6px; }
.odo .d { display: inline-block; width: .78em; height: 1.1em; overflow: hidden; background: #2b2b2e; border-radius: 4px; position: relative; }
.odo .d::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0,0,0,.6); }
.odo .strip { display: flex; flex-direction: column; transition: transform .45s var(--ease); }
.odo .strip span { height: 1.1em; display: flex; align-items: center; justify-content: center; }
.odo .sep { width: .25em; text-align: center; color: var(--bg); }
.sub { margin-top: 10px; font-size: 12px; }
.sub i { font-style: normal; opacity: .5; padding: 0 4px; }

/* the button */
.housing { position: relative; width: var(--size); height: var(--size); border-radius: 22%; background: var(--plate); box-shadow: 0 10px 0 #000, 0 18px 30px rgba(0,0,0,.25); display: grid; place-items: center; touch-action: manipulation; }
.stripes { position: absolute; inset: 7%; border-radius: 50%; background: repeating-conic-gradient(from 8deg, var(--bg) 0 9deg, var(--ink) 9deg 18deg); }
.collar { position: relative; width: 70%; height: 70%; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #3a3a3e, #0d0d0e 70%); box-shadow: 0 0 0 6px #0b0b0b, inset 0 -6px 12px rgba(255,255,255,.06); display: grid; place-items: center; transition: box-shadow .3s; }
.btn { position: relative; width: 84%; height: 84%; border-radius: 50%; outline: none; }
.btn .cap {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #ff6a5c 0, var(--red) 45%, var(--red-d) 100%);
  box-shadow: 0 14px 0 var(--red-d), 0 18px 18px rgba(0,0,0,.55), inset 0 -10px 20px rgba(0,0,0,.25);
  transform: translateY(-12px);
  transition: transform .09s ease-out, box-shadow .09s ease-out, background .4s;
}
.btn .shine { position: absolute; left: 22%; top: 8%; width: 40%; height: 22%; border-radius: 50%; background: rgba(255,255,255,.35); filter: blur(2px); transform: translateY(-12px) rotate(-18deg); transition: transform .09s ease-out; pointer-events: none; }
.btn.down .cap { transform: translateY(0); box-shadow: 0 2px 0 var(--red-d), 0 4px 6px rgba(0,0,0,.5), inset 0 -4px 12px rgba(0,0,0,.35); }
.btn.down .shine { transform: translateY(0) rotate(-18deg); }
.btn:focus-visible { box-shadow: 0 0 0 4px var(--cream); }
.screw { position: absolute; width: 4.5%; height: 4.5%; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #8a8a90, #3a3a3e); }
.screw::after { content: ""; position: absolute; left: 20%; right: 20%; top: 45%; height: 12%; background: #222; transform: rotate(35deg); }
.s1 { left: 6%; top: 6%; } .s2 { right: 6%; top: 6%; } .s3 { left: 6%; bottom: 6%; } .s4 { right: 6%; bottom: 6%; }
.housing.shake { animation: shake .12s; }
@keyframes shake { 30% { transform: translate(1px, 1px) rotate(.4deg); } 70% { transform: translate(-1px, 0) rotate(-.4deg); } }

/* tiers: the button changes for everyone */
body[data-tier="chrome"] .collar { box-shadow: 0 0 0 6px #c9ccd3, 0 0 0 9px #7c808a, inset 0 -6px 12px rgba(255,255,255,.08); }
body[data-tier="glow"] .collar, body[data-tier="gold"] .collar, body[data-tier="diamond"] .collar { box-shadow: 0 0 0 6px #c9ccd3, 0 0 0 9px #7c808a, 0 0 40px 10px rgba(255,70,50,.65); }
body[data-tier="glow"] .btn .cap { background: radial-gradient(circle at 50% 30%, #ffb3a8 0, #ff3b2b 40%, var(--red-d) 100%); animation: pulse 1.6s infinite; }
body[data-tier="gold"] .btn .cap { background: radial-gradient(circle at 50% 30%, #fff3b0 0, #f5b800 45%, #8a5a00 100%); box-shadow: 0 14px 0 #7a4f00, 0 18px 18px rgba(0,0,0,.55), inset 0 -10px 20px rgba(0,0,0,.2); }
body[data-tier="gold"] .collar { box-shadow: 0 0 0 6px #f5c400, 0 0 0 9px #8a5a00, 0 0 40px 10px rgba(255,200,0,.7); }
body[data-tier="diamond"] .btn .cap { background: conic-gradient(from 20deg, #e8fbff, #8fe3ff, #ffffff, #b9c8ff, #e8fbff, #7fd7ff, #ffffff, #e8fbff); box-shadow: 0 14px 0 #5a8fb0, 0 18px 18px rgba(0,0,0,.55), inset 0 -10px 20px rgba(0,40,80,.25); }
body[data-tier="diamond"] .collar { box-shadow: 0 0 0 6px #e8fbff, 0 0 0 9px #5a8fb0, 0 0 50px 14px rgba(140,220,255,.8); }
body[data-tier="gold"] .btn.down .cap { box-shadow: 0 2px 0 #7a4f00, 0 4px 6px rgba(0,0,0,.5); }
body[data-tier="diamond"] .btn.down .cap { box-shadow: 0 2px 0 #5a8fb0, 0 4px 6px rgba(0,0,0,.5); }
@keyframes pulse { 50% { filter: brightness(1.18); } }

/* dymo tape */
.tape { margin-top: 26px; background: var(--ink); color: #f2f2f2; font-family: "Bungee", sans-serif; font-size: 20px; letter-spacing: 6px; padding: 6px 14px 6px 20px; transform: rotate(-2deg); text-shadow: 0 1px 0 #000, 0 -1px 0 rgba(255,255,255,.25); box-shadow: 0 2px 0 rgba(0,0,0,.25); }

/* goal */
.goal { width: 100%; max-width: 420px; margin-top: 26px; }
.goal-line { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.bar { height: 14px; background: rgba(0,0,0,.12); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--red); transition: width .6s var(--ease); }
.lamps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; text-align: center; font-size: 10px; }
.lamps li .l { display: block; width: 18px; height: 18px; margin: 0 auto 5px; border-radius: 50%; background: #5c4f00; box-shadow: inset 0 -3px 0 rgba(0,0,0,.35); }
.lamps li.on .l { background: radial-gradient(circle at 40% 35%, #fff, var(--red) 60%); box-shadow: 0 0 10px 2px rgba(232,38,28,.6); }
.lamps li b { display: block; font-size: 11px; }

/* who */
.who { margin-top: 24px; text-align: center; font-size: 12px; }
.who b { background: var(--ink); color: var(--bg); padding: 2px 7px; border-radius: 4px; }
.reroll { text-decoration: underline; font-size: 11px; margin-left: 4px; }
.hint { margin-top: 8px; font-size: 11px; opacity: .7; }

/* plaques */
.plaques { width: 100%; max-width: 420px; margin: 26px 0 10px; }
.plaques h2 { font-family: "Bungee", sans-serif; font-size: 16px; font-weight: 400; margin-bottom: 10px; }
.plaques ul { list-style: none; display: grid; gap: 8px; }
.plaques li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 6px; background: linear-gradient(180deg, #e6c45a, #b98b1e); color: #3b2a00; box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 2px 0 rgba(0,0,0,.25); font-size: 12px; }
.plaques li b { font-family: "Bungee", sans-serif; font-weight: 400; font-size: 14px; }
.plaques li .t { font-size: 10px; opacity: .7; white-space: nowrap; }
.plaques li.empty { background: rgba(0,0,0,.08); color: var(--ink); box-shadow: none; justify-content: center; }
.plaques li.me { outline: 3px solid var(--ink); }

/* foot */
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 20px 16px 30px; }
.switch { display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--cream); padding: 8px 12px; border-radius: 8px; font-size: 12px; }
.switch .tog { width: 22px; height: 12px; border-radius: 999px; background: #444; position: relative; }
.switch .tog::after { content: ""; position: absolute; left: 2px; top: 2px; width: 8px; height: 8px; border-radius: 50%; background: #999; transition: left .2s; }
.switch.live .tog, .switch.on .tog { background: var(--red); }
.switch.live .tog::after, .switch.on .tog::after { left: 12px; background: #fff; }
.switch.off { opacity: .5; pointer-events: none; }

/* overlays */
.flash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(255,212,0,.92); animation: fin .25s ease-out; padding: 16px; }
.flash-card { text-align: center; background: linear-gradient(180deg, #f2d36b, #b98b1e); color: #3b2a00; padding: 26px 28px; border-radius: 12px; box-shadow: 0 8px 0 #6e5200, 0 20px 40px rgba(0,0,0,.3); transform: rotate(-2deg); max-width: 92vw; }
.flash-k { font-size: 12px; text-transform: uppercase; letter-spacing: 3px; }
.flash-n { font-family: "Bungee", sans-serif; font-size: clamp(44px, 14vw, 80px); line-height: 1.1; }
.flash-name { font-family: "Bungee", sans-serif; font-size: 18px; margin-top: 4px; }
.flash-s { font-size: 11px; margin-top: 10px; }
.banner { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 40; background: var(--ink); color: var(--bg); font-family: "Bungee", sans-serif; font-size: 16px; padding: 12px 18px; border-radius: 10px; text-align: center; width: max-content; max-width: calc(100vw - 32px); animation: fin .3s var(--ease); }
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40; background: var(--ink); color: var(--cream); font-size: 12px; padding: 9px 14px; border-radius: 8px; width: max-content; max-width: calc(100vw - 32px); text-align: center; }
@keyframes fin { from { opacity: 0; transform: translateX(var(--tx, 0)) scale(.9); } }
.banner { --tx: -50%; }

@media (min-width: 920px) {
  .readout { margin-top: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .housing.shake { animation: none; }
  body[data-tier="glow"] .btn .cap { animation: none; }
  .odo .strip { transition: none; }
}
