/* Act 04 · How do you name element 120? */
/* the naming machine (chem1103-a04-namer.js): digits → roots → name → symbol, with the key of ten roots */
.a4-namer .a4-mach { position: absolute; z-index: 2; left: var(--xp-g); right: var(--xp-g); top: calc(var(--xp-bar) + 150px); display: grid; gap: 18px; align-content: start; }
.a4-mach .xp-k { display: block; margin-bottom: 8px; }
.a4-digits { display: flex; gap: 10px; }
.a4-d { display: grid; justify-items: center; gap: 6px; width: 76px; opacity: var(--a, 0); transform: translateY(calc((1 - var(--a, 0)) * 14px)); }
.a4-d b { display: grid; place-items: center; width: 76px; height: 64px; border: 1px solid color-mix(in srgb, var(--xp-hd) 70%, transparent); background: color-mix(in srgb, var(--xp-hd) 16%, var(--void)); border-radius: 4px; font-size: 40px; font-weight: 500; letter-spacing: -0.03em; color: var(--bone); font-variant-numeric: tabular-nums; }
.a4-d i { font-style: normal; font-size: 19px; color: var(--bone); opacity: var(--r, 0); }
.a4-word { margin: 0; font-size: clamp(1.9rem, 9vw, 3.4rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 500; color: var(--bone); min-height: 1.1em; overflow-wrap: anywhere; }
.a4-word span { opacity: var(--a, 0); transition: opacity .3s; }
.a4-word span.end { color: var(--mix-2); }
.a4-word.ruled span.cut { opacity: calc(var(--a, 0) * .35); text-decoration: line-through; text-decoration-thickness: 2px; }
.a4-out { display: flex; align-items: center; gap: 16px; }
.a4-out .c3-tile { width: 76px; opacity: var(--a, 0); }
.a4-out .c3-tile b { font-size: 24px; }
.a4-official { margin: 0; font-size: 17px; color: var(--mix-2); opacity: var(--a, 0); }
.a4-official b { color: var(--bone); font-weight: 500; }
.a4-key { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-width: 420px; }
.a4-key li { display: grid; gap: 2px; padding: 6px 8px; border: 1px solid var(--hairline); border-radius: 4px; transition: background .3s, border-color .3s; }
.a4-key li b { font-size: 14px; font-weight: 500; color: var(--mix-3); font-variant-numeric: tabular-nums; }
.a4-key li span { font-size: 15px; color: var(--mix-2); }
.a4-key li.on { border-color: color-mix(in srgb, var(--xp-hd) 70%, transparent); background: color-mix(in srgb, var(--xp-hd) 18%, transparent); }
.a4-key li.on b, .a4-key li.on span { color: var(--bone); }
@media (max-height: 760px) and (max-width: 899px) { .a4-key { display: none; } .a4-namer .a4-mach { top: calc(var(--xp-bar) + 130px); gap: 12px; } }
@media (min-width: 900px) {
  .a4-namer .a4-mach { left: 46%; right: var(--xp-g); top: 50%; translate: 0 -50%; gap: 26px; }
  .a4-d, .a4-d b { width: 96px; } .a4-d b { height: 80px; font-size: 50px; }
}
html.xp-reduced .a4-namer .a4-mach { position: relative; inset: auto; translate: none; margin: 0 var(--xp-g) 24px; }

/* the ten roots as a strip: digit, root, first letter */
.a4-roots { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 900px) { .a4-roots { grid-template-columns: repeat(10, minmax(0, 1fr)); margin-left: var(--xp-col); max-width: 900px; } }
.a4-roots li { display: grid; gap: 4px; padding: 10px 8px; border: 1px solid color-mix(in srgb, var(--xp-hd) 55%, transparent); background: color-mix(in srgb, var(--xp-hd) 10%, var(--void)); border-radius: 4px; text-align: center; }
.a4-roots b { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; color: var(--bone); font-variant-numeric: tabular-nums; }
.a4-roots span { font-size: 17px; color: var(--bone); }
.a4-roots i { font-style: normal; font-size: 14px; color: var(--mix-3); }
.a4-roots i u { text-decoration: none; border-bottom: 1px solid var(--mix-3); }

/* "new" long-form sketch: callouts hang below and above */
#s-new .xa-box { margin: 70px 0 90px; }
/* the lite table of 101–118 as one card per element on a phone: each cell carries its column name */
@media (max-width: 899px) {
  #s-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #s-table table, #s-table tbody { display: block; width: 100%; }
  #s-table tr { display: grid; grid-template-columns: 44px 1fr 56px; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--hairline); align-items: baseline; }
  #s-table td { padding: 0; border: 0; font-size: 15px; }
  #s-table td:nth-child(1) { grid-row: span 2; font-weight: 500; font-size: 17px; font-variant-numeric: tabular-nums; }
  #s-table td:nth-child(2), #s-table td:nth-child(3) { color: var(--mix-2); }
  #s-table td:nth-child(4) { grid-column: 2; color: var(--bone); }
  #s-table td:nth-child(5) { grid-column: 3; color: var(--bone); }
}
