/* Atoms game, placement test: periodic table box, particle counts, and the Bohr and Lewis diagram builder. */
.ptile { display: inline-grid; grid-template-columns: auto; justify-items: center; margin: 12px auto 0; padding: 8px 18px 10px; min-width: 92px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--bg); line-height: 1.15; position: relative; }
.ptile .z { font-weight: 700; font-size: 1rem; }
.ptile b { font-size: 2.2rem; font-weight: 800; }
.ptile .nm { font-size: .9rem; color: var(--muted); }
.ptile .am { font-size: .95rem; font-weight: 600; }

.pne { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pne-f { display: grid; gap: 4px; justify-items: center; font-weight: 600; color: var(--muted); font-size: .9rem; }
.pne-f input { width: 100%; box-sizing: border-box; text-align: center; font-size: 1.5rem; font-weight: 800; }
.pne-f i { font-style: normal; font-weight: 800; color: var(--ink); font-size: 1.05rem; }

.dg-box { text-align: left; }
.dg-stage { position: relative; margin: 4px auto 0; max-width: 360px; }
/* Diagram questions keep everything needed to play on one screen (an iPhone 16 in the browser, or a laptop window). */
.qcard:has(.q-dg) { min-height: 0; padding: 8px 14px 10px; }
.qcard:has(.q-dg) .q-label { font-size: .9rem; }
.q-main.q-dg { font-size: 1.35rem; margin-top: 0; line-height: 1.2; }
.streak-zone:has(+ .qcard .q-dg) { height: 26px; }
.qcard:has(.q-dg) + .answers { margin-top: 8px; }
.qcard:has(.q-dg) + .answers .check-btn { margin-top: 6px; }
.qcard:has(.q-dg) + .answers #dg-msg:empty { min-height: 0; margin: 0; }
.dg-line { padding: 8px 12px; font-size: 1rem; }
/* The drawing shrinks on short screens so the buttons and Check stay in view. */
.dg-box .dg-stage { max-width: clamp(220px, calc(100svh - 390px), 340px); }
.dg { display: block; width: 100%; height: auto; touch-action: manipulation; user-select: none; }
.dg-ring { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.dg-nuc { fill: var(--accent); }
.dg-lbox { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 4 3; }
.dg-slot { fill: transparent; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 3 3; cursor: pointer; outline: none; }
.dg-slot.on { stroke: transparent; }
.dg-slot:hover, .dg-slot:focus-visible { stroke: var(--accent); stroke-dasharray: none; }
.dg-e { fill: var(--ink); pointer-events: none; }
.dg-sym { font: 800 44px 'IBM Plex Sans', sans-serif; fill: var(--ink); }
.dg-nsym { font: 800 26px 'IBM Plex Sans', sans-serif; fill: #fff; }
.dg-pn { font: 700 15px 'IBM Plex Sans', sans-serif; fill: #fff; }
.dg-br { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: square; }
.dg-ch { font: 700 24px 'IBM Plex Sans', sans-serif; fill: var(--ink); }
/* The typing box in the middle of the diagram (mirrors the line above it). */
.dg-core { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.dg-core input { border: 0; background: transparent; text-align: center; font-family: inherit; font-weight: 800; padding: 0; outline: none; border-radius: 6px; }
.dg-core input:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
.dg-core-sym { width: 100%; font-size: 30px; line-height: 1.1; }
.dg-core.nuc input { color: #fff; }
.dg-core.nuc input::placeholder { color: #fff; opacity: .45; }
.dg-core.lew .dg-core-sym { font-size: 38px; color: var(--ink); }
.dg-core.lew input::placeholder { color: var(--ink); opacity: .35; }
.dg-core.big .dg-core-sym { font-size: 24px; }
.dg-pn-row { display: flex; align-items: center; gap: 3px; color: #fff; font-weight: 700; font-size: 14px; }
.dg-pn-in { width: 30px; font-size: 15px; background: rgba(255, 255, 255, .18) !important; }
.dg-tip { color: var(--muted); font-size: .8rem; line-height: 1.3; margin: 2px 0 6px; text-align: center; }
.dg-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.dg-btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; min-height: 44px; padding: 0 10px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.dg-btn.sq { width: 44px; padding: 0; font-size: 1.3rem; }
.dg-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dg-btn:disabled { opacity: .5; cursor: default; }
.dg-charge { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; }
.dg-chv { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1; min-width: 3em; }
.dg-chv small { font-size: .7rem; }
.dg-charge b { text-align: center; color: var(--ink); font-size: 1.05rem; }
.dg-reveal { max-width: 230px; margin: 0 auto; }
.dg-core[hidden] { display: none; }
