/* ── Canvas-wrap override ─────────────────────────────────────────────────── */
body[data-tab="hare-brain"] #canvas-wrap {
  background: linear-gradient(180deg, #130930 0%, #0e0720 70%);
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 8px;
  gap: 0;
}

/* ── Problem area ─────────────────────────────────────────────────────────── */
#hb-problem-area {
  width: 100%;
  max-width: 480px;
  padding: 10px 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#hb-count-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: rgba(196,181,253,0.7);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#hb-count {
  font-weight: 700;
  color: #c4b5fd;
  font-size: 0.85rem;
}

#hb-problem-text {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 2.4rem;
  font-weight: 400;
  color: #f1f5f9;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1;
  min-height: 2.8rem;
}

#hb-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 260px;
}

#hb-input {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(196,181,253,0.35);
  border-radius: 10px;
  color: #f1f5f9;
  font-family: 'DM Sans', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  padding: 9px 10px;
  outline: none;
  transition: border-color 0.12s, background 0.12s;
  -webkit-tap-highlight-color: transparent;
  /* hide number input spinners */
  -moz-appearance: textfield;
}
#hb-input::-webkit-inner-spin-button,
#hb-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

#hb-input:focus {
  border-color: #a78bfa;
  background: rgba(167,139,250,0.12);
}

#hb-input.hb-correct {
  border-color: #22c55e;
  background: rgba(34,197,94,0.15);
}

#hb-input.hb-wrong {
  border-color: #ef4444;
  background: rgba(239,68,68,0.15);
}

#hb-submit {
  background: #7c3aed;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
#hb-submit:hover  { background: #6d28d9; }
#hb-submit:active { background: #5b21b6; }

/* ── Board wrap ──────────────────────────────────────────────────────────── */
#hb-board-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#hb-board {
  display: grid;
  /* width / height / grid-template-columns / grid-auto-rows set by JS */
}

/* ── Cell styles ─────────────────────────────────────────────────────────── */
.hb-cell {
  background: rgba(255,255,255,0.03);
  border: 0.5px solid rgba(255,255,255,0.07);
  box-sizing: border-box;
}

.hb-cell.hb-blue {
  background-color: rgba(37,99,235,0.18);
  background-image: url('/assets/icons/blue-bunny.svg');
  background-size: 78%;
  background-repeat: no-repeat;
  background-position: center;
}

.hb-cell.hb-red {
  background-color: rgba(220,38,38,0.18);
  background-image: url('/assets/icons/red-bunny.svg');
  background-size: 78%;
  background-repeat: no-repeat;
  background-position: center;
}

/* ── Shake animation (mirrors hexflip / cubrick pattern) ─────────────────── */
@keyframes hb-shake {
  0%,  100% { transform: translateX(0); }
  16%       { transform: translateX(-8px); }
  33%       { transform: translateX(8px); }
  50%       { transform: translateX(-5px); }
  66%       { transform: translateX(5px); }
  83%       { transform: translateX(-2px); }
}

#hb-input-wrap.hb-shake {
  animation: hb-shake 0.44s ease-out;
}

/* ── Canvas-wrap background shadow on this tab ───────────────────────────── */
body[data-tab="hare-brain"] #game-canvas {
  display: none; /* no canvas element used */
}
