/* ==========================================================================
   Bug Hunt — the footer is the game.

   The stage runs the full width of the page; everything the player needs
   floats on top of it. Only the UI lives here: the world, the hero and the
   twelve creatures are all drawn in js/bughunt.js.
   ========================================================================== */

.hunt {
  padding-top: clamp(2.5rem, 5vw, 4.5rem);
}
.hunt-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: clamp(18px, 2.4vw, 30px);
}
.hunt-intro .eyebrow {
  margin-bottom: 12px;
}
.hunt-intro h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.045em;
}
.hunt-intro > p {
  max-width: 46ch;
  margin: 0;
  color: var(--grey);
  font-size: 14px;
  line-height: 1.6;
}

/* No JavaScript, no game: show the note instead of a dead machine. */
html:not(.js) .hunt-stage,
html:not(.js) .hunt-foot {
  display: none;
}

/* ---------- The stage: full bleed, and the only thing that scrolls is you --- */
.hunt-stage {
  position: relative;
  isolation: isolate;
  height: clamp(440px, 64vh, 680px);
  border-block: 1px solid #262729;
  background: #0b0c0d;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
/* The stage never swallows a vertical swipe — a thumb has to be able to
   scroll past a game that is two thirds of the screen tall. The pad buttons
   take their own touches, and nothing else on the canvas wants a drag. */
/* The buffer is small and blown up with the pixels left hard. */
.hunt-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
/* A cabinet's worth of scanline and a little falloff at the corners. The
   stage draws them once; the game loop never touches them. */
.hunt-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(rgba(0, 0, 0, 0.17) 0 1px, rgba(0, 0, 0, 0) 1px 3px),
    radial-gradient(130% 115% at 50% 48%, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, 0.55) 100%);
}
@media (prefers-reduced-motion: reduce) {
  .hunt-stage::after {
    background: radial-gradient(130% 115% at 50% 48%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.45) 100%);
  }
}
.hunt-canvas:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: -4px;
}

/* ---------- Shared furniture ---------- */
.hunt .bar {
  display: block;
  width: 100%;
  height: 7px;
  border-radius: 4px;
  background: #ffffff1a;
  overflow: hidden;
}
.hunt .bar b {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: var(--tint, var(--white));
  transition: width 0.4s var(--ease-soft), background-color 0.3s linear;
}
.hunt .bar b[data-low='1'] {
  background: #ffb259;
}
.hunt .bar b[data-low='2'] {
  background: var(--error);
}
.hunt button {
  border: 1px solid #3b3d40;
  border-radius: 999px;
  background: #0f1012;
  color: var(--soft);
  font: 11px/1.4 var(--mono);
  cursor: pointer;
  touch-action: manipulation;
}
.hunt button:hover:not(:disabled) {
  border-color: #85867f;
  color: var(--white);
}
.hunt button:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}
.hunt button:disabled {
  opacity: 0.38;
  cursor: default;
}

/* ---------- Heads-up display ---------- */
.hunt-hud {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: clamp(10px, 1.6vw, 16px) clamp(12px, 2.4vw, 26px);
  background: linear-gradient(#0b0c0dd9, #0b0c0d00);
  pointer-events: none;
}
.hunt-hud > * {
  pointer-events: auto;
}
.hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 6px 13px;
  border: 1px solid #34363a;
  border-radius: 999px;
  background: #101113cc;
  backdrop-filter: blur(6px);
  font: 11px/1 var(--mono);
  color: var(--soft);
  white-space: nowrap;
}
.hud-zone i {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--live);
  box-shadow: 0 0 10px #3ddc8488;
}
.hud-focus {
  min-width: 170px;
}
.hud-focus .hud-key {
  color: var(--grey);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 9px;
}
.hud-focus .bar {
  flex: 1;
  min-width: 56px;
}
.hud-num {
  font-variant-numeric: tabular-nums;
  color: var(--white);
}
.hud-dex {
  margin-left: auto;
}
.hunt-hud .hud-dex {
  font-family: var(--mono);
}

