/* 7-algebra (plan 119): Terim Toplayıcı, Denklem Terazisi, Eşitsizlik Tüneli, Akış Şeması and İddia Mahkemesi
   (units/7-algebra-boards.js) and the Hızlı Parmak figures (u7a-figure, units/7-algebra-core.js). Theme tokens only,
   so light, dark and high contrast follow tokens.css and the world tokens of topic-games.css. */

/* ---------- Shared ---------- */
.u7a-board { width: min(100%, 1040px); }
.u7a-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; }
.u7a-spark:empty { visibility: hidden; }
.u7a-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; }
.u7a-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.u7a-choice { min-width: 150px; padding: 6px 16px; font-size: clamp(19px, 1.8vw, 24px); line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.u7a-choice[data-missed] { border-color: var(--red-base); border-style: dashed; }
.u7a-choice[data-answer],
.u7a-tick[data-answer],
.u7a-toggle[data-answer],
.u7a-slot[data-answer] { color: var(--green-ink); background: var(--green-tint); border-color: var(--green-base); opacity: 1; }
.u7a-toggle[aria-pressed="true"],
.u7a-tick[aria-pressed="true"],
.u7a-chip[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); }
.u7a-check { min-height: var(--touch); font-size: clamp(18px, 1.7vw, 22px); }
.u7a-frac { display: inline-grid; vertical-align: middle; margin-inline: 1px; font-size: .72em; line-height: 1; text-align: center; }
.u7a-frac > span:first-child { padding: 0 2px 1px; border-bottom: 2px solid currentColor; }
.u7a-frac > span:last-child { padding-top: 1px; }

