/* ═════════════════════ WIDGETS · chapter 3 + closing ═════════════════════ */

/* definitions */
.defs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; height: 100%; align-content: center; }
.def { border-radius: 32px; padding: 30px 30px 36px; background: linear-gradient(180deg, color-mix(in srgb, var(--dc) 15%, transparent), rgba(255,255,255,.02)); border: 1.5px solid color-mix(in srgb, var(--dc) 40%, transparent); cursor: help; display: flex; flex-direction: column; gap: 12px; min-height: 520px; }
.def svg { width: 100%; height: 190px; margin-bottom: 14px; }
.def h3 { font-size: 40px; line-height: 1.08; color: var(--dc); }
.def p { margin: 0; font-size: 31px; color: var(--text-2); font-weight: 550; line-height: 1.3; }
.def .d1a { animation: d1a 3s ease-in-out infinite; }
.def .d1b { animation: d1b 3s ease-in-out infinite; }
.def .d1c { animation: d1c 3s ease-in-out infinite; transform-origin: 230px 85px; }
@keyframes d1a { 0%, 30% { transform: translateX(0); opacity: 1; } 55%, 100% { transform: translateX(80px); opacity: 0; } }
@keyframes d1b { 0%, 30% { transform: translateX(0); opacity: 1; } 55%, 100% { transform: translateX(50px); opacity: 0; } }
@keyframes d1c { 0%, 45% { transform: scale(0); opacity: 0; } 60%, 90% { transform: scale(1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
.def .gear.g1 { animation: spin 4s linear infinite; }
.def .gear.g2 { animation: spin 4s linear infinite reverse; }
.def .d4p { animation: d4p 2.4s ease-in-out infinite; }
@keyframes d4p { 0%, 20% { transform: translateX(0); } 60%, 100% { transform: translateX(70px); opacity: 0; } }

/* yield */
.yield { display: flex; flex-direction: column; gap: 20px; height: 100%; justify-content: center; }
.yhead, .yrow { display: grid; grid-template-columns: 250px repeat(4, 1fr) 330px; gap: 18px; align-items: stretch; }
.yhead span { font-size: 26px; font-weight: 650; color: var(--text-3); text-align: center; }
.ytag { display: grid; place-items: center; border-radius: 24px; font-size: 36px; font-weight: 800; background: var(--yc); color: #000; cursor: help; }
.ycell { border-radius: 24px; padding: 22px 18px; background: color-mix(in srgb, var(--cc) 14%, transparent); border: 1.5px solid color-mix(in srgb, var(--cc) 45%, transparent); display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: help; }
.ycell.skip { background: rgba(255,255,255,.03); border-color: var(--hairline); opacity: .55; }
.ycx { font-size: 26px; font-weight: 800; color: var(--cc); }
.yh { display: flex; gap: 8px; min-height: 30px; font-size: 26px; color: var(--text-4); }
.yh i { width: 26px; height: 26px; border-radius: 50%; background: #ff453a; box-shadow: 0 0 14px #ff453a; }
.yn { font-size: 26px; font-weight: 700; color: var(--text-2); }
.ysum { display: flex; align-items: baseline; justify-content: center; gap: 12px; border-radius: 24px; background: rgba(255,214,10,.1); border: 1.5px solid rgba(255,214,10,.45); padding: 20px; flex-wrap: wrap; }
.yeq { font-size: 26px; color: var(--text-2); font-weight: 600; width: 100%; text-align: center; }
.ysum b { font-size: 76px; font-weight: 800; color: #ffd60a; line-height: 1; letter-spacing: -0.03em; }
.yu { font-size: 32px; font-weight: 750; color: var(--text-2); }
.yfoot { display: flex; align-items: center; gap: 30px; margin-top: 20px; }
.yrule { font-size: 36px; font-weight: 800; padding: 14px 30px; border-radius: 999px; background: #fff; color: #000; cursor: help; }
.ynote { font-size: 26px; color: var(--text-3); }

/* classes */
.classes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; height: 100%; align-content: center; }
.cls { position: relative; border-radius: 34px; padding: 36px 40px 44px; background: linear-gradient(180deg, color-mix(in srgb, var(--kc) 14%, transparent), rgba(255,255,255,.02)); border: 1.5px solid color-mix(in srgb, var(--kc) 40%, transparent); cursor: help; min-height: 560px; display: flex; flex-direction: column; }
.cls .kn { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--kc); color: #000; font-size: 34px; font-weight: 800; }
.cls svg { width: 100%; height: 220px; margin: 20px 0; }
.cls h3 { font-size: 44px; line-height: 1.05; }
.cls p { margin: 14px 0 0; font-size: 31px; color: var(--text-2); font-weight: 550; }

/* chain */
[data-widget="chain"] > svg { height: 330px; }
.chpanel { display: flex; gap: 28px; margin-top: 30px; align-items: flex-start; }
.chcol { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 24px; border-radius: 28px; background: color-mix(in srgb, var(--sc) 10%, transparent); border: 1.5px solid color-mix(in srgb, var(--sc) 40%, transparent); }
.chh { font-size: 26px; font-weight: 700; color: var(--sc); margin-bottom: 4px; }
.inh { text-align: left; cursor: pointer; font-size: 30px; font-weight: 650; padding: 14px 22px; border-radius: 18px; border: 1.5px solid var(--hairline); background: rgba(255,255,255,.05); transition: all .35s var(--ease); }
.inh:hover { background: rgba(255,255,255,.1); }
.inh.on { background: #ff453a; border-color: #ff453a; color: #fff; box-shadow: 0 0 30px rgba(255,69,58,.45); }
.chclear { align-self: center; font-size: 26px; padding: 16px 28px; }

/* toxin lab */
.lab { margin-top: 30px; display: flex; flex-direction: column; gap: 26px; }
.agents { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ag { text-align: left; cursor: pointer; padding: 14px 20px; border-radius: 20px; border: 1.5px solid var(--hairline); background: rgba(255,255,255,.05); display: flex; flex-direction: column; gap: 2px; transition: all .35s var(--ease); }
.ag b { font-size: 28px; }
.ag span { font-size: 21px; color: var(--text-3); font-weight: 600; min-height: 1em; }
.ag:hover { background: rgba(255,255,255,.1); }
.ag.on { background: #fff; border-color: #fff; color: #000; }
.ag.on b { color: #000; } .ag.on span { color: #555; }
.gauges { display: flex; flex-direction: column; gap: 14px; }
.gauge { display: grid; grid-template-columns: 230px 1fr 150px; align-items: center; gap: 16px; }
.gn { font-size: 26px; font-weight: 650; }
.gt { height: 22px; border-radius: 11px; background: rgba(255,255,255,.08); overflow: hidden; }
.gt i { display: block; height: 100%; width: 0; border-radius: 11px; background: var(--gc); box-shadow: 0 0 18px var(--gc); transition: width .35s linear; }
.gv { font-size: 24px; font-weight: 700; color: var(--text-2); text-align: right; }
.labnote { margin: 0; font-size: 21px; color: var(--text-4); }

/* recap */
.recap { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 24px; height: 100%; }
.rtile { border-radius: 34px; padding: 36px 42px; background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 1px solid var(--hairline); display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; opacity: 0; transform: translateY(30px) scale(.97); }
.rtile.in { animation: tileIn .9s var(--ease) forwards; animation-delay: calc(.25s + var(--d)); }
@keyframes tileIn { to { opacity: 1; transform: none; } }
.rbig { font-size: 92px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; margin-bottom: 10px; }
.rtile b { font-size: 36px; letter-spacing: -0.02em; }
.rs { font-size: 26px; color: var(--text-3); font-weight: 550; }

/* quiz CTA */
.qcta { height: 100%; display: grid; grid-template-columns: 1fr 460px; gap: 80px; align-items: center; }
.qtitle { font-size: 170px; letter-spacing: -0.05em; line-height: .95; background: linear-gradient(180deg, #fff 30%, #9a9aa2); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.qsub { font-size: 40px; color: var(--text-2); font-weight: 550; line-height: 1.3; margin: 30px 0 50px; max-width: 1050px; }
.qsub b { color: #ffd60a; }
.qbtns { display: flex; align-items: center; gap: 30px; }
.qbtns .btn { font-size: 36px; padding: 26px 50px; }
.qhint { font-size: 26px; color: var(--text-3); }
.qqr { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.qrbox { width: 420px; height: 420px; padding: 26px; border-radius: 36px; background: #fff; }
.qrbox svg { width: 100%; height: 100%; display: block; }
.qqr span { font-size: 28px; color: var(--text-2); font-weight: 600; }
