.prompt { flex: none; text-align: center; padding: 4px 14px 2px; }
.ptitle {
  display: inline-block;
  max-width: 100%;
  padding: 6px 20px;
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  font: 700 1.9rem var(--num);
  box-shadow: 4px 4px 0 var(--ink);
}
.psub { margin-top: 8px; font-weight: 800; font-size: 0.95rem; color: #cfc3ff; min-height: 22px; }

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 12px;
}

.feedback { flex: none; min-height: 52px; max-height: 32dvh; overflow-y: auto; padding: 2px 14px; text-align: center; font: 800 0.95rem/1.25 Nunito, sans-serif; white-space: pre-line; display: flex; align-items: center; justify-content: center; }
.feedback.bad { font-size: 0.9rem; }
.feedback.good { color: var(--green); }
.feedback.bad { color: #ff9a9a; }

.footer {
  flex: none;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 8px 14px calc(14px + env(safe-area-inset-bottom));
  background: #0c0624;
  border-top: 4px solid var(--ink);
}
.footer .big { margin-top: 0; }
.footer .big.small { width: auto; min-width: 100px; padding: 0 14px; }
.footer #btn-check { flex: 1; max-width: 260px; }

/* Ten frames and percent grids */
.frames { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.frame {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #2a1b66;
}
.cellbtn {
  width: 52px; height: 52px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #4b3a96;
}
.cellbtn.on { background: radial-gradient(circle at 50% 50%, var(--paper) 0 55%, #ffb300 56%); }
.cellbtn.pct.on { background: linear-gradient(180deg, #8bf3c1, var(--green)); }
.cellbtn.reveal { outline: 4px dashed var(--pink); outline-offset: 2px; }
.counter { font: 700 1.5rem var(--num); color: var(--paper); }
.frame.pctgrid { grid-template-columns: repeat(5, 1fr); }
.frame.pctgrid .cellbtn { width: 54px; height: 44px; }

/* Pizza */
.pizza { width: min(72vw, 270px); height: auto; touch-action: manipulation; }
.pizza path { fill: #ffe9b0; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; cursor: pointer; }
.pizza path.on { fill: #ff6b3d; }
.pizza path.reveal { stroke: var(--pink); stroke-width: 5; }
.pizza circle.rim { fill: none; stroke: var(--ink); stroke-width: 5; }

/* Arrays */
.arraybox { min-height: 150px; display: flex; align-items: center; justify-content: center; }
.dots { display: grid; gap: 4px; }
.dot { border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff9ad0, var(--pink)); border: 2px solid var(--ink); }
.steppers { display: flex; gap: 22px; }
.stepper { display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 900; }
.stepper .row { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 52px; height: 52px;
  border: 3px solid var(--ink); border-radius: 14px;
  background: var(--purple); color: #fff;
  font: 700 1.8rem var(--num);
  box-shadow: 3px 3px 0 var(--ink);
}
.stepper button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.stepper b { min-width: 34px; font: 700 1.8rem var(--num); color: var(--paper); }

/* Graph */
.graph {
  --cell: min(36px, calc((100vw - 40px) / 10));
  display: grid;
  grid-template-columns: repeat(10, var(--cell));
  grid-auto-rows: var(--cell);
  gap: 0;
  padding: 6px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #2a1b66;
}
.graph .lab { display: grid; place-items: center; font: 700 0.7rem var(--num); color: #cfc3ff; }
.gp {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
}
.gp::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}
.gp.ax-x { background: linear-gradient(0deg, transparent calc(50% - 1.5px), #fff calc(50% - 1.5px) calc(50% + 1.5px), transparent calc(50% + 1.5px)); }
.gp.ax-y { background: linear-gradient(90deg, transparent calc(50% - 1.5px), #fff calc(50% - 1.5px) calc(50% + 1.5px), transparent calc(50% + 1.5px)); }
.gp.ax-x.ax-y {
  background:
    linear-gradient(0deg, transparent calc(50% - 1.5px), #fff calc(50% - 1.5px) calc(50% + 1.5px), transparent calc(50% + 1.5px)),
    linear-gradient(90deg, transparent calc(50% - 1.5px), #fff calc(50% - 1.5px) calc(50% + 1.5px), transparent calc(50% + 1.5px));
}
.gp.on::before { width: 20px; height: 20px; margin: -10px 0 0 -10px; background: var(--paper); border: 3px solid var(--ink); }
.gp.reveal::before { width: 20px; height: 20px; margin: -10px 0 0 -10px; background: var(--green); border: 3px solid var(--ink); }

/* A wrong tap shows red so you can see what you picked next to the green answer. */
.gp.wrong::before { width: 20px; height: 20px; margin: -10px 0 0 -10px; background: var(--red); border: 3px solid var(--ink); }
