/* 5-shapes (plan 119 wave 2): Geometri Alet Çantası, Açı Radarı, Şekil Avcısı and Pergel Atölyesi
   (units/5-shapes-boards.js) and the Hızlı Parmak figures (u5s-figure, units/5-shapes-core.js). Theme tokens only, so
   light, dark and high contrast follow tokens.css and the world tokens of topic-games.css. */

/* ---------- Shared ---------- */
.u5s-board { width: min(100%, 1040px); }
.u5s-work { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(12px, 2vw, 28px); width: 100%; }
.u5s-controls { display: grid; justify-items: center; gap: 10px; max-width: 460px; }
.u5s-spark { min-height: 1.6em; margin: 0; padding: 2px 14px; color: var(--ink); background: var(--red-tint); border: 2px solid var(--red-base); border-left-width: 8px; border-radius: 12px; font-size: clamp(17px, 1.6vw, 21px); font-weight: 800; text-align: center; overflow-wrap: anywhere; }
.u5s-spark:empty { visibility: hidden; }
.u5s-reason { margin: 0; padding: 6px 16px; color: var(--world-ink); background: var(--world-band); border: 2px solid var(--world-band-edge); border-radius: 14px; font-size: clamp(17px, 1.6vw, 21px); font-weight: 800; text-align: center; overflow-wrap: anywhere; }
.u5s-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.u5s-choice { min-width: 150px; padding: 6px 16px; font-size: clamp(18px, 1.7vw, 22px); line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.u5s-choice[data-missed] { border-color: var(--red-base); border-style: dashed; }
.u5s-choice[data-answer] { color: var(--green-ink); background: var(--green-tint); border-color: var(--green-base); opacity: 1; }
.u5s-toggle[aria-pressed="true"] { color: var(--world-ink); background: var(--world-band); border-color: var(--world-model-edge); box-shadow: inset 0 0 0 2px var(--world-model-edge); }
.u5s-count, .u5s-readout { margin: 0; color: var(--ink); font-size: clamp(18px, 1.8vw, 23px); font-weight: 900; }
.u5s-readout strong { color: var(--world-ink); }

/* Lines, points and shapes, shared by the boards and the Hızlı Parmak figures. */
.u5s-point { fill: var(--ink); }
.u5s-letter { fill: var(--ink); font-size: 20px; font-weight: 900; }
.u5s-stroke, .u5s-ray { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.u5s-head { fill: var(--ink); }
.u5s-shape { fill: var(--world-band, var(--brand-tint)); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.u5s-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.u5s-wedge { fill: var(--world-accent, var(--brand)); fill-opacity: .35; stroke: var(--world-accent, var(--brand)); stroke-width: 2; }
.u5s-side, .u5s-angle { fill: var(--ink); font-size: 17px; font-weight: 900; }
.u5s-angle { fill: var(--world-ink, var(--brand-ink)); font-size: 15px; }

/* ---------- Hızlı Parmak figures ---------- */
.u5s-figure { display: block; width: min(100%, 360px); height: auto; margin-inline: auto; }
.u5s-figure .u5s-shape { fill: var(--brand-tint); }
.u5s-protractor { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.u5s-tick { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.u5s-inner-arc { fill: none; stroke: var(--line); stroke-width: 1.5; }
.u5s-scale { fill: var(--ink); font-size: 11px; font-weight: 800; }
.u5s-scale--inner { fill: var(--ink-2); font-size: 9.5px; }
.u5s-protractor-figure .u5s-ray, .u5s-figure .u5s-ray { stroke: var(--coral-base); stroke-width: 3; }

/* ---------- Geometri Alet Çantası ---------- */
.u5s-dots { position: relative; width: min(100%, 560px); aspect-ratio: 476 / 320; background: var(--surface); border: 2px solid var(--world-model-edge); border-radius: 16px; }
.u5s-dots__svg { display: block; width: 100%; height: 100%; }
.u5s-lattice { stroke: var(--ink-2); stroke-width: 6; stroke-linecap: round; }
.u5s-dots .u5s-stroke { stroke: var(--world-accent, var(--brand)); stroke-width: 5; }
.u5s-dots .u5s-head { fill: var(--world-accent, var(--brand)); }
.u5s-stroke--missed { stroke-dasharray: 10 8; }
.u5s-dots[data-solved] .u5s-stroke { stroke: var(--green-base); }
.u5s-dots[data-solved] .u5s-head { fill: var(--green-base); }
.u5s-dot {
  position: absolute;
  display: inline-grid;
  min-width: var(--touch);
  min-height: var(--touch);
  place-items: center;
  padding: 0;
  color: var(--ink);
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 900;
  line-height: 1;
  background: var(--surface);
  border: 3px solid var(--ink);
  border-radius: 999px;
  transform: translate(-50%, -50%);
}
.u5s-dot.tg-key:hover:not(:disabled) { transform: translate(-50%, calc(-50% - 1px)); }
.u5s-dot.tg-key:active:not(:disabled) { transform: translate(-50%, calc(-50% + 1px)); }
.u5s-dot[data-picked] { color: var(--world-ink); background: var(--world-band); border-color: var(--world-model-edge); box-shadow: 0 0 0 4px var(--world-model-edge); }
.u5s-dot--fixed { min-width: 40px; min-height: 40px; }
.u5s-tools { flex-direction: column; }
.u5s-tool { display: inline-flex; align-items: center; justify-content: flex-start; gap: 12px; min-width: 240px; }
.u5s-tool__icon { flex: none; width: 52px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Açı Radarı ---------- */
.u5s-radar__box { display: grid; justify-items: center; gap: 4px; }
.u5s-radar { display: block; width: min(100%, 340px); height: auto; }
.u5s-radar__screen { fill: var(--world-model); stroke: var(--world-model-edge); stroke-width: 3; }
.u5s-radar__ring { fill: none; stroke: var(--world-model-edge); stroke-width: 1.5; }
.u5s-radar__spokes { stroke: var(--world-model-edge); stroke-width: 1; opacity: .7; }
.u5s-radar .u5s-ray { stroke-width: 5; }
.u5s-radar__label { fill: var(--ink); font-size: 22px; font-weight: 900; }
.u5s-radar__arm { transform-box: view-box; transform-origin: 160px 160px; }
.u5s-radar__sweep { animation: u5s-sweep 900ms cubic-bezier(.2, .7, .2, 1) both; }
.u5s-radar__late { animation: u5s-fade 250ms ease-out 700ms both; }
@keyframes u5s-sweep { from { transform: rotate(0deg); } }
@keyframes u5s-fade { from { opacity: 0; } }
.u5s-protractor-box { width: min(100%, 520px); padding: 6px; background: var(--world-model); border: 2px solid var(--world-model-edge); border-radius: 16px; }
.u5s-protractor-figure { display: block; width: 100%; height: auto; }
.u5s-protractor-box[data-solved] .u5s-ray { stroke: var(--green-base); }

/* ---------- Şekil Avcısı ---------- */
.u5s-grid-paper { position: relative; width: min(100%, 500px); aspect-ratio: 368 / 272; background: var(--surface); border: 2px solid var(--world-model-edge); border-radius: 14px; }
.u5s-grid-paper__svg { display: block; width: 100%; height: 100%; }
.u5s-corner {
  position: absolute;
  display: inline-grid;
  width: var(--touch);
  min-width: 0;
  height: var(--touch);
  place-items: center;
  padding: 0;
  color: var(--world-ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  background: var(--surface);
  border: 3px dashed var(--ink);
  border-radius: 999px;
  transform: translate(-50%, -50%);
}
.u5s-corner.tg-key:hover:not(:disabled) { transform: translate(-50%, calc(-50% - 1px)); }
.u5s-corner.tg-key:active:not(:disabled) { transform: translate(-50%, calc(-50% + 1px)); }
.u5s-corner[aria-pressed="true"] { background: var(--world-band); border: 3px solid var(--world-model-edge); opacity: 1; }
.u5s-measured-box { width: min(100%, 500px); padding: 6px; background: var(--world-model); border: 2px solid var(--world-model-edge); border-radius: 16px; }
.u5s-measured { display: block; width: 100%; height: auto; }
.u5s-measured-box .u5s-shape, .u5s-grid-paper .u5s-shape { fill: var(--world-band); }
.u5s-measured-box[data-finale-board] .u5s-shape, .u5s-grid-paper[data-finale-board] .u5s-shape { stroke: var(--green-base); }

/* ---------- Pergel Atölyesi ---------- */
.u5s-compass-box { width: min(100%, 540px); padding: 6px; background: var(--world-model); border: 2px solid var(--world-model-edge); border-radius: 16px; }
.u5s-compass { display: block; width: 100%; height: auto; }
.u5s-circle { fill: none; stroke: var(--world-accent, var(--brand)); stroke-width: 3; stroke-dasharray: 9 7; }
.u5s-circle[data-u5s-circle="B"] { stroke: var(--coral-base); }
.u5s-side-line { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.u5s-radius { stroke: var(--ink-2); stroke-width: 2.5; stroke-dasharray: 4 5; }
.u5s-compass-box[data-solved] .u5s-side-line { stroke: var(--green-base); }

/* High contrast: no tints; marks speak through strokes. */
body.high-contrast .u5s-wedge { fill: var(--ink); fill-opacity: .2; stroke: var(--ink); }
body.high-contrast .u5s-radar__spokes { display: none; }
body.high-contrast .u5s-dots .u5s-stroke, body.high-contrast .u5s-circle { stroke: var(--ink); }
body.high-contrast .u5s-dots .u5s-head { fill: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .u5s-radar__sweep, .u5s-radar__late { animation: none; }
}

/* A short landscape board (1366 × 768): the kicker goes, as on the units 1–2 boards, and the figures slim so the
   options stand above the instruction bar. */
@media (orientation: landscape) and (min-width: 900px) and (max-height: 820px) {
  .question-card--topic:has(.u5s-board) .question-kicker { display: none; }
  .question-card--topic:has(.u5s-board) .question-copy { margin-bottom: 8px; }
  .u5s-dots { width: min(100%, 470px); }
  .u5s-radar { width: min(100%, 290px); }
  .u5s-protractor-box { width: min(100%, 470px); }
  .u5s-grid-paper { width: min(100%, 430px); }
  .u5s-measured-box, .u5s-compass-box { width: min(100%, 440px); }
}

@media (max-width: 700px) {
  .u5s-choice { min-width: 0; flex: 1 1 40%; }
  /* A 390 × 844 phone holds the whole round above the instruction bar: smaller figures, two options a row. */
  .u5s-choices { gap: 8px; }
  .u5s-controls { width: 100%; }
  .u5s-tools { flex-direction: row; }
  .u5s-tool { min-width: 0; flex: 1 1 30%; flex-direction: column; gap: 2px; padding: 4px 6px; font-size: 16px; }
  .u5s-radar { max-height: 30vh; }
  .u5s-measured, .u5s-compass { max-height: 28vh; }
}
