:root {
  --sky: #1c1430;
  --sky-2: #3b2448;
  --dusk: #b4543a;
  --case: #d9772e;
  --case-hi: #f0a050;
  --case-lo: #9a4c1a;
  --brown: #4a2a18;
  --cream: #f6ead0;
  --led: #ff3a2a;
  --ink: #1a1012;
  --brand: 'Righteous', 'Arial Black', sans-serif;
  --body: 'Barlow Condensed', 'Arial Narrow', sans-serif;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--cream);
  font: 500 18px/1.4 var(--body);
  /* A prairie at night: stars over a dark ridge, the last of the dusk at the bottom */
  background:
    radial-gradient(1px 1px at 12% 14%, #fff8, transparent),
    radial-gradient(1px 1px at 28% 32%, #fff6, transparent),
    radial-gradient(1.5px 1.5px at 41% 9%, #fffa, transparent),
    radial-gradient(1px 1px at 63% 22%, #fff7, transparent),
    radial-gradient(1.5px 1.5px at 78% 12%, #fff9, transparent),
    radial-gradient(1px 1px at 88% 38%, #fff6, transparent),
    radial-gradient(1px 1px at 6% 46%, #fff5, transparent),
    radial-gradient(1px 1px at 54% 41%, #fff5, transparent),
    radial-gradient(60px 60px at 84% 18%, #f6ead022, transparent),
    linear-gradient(to bottom, var(--sky) 0%, var(--sky-2) 65%, var(--dusk) 120%);
  background-attachment: fixed;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 50;
  padding: 8px 12px;
  background: var(--cream);
  color: #111;
  font-weight: 700;
}
.skip-link:focus { top: 8px; }

:focus-visible {
  outline: 3px solid #ffe08a;
  outline-offset: 3px;
}

kbd {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 4px;
  margin: 0 1px;
  border: 1px solid #8a6a5a;
  border-bottom-width: 2px;
  border-radius: 3px;
  background: #2a1a2a;
  font: inherit;
  text-align: center;
}

main {
  display: grid;
  grid-template-columns: auto minmax(260px, 420px);
  justify-content: center;
  align-items: start;
  gap: 36px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 36px 16px 70px;
}

/* ---------- the device ---------- */

.device {
  position: relative;
  width: 380px;
  padding: 0 28px 22px;
  border-radius: 120px 120px 40px 40px;
  background:
    radial-gradient(ellipse at 30% 10%, rgba(255, 255, 255, 0.25), transparent 50%),
    linear-gradient(170deg, var(--case-hi), var(--case) 40%, var(--case-lo));
  box-shadow:
    inset 0 3px 0 rgba(255, 230, 200, 0.5),
    inset 0 -6px 0 rgba(0, 0, 0, 0.25),
    0 0 0 4px var(--brown),
    0 22px 50px rgba(0, 0, 0, 0.6);
  text-align: center;
  outline: none;
}
.head { height: 104px; margin: 0 -10px; padding-top: 6px; }
.coyote { width: 100%; height: 100%; }
.coyote .mold { fill: var(--case-lo); stroke: var(--brown); stroke-width: 3; stroke-linejoin: round; }
.coyote .ear-in { fill: var(--brown); opacity: 0.6; }
.coyote .muzzle { fill: var(--case-hi); opacity: 0.6; }
.coyote .nose { fill: var(--ink); }
.coyote .eye { fill: #3a1010; stroke: var(--ink); stroke-width: 2; transition: fill 0.1s; }
.device[data-eyes='watch'] .eye { fill: var(--led); filter: drop-shadow(0 0 4px var(--led)); }
.device[data-eyes='glow'] .eye { fill: #ffb43a; filter: drop-shadow(0 0 4px #ffb43a); }
.device[data-eyes='wink'] #eye-l { fill: var(--led); filter: drop-shadow(0 0 4px var(--led)); }
.device[data-eyes='wink'] #eye-r { fill: #3a1010; }
.device[data-eyes='laugh'] .eye { fill: var(--led); animation: laugh 0.18s steps(2) 6; }
.device[data-eyes='caught'] .eye { fill: #6aff7a; filter: drop-shadow(0 0 4px #6aff7a); }
@keyframes laugh { 50% { fill: #3a1010; } }

.brand {
  margin: -6px 0 12px;
  font: 400 34px/1 var(--brand);
  letter-spacing: 0.06em;
  color: var(--cream);
  text-shadow: 0 2px 0 var(--brown), 0 3px 0 rgba(0, 0, 0, 0.3);
}

.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.readout {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  background: #1a0606;
  box-shadow: inset 0 0 0 3px var(--brown), inset 0 4px 10px rgba(0, 0, 0, 0.8);
}
.digit {
  position: relative;
  width: 26px;
  height: 44px;
}
.digit i {
  position: absolute;
  background: #3a0c0c;
  border-radius: 2px;
}
.digit i.on { background: var(--led); box-shadow: 0 0 6px var(--led); }
.digit i.a, .digit i.d, .digit i.g { left: 4px; right: 4px; height: 4px; }
.digit i.a { top: 0; }
.digit i.g { top: 20px; }
.digit i.d { bottom: 0; }
.digit i.b, .digit i.c, .digit i.e, .digit i.f { width: 4px; height: 18px; }
.digit i.f { left: 0; top: 2px; }
.digit i.b { right: 0; top: 2px; }
.digit i.e { left: 0; bottom: 2px; }
.digit i.c { right: 0; bottom: 2px; }
.readout.blink .digit i.on { animation: dim 1s steps(2) infinite; }
@keyframes dim { 50% { background: #3a0c0c; box-shadow: none; } }

.power {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--brown);
}
.power-track {
  position: relative;
  width: 52px;
  height: 22px;
  border-radius: 11px;
  background: var(--brown);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}
.power-knob {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(#e8e0d0, #a89a88);
  transition: left 0.15s;
}
.power[aria-pressed='true'] .power-knob { left: 27px; }
.power-label { font: 700 12px var(--body); letter-spacing: 0.2em; text-transform: uppercase; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  background: var(--brown);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.6);
}
.light {
  --c: #e33;
  position: relative;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, color-mix(in srgb, var(--c) 45%, #fff 0%), color-mix(in srgb, var(--c) 35%, #000) 70%);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.35), 0 4px 0 rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.05s;
}
.light:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 2px 0 rgba(0, 0, 0, 0.4); }
.light.on, .light.yip {
  background: radial-gradient(circle at 38% 32%, #fff, var(--c) 45%, color-mix(in srgb, var(--c) 70%, #000));
  box-shadow: 0 0 22px var(--c), 0 0 4px #fff inset, 0 4px 0 rgba(0, 0, 0, 0.4);
}
.light.yip { animation: flick 0.06s steps(2) infinite; }
@keyframes flick { 50% { filter: brightness(0.4) hue-rotate(40deg); } }
.light.blink { animation: blinky 0.9s steps(2) infinite; }
@keyframes blinky {
  0% { background: radial-gradient(circle at 38% 32%, #fff, var(--c) 45%, color-mix(in srgb, var(--c) 70%, #000)); box-shadow: 0 0 22px var(--c), 0 4px 0 rgba(0, 0, 0, 0.4); }
}
.light.dim { filter: brightness(1.3) saturate(1.2); }
.light .num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 15px var(--body);
  color: rgba(0, 0, 0, 0.35);
}

.fn { display: flex; justify-content: center; gap: 18px; margin-top: 20px; }
.fn-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brown);
  font: 700 13px var(--body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}
.fn-btn::before {
  content: '';
  width: 58px;
  height: 26px;
  border-radius: 13px;
  background: linear-gradient(#e8e0d0, #a89a88);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
}
.fn-btn.start::before { background: linear-gradient(#8ad07a, #3a8a3a); }
.fn-btn.howl::before { width: 72px; height: 34px; border-radius: 17px; background: linear-gradient(#ff7a5a, #b8261a); }
.fn-btn:active::before { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45); }

.grille {
  height: 26px;
  margin: 18px 50px 0;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.45) 2px, transparent 2.5px) 0 0 / 12px 12px;
}
.small-print {
  margin: 10px 0 0;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #3a1e0e;
}
.small-print a { color: #3a1e0e; }

/* ---------- the manual ---------- */

.manual {
  padding: 18px 20px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: rotate(0.8deg);
}
.manual h2 { margin: 0 0 6px; font: 400 26px var(--brand); color: var(--case-lo); }
.caption { min-height: 2.8em; margin: 0 0 10px; padding: 6px 10px; background: #fff7e2; border-left: 4px solid var(--case); font-size: 19px; }
.games { margin: 0 0 10px; padding: 0; list-style: none; }
.games li { padding: 4px 0; border-bottom: 1px dotted #c9b48a; }
.games button {
  padding: 2px 8px;
  border: 2px solid var(--brown);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: 700 17px var(--body);
  cursor: pointer;
}
.games button[aria-pressed='true'] { background: var(--case-lo); color: #fff; }
.games button b { display: inline-block; min-width: 1em; color: var(--case-lo); }
.games button[aria-pressed='true'] b { color: #fff; }
.games span { display: block; margin: 2px 0 0 4px; font-size: 16px; color: #5a4636; }
.rule { margin: 0 0 10px; font-size: 17px; }
.extra:empty { display: none; }
.extra { margin: 0 0 10px; padding: 8px 10px; background: #fff7e2; font-size: 17px; }
.extra table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.extra th, .extra td { padding: 2px 6px; border-bottom: 1px dotted #c9b48a; text-align: left; }
.extra .fixed { color: #2a7a2a; }
.extra button {
  padding: 4px 10px;
  border: 2px solid var(--brown);
  border-radius: 6px;
  background: #fff;
  font: 700 16px var(--body);
  cursor: pointer;
}
.keys { font-size: 16px; }
.keys summary { cursor: pointer; font-weight: 700; }
.callout-opt { display: block; margin-top: 6px; }

.board { margin-top: 12px; padding: 10px 12px; background: #2a1a2a; color: var(--cream); }
.board[hidden] { display: none; }
.board h3 { margin: 0 0 6px; font: 400 18px var(--brand); color: #ffb43a; }
.board-tabs { display: flex; gap: 6px; margin-bottom: 4px; }
.board-tabs button {
  flex: 1;
  border: 1px solid #8a6a5a;
  border-radius: 6px;
  background: transparent;
  color: var(--cream);
  font: 600 15px var(--body);
  cursor: pointer;
}
.board-tabs button[aria-selected='true'] { background: #5a3a4a; }
.board-list { margin: 0; padding: 0; list-style: none; counter-reset: r; }
.board-list li { display: flex; gap: 8px; counter-increment: r; border-bottom: 1px dashed rgba(246, 234, 208, 0.2); }
.board-list li::before { content: counter(r) '.'; width: 1.6em; opacity: 0.6; }
.board-list .who { flex: 1; letter-spacing: 0.15em; }
.board-list li.you { color: #ffb43a; }
.board-list li.empty { justify-content: center; opacity: 0.7; }
.board-list li.empty::before { content: none; }
#initials-form { margin-top: 8px; }
#initials { width: 4em; padding: 2px 6px; font: 700 18px var(--body); text-transform: uppercase; letter-spacing: 0.15em; }
#initials-form button { font: 700 15px var(--body); }
.form-msg { min-height: 1.2em; margin: 4px 0 0; }

.leave {
  position: fixed;
  right: 14px;
  top: 14px;
  z-index: 10;
  padding: 6px 14px;
  border: 2px solid var(--cream);
  border-radius: 999px;
  background: rgba(28, 20, 48, 0.85);
  color: var(--cream);
  font-weight: 700;
  text-decoration: none;
}

.noscript { text-align: center; padding: 40px; }

/* The share card (#card) */
.share-card main { grid-template-columns: auto 520px; align-items: center; padding: 24px 40px; gap: 60px; }
.share-card .manual, .share-card .leave { display: none; }
.share-card .card-copy { display: block; }
.share-card .device { transform: scale(0.8); transform-origin: center; margin: -70px 0; }
.card-big { margin: 0; font: 400 96px/1 var(--brand); color: #ffb43a; text-shadow: 0 4px 0 var(--case-lo); }
.card-small { margin: 18px 0; font: 600 40px/1.15 var(--body); }
.card-howl { margin: 0; font: 400 34px var(--brand); color: #ff7a5a; }

@media (max-width: 860px) {
  main { grid-template-columns: 1fr; justify-items: center; gap: 26px; padding-top: 60px; }
  .manual { transform: none; width: min(100%, 460px); }
}
@media (max-width: 420px) {
  .device { width: calc(100vw - 24px); padding: 0 16px 18px; border-radius: 90px 90px 30px 30px; }
  .grid { gap: 12px; padding: 14px; }
  .brand { font-size: 28px; }
  .digit { width: 22px; height: 38px; }
  .digit i.b, .digit i.c, .digit i.e, .digit i.f { height: 15px; }
  .digit i.g { top: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .light.yip { animation: none; filter: brightness(0.7) hue-rotate(40deg); }
  .device[data-eyes='laugh'] .eye { animation: none; }
}
