/* Spark March. Every selector starts with .g-spark-march; colours come from the site variables only. */

/* every button here is a comfortable tap target, including the small ones */
.g-spark-march .pz-btn { min-height: 44px; }

/* ---------- level header ---------- */
.g-spark-march .sm-head {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px auto;
  gap: 8px; align-items: center; margin: 0 0 4px;
}
.g-spark-march .sm-nav { width: 44px; padding: 0; font-size: 1.45rem; line-height: 1; }
.g-spark-march .sm-title { display: grid; gap: 1px; min-width: 0; text-align: center; line-height: 1.25; }
.g-spark-march .sm-world {
  font-size: .74rem; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; overflow-wrap: anywhere;
}
.g-spark-march .sm-level { font-size: 1.04rem; overflow-wrap: anywhere; }
.g-spark-march .sm-stars { font-size: .82rem; line-height: 1.2; }
@media (max-width: 480px) {
  .g-spark-march .sm-head { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .g-spark-march .sm-levels-btn { grid-column: 1 / -1; justify-self: center; }
}

/* ---------- level picker ---------- */
.g-spark-march .sm-picker {
  margin: 8px 0 4px; padding: 6px 12px 8px; border-radius: var(--radius);
  background: var(--surface-2);
}
.g-spark-march .sm-pick-world { font-size: .9rem; margin: 10px 0 0; text-align: left; }
.g-spark-march .sm-picker .pz-levels { margin: 8px 0 6px; }
.g-spark-march .sm-picker .pz-level { padding: 0 0 9px; color: var(--text); font-family: inherit; min-height: 44px; }
.g-spark-march .sm-mini { position: absolute; left: 0; right: 0; bottom: 4px; font-size: .56rem; letter-spacing: 0; line-height: 1; }

/* ---------- note line: room is kept for it, so the board never jumps when the words change ---------- */
.g-spark-march .sm-note {
  display: flex; align-items: center; justify-content: center;
  min-height: 3.1em; margin: 6px 0 8px; line-height: 1.5;
}
.g-spark-march .sm-note.sm-now { color: var(--text); font-weight: 700; }
@media (max-width: 480px) {
  .g-spark-march .sm-note { min-height: 4.6em; font-size: .92rem; }
}

/* ---------- "New skill" card ---------- */
.g-spark-march .sm-teach {
  display: flex; align-items: center; gap: 12px; text-align: left;
  margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
}
.g-spark-march .sm-teach-icon {
  flex: none; width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; background: var(--surface); color: var(--accent);
  border: 1.5px solid color-mix(in srgb, var(--accent) 45%, var(--border));
}
.g-spark-march .sm-teach-icon svg { width: 28px; height: 28px; display: block; }
.g-spark-march .sm-teach-body { display: grid; gap: 1px; min-width: 0; }
.g-spark-march .sm-teach-tag {
  font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}
.g-spark-march .sm-teach-name { font-weight: 900; line-height: 1.2; }
.g-spark-march .sm-teach-text { margin: 0; font-size: .9rem; line-height: 1.35; color: var(--muted); }

/* ---------- HUD ---------- */
.g-spark-march .sm-hud { margin-bottom: 10px; }
.g-spark-march .sm-hud .pz-pill { white-space: nowrap; }
.g-spark-march .sm-sub { color: var(--muted); font-weight: 700; }
/* on a phone each pill stacks its label over its numbers, so all three sit on one line and do not reshuffle */
@media (max-width: 480px) {
  .g-spark-march .sm-hud { gap: 6px; }
  .g-spark-march .sm-hud .pz-pill {
    display: inline-grid; grid-template-columns: auto auto; justify-content: center; align-items: baseline; gap: 0 4px;
    padding: 4px 10px 5px; border-radius: 14px; font-size: .88rem; line-height: 1.25;
  }
  .g-spark-march .sm-hud .pz-pill small { grid-column: 1 / -1; text-align: center; font-size: .66rem; }
  .g-spark-march .sm-hud .pz-pill small + span:last-child { grid-column: 1 / -1; text-align: center; }
}

/* ---------- board ---------- */
.g-spark-march .sm-board { width: 100%; margin: 0 0 12px; overflow-x: auto; overflow-y: hidden; }
.g-spark-march .sm-stage { position: relative; width: -moz-fit-content; width: fit-content; margin: 0 auto; }
/* the edge line is drawn inside the canvas box, so it adds no width and is never clipped */
.g-spark-march .sm-canvas {
  display: block; border-radius: 10px; background: var(--surface-2);
  outline: 1px solid var(--border); outline-offset: -1px;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: default;
}
.g-spark-march .sm-canvas.sm-armed { cursor: crosshair; }
.g-spark-march .sm-canvas.sm-showing { outline: 2px dashed var(--text); outline-offset: -2px; }
.g-spark-march .sm-canvas:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
/* the label sits on the bottom edge, where it hides the least of the action */
.g-spark-march .sm-demo {
  position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%);
  padding: 3px 11px; border-radius: 99px; white-space: nowrap; pointer-events: none;
  background: var(--text); color: var(--bg); font-size: .76rem; font-weight: 800;
}