/* ---------- Hızlı Parmak figures ---------- */
.u7a-figure { display: block; width: min(100%, 360px); height: auto; margin-inline: auto; }
.u7a-fig-text { fill: var(--ink); font-size: 17px; font-weight: 900; }
.u7a-fig-small { fill: var(--ink-2); font-size: 13px; font-weight: 800; }
.u7a-fig-line { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.u7a-fig-tip { fill: var(--ink); }
.u7a-fig-beam { stroke: var(--ink); stroke-width: 6; stroke-linecap: round; }
.u7a-fig-stand { fill: var(--line); stroke: var(--ink); stroke-width: 2; }
.u7a-fig-pan { fill: var(--brand-tint); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.u7a-fig-ray { stroke: var(--brand); stroke-width: 7; stroke-linecap: round; }
.u7a-fig-arrow { fill: var(--brand); }
.u7a-fig-dot { fill: var(--surface); stroke: var(--brand); stroke-width: 4; }
.u7a-fig-dot--closed { fill: var(--brand); }
.u7a-fig-box { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.u7a-fig-box--io { fill: var(--brand-tint); }

/* ---------- Terim Toplayıcı ---------- */
.u7a-terms__work { display: grid; justify-items: center; gap: clamp(10px, 1.6vw, 18px); width: 100%; }
.u7a-terms__line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; color: var(--ink); background: var(--world-model); border: 2px solid var(--world-model-edge); border-radius: 16px; font-size: clamp(22px, 2.3vw, 30px); font-weight: 900; }
.u7a-tile { display: inline-flex; align-items: center; gap: 4px; min-height: 48px; padding: 2px 12px; background: var(--surface); border: 2px solid var(--line); border-radius: 12px; white-space: nowrap; }
.u7a-tile--x { background: var(--world-band); border-color: var(--world-model-edge); }
.u7a-tile b { font-weight: 900; }
.u7a-tile i { font-style: italic; font-family: Georgia, "Times New Roman", serif; }
.u7a-group { display: inline-flex; align-items: center; gap: 4px; }
.u7a-mult { padding: 0 4px; color: var(--world-ink); }
.u7a-paren { font-size: 1.3em; font-weight: 400; }
.u7a-join { padding-inline: 2px; }
.u7a-baskets { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; }
.u7a-basket { display: grid; justify-items: center; gap: 2px; min-width: 200px; padding: 6px 16px 10px; background: var(--surface); border: 2px dashed var(--world-model-edge); border-radius: 6px 6px 22px 22px; }
.u7a-basket__name { margin: 0; color: var(--ink-2); font-size: clamp(15px, 1.4vw, 18px); font-weight: 800; }
.u7a-basket__sum { margin: 0; color: var(--ink); font-size: clamp(20px, 2vw, 26px); font-weight: 900; overflow-wrap: anywhere; text-align: center; }
.u7a-basket[data-filled] { border-style: solid; border-color: var(--green-base); }
.u7a-basket[data-filled] .u7a-basket__sum { color: var(--green-ink); }

/* ---------- Denklem Terazisi ---------- */
.u7a-gates__work { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(12px, 2vw, 28px); width: 100%; }
.u7a-gates__scale { width: min(100%, 480px); padding: 4px; background: var(--world-model); border: 2px solid var(--world-model-edge); border-radius: 18px; }
.u7a-scale { display: block; width: 100%; height: auto; }
.u7a-scale__stand { fill: var(--line); stroke: var(--ink); stroke-width: 2; }
.u7a-scale__base { fill: var(--ink-2); }
.u7a-scale__bar { stroke: var(--ink); stroke-width: 8; stroke-linecap: round; }
.u7a-scale__pivot { fill: var(--world-accent); }
.u7a-scale__rope { stroke: var(--ink-2); stroke-width: 2; }
.u7a-scale__dish { fill: var(--surface); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.u7a-scale__label { fill: var(--ink); font-size: 24px; font-weight: 900; }
.u7a-scale__beam { transform-origin: 200px 52px; transition: transform 320ms cubic-bezier(.2, .8, .2, 1); }
.u7a-scale__pan { transform-box: view-box; transition: transform 320ms cubic-bezier(.2, .8, .2, 1); }
.u7a-scale__beam[data-tilt="left"] { transform: rotate(-8deg); }
.u7a-scale__beam[data-tilt="right"] { transform: rotate(8deg); }
/* The pans hang straight while the beam turns. */
.u7a-scale__beam[data-tilt="left"] [data-u7a-pan="left"] { transform: rotate(8deg); transform-origin: 80px 52px; }
.u7a-scale__beam[data-tilt="left"] [data-u7a-pan="right"] { transform: rotate(8deg); transform-origin: 320px 52px; }
.u7a-scale__beam[data-tilt="right"] [data-u7a-pan="left"] { transform: rotate(-8deg); transform-origin: 80px 52px; }
.u7a-scale__beam[data-tilt="right"] [data-u7a-pan="right"] { transform: rotate(-8deg); transform-origin: 320px 52px; }
.u7a-gates__scale[data-solved] .u7a-scale__dish { stroke: var(--green-base); }
.u7a-gates__controls { display: grid; justify-items: center; gap: 8px; }
.u7a-gates__pad { display: grid; justify-items: center; gap: 4px; }
.u7a-gates__ask { margin: 0; color: var(--world-ink); font-family: var(--font-display); font-size: clamp(20px, 2vw, 26px); font-weight: 900; }
.u7a-choices--gates { display: grid; gap: 10px; width: min(100%, 420px); }
.u7a-gate { min-width: 0; text-align: left; }

/* ---------- Eşitsizlik Tüneli ---------- */
.u7a-tunnel__work { display: grid; justify-items: center; gap: clamp(10px, 1.6vw, 18px); width: 100%; }
.u7a-tunnel__line { width: min(100%, 640px); padding: 6px 10px 8px; background: var(--world-model); border: 2px solid var(--world-model-edge); border-radius: 18px; }
.u7a-tunnel__svg { display: block; width: 100%; height: auto; }
.u7a-tunnel__tube { fill: var(--surface); stroke: var(--world-model-edge); stroke-width: 2; }
.u7a-tunnel__axis { stroke: var(--ink); stroke-width: 3; }
.u7a-tunnel__tick { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.u7a-tunnel__ray { stroke-width: 9; stroke-linecap: round; opacity: .85; }
.u7a-tunnel__mine .u7a-tunnel__ray { stroke: var(--world-accent); }
.u7a-tunnel__mine .u7a-tunnel__head { fill: var(--world-accent); }
.u7a-tunnel__truth .u7a-tunnel__ray { stroke: var(--green-base); }
.u7a-tunnel__truth .u7a-tunnel__head { fill: var(--green-base); }
.u7a-tunnel__dot { fill: var(--surface); stroke: var(--ink); stroke-width: 4; }
.u7a-tunnel__dot--closed { fill: var(--ink); }
.u7a-tunnel__probe line { stroke: var(--red-base); stroke-width: 3; stroke-dasharray: 5 4; }
/* The tick buttons sit under their ticks: the ticks stand at the centres of seven equal columns of the 420-unit line. */
.u7a-tunnel__ticks { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.u7a-tick { min-width: 0; min-height: var(--touch); padding: 0 2px; font-size: clamp(18px, 1.8vw, 22px); font-weight: 900; }
.u7a-tunnel__controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; }
.u7a-toggles { display: flex; gap: 8px; }
.u7a-toggle { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; padding: 6px 14px; font-size: clamp(17px, 1.6vw, 20px); white-space: nowrap; }
.u7a-swatch { width: 16px; height: 16px; border: 3px solid currentColor; border-radius: 50%; }
.u7a-swatch--closed { background: currentColor; }

/* ---------- Akış Şeması ---------- */
.u7a-flow__work { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(12px, 2vw, 28px); width: 100%; }
.u7a-flow__chart { display: grid; justify-items: center; gap: 10px; padding: 10px 12px; background: var(--world-model); border: 2px solid var(--world-model-edge); border-radius: 18px; }
.u7a-flow__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.u7a-arrow { color: var(--ink-2); font-size: 22px; font-weight: 900; }
.u7a-box { display: grid; justify-items: center; min-width: 72px; padding: 4px 10px; color: var(--ink); background: var(--surface); border: 2px solid var(--ink); border-radius: 10px; }
.u7a-box--io { background: var(--world-band); border-color: var(--world-model-edge); border-radius: 22px; }
.u7a-box__op { font-size: clamp(18px, 1.8vw, 22px); font-weight: 900; white-space: nowrap; }
.u7a-box__value { min-height: 1.2em; color: var(--ink); font-size: clamp(16px, 1.5vw, 19px); font-weight: 900; white-space: nowrap; }
.u7a-box--io .u7a-box__op { color: var(--world-ink); font-size: clamp(14px, 1.3vw, 16px); }
.u7a-box--io .u7a-box__value { color: var(--world-ink); font-size: clamp(20px, 2vw, 26px); }
.u7a-box[data-state="right"] { border-color: var(--green-base); }
.u7a-box[data-state="wrong"] { border-color: var(--red-base); border-style: dashed; }
.u7a-diamond { display: grid; place-items: center; width: 132px; height: 84px; padding: 0 22px; color: var(--ink); background: var(--surface); border: 2px solid var(--ink); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); font-size: clamp(14px, 1.3vw, 16px); font-weight: 900; line-height: 1.15; text-align: center; }
.u7a-branches { display: grid; gap: 6px; }
.u7a-branch { display: flex; align-items: center; gap: 6px; }
.u7a-branch__name { min-width: 52px; color: var(--ink-2); font-size: clamp(15px, 1.4vw, 18px); font-weight: 900; text-align: right; }
.u7a-branch[data-state="taken"] .u7a-box { border-color: var(--world-accent); box-shadow: inset 0 0 0 2px var(--world-accent); }
.u7a-branch[data-state="taken"] .u7a-branch__name { color: var(--ink); }
.u7a-branch[data-state="idle"] { opacity: .55; }
.u7a-flow__pad { display: grid; justify-items: center; }

/* ---------- İddia Mahkemesi ---------- */
/* The claim card holds the prompt's claim and the verdict keys its question, so the prompt line gives way. */
.question-card--topic:has(.u7a-court) .question-copy { display: none; }
.u7a-court__work { display: grid; justify-items: center; gap: clamp(10px, 1.4vw, 16px); width: 100%; }
/* The claim on a newsroom paper; the stamp lands in its bottom corner, beside the short ruling line, when the round ends. */
.u7a-claim { position: relative; display: grid; justify-items: center; gap: 4px; width: min(100%, 780px); padding: 10px 22px 12px; color: var(--ink); background: var(--surface); border: 2px solid var(--world-model-edge); border-top-width: 8px; border-radius: 6px 6px 16px 16px; box-shadow: 0 3px 0 var(--line); }
.u7a-claim__tag { padding: 1px 12px; color: var(--world-ink); background: var(--world-band); border: 2px solid var(--world-band-edge); border-radius: 999px; font-size: clamp(14px, 1.3vw, 16px); font-weight: 900; }
.u7a-claim__text { margin: 0; font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 32px); font-weight: 900; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.u7a-claim__ruling { margin: 0; color: var(--world-ink); font-size: clamp(16px, 1.5vw, 19px); font-weight: 900; }
.u7a-stamp { position: absolute; right: 14px; bottom: 6px; margin: 0; padding: 0 12px; color: var(--red-ink); background: var(--red-tint); border: 3px solid var(--red-base); border-radius: 8px; font-family: var(--font-display); font-size: clamp(18px, 1.8vw, 24px); font-weight: 900; letter-spacing: .05em; transform: rotate(-6deg); animation: u7a-stamp 240ms cubic-bezier(.2, .8, .2, 1); }
.u7a-stamp[data-truth="true"] { color: var(--green-ink); background: var(--green-tint); border-color: var(--green-base); }
@keyframes u7a-stamp { from { opacity: 0; transform: rotate(-6deg) scale(1.35); } }
.u7a-verdicts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.u7a-verdict { min-width: 200px; min-height: 64px; font-size: clamp(20px, 2vw, 26px); font-weight: 900; }
.u7a-court__step { display: grid; justify-items: center; gap: 10px; width: 100%; }
.u7a-court__ask { margin: 0; color: var(--world-ink); font-size: clamp(17px, 1.6vw, 21px); font-weight: 900; text-align: center; overflow-wrap: anywhere; }
.u7a-court__try { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; }
.u7a-slots { display: flex; align-items: center; gap: 8px; }
.u7a-slots__and { color: var(--ink-2); font-size: clamp(17px, 1.6vw, 20px); font-weight: 900; }
.u7a-slot { min-width: 84px; min-height: var(--touch); padding: 0 10px; color: var(--ink); background: var(--world-model); border-color: var(--world-model-edge); border-style: dashed; font-size: clamp(22px, 2.2vw, 28px); font-weight: 900; }
.u7a-slot[data-value] { background: var(--surface); border-style: solid; }
.u7a-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.u7a-chip { min-width: 72px; min-height: var(--touch); padding: 0 10px; font-size: clamp(20px, 2vw, 26px); font-weight: 900; }
.u7a-record { margin: 0; padding: 4px 14px; color: var(--green-ink); background: var(--green-tint); border: 2px solid var(--green-base); border-radius: 12px; font-size: clamp(17px, 1.6vw, 21px); font-weight: 800; text-align: center; overflow-wrap: anywhere; }
/* The reasons are sentences: one a row, read from the left. */
.u7a-choices--reasons { display: grid; gap: 8px; width: min(100%, 880px); }
.u7a-choices--reasons .u7a-choice { min-width: 0; padding: 6px 14px; font-size: clamp(17px, 1.6vw, 21px); text-align: left; }

/* High contrast: no tints; marks speak through borders and weight. */
body.high-contrast .u7a-tile--x,
body.high-contrast .u7a-box--io { background: var(--surface); border-width: 3px; }
body.high-contrast .u7a-box--io :is(.u7a-box__op, .u7a-box__value) { color: var(--ink); }
body.high-contrast .u7a-branch[data-state="idle"] { opacity: 1; }
body.high-contrast .u7a-branch[data-state="idle"] .u7a-box { border-style: dashed; }
body.high-contrast .u7a-tunnel__ray { opacity: 1; }
body.high-contrast :is(.u7a-claim__tag, .u7a-slot) { background: var(--surface); }
body.high-contrast .u7a-claim__tag { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .u7a-scale__beam,
  .u7a-scale__pan { transition: none; }
  .u7a-stamp { animation: none; }
}

/* A short landscape board (1366 × 768): the kicker goes, as on the units 1–2 boards, and the figures slim so the
   controls stand above the instruction bar. */
@media (orientation: landscape) and (min-width: 900px) and (max-height: 820px) {
  .question-card--topic:has(.u7a-board) .question-kicker { display: none; }
  .question-card--topic:has(.u7a-board) .question-copy { margin-bottom: 8px; }
  .u7a-gates__scale { width: min(100%, 420px); }
  .u7a-tile { min-height: 42px; }
}

@media (max-width: 700px) {
  /* A 390 × 844 phone holds the whole round above the instruction bar: smaller figures, two choices a row. */
  .u7a-choice { min-width: 0; flex: 1 1 40%; padding: 4px 8px; }
  .u7a-choices { gap: 8px; }
  .u7a-choices--gates { gap: 6px; }
  .u7a-terms__line { gap: 4px; padding: 6px 8px; font-size: 20px; }
  .u7a-tile { min-height: 38px; padding: 2px 8px; }
  .u7a-baskets { gap: 8px; }
  .u7a-basket { min-width: 0; flex: 1 1 40%; padding: 4px 8px 6px; }
  .u7a-scale { max-height: 20vh; }
  .u7a-scale__label { font-size: 28px; }
  .u7a-toggle { min-width: 0; padding: 4px 10px; }
  .u7a-tick { font-size: 16px; }
  .u7a-flow__chart { gap: 6px; padding: 6px; }
  .u7a-box { min-width: 56px; padding: 2px 6px; }
  .u7a-diamond { width: 112px; height: 70px; padding: 0 18px; }
  .u7a-arrow { font-size: 18px; }
  /* The stamp joins the paper's flow so it never covers the tag or the claim. */
  .u7a-claim { padding: 8px 12px 10px; }
  .u7a-claim__text { font-size: 21px; }
  .u7a-stamp { position: static; justify-self: center; }
  .u7a-verdict { min-width: 0; min-height: 56px; }
  .u7a-court__step { gap: 8px; }
  .u7a-slot { min-width: 72px; }
  .u7a-chips { flex-wrap: nowrap; gap: 6px; width: 100%; }
  .u7a-chip { min-width: 0; flex: 1 1 0; padding: 0 2px; font-size: 20px; }
  .u7a-court__ask { font-size: 16px; }
  .u7a-choices--reasons { gap: 6px; }
  .u7a-choices--reasons .u7a-choice { padding: 4px 10px; font-size: 16px; }
}
