/* ------------------------------------------------------------ study guides
   Played, not read. See public/guide.js for why, and for the three rungs.
   Sized for an eleven-year-old on an iPad: one card a screen, thumb-sized
   targets, and type he does not lean in for.
*/

.sg-wrap { max-width: 640px; margin: 0 auto; padding: 0 2px 40px; }

.sg-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sg-where { font-size: 15px; color: var(--muted); flex: 1; min-width: 0; }
/* The rung he is on, in the same pixel face as every other status in HQ, and
   named from the ladder he already climbs: Rookie, Varsity, NBA. */
.sg-rung {
  font-family: var(--pixel); font-size: 11px; letter-spacing: .08em;
  padding: 6px 10px; border-radius: var(--radius); flex: none;
  color: var(--turq); border: 2px solid var(--line);
}
.sg-rung.r1 { color: var(--ink); border-color: var(--turq); }
.sg-rung.r2 { color: var(--on-bright); background: var(--turq); border-color: var(--turq); }

.sg-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.sg-bar i { display: block; height: 100%; background: var(--turq); transition: width .3s ease; }
.sg-count {
  margin: 8px 0 16px; font-family: var(--pixel); font-size: 11px;
  letter-spacing: .08em; color: var(--muted);
}

.sg-card {
  padding: 20px; background: var(--card);
  border: 2px solid var(--line); border-radius: var(--radius);
}
/* 19px, not the 15px the rest of HQ uses for prose. This is the only screen he
   READS a full sentence on, and reading is where small type costs him. */
.sg-q { margin: 0 0 18px; font-size: 19px; line-height: 1.5; }
.sg-hint { margin: -8px 0 18px; font-size: 15px; color: var(--muted); }

/* The gap, at VARSITY. It is a slot with a "?" in it rather than a rule, so it
   is obvious something is missing and obvious where it goes. */
.sg-gap { display: block; }
.sg-slot {
  display: inline-block; min-width: 92px; text-align: center; padding: 0 10px;
  color: var(--turq); border-bottom: 3px solid var(--turq);
}
.sg-slot.right { color: var(--green); border-color: var(--green); }
.sg-slot.wrong { color: var(--bad); border-color: var(--bad); }

/* Answer buttons. 56px tall because a thumb on an iPad is not a mouse, and a
   grid rather than flex so four options of different lengths stay equal - the
   min-content lesson the memory shelf paid for. */
.sg-opts { display: grid; gap: 10px; }
.sg-opts.bank { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.sg-opt {
  min-height: 56px; padding: 14px 16px; font: inherit; font-size: 17px;
  text-align: left; cursor: pointer; color: var(--ink); background: var(--btn-a);
  border: 2px solid var(--line); border-radius: var(--radius);
}
.sg-opts.bank .sg-opt { text-align: center; }
.sg-opt:active { transform: translateY(2px); }
.sg-opt:disabled { opacity: 1; }          /* never grey out the answer he is reading */
/* The right one always lights, win or lose - "check right away" is what stops a
   wrong fact settling in.

   🔴 `:not(.tile)`, because a Kahoot tile carries its own color and this rule
   was painting the correct one green - which in Scoreboard is the same amber as
   everything else, so the red tile turned amber the moment it was answered.
   Caught by rendering it; the specificity is identical, so load order decided
   it and load order is not a design. */
.sg-opt:not(.tile).right { color: var(--on-bright); background: var(--green); border-color: var(--green); }
.sg-opt:not(.tile).wrong { color: var(--bad); border-color: var(--bad); }

/* NBA: what he actually wrote, once he has tried. */
.sg-a {
  margin: 0 0 18px; padding: 16px; font-size: 18px; line-height: 1.55;
  background: var(--sunk); border-left: 6px solid var(--turq); border-radius: var(--radius);
}
.sg-mark span { display: block; margin-bottom: 12px; font-size: 16px; color: var(--muted); }
.sg-mark-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px;
}
.sg-mark-row .big-btn { min-width: 0; padding-left: 10px; padding-right: 10px; text-align: center; }

.sg-next { display: block; width: 100%; margin-top: 20px; }

/* ------------------------------------------------------------- the finish */

.sg-done { text-align: center; padding-top: 20px; }
.sg-done h1 { font-size: 17px; line-height: 1.5; }
.sg-big { font-family: var(--num); font-size: 52px; color: var(--turq); margin: 10px 0 6px; }
.sg-line { font-size: 17px; margin: 0 0 10px; }
.sg-done .big-btn { display: block; width: 100%; margin: 22px 0 0; }
.sg-done .ghost-btn { width: 100%; }

/* ------------------------------------------------- the list of his guides */

.sg-list { display: grid; gap: 12px; }
.sg-item {
  display: grid; gap: 6px; text-align: left; padding: 18px;
  color: var(--ink); background: var(--card);
  border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 5px 0 var(--drop);
}
.sg-item:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--drop); }
.sg-item b { font-size: 17px; font-weight: 600; }
.sg-item span { font-size: 15px; color: var(--muted); }

/* A warning on a card: where his packet and the wider world disagree. Amber-ish
   rather than red - nothing is wrong, he just needs to know both exist. */
.sg-note {
  margin: 18px 0 0; padding: 14px 16px; font-size: 16px; line-height: 1.5;
  color: var(--ink); background: var(--sunk);
  border-left: 6px solid var(--turq); border-radius: var(--radius);
}

/* ---------------------------------------------------------- the Kahoot grid
   Jason: "check kahoot, he likes those and they are basic." The four colors and
   shapes are Kahoot's, checked against their site on 2026-09-28: red triangle,
   blue diamond, yellow circle, green square.

   🔴 This is the ONLY place in HQ that ignores the skin. It is a borrowed
   convention, like a traffic light, and it means the same thing in both skins
   because it is the thing he already knows from school. */