/* ---------- Sign boards ---------- */
.hunt-say {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: clamp(14px, 3vw, 26px);
  width: min(620px, calc(100% - 28px));
  transform: translateX(-50%);
  padding: 16px 18px 14px;
  border: 1px solid #3a3c40;
  border-radius: 14px;
  background: #0e0f11f2;
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 50px #000000aa;
}
.hunt-say[hidden] {
  display: none;
}
.hunt-say p {
  margin: 0;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.6;
}
.hunt-say p b {
  display: block;
  margin-bottom: 4px;
  color: var(--white);
  font: 10px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hunt-say-more {
  display: block;
  margin-top: 10px;
  color: var(--dim);
  font: 10px/1 var(--mono);
}

/* ---------- Thumb controls ---------- */
.hunt-pad {
  position: absolute;
  z-index: 3;
  inset: auto 0 0;
  display: none;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px;
  pointer-events: none;
}
.hunt[data-hunt='walk'] .hunt-pad {
  display: flex;
}
.pad-dir {
  display: grid;
  grid-template: repeat(3, 46px) / repeat(3, 46px);
  gap: 4px;
}
.hunt-pad button {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #15161999;
  backdrop-filter: blur(6px);
  pointer-events: auto;
  touch-action: none;
}
.hunt-pad button svg {
  width: 20px;
  height: 20px;
}
.hunt-pad button.is-down {
  background: var(--white);
  border-color: var(--white);
  color: #0b0c0d;
}
.pad-dir [data-walk='up'] {
  grid-area: 1 / 2;
}
.pad-dir [data-walk='left'] {
  grid-area: 2 / 1;
}
.pad-dir [data-walk='right'] {
  grid-area: 2 / 3;
}
.pad-dir [data-walk='down'] {
  grid-area: 3 / 2;
}
.pad-a {
  width: 62px;
  height: 62px;
  font-size: 13px !important;
  letter-spacing: 0.1em;
}

/* ---------- The gate: before you start, and after you faint ---------- */
.hunt-gate {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: #0b0c0de8;
  backdrop-filter: blur(4px);
}
.hunt-gate[hidden] {
  display: none;
}
.hunt-gate img {
  width: 64px;
  height: 92px;
  object-fit: contain;
}
.hunt-gate h3 {
  margin: 0;
  font-size: clamp(22px, 3.4vw, 36px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
}
.hunt-gate p {
  max-width: 44ch;
  margin: 0;
  color: #b4b4ae;
  font-size: 13.5px;
  line-height: 1.6;
}
.hunt-go {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-height: 46px;
  margin-top: 6px;
  padding: 10px 24px;
  border-color: #f3f3f0 !important;
  background: #f3f3f0 !important;
  color: #171817 !important;
  font: 600 13px/1.4 var(--sans) !important;
}
.hunt-go:hover {
  background: #fff !important;
  border-color: #fff !important;
}
.hunt-keys {
  color: var(--dim) !important;
  font: 10px/1.6 var(--mono) !important;
}

/* ---------- The battle ---------- */
/* On a wide page the stage is much wider than a fight wants to be, so the
   whole thing sits in a column down the middle. */
.hunt-battle {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  background: #07080a;
}
.hunt-battle[hidden] {
  display: none;
}
/* The scene fills the upper part of the panel; the cards sit over it the way
   they always have — the bug's at the top left, yours at the bottom right. */
.fight {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
}
.fight-scene {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Score cards: a dark plate with a hard drop shadow and a stripe of the
   creature's own colour down the side, sliding in once the scene opens. */
.hunt .card {
  position: absolute;
  width: min(280px, 42%);
  padding: 9px 12px 10px 15px;
  border: 2px solid #2c2f35;
  border-radius: 4px;
  background:
    linear-gradient(180deg, #ffffff0d, #ffffff00 42%),
    #0c0d10f2;
  box-shadow:
    inset 0 1px 0 #ffffff14,
    4px 4px 0 #000000b3;
  overflow: hidden;
}
.hunt .card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--tint, var(--white));
  box-shadow: 0 0 12px var(--tint, var(--white));
}
.card-you {
  --tint: #4a7fe0;
}
.card-foe {
  top: clamp(16px, 6%, 34px);
  left: clamp(12px, 4%, 40px);
  animation: card-in-left 0.5s 0.35s cubic-bezier(0.2, 0.9, 0.25, 1.15) backwards;
}
.card-you {
  right: clamp(12px, 4%, 40px);
  bottom: clamp(14px, 6%, 30px);
  animation: card-in-right 0.5s 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.15) backwards;
}
@keyframes card-in-left {
  from { transform: translateX(-130%); }
  to { transform: none; }
}
@keyframes card-in-right {
  from { transform: translateX(130%); }
  to { transform: none; }
}
/* Taking a hit: a hard sideways judder. Caught: a flash of the tint. */
.hunt .card.is-hit {
  animation: card-hit 0.36s steps(6) both;
}
@keyframes card-hit {
  0%, 100% { transform: none; }
  20% { transform: translate(-5px, 1px); }
  40% { transform: translate(4px, -1px); }
  60% { transform: translate(-3px, 0); }
  80% { transform: translate(2px, 0); }
}
.hunt .card.is-caught {
  animation: card-caught 0.9s ease-out both;
}
@keyframes card-caught {
  0% { box-shadow: inset 0 0 0 2px #9fe8ff, 0 0 0 0 #9fe8ffaa, 4px 4px 0 #000000b3; }
  100% { box-shadow: inset 0 1px 0 #ffffff14, 0 0 0 14px #9fe8ff00, 4px 4px 0 #000000b3; }
}
.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}
.card-top strong {
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card-tag {
  padding: 3px 6px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font: 8.5px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tint, var(--grey));
}
.card-you .card-tag {
  color: #8ab2f8;
}
/* Health in the battle is a segmented meter with an HP plate, and the
   part you just lost hangs on for a moment in red before it drains. */
.hunt .card .bar {
  position: relative;
  height: 9px;
  padding: 1px;
  border: 1px solid #000;
  border-radius: 2px;
  background: #1a1c20;
  box-shadow: inset 0 0 0 1px #ffffff12;
}
.hunt .card .bar::after {
  content: '';
  position: absolute;
  inset: 1px;
  z-index: 2;
  background: repeating-linear-gradient(90deg, #0000 0 9px, #00000073 9px 10px);
  pointer-events: none;
}
.hunt .card .bar b {
  position: relative;
  z-index: 1;
  border-radius: 1px;
  background: linear-gradient(180deg, #a4f0b6 0 35%, #3ddc84 35% 100%);
  transition: width 0.45s steps(12), background 0.2s linear;
}
.hunt .card .bar b[data-low='1'] {
  background: linear-gradient(180deg, #ffd59a 0 35%, #ffb259 35% 100%);
}
.hunt .card .bar b[data-low='2'] {
  background: linear-gradient(180deg, #ffb3b3 0 35%, #ff5c5c 35% 100%);
  animation: low-blink 0.8s steps(2) infinite;
}
@keyframes low-blink {
  50% { filter: brightness(1.5); }
}
.hunt .card .bar::before {
  content: '';
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 1px;
  width: calc(var(--ghost, 100%) - 2px);
  max-width: calc(100% - 2px);
  background: #ff6b6b;
  transition: width 0.5s 0.45s ease-in;
}
.card-sub {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
  color: var(--soft);
  font: 10px/1 var(--mono);
  font-variant-numeric: tabular-nums;
}

/* The dialogue box: a framed panel along the bottom, the log typing out
   across it and the moves underneath. */
.fight-foot {
  position: relative;
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding: clamp(10px, 1.6vw, 16px) clamp(12px, 3vw, 44px) clamp(12px, 2vw, 22px);
}
.fight-log {
  position: relative;
  min-height: 3.2em;
  margin: 0;
  padding: 10px 30px 10px 14px;
  border: 2px solid #2c2f35;
  border-radius: 4px;
  background: #0c0d10;
  box-shadow: inset 0 1px 0 #ffffff12, 0 3px 0 #000;
  color: var(--soft);
  font: 12.5px/1.45 var(--mono);
}
.log-type {
  display: block;
  animation: log-type 0.45s steps(26) backwards;
}
.fight-log::after {
  content: '';
  position: absolute;
  right: 12px;
  bottom: 10px;
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-top: 6px solid #f3f3f0;
  border-bottom: 0;
  animation: log-more 0.9s steps(2) infinite;
}
@keyframes log-type {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes log-more {
  50% { transform: translateY(3px); opacity: 0.4; }
}
.fight-log em {
  color: var(--white);
  font-style: normal;
}

.fight-moves {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* The two decisive buttons join the same row rather than starting a new one. */
.fight-extra {
  display: contents;
}
/* Each move is a chunky key: a stripe of its own colour, a keycap in the
   corner, a hard shadow it presses down into. */
.hunt .move {
  position: relative;
  flex: 1 1 140px;
  display: grid;
  gap: 3px;
  min-height: 54px;
  padding: 9px 30px 9px 14px;
  border: 2px solid #2c2f35;
  border-radius: 4px;
  background:
    linear-gradient(180deg, #ffffff0a, #ffffff00 50%),
    #111216;
  box-shadow: 0 4px 0 #000, inset 0 1px 0 #ffffff12;
  text-align: left;
  overflow: hidden;
  transition:
    transform 0.12s steps(2),
    box-shadow 0.12s steps(2),
    border-color 0.15s linear,
    background-color 0.15s linear;
  animation: move-in 0.42s calc(0.65s + var(--i, 0) * 0.06s) cubic-bezier(0.2, 0.9, 0.25, 1.2) backwards;
}
@keyframes move-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.hunt .move::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--mc, #f3f3f0);
}
/* A sheen that passes over a key when you point at it. */
.hunt .move::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #0000 30%, #ffffff1f 45%, #0000 60%);
  transform: translateX(-120%);
  pointer-events: none;
}
.hunt .move:hover:not(:disabled) {
  border-color: var(--mc, #85867f);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #000, 0 0 18px -4px var(--mc, #fff), inset 0 1px 0 #ffffff1f;
}
.hunt .move:hover:not(:disabled)::after {
  transform: translateX(120%);
  transition: transform 0.55s ease-out;
}
.hunt .move:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0 0 #000, inset 0 2px 0 #00000080;
}
.hunt .move:disabled {
  opacity: 0.42;
  filter: saturate(0.3);
}
.move-name {
  color: var(--white);
  font-size: 11.5px;
  font-weight: 600;
}
.move-hint {
  color: var(--dim);
  font-size: 9.5px;
  line-height: 1.3;
}
.move:hover:not(:disabled) .move-hint {
  color: var(--grey);
}
.move-key {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border: 1px solid #3b3e45;
  border-bottom-width: 2px;
  border-radius: 3px;
  background: #1a1c21;
  color: var(--mc, var(--soft));
  font: 600 9px/1 var(--mono);
}

/* Commit the fix: the white key, with the capsule on it. */
.hunt .move-commit {
  --mc: #4a7fe0;
  padding-left: 46px;
  border-color: #f3f3f0;
  background:
    linear-gradient(180deg, #ffffff 0 50%, #e6e5df 50% 100%);
  color: #171817;
  box-shadow: 0 4px 0 #8e9096, inset 0 1px 0 #fff;
}
.hunt .move-commit .move-name,
.hunt .move-commit .move-hint {
  color: #171817;
}
.hunt .move-commit .move-hint {
  opacity: 0.7;
}
.hunt .move-commit:hover:not(:disabled) {
  border-color: #fff;
  box-shadow: 0 6px 0 #8e9096, 0 0 22px -2px #6f9cff, inset 0 1px 0 #fff;
}
.hunt .move-commit:active:not(:disabled) {
  box-shadow: 0 0 0 #8e9096, inset 0 2px 0 #0000001f;
}
.hunt .move-commit .move-key {
  border-color: #c9c9c3;
  background: #f3f3f0;
  color: #2c58ae;
}
/* The capsule, in CSS: blue over white, a band, and the button. */
.move-ball {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  border: 2px solid #07080a;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #f3f3f0 0 3px, #07080a 3px 5.5px, transparent 5.5px),
    linear-gradient(180deg, #4a7fe0 0 44%, #07080a 44% 56%, #ecebe5 56% 100%);
  box-shadow: inset -3px -3px 0 #00000033, inset 2px 2px 0 #ffffff55;
}
.hunt .move-commit:hover:not(:disabled) .move-ball {
  animation: ball-wiggle 0.5s steps(4) infinite;
}
@keyframes ball-wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-16deg); }
  75% { transform: rotate(16deg); }
}
.hunt .move-commit[data-hot='1']:not(:disabled) .move-ball {
  animation: ball-ready 1.4s ease-in-out infinite;
}
@keyframes ball-ready {
  0%, 100% { box-shadow: inset -3px -3px 0 #00000033, inset 2px 2px 0 #ffffff55, 0 0 0 0 #6f9cff00; }
  50% { box-shadow: inset -3px -3px 0 #00000033, inset 2px 2px 0 #ffffff55, 0 0 0 5px #6f9cff66; }
}
.hunt .move-flee {
  --mc: #8e9096;
}

/* ---------- The Bugdex ---------- */
.hunt-dex {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  background: #0b0c0df5;
  backdrop-filter: blur(6px);
}
.hunt-dex[hidden] {
  display: none;
}
.dex-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(14px, 2.4vw, 24px) clamp(14px, 3vw, 40px) 14px;
  border-bottom: 1px solid #242527;
}
.dex-head h3 {
  margin: 6px 0 0;
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 600;
  letter-spacing: -0.035em;
}
.dex-head button {
  min-height: 38px;
  padding: 9px 16px;
}
.dex-list {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(14px, 2.4vw, 24px) clamp(14px, 3vw, 40px);
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.dex-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid #242527;
  border-radius: 14px;
  background: #0f1012;
}
.dex-item canvas {
  flex: none;
  width: 88px;
  height: 88px;
}
.dex-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.dex-name span {
  color: var(--dim);
  font: 10px/1 var(--mono);
}
.dex-real {
  margin: 0 0 6px;
  color: var(--tint, var(--grey));
  font: 9.5px/1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.dex-note {
  margin: 0;
  color: var(--grey);
  font-size: 12px;
  line-height: 1.5;
}
.dex-item.is-locked .dex-name,
.dex-item.is-locked .dex-note {
  color: var(--dim);
}

/* ---------- Under the stage ---------- */
.hunt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-block: 14px 4px;
}
.hunt-help {
  margin: 0;
  color: #8d8f8b;
  font-size: 11px;
  line-height: 1.6;
}
.hunt-tools {
  display: flex;
  gap: 8px;
}
.hunt-tools button {
  min-height: 36px;
  padding: 9px 14px;
}

/* ---------- Narrow ---------- */
@media (max-width: 860px) {
  .fight-moves {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .fight-extra {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .hunt-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .hunt-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
@media (max-width: 639px) {
  .hunt-stage {
    height: clamp(420px, 72vh, 580px);
  }
  .hunt-hud {
    gap: 6px;
    flex-wrap: wrap;
  }
  .hud-chip {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 10px;
  }
  .hud-focus {
    min-width: 128px;
  }
  .hud-zone span {
    max-width: 84px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hunt .card {
    width: min(196px, 54%);
    padding: 6px 9px 7px 12px;
  }
  .card-top strong {
    font-size: 12.5px;
  }
  .fight-log {
    min-height: 3.6em;
    font-size: 11.5px;
  }
  .hunt .move {
    min-height: 46px;
    padding: 7px 26px 7px 12px;
  }
  .hunt .move-commit {
    padding-left: 42px;
  }
  .move-ball {
    left: 11px;
  }
  .fight-log {
    padding: 8px 26px 8px 11px;
  }
  .move-name {
    font-size: 11px;
  }
  .move-hint {
    display: none;
  }
  .hunt .move-commit .move-hint {
    display: block;
  }
  .hunt-say {
    bottom: 10px;
    padding: 13px 14px 11px;
  }
  .hunt-say p {
    font-size: 13px;
  }
  .pad-dir {
    grid-template: repeat(3, 42px) / repeat(3, 42px);
  }
  .pad-a {
    width: 56px;
    height: 56px;
  }
  .dex-list {
    grid-template-columns: 1fr;
  }
}

/* A pointer that cannot hover is a thumb; give it the pad and a bigger gate. */
@media (hover: none) {
  .hunt-keys {
    display: none;
  }
}
@media (hover: hover) and (pointer: fine) {
  .hunt-pad {
    display: none !important;
  }
}

/* ---------- Polish: the gate, the HUD and the Bugdex ---------- */
.hunt-gate {
  background:
    radial-gradient(60% 55% at 50% 45%, #4a7fe01f, #0000 70%),
    repeating-linear-gradient(0deg, #ffffff05 0 1px, #0000 1px 4px),
    #090a0ce6;
}
.hunt-gate img {
  filter: drop-shadow(0 6px 0 #00000080);
  animation: gate-bob 1.6s steps(4) infinite;
}
@keyframes gate-bob {
  50% { transform: translateY(-5px); }
}
.hunt-go {
  border-radius: 4px !important;
  box-shadow: 0 4px 0 #8e9096;
  transition: transform 0.12s steps(2), box-shadow 0.12s steps(2);
}
.hunt-go:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #8e9096, 0 0 26px -4px #6f9cff;
}
.hunt-go:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #8e9096;
}
.hunt-go span {
  display: inline-block;
  animation: go-nudge 1s steps(2) infinite;
}
@keyframes go-nudge {
  50% { transform: translateX(3px); }
}
.hud-chip,
.hunt .hud-chip {
  border-width: 2px;
  border-color: #2c2f35;
  border-radius: 4px;
  box-shadow: 0 3px 0 #000000a6;
}
.hud-zone i {
  animation: low-blink 1.6s steps(2) infinite;
}
.hunt .hud-focus .bar {
  height: 8px;
  border-radius: 2px;
  border: 1px solid #000;
}
.hunt .hud-focus .bar b {
  border-radius: 1px;
  background: linear-gradient(180deg, #a4f0b6 0 35%, #3ddc84 35% 100%);
}
.hunt .hud-focus .bar b[data-low='1'] {
  background: linear-gradient(180deg, #ffd59a 0 35%, #ffb259 35% 100%);
}
.hunt .hud-focus .bar b[data-low='2'] {
  background: linear-gradient(180deg, #ffb3b3 0 35%, #ff5c5c 35% 100%);
}
.hunt-say {
  border: 2px solid #2c2f35;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 #ffffff12, 4px 4px 0 #000000b3;
  animation: say-in 0.28s steps(4) backwards;
}
@keyframes say-in {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0); }
}
.hunt-pad button {
  border-width: 2px;
  border-radius: 6px;
  box-shadow: 0 3px 0 #000000b3;
}
.hunt-pad button.is-down {
  transform: translateY(3px);
  box-shadow: none;
}
.dex-item {
  position: relative;
  border-width: 2px;
  border-radius: 4px;
  box-shadow: 4px 4px 0 #00000080;
  transition: transform 0.15s steps(2), border-color 0.15s linear;
}
.dex-item.is-caught {
  border-color: color-mix(in srgb, var(--tint) 40%, #242527);
  background:
    radial-gradient(90px 90px at 44px 44px, color-mix(in srgb, var(--tint) 16%, transparent), transparent 70%),
    #0f1012;
}
.dex-item.is-caught:hover {
  transform: translateY(-2px);
  border-color: var(--tint);
}
.dex-item canvas {
  image-rendering: auto;
}
.dex-item.is-locked canvas {
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  .hunt .bar b,
  .hunt .card .bar::before {
    transition: none;
  }
  .hunt .card,
  .hunt .move,
  .log-type,
  .hunt-say,
  .hunt-gate img,
  .hunt-go span,
  .move-ball {
    animation: none !important;
  }
}
