/* ============================================================
   AA — week 3 animation styles (anim-w3.js). Theme tokens only.
   ============================================================ */

/* countdown strip */
.anim .w3-strip .cell { min-width: 2rem; }
.anim .w3-strip.w3-small { gap: 2px; }
.anim .w3-strip.w3-small .cell { min-width: 1.55rem; height: 1.45rem; font-size: .58rem; padding: 0 .1rem; }
.anim .w3-strip .cell.w3-stop { border: 2px dashed var(--red); color: var(--red); background: transparent; }
.anim .w3-strip .cell.w3-stop.bad { background: var(--red-soft); }

/* grids drawn on canvas */
.anim canvas.w3-grid { margin-top: .3rem; max-width: 700px; }
.anim canvas.w3-sq { width: 100%; max-width: 300px; margin-top: .3rem; image-rendering: pixelated; }
.anim canvas.w3-mcanvas { max-width: 666px; margin-top: .4rem; }

/* table + chart side by side */
.w3-two { display: grid; grid-template-columns: minmax(0, 1fr); gap: .4rem; margin-top: .8rem; }

/* nested: grid + bars */
.w3-nest { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.w3-bars { display: flex; flex-direction: column; gap: .55rem; margin-top: .45rem; }
.w3-brow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .5rem; align-items: center; font-family: var(--font-mono); font-size: .68rem; }
.w3-brow b { color: var(--heading); font-weight: 700; text-align: right; }
.w3-blab { grid-column: 1 / -1; color: var(--muted); }
.w3-btrack { height: 14px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.w3-bar { display: block; height: 100%; transition: width .2s ease; }
.w3-b-add { background: var(--blue); }
.w3-b-you { background: var(--muted); }
.w3-b-now { background: var(--accent); }

/* halving chain */
.w3-chain { font-family: var(--font-mono); font-size: .72rem; line-height: 1.9; margin-top: .5rem; color: var(--muted); min-height: 3.8em; overflow-wrap: anywhere; }
.w3-chain b { color: var(--heading); font-weight: 400; }
.w3-chain b.now { color: var(--accent); font-weight: 700; }

/* first multiple */
.anim .w3-mgrid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.anim .w3-mgrid .cell { min-width: 0; height: 1.75rem; font-size: .68rem; padding: 0; }
.anim .w3-mgrid .cell.w3-seen { opacity: .45; }
.anim .w3-mgrid .cell.w3-m7 { border-color: var(--blue); color: var(--blue); }
.anim .w3-mgrid .cell.w3-m9 { border-color: var(--green); color: var(--green); }
.anim .w3-mgrid .cell.gold { font-weight: 700; transform: scale(1.12); }
.w3-legend span { margin-right: .7rem; white-space: nowrap; }
.w3-legend span::before { content: ""; display: inline-block; width: .6rem; height: .6rem; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }
.w3-k7::before { background: var(--blue); }
.w3-k9::before { background: var(--green); }
.w3-kg::before { background: var(--accent); }
.w3-kr::before { background: var(--red); }

/* fizzbuzz strip */
.w3-fb { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; margin-bottom: .9rem; }
.w3-fbt { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); padding: .25rem .1rem; text-align: center; font-family: var(--font-mono); min-width: 0; transition: all .2s ease; }
.w3-fbt .num { display: block; font-size: .62rem; color: var(--muted); }
.w3-fbt .said { display: block; font-size: .6rem; min-height: 1.1em; color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w3-fbt.on { border-color: var(--blue); background: var(--blue-soft); transform: translateY(-3px); }
.w3-fbt.f3 { border-color: var(--green); } .w3-fbt.f3 .said { color: var(--green); }
.w3-fbt.f5 { border-color: var(--blue); } .w3-fbt.f5 .said { color: var(--blue); }
.w3-fbt.fz { border-color: var(--accent); background: var(--accent-soft); } .w3-fbt.fz .said { color: var(--accent); font-weight: 700; }
.w3-fbt.bad { border: 2px solid var(--red); background: var(--red-soft); } .w3-fbt.bad .said { color: var(--red); font-weight: 700; }
.w3-you .anim-msg { margin-top: 0; }
.w3-you .anim-opts { margin: .6rem 0 0; }

@media (max-width: 640px) {
  .w3-nest { grid-template-columns: minmax(0, 1fr); }
  .w3-fb { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .w3-fbt .said { font-size: .66rem; }
}

/* option rows: let long segmented controls wrap instead of overflowing; tables may shrink */
.anim .w3-opts .seg { flex-wrap: wrap; max-width: 100%; }
.anim .w3-opts .seg button { white-space: nowrap; }
.anim .w3-opts > span { max-width: 100%; }
.anim-table.w3-tbl { min-width: 0; }
