/* Chapter 1: scene text, ion cards, atom counter, naming match and the ion-card builder. */

.sc-title { font: 700 40px system-ui, sans-serif; fill: #e8eefc; }
.sc-text { font: 600 30px system-ui, sans-serif; fill: #e8eefc; }
.sc-note { font: 600 24px system-ui, sans-serif; fill: #9fb4dd; }
.sc-formula { font: 800 52px system-ui, sans-serif; fill: #fff; }
.sc-formula.small { font-size: 40px; }
.sc-big { font: 800 88px system-ui, sans-serif; fill: #fff; }
.sc-huge { font: 800 200px system-ui, sans-serif; fill: #fff; }
.sc-huge-sub { font: 800 110px system-ui, sans-serif; fill: #ffd166; }
.sc-formula.gold, .sc-big.gold, .gold-fill { fill: #ffd166; }
.sc-formula.bad, .sc-big.bad { fill: #ff8a8a; }
.sc-formula.pos, .ion-total.pos { fill: #74c0fc; }
.sc-formula.neg, .ion-total.neg { fill: #ff8fab; }

.ion-label { font: 800 26px system-ui, sans-serif; fill: #fff; }
.ion-label.small { font-size: 22px; }
.ion-sign { font: 800 22px system-ui, sans-serif; fill: rgba(255, 255, 255, .7); }
.ion-total { font: 800 34px system-ui, sans-serif; }
.atom-letter { font-weight: 800; font-family: system-ui, sans-serif; fill: #14213d; }

/* Shared activity bits */
.chip-btn.hint { box-shadow: 0 0 0 3px var(--gold); }
.chip-btn sub, .chip-btn sup, .count-formula sub, .build-formula sub, .made-chip sub { line-height: 0; }

.calc-values { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px; }
.calc-field { display: flex; align-items: center; gap: 6px; font-weight: 700; color: #cfd9ef; }
.calc-input {
  width: 4.5em;
  font: 700 1.1em ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: .45em .6em;
  border-radius: .6em;
  border: 2px solid #3a4f7d;
  background: #0f1a33;
  color: #fff;
  text-align: center;
}
.calc-input:focus { outline: none; border-color: var(--gold); }
.calc-input.wrong { border-color: var(--bad); }
.calc-input.correct { border-color: var(--ok); background: #143a28; }

.count-formula { margin: 0; font-size: max(30px, 5cqw); font-weight: 800; letter-spacing: .02em; color: #fff; }

/* Naming match */
.formula-btn { font-size: 1.1em; }
.name-match { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }

/* Ion-card builder */
.goals { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; }
.goal { font-weight: 700; color: #9fb4dd; }
.goal.met { color: #c9f7d4; }
.palettes { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: max(8px, 1.4cqw); }
.palette-group { display: flex; flex-direction: column; gap: 4px; }
.palette-group .lab-label { margin: 0; font-weight: 800; color: #cfd9ef; font-size: .9em; }
.lab-label { margin: 0; font-weight: 700; color: #cfd9ef; text-align: center; }
.ion-palette { display: flex; flex-wrap: wrap; gap: 5px; }
.ion-pick { padding: .3em .55em; font-weight: 800; text-align: center; min-width: 3.2em; }
.ion-pick.cat { border-color: #2f6db5; }
.ion-pick.an { border-color: #a3456b; }

.bench {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: max(6px, 1cqw);
  border-radius: .8em;
  background: rgba(255, 255, 255, .05);
  border: 1px dashed rgba(255, 255, 255, .2);
}
.bench-row { display: flex; align-items: center; gap: 8px; min-height: 2.8em; }
.stepper { display: flex; gap: 4px; flex: none; }
.step-btn { padding: .15em .7em; font-size: 1.1em; line-height: 1.2; }
.bench-cards { display: flex; gap: 0; flex: 1; min-width: 0; }
.bench-empty { color: #9fb4dd; font-style: italic; align-self: center; }
.bench-total { flex: none; min-width: 2.4em; font-weight: 800; font-size: 1.15em; text-align: right; }
.bench-total.pos { color: #74c0fc; }
.bench-total.neg { color: #ff8fab; }

.ion-card {
  --u: min(2.8em, 8.5cqw);
  box-sizing: border-box;
  width: calc(var(--c) * var(--u));
  height: 2.6em;
  margin-right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: .5em;
  border: 2px solid;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25);
  font-size: .9em;
  line-height: 1.05;
  animation: land .3s ease-out;
  overflow: hidden;
}
.ion-card.cat { background: #1d4f8f; border-color: #74c0fc; }
.ion-card.an { background: #7a2848; border-color: #ff8fab; }
.ion-card b { white-space: nowrap; }
.ion-card i { font-style: normal; font-weight: 800; letter-spacing: .3em; opacity: .7; font-size: .85em; }
.ion-card sub, .ion-card sup { line-height: 0; }

.charge-readout { margin: 0; text-align: center; font-weight: 800; color: #cfd9ef; padding: .2em .6em; border-radius: .5em; border: 2px solid transparent; }
.charge-readout.zero { color: #c9f7d4; }
.build-result { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.build-result[hidden] { display: none; }
.build-formula { margin: 0; font-size: max(26px, 4cqw); font-weight: 800; color: var(--gold); }
.name-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.name-options .chip-btn { text-align: center; }
.made-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.made-chip { padding: .3em .7em; border-radius: .6em; background: #1f5a3a; border: 1px solid var(--ok); font-weight: 800; }
.made-chip small { font-weight: 500; opacity: .85; }
.build-note { margin: 0; text-align: center; font-size: .8em; color: #9fb4dd; }

@container (max-width: 620px) {
  .palettes { grid-template-columns: 1fr; }
  .name-match { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .ion-card { font-size: .75em; }
  .step-btn { padding: .1em .5em; }
}