/* ---------- skill bar ---------- */
.g-spark-march .sm-skills {
  display: grid; grid-template-columns: repeat(var(--sm-n, 3), minmax(0, 104px));
  justify-content: center; gap: 6px; min-height: 70px; margin: 0;
}
.g-spark-march .sm-skill {
  position: relative; flex-direction: column; gap: 0; width: 100%; min-width: 0;
  min-height: 70px; padding: 7px 2px 6px; border-radius: 14px; line-height: 1.15;
}
.g-spark-march .sm-skill-icon { display: block; line-height: 0; }
.g-spark-march .sm-skill-icon svg { width: 27px; height: 27px; display: block; }
.g-spark-march .sm-skill-name { font-size: .8rem; margin-top: 2px; }
.g-spark-march .sm-skill-left { font-size: .92rem; font-weight: 900; font-variant-numeric: tabular-nums; }
/* armed: filled (from .pz-btn.on), raised and ringed, so it is not told by colour alone */
.g-spark-march .sm-skill.on { transform: translateY(-3px); box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 45%, var(--text)); }
.g-spark-march .sm-skill.on:active { transform: translateY(-1px); }
.g-spark-march .sm-skill.sm-none:not(.on) { opacity: .5; }
.g-spark-march .sm-key {
  display: none; position: absolute; top: 4px; left: 8px;
  font-size: .64rem; font-weight: 800; color: var(--muted); line-height: 1;
}
.g-spark-march .sm-skill.on .sm-key { color: inherit; opacity: .8; }
@media (hover: hover) and (pointer: fine) {
  .g-spark-march .sm-key { display: block; }   /* key hints only where there is likely a keyboard */
}
@media (max-width: 400px) {   /* five skills still fit side by side on the narrowest phone */
  .g-spark-march .sm-skills { gap: 5px; }
  .g-spark-march .sm-skill { padding-left: 0; padding-right: 0; }
  .g-spark-march .sm-skill-name { font-size: .7rem; letter-spacing: -.01em; }
}
.g-spark-march .sm-noskills {
  grid-column: 1 / -1; align-self: center; margin: 0; text-align: center; color: var(--muted); font-size: .95rem;
}

/* ---------- controls and help ---------- */
.g-spark-march .sm-controls { margin: 14px 0 0; }
.g-spark-march .sm-go { min-width: 6.4em; }
.g-spark-march .sm-help { margin: 10px 0 0; }

/* ---------- nothing to play yet ---------- */
.g-spark-march .sm-soon { text-align: center; padding: 56px 10px 40px; }
.g-spark-march .sm-soon-art { color: var(--accent); line-height: 0; }
.g-spark-march .sm-soon-art svg { width: 72px; height: 72px; }
.g-spark-march .sm-soon-title { font-size: 1.25rem; font-weight: 900; margin: 12px 0 0; }

@media (prefers-reduced-motion: reduce) {
  .g-spark-march .sm-skill.on { transform: none; }
}
