:root {
  --ink: #14120f;
  --paper: #f4efe6;
  --mute: #8d8578;
  --hot: #ff4d2e;
  --gem: #f0b429;
  --line: rgba(244, 239, 230, 0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: var(--ink);
  color: var(--paper);
  font-family: Manrope, "Segoe UI", sans-serif;
  overflow: hidden;
  touch-action: none;
}

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

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.meters {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top));
  left: calc(18px + env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 0.85;
}

.meters b {
  font-family: Unbounded, Manrope, sans-serif;
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.meters span, .scoreline span, .reason {
  color: var(--mute);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.meters small {
  margin-top: 8px;
  color: var(--mute);
  font-size: 13px;
}

#pause {
  pointer-events: auto;
  position: absolute;
  top: calc(18px + env(safe-area-inset-top));
  right: calc(18px + env(safe-area-inset-right));
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  font: 700 14px Manrope, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gems {
  position: absolute;
  right: calc(18px + env(safe-area-inset-right));
  bottom: calc(22px + env(safe-area-inset-bottom));
  font-family: Unbounded, Manrope, sans-serif;
  font-size: 28px;
  color: var(--gem);
}

.gems::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  background: var(--gem);
  border-radius: 50%;
  vertical-align: 1px;
}

.hint {
  position: absolute;
  left: 50%;
  top: calc(18px + env(safe-area-inset-top));
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--hot);
  color: #1a0c08;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 16px;
  font-weight: 700;
}

.panel, .dock {
  position: fixed;
  z-index: 3;
  background: rgba(20, 18, 15, 0.88);
  border: 1px solid var(--line);
}

.panel.left {
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: min(440px, calc(100% - 32px));
  padding: 22px 22px 18px;
  border-radius: 18px;
}

.eyebrow {
  color: var(--hot);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

h1, h2 {
  font-family: Unbounded, Manrope, sans-serif;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

h1 { font-size: clamp(48px, 8vw, 68px); margin-bottom: 10px; }
h2 { font-size: 36px; }

.lead {
  max-width: 28ch;
  color: #d9d0c3;
  line-height: 1.45;
  margin-bottom: 22px;
}

.modes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.go.hard {
  background: #2a1218;
  color: #ffb4a8;
  border: 1px solid #ff4d2e;
}

.help {
  list-style: none;
  margin-top: 22px;
  color: #d9d0c3;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
}

kbd {
  display: inline-block;
  min-width: 1.4em;
  padding: 2px 6px;
  margin-right: 4px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  font-family: inherit;
  text-align: center;
}

.meta {
  margin-top: 18px;
  color: var(--mute);
  font-size: 13px;
}

.dock {
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 18px;
}

.scoreline {
  display: flex;
  gap: 22px;
}

.scoreline b {
  display: block;
  font-family: Unbounded, Manrope, sans-serif;
  font-size: 28px;
  line-height: 1;
}

.reason { margin-top: 6px; }

#over {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  background: rgba(8, 6, 5, 0.62);
  padding: 20px;
}

.death {
  width: min(420px, 100%);
  background: rgba(20, 18, 15, 0.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 22px 22px;
  text-align: center;
}

.death h2 {
  font-size: clamp(40px, 8vw, 56px);
  margin-bottom: 6px;
}

.death .scoreline {
  justify-content: center;
  margin: 18px 0;
}

.death .go {
  width: 100%;
}

@media (max-width: 640px) {
  .panel.left {
    left: 12px;
    right: 12px;
    width: auto;
  }

  .dock {
    flex-direction: column;
    align-items: stretch;
  }

  .go { align-self: stretch; text-align: center; }
}
