/* Fire the Neuron: the board beside its controls on a wide screen, above them on a phone. Games 20261117. */
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; width: 100%; margin-top: 22px; text-align: left; }
.level { text-align: left; background: #0f0f11; border: 1px solid #1f1f23; border-radius: 16px; padding: 16px; cursor: pointer; transition: border-color .15s, translate .15s; }
.level:hover { border-color: var(--line-2); translate: 0 -2px; }
.level .n { color: var(--red); font-weight: 900; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.level b { display: block; font-size: 19px; font-weight: 750; letter-spacing: -.01em; margin: 2px 0 4px; }
.level span.d { color: var(--soft); font-size: 14px; }
.level .st { margin-top: 8px; color: var(--yellow); letter-spacing: 2px; }

.nlayout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.boardbox.square { aspect-ratio: 1; width: 100%; }
.legend { position: absolute; left: 10px; bottom: 8px; display: flex; gap: 10px; font-size: 12px; color: var(--muted); pointer-events: none; }
.legend .na { color: #ff9a3c; } .legend .k { color: #b57bff; }
.panel { display: flex; flex-direction: column; gap: 10px; }
.goal { margin: 0; font-weight: 900; font-size: 18px; }
.coach { margin: 0; min-height: 48px; color: var(--soft); font-size: 16px; }
.coach b { color: var(--text); }
.controls { display: flex; flex-wrap: wrap; gap: 10px; }
.controls .go { flex: 1 1 140px; min-height: 64px; font-size: 17px; }
.controls .go.na { background: #ff9a3c; border: 0; color: #1a0d00; }
.controls .go.na:active, .controls .go.na.held { transform: scale(.97); filter: brightness(1.12); }
.controls .go.k { background: #b57bff; border: 0; color: #14062b; }
.controls .go.k:active, .controls .go.k.held { transform: scale(.97); filter: brightness(1.12); }
.controls .go.locked { filter: grayscale(.7) brightness(.7); }
.controls .kb { flex-basis: 100%; color: var(--muted); font-size: 13px; text-align: center; margin: -2px 0 0; }
.quiz .qq { margin: 6px 0 10px; font-weight: 800; font-size: 17px; }
.quiz .opts { grid-template-columns: minmax(0, 1fr); max-width: none; }
.quiz .opt { text-align: left; font-size: 15px; }
.next .stars { margin: 0 0 10px; font-size: 22px; color: var(--yellow); letter-spacing: 3px; }
.endh { font-size: clamp(26px, 5vw, 38px); line-height: 1.15; margin: 10px 0 14px; }
.learned { color: var(--soft); padding-left: 20px; max-width: 720px; }
.learned li { margin: 8px 0; }
.learned b { color: var(--text); }
.row.center { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.stat { font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: 0; text-transform: none; font-size: 16px; }

@media (min-width: 900px) {
  .nlayout { grid-template-columns: minmax(0, min(64vh, 620px)) minmax(280px, 1fr); align-items: start; }
}
@media (max-width: 700px) {
  .controls .go { min-height: 58px; font-size: 16px; }
  .coach { min-height: 44px; font-size: 15px; }
  .legend { font-size: 11px; gap: 8px; }
}

/* ---------- phones (Matt, Nov 17: "on mobile it sucks", fine in a desktop phone emulator): a phone browser leaves the page ~550-660 px,
   so the buttons sat under the screen, and a thumb wobble on a held channel scrolled the page and let go of it. Now the whole level fits
   one screen (board on top, the buttons in the thumb zone, the coach text scrolls in between), nothing on it pans, scrolls or selects,
   and keyboard hints stay off touch screens. During a level's question the page flows normally again. ---------- */
#play .controls, #play .boardbox { touch-action: none; -webkit-touch-callout: none; }
#play { -webkit-user-select: none; user-select: none; }
@media (hover: none) and (pointer: coarse), (max-width: 700px) { .controls .kb { display: none; } }
@media (max-width: 700px) {
  body.playing:not(.quizzing) { overscroll-behavior: none; }
  body.playing:not(.quizzing) main { padding-bottom: 0; }
  body.playing:not(.quizzing) #play:not([hidden]) { display: flex; flex-direction: column; height: calc(100vh - 8px); height: calc(100svh - 8px); }
  body.playing:not(.quizzing) #play .hud { flex: none; }
  body.playing:not(.quizzing) .nlayout { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
  body.playing:not(.quizzing) .boardbox.square { flex: none; width: min(100%, calc(100vh - 262px)); width: min(100%, calc(100svh - 262px)); align-self: center; }
  body.playing:not(.quizzing) .panel { flex: 1; min-height: 0; gap: 6px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  body.playing:not(.quizzing) .goal { flex: none; font-size: 16px; }
  body.playing:not(.quizzing) .coach { flex: 1 1 auto; min-height: 0; overflow-y: auto; font-size: 14.5px; line-height: 1.4; touch-action: pan-y; }
  body.playing:not(.quizzing) .controls { flex: none; flex-wrap: nowrap; gap: 8px; }
  body.playing:not(.quizzing) .controls .go { flex: 1 1 0; min-width: 0; min-height: 60px; padding: 8px 10px; }
  body.playing:not(.quizzing) .controls .kb { display: none; } /* (not every phone says it has no hover; the hint row squeezed the buttons to slivers) */
}
/* phones on their side: board left, everything else right */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 899px) {
  body.playing .top, body.playing .foot { display: none; }
  body.playing main { padding-top: 8px; }
  .nlayout { grid-template-columns: minmax(0, calc(100svh - 80px)) minmax(240px, 1fr); align-items: start; }
}
