/* Not a Robot: one device holds the HUD (score · lives), the instruction, the timer row and the play area.
   Challenge boxes are real, clickable checkboxes sized by --s (set per box in not-a-robot.js).
   PERF: nothing here gives a box opacity, filter or transform. Tints are accent-color (the .c-* classes),
   empties are disabled, hiding is visibility, and only the whole device shakes. */

.toy.not-a-robot .nar-dev {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 12px 14px 14px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.toy.not-a-robot .nar-dev.ok {
  border-color: var(--green);
}

.toy.not-a-robot .nar-dev.up {
  border-color: var(--gold);
}

.toy.not-a-robot .nar-dev.bad {
  border-color: var(--red);
  animation: nar-shake 0.4s ease-out;
}

/* ---------- HUD: score · lives ---------- */
.toy.not-a-robot .nar-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 9px;
  border-bottom: 2px solid var(--line);
}

.toy.not-a-robot .nar-score {
  display: flex;
  width: 90px;
}

.toy.not-a-robot .nar-lives {
  display: flex;
  gap: 7px;
}

.toy.not-a-robot .nar-lives input {
  width: 22px;
  height: 22px;
  margin: 0;
  pointer-events: none;
}

/* ---------- instruction + timer row ---------- */
.toy.not-a-robot .nar-word {
  display: flex;
  justify-content: center;
  margin: 16px 0 14px;
}

.toy.not-a-robot .nar-timer {
  display: flex;
  justify-content: space-between;
  padding: 0 1px;
}

.toy.not-a-robot .nar-timer input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  pointer-events: none;
}

.toy.not-a-robot .nar-timer.low input {
  accent-color: var(--red);
}

/* ---------- play area ---------- */
.toy.not-a-robot .nar-play {
  position: relative;
  height: 272px;
  margin-top: 12px;
  touch-action: none;
}

.toy.not-a-robot .nar-layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.toy.not-a-robot .nar-layer.done,
.toy.not-a-robot .nar-layer.wait {
  pointer-events: none;
}

.toy.not-a-robot .nar-dev.paused .nar-layer {
  visibility: hidden;
}

.toy.not-a-robot .nar-box {
  flex: none;
  width: var(--s, 48px);
  height: var(--s, 48px);
  margin: 0;
  cursor: pointer;
}

.toy.not-a-robot .nar-box:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

/* after a fail: the one you wanted */
.toy.not-a-robot .nar-box.nar-was {
  outline: 3px dashed var(--green);
  outline-offset: 3px;
}

.toy.not-a-robot .nar-abs {
  position: absolute;
}

.toy.not-a-robot .nar-flow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--g, 12px);
}

.toy.not-a-robot .nar-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

/* read-outs: hold / mash progress, the pattern to copy */
.toy.not-a-robot .nar-minis {
  display: flex;
  gap: 6px;
}

.toy.not-a-robot .nar-target {
  display: grid;
  grid-template-columns: repeat(3, 22px);
  gap: 4px;
}

.toy.not-a-robot .nar-mini {
  width: 18px;
  height: 18px;
  margin: 0;
  pointer-events: none;
}

.toy.not-a-robot .nar-target .nar-mini {
  width: 22px;
  height: 22px;
}

.toy.not-a-robot .nar-arrow {
  font-size: 22px;
  font-weight: 900;
  color: var(--ink-3);
}

/* labelled boxes: clicking the words ticks the box, like any form */
.toy.not-a-robot .nar-master,
.toy.not-a-robot .nar-stop,
.toy.not-a-robot .nar-item,
.toy.not-a-robot .nar-clause {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.toy.not-a-robot .nar-master,
.toy.not-a-robot .nar-stop {
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.toy.not-a-robot .nar-item {
  width: 132px;
  font-size: 13px;
  color: var(--ink-2);
}

.toy.not-a-robot .nar-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.toy.not-a-robot .nar-clause {
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}

.toy.not-a-robot .nar-num {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.toy.not-a-robot .nar-hint {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}

/* ---------- overlay: ✓ / ✗ stings, pause, start, game over ---------- */
.toy.not-a-robot .nar-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  visibility: hidden;
}

.toy.not-a-robot .nar-veil.on {
  visibility: visible;
}

.toy.not-a-robot .nar-veil:not(.big) .nar-big,
.toy.not-a-robot .nar-veil:not(.note) .nar-note,
.toy.not-a-robot .nar-veil:not(.again) .nar-again {
  display: none;
}

/* full width, not shrink-wrapped: the screen sizes itself from this box's width, and a box that hugs the
   screen would shrink it a little on every resize */
.toy.not-a-robot .nar-big {
  display: flex;
  justify-content: center;
  align-self: stretch;
}

.toy.not-a-robot .nar-note {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.toy.not-a-robot .nar-again {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

@media (max-width: 480px) {
  .toy.not-a-robot .nar-dev {
    padding: 10px 12px 12px;
  }
  .toy.not-a-robot .nar-play {
    height: 252px;
  }
  .toy.not-a-robot .nar-timer input {
    width: 19px;
    height: 19px;
  }
  .toy.not-a-robot .nar-lives input {
    width: 20px;
    height: 20px;
  }
}

@keyframes nar-shake {
  0%,
  100% {
    transform: none;
  }
  15% {
    transform: translateX(-7px);
  }
  30% {
    transform: translateX(6px);
  }
  45% {
    transform: translateX(-4px);
  }
  60% {
    transform: translateX(3px);
  }
  80% {
    transform: translateX(-1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .toy.not-a-robot .nar-dev.bad {
    animation: none;
  }
}