.sg-opts.kahoot { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sg-opts.kahoot .sg-opt {
  display: flex; align-items: center; gap: 12px;
  min-height: 108px; padding: 16px; text-align: left;
  color: #fff; border: 0; border-radius: 8px;
  font-size: 17px; line-height: 1.35; text-shadow: 0 2px 4px rgba(0,0,0,.45);
}
.tile-shape { font-style: normal; font-size: 24px; flex: none; opacity: .95; }
.tile span { flex: 1; min-width: 0; }
.k-red   { background: #e21b3c; box-shadow: 0 6px 0 #9c1229; }
.k-blue  { background: #1368ce; box-shadow: 0 6px 0 #0d478f; }
.k-gold  { background: #d89e00; box-shadow: 0 6px 0 #966e00; }
.k-green { background: #26890c; box-shadow: 0 6px 0 #1a5f08; }
.sg-opts.kahoot .sg-opt:active { transform: translateY(4px); box-shadow: none; }
/* After an answer: the right tile stays lit and everything else falls back, so
   the last thing on the screen is the answer. */
.sg-opts.kahoot .sg-opt.dim { opacity: .28; }
.sg-opts.kahoot .sg-opt.wrong { opacity: .5; outline: 3px solid #fff; outline-offset: -3px; }
.sg-opts.kahoot .sg-opt.right { outline: 4px solid #fff; outline-offset: -4px; }
@media (prefers-reduced-motion: no-preference) {
  .sg-opts.kahoot .sg-opt.right { animation: pulse 1.1s ease-in-out 2; }
}

/* ------------------------------------------------------------- the clock */

.sg-clock {
  flex: none; min-width: 44px; text-align: center;
  font-family: var(--num); font-size: 22px; color: var(--muted);
  font-variation-settings: var(--num-set);
}
/* The last five seconds. Color AND a pulse, because a color alone is missed by
   a boy who is reading the question rather than the header. */
.sg-clock.warn { color: var(--bad); }
@media (prefers-reduced-motion: no-preference) {
  .sg-clock.warn { animation: pulse .6s ease-in-out infinite; }
}
.sg-outof { margin: 18px 0 0; font-size: 16px; color: var(--muted); }

/* ------------------------------------------------------------- the break */

.hoops {
  position: fixed; inset: 0; z-index: 60;
  background: radial-gradient(120% 80% at 50% 0%, #1a1330 0%, rgba(5,4,10,.97) 70%);
  display: flex; flex-direction: column;
}
:root[data-theme="scoreboard"] .hoops {
  background: radial-gradient(120% 80% at 50% 0%, #1a1208 0%, rgba(6,5,5,.97) 70%);
}
.hoops-hud {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  font-family: var(--pixel); font-size: 13px; letter-spacing: .08em; color: var(--turq);
}
.hoops-say { flex: 1; text-align: center; color: var(--muted); }
.hoops-made, .hoops-left {
  font-family: var(--num); font-size: 26px; color: var(--ink);
  font-variation-settings: var(--num-set); min-width: 42px;
}
.hoops-left { text-align: right; }

/* The way out of a break. Big enough to hit with a thumb without aiming - 44px
   is the floor for a touch target and this is a child's screen - and far enough
   from the canvas edge that reaching for it is never a tap on the game. */
.hoops-out {
  width: 44px; height: 44px; margin: -8px -6px -8px 0; padding: 0;
  border: 0; background: none; cursor: pointer;
  font: 28px/1 var(--num); color: var(--muted);
}
.hoops-out:active { color: var(--ink); }
@media (hover: hover) { .hoops-out:hover { color: var(--ink); } }
.hoops-canvas { flex: 1; width: 100%; touch-action: manipulation; }

/* ---------------------------------------------------- the tap-to-draw pad

   public/draw.js. He taps lattice points and the shape closes itself. Sized so a
   grid square is never under 26px: a finger is about 10mm across, and a square
   smaller than that turns a geometry question into a test of his aim. */

.dp { margin-top: 10px; }
.dp-svg {
  width: 100%; height: auto; display: block;
  touch-action: manipulation;          /* no double-tap zoom mid-drawing */
  background: rgba(255, 255, 255, .03);
  border-radius: 10px;
}
.dp-grid { stroke: rgba(255, 255, 255, .17); stroke-width: 1; }
.dp-shape { fill: rgba(255, 255, 255, .10); stroke: rgba(255, 255, 255, .55); stroke-width: 2; }
.dp-base { stroke: var(--accent, #2ec4b6); stroke-width: 4; }
.dp-label { fill: #cfe8e6; font-size: 13px; text-anchor: middle; }

.dp-line { fill: none; stroke: var(--accent, #2ec4b6); stroke-width: 3; }
.dp-drawn { fill: rgba(46, 196, 182, .22); stroke: var(--accent, #2ec4b6); stroke-width: 3; }
.dp-dot { fill: var(--accent, #2ec4b6); }

.dp-say { margin: 10px 0 0; font-size: 16px; line-height: 1.45; }
.dp-say.right { color: #7ee787; font-weight: 700; }
.dp-say.wrong { color: #ffd9d9; }

.dp-nav { display: flex; gap: 12px; margin-top: 12px; }
.dp-nav .ghost-btn, .dp-nav .btn { margin: 0; flex: 1 1 0; }
.dp-nav .btn[disabled] { opacity: .45; }

#sg-skip { margin-top: 14px; width: 100%; }
