html, body {
  margin: 0;
  height: 100%;
  background: #070b12;
  position: fixed;
  inset: 0;
  color: #f4ecdf;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  font-family: "Avenir Next", "Avenir", "Nunito Sans", "Segoe UI", sans-serif;
}

#c {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#shade {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.38) 100%);
  z-index: 2;
}

#grain {
  position: fixed;
  inset: -20px;
  pointer-events: none;
  z-index: 3;
  opacity: 0.045;
  mix-blend-mode: overlay;
}

#ui {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

button, #card, #title, #paused, #hud, #fail {
  pointer-events: auto;
}

button {
  font: 600 18px/1 "Avenir Next", "Avenir", "Nunito Sans", sans-serif;
  color: #f7f1e6;
  background: rgba(8, 10, 16, 0.28);
  border: 1px solid rgba(243, 220, 176, 0.55);
  border-radius: 999px;
  min-height: 56px;
  padding: 0 22px;
  cursor: pointer;
}

button:active {
  transform: translateY(1px) scale(0.985);
  background: rgba(243, 220, 176, 0.2);
}

button:focus-visible {
  outline: 2px solid #f0d7a4;
  outline-offset: 3px;
}

button.primary {
  min-width: 210px;
  background: rgba(240, 214, 168, 0.16);
  border-color: rgba(247, 226, 186, 0.85);
}

button.quiet {
  min-height: 48px;
  font-weight: 500;
  font-size: 16px;
  border-color: rgba(243, 220, 176, 0.28);
}

button:disabled {
  opacity: 0.4;
}

h1, h2, .lede, .meta, .eyebrow, #card-score, #card-detail, #hint, #score {
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

h1, h2 {
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.02em;
}

#title, #card, #paused {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 22px calc(84px + env(safe-area-inset-bottom));
  text-align: center;
  background: linear-gradient(to top, rgba(5, 8, 14, 0.78) 10%, rgba(5, 8, 14, 0.28) 62%, transparent);
}

#title[hidden], #card[hidden], #paused[hidden], #hud[hidden], #fail[hidden], #hint[hidden] {
  display: none;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 14px;
  letter-spacing: 0.18em;
  color: #e6d3b0;
}

h1 {
  font-size: clamp(68px, 12vw, 120px);
  line-height: 0.88;
  color: #f8f2e7;
}

h2 {
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1;
  color: #f8f2e7;
}

.lede, #card-detail, .meta {
  margin: 14px auto 0;
  max-width: 28rem;
  font-size: 18px;
  line-height: 1.35;
  color: #f0e4d0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

.meta {
  font-size: 15px;
  color: #d9cbb6;
}

#hud {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
}

#score {
  font-variant-numeric: tabular-nums;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

#chain {
  display: inline-block;
  margin-left: 8px;
  font-size: 16px;
  color: #f0d7a4;
}

#pips {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

#pips i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 236, 200, 0.35);
}

#pips i.on {
  background: #ffc27a;
  box-shadow: 0 0 10px rgba(255, 184, 96, 0.85);
}

#hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(22vh + env(safe-area-inset-bottom));
  text-align: center;
  pointer-events: none;
  font-size: 20px;
  color: #f6ead8;
}

#dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  padding: 0 14px;
  pointer-events: none;
  z-index: 5;
}

#dock button {
  pointer-events: auto;
  width: 56px;
  height: 56px;
  min-height: 56px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(7, 10, 16, 0.35);
}

#dock button[hidden] {
  display: none;
}

#card-score {
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: clamp(42px, 7vw, 72px);
  margin-top: 8px;
}

#mute[data-muted="1"] #wave,
#mute[data-muted="1"] #wave2 {
  display: none;
}

#cut {
  display: none;
  stroke: #f4eadc;
}

#mute[data-muted="1"] #cut {
  display: block;
}

#dock svg {
  width: 22px;
  height: 22px;
  stroke: #f4eadc;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
}

#fail {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  background: #070b12;
  z-index: 6;
}

.desk {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .desk {
    display: inline;
  }
}

@media (prefers-reduced-motion: reduce) {
  #hint {
    transition: none;
  }
}
