/* Waste Heroes. A game for young recyclers.
   Soft surfaces, rounded shapes, one idea per screen, and motion that
   rewards without distracting. No heavy outlines: 1px hairlines at most. */
@font-face { font-family: "Outfit"; src: url("/fonts/Outfit-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/fonts/Figtree-latin.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  --bg: #F6F8FC; --surface: #FFFFFF; --ink: #1F1F1F; --ink2: #444746; --ink3: #747775; --hair: #E3E7EE;
  --blue: #1A73E8; --blue-t: #D3E3FD; --green: #1E8E3E; --green-t: #C4EED0; --yellow: #F9AB00; --yellow-t: #FEEFC3;
  --red: #D93025; --red-t: #FAD2CF; --purple: #8430CE; --purple-t: #E9D2FD; --teal: #007B83; --teal-t: #C2E7EA;
  --r-s: 14px; --r-m: 22px; --r-l: 32px;
  --e1: 0 1px 2px rgba(31,31,31,.06), 0 1px 3px rgba(31,31,31,.08);
  --e2: 0 2px 6px rgba(31,31,31,.06), 0 8px 24px rgba(31,31,31,.08);
  --display: "Outfit", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 17px/1.5 var(--body); color: var(--ink); background: var(--bg); overflow-x: hidden; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
svg { display: block; width: 100%; height: 100%; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.01em; margin: 0; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── top bar ── */
.bar { position: sticky; top: 0; z-index: 20; background: rgba(246,248,252,.86); backdrop-filter: blur(12px); }
.bar-in { max-width: 1080px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.logo { display: flex; align-items: center; gap: 10px; font: 700 19px var(--display); text-decoration: none; color: var(--ink); }
.logo i { width: 34px; height: 34px; display: block; }
.spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--e1); font: 700 15px var(--display); }
.chip i { width: 20px; height: 20px; display: block; }
.chip.xp b { color: var(--blue); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--e1); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { transform: scale(.92); }

main { max-width: 1080px; margin: 0 auto; padding: 8px 16px 40px; }
.screen { animation: screenIn .5s var(--ease) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── home ── */
.hero { position: relative; border-radius: var(--r-l); background: linear-gradient(135deg, #E8F0FE 0%, #E6F4EA 60%, #FEF7E0 100%); padding: 34px 26px; overflow: hidden; display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; align-items: center; min-height: 340px; }
.hero h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1.02; }
.hero h1 span { color: var(--green); }
.hero p { font-size: 19px; color: var(--ink2); margin: 14px 0 22px; max-width: 420px; }
.hero-art { position: relative; height: 290px; }
.hero-art .bini { position: absolute; left: 50%; bottom: 0; width: 170px; height: 170px; transform: translateX(-50%); animation: bob 3.2s ease-in-out infinite; }
.hero-art .drop { position: absolute; width: 62px; height: 62px; top: -70px; animation: drop 4.8s var(--ease) infinite both; opacity: 0; }
.hero-art .drop:nth-child(2) { left: 18%; animation-delay: 0s; }
.hero-art .drop:nth-child(3) { left: 44%; animation-delay: 1.6s; }
.hero-art .drop:nth-child(4) { left: 68%; animation-delay: 3.2s; }
@keyframes drop {
  0% { transform: translate(0, 0) rotate(-20deg); opacity: 0; }
  12% { opacity: 1; }
  55% { transform: translate(var(--dx, 0), 150px) rotate(20deg); opacity: 1; }
  70% { transform: translate(var(--dx, 0), 190px) scale(.4) rotate(40deg); opacity: 0; }
  100% { opacity: 0; }
}
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -8px); } }
.hero .blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 26px; border-radius: 999px; background: var(--blue); color: #fff; font: 700 17px var(--display); box-shadow: 0 2px 0 rgba(0,0,0,.08), var(--e1); transition: transform .2s var(--spring), box-shadow .2s; text-decoration: none; }
.btn:hover { box-shadow: var(--e2); transform: translateY(-1px); }
.btn:active { transform: scale(.96); }
.btn.green { background: var(--green); }
.btn.tonal { background: var(--blue-t); color: #041E49; box-shadow: none; }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: var(--e1); }
.btn.sm { height: 42px; padding: 0 18px; font-size: 15px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.section-title { display: flex; align-items: baseline; gap: 10px; margin: 30px 4px 14px; }
.section-title h2 { font-size: 26px; }
.section-title span { color: var(--ink3); font-weight: 600; }

/* level map */
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); gap: 16px; }
.level { position: relative; text-align: left; background: var(--surface); border-radius: var(--r-m); padding: 18px 18px 16px; box-shadow: var(--e1); transition: transform .25s var(--spring), box-shadow .25s; overflow: hidden; display: flex; flex-direction: column; gap: 10px; min-height: 212px; }
.level:hover { transform: translateY(-4px); box-shadow: var(--e2); }
.level:active { transform: scale(.98); }
.level .art { width: 86px; height: 86px; border-radius: 26px; display: grid; place-items: center; padding: 12px; }
.level .n { font: 700 13px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.level h3 { font-size: 22px; }
.level p { color: var(--ink2); font-size: 15px; }
.level .stars { display: flex; gap: 2px; margin-top: auto; }
.level .stars i { width: 22px; height: 22px; display: block; }
.level.locked { opacity: .6; }
.level .lock { position: absolute; top: 14px; right: 14px; height: 28px; padding: 0 10px; border-radius: 999px; background: #EEF1F6; color: var(--ink3); font: 700 13px var(--display); display: flex; align-items: center; gap: 4px; }
.level.locked::after { content: ""; position: absolute; inset: 0; background: rgba(246,248,252,.35); }
.level .done { position: absolute; top: 14px; right: 14px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--green-t); color: #0D652D; font: 700 13px var(--display); display: flex; align-items: center; }

/* badges */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.badge { background: var(--surface); border-radius: var(--r-m); padding: 16px 12px; text-align: center; box-shadow: var(--e1); }
.badge .medal { width: 70px; height: 70px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; padding: 14px; transition: transform .4s var(--spring); }
.badge b { display: block; font: 700 15px var(--display); }
.badge small { color: var(--ink3); font-size: 13px; }
.badge.off .medal { filter: grayscale(1); opacity: .35; }
.badge.new .medal { animation: medal 1s var(--spring); }
@keyframes medal { 0% { transform: scale(.2) rotate(-90deg); } 100% { transform: none; } }

/* ── level screens ── */
.crumbs { display: flex; align-items: center; gap: 10px; margin: 6px 0 16px; }
.back { text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 8px; border-radius: 999px; background: var(--surface); box-shadow: var(--e1); font: 700 15px var(--display); }
.back svg { width: 20px; height: 20px; }
.progress { flex: 1; height: 10px; border-radius: 999px; background: #E4E9F2; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green), #34A853); transition: width .6s var(--ease); }

.stage { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--e1); padding: 26px 22px; min-height: 420px; position: relative; overflow: hidden; }
.stage h2 { font-size: clamp(26px, 4vw, 36px); text-align: center; }
.stage .sub { text-align: center; color: var(--ink2); margin: 8px auto 20px; max-width: 520px; font-size: 18px; }

.say { display: flex; align-items: flex-end; gap: 12px; margin: 0 auto 18px; max-width: 560px; }
.say .who { width: 70px; height: 70px; flex: 0 0 70px; }
.say .bubble { position: relative; background: var(--blue-t); color: #041E49; border-radius: 22px 22px 22px 6px; padding: 12px 16px; font: 600 17px/1.4 var(--display); animation: pop .45s var(--spring) both; }

/* flip cards (the 4 Rs) */
.flips { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.flip { perspective: 900px; height: 220px; }
.flip-in { position: relative; width: 100%; height: 100%; transition: transform .7s var(--spring); transform-style: preserve-3d; }
.flip.on .flip-in { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; border-radius: var(--r-m); backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 18px; text-align: center; }
.face .pic { width: 92px; height: 92px; }
.face b { font: 800 26px var(--display); }
.face small { font-size: 13px; font-weight: 700; opacity: .7; }
.face.rear { transform: rotateY(180deg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); }
.face.rear p { font: 600 18px/1.35 var(--display); }
.face.rear em { font-style: normal; color: var(--ink2); font-size: 15px; }

/* choice quiz */
.q { max-width: 620px; margin: 0 auto; text-align: center; }
.q .pic { width: 150px; height: 150px; margin: 0 auto 14px; animation: pop .5s var(--spring) both; }
.q .pics { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; }
.q .pics > div { width: 120px; height: 120px; animation: pop .5s var(--spring) both; }
.q .pics .arrow { width: 40px; height: 40px; color: var(--ink3); animation-delay: .1s; }
.q .pics > div:last-child { animation-delay: .2s; }
.q h3 { font-size: 24px; margin-bottom: 18px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.choice { height: 64px; border-radius: var(--r-s); background: var(--bg); font: 700 18px var(--display); display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform .2s var(--spring), background .2s; box-shadow: inset 0 0 0 1px var(--hair); }
.choice:hover { background: var(--blue-t); }
.choice:active { transform: scale(.96); }
.choice.right { background: var(--green-t); color: #0D652D; box-shadow: none; animation: yay .5s var(--spring); }
.choice.wrong { background: var(--red-t); color: #8C1D18; box-shadow: none; animation: shake .4s; }
.choice .code { width: 38px; height: 38px; }
@keyframes yay { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.feedback { min-height: 30px; margin-top: 14px; font: 700 18px var(--display); }
.feedback.good { color: var(--green); } .feedback.bad { color: var(--red); }

/* plastic codes */
.codes { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin: 6px 0 14px; }
.codes button { background: var(--bg); border-radius: var(--r-s); padding: 8px 4px 6px; transition: transform .2s var(--spring), background .2s; }
.codes button.on { background: var(--blue-t); transform: translateY(-3px); }
.codes .c { width: 52px; height: 52px; margin: 0 auto; }
.codes span { display: block; font: 700 12px var(--display); color: var(--ink2); margin-top: 2px; }
.code-card { display: flex; gap: 14px; align-items: center; background: var(--bg); border-radius: var(--r-m); padding: 14px 16px; min-height: 104px; animation: pop .35s var(--spring) both; }
.code-card .pics { display: flex; gap: 6px; }
.code-card .pics div { width: 58px; height: 58px; }
.code-card b { font: 700 20px var(--display); display: block; }
.code-card .ok { font-weight: 700; font-size: 14px; }

/* magnet lab */
.lab { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 18px 0; }
.lab-item { position: relative; background: var(--bg); border-radius: var(--r-m); padding: 16px 12px 14px; text-align: center; min-height: 190px; touch-action: none; }
.lab-item .thing { width: 100px; height: 100px; margin: 0 auto; transition: transform .3s var(--spring); }
.lab-item.stuck .thing { animation: jiggle .6s var(--spring); }
.lab-item b { display: block; font: 700 17px var(--display); margin-top: 6px; }
.lab-item small { display: block; color: var(--ink2); font-weight: 600; min-height: 22px; }
.lab-item.target { background: var(--yellow-t); }
.lab-item.res-steel { background: var(--green-t); }
.lab-item.res-alu { background: var(--blue-t); }
.lab-item small { font-size: 16px; margin-top: 2px; }
@keyframes jiggle { 0% { transform: translateY(0); } 30% { transform: translateY(-14px); } 60% { transform: translateY(-6px); } 100% { transform: translateY(-10px); } }
.magnet { width: 78px; height: 78px; margin: 0 auto; cursor: grab; touch-action: none; transition: transform .2s var(--spring); position: relative; z-index: 5; }
.magnet.dragging { cursor: grabbing; transform: scale(1.1) rotate(-8deg); }

/* sorting race */
.race-top { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--bg); font: 700 16px var(--display); }
.pill.time.low { background: var(--red-t); color: var(--red); animation: yay .6s infinite; }
.tray { position: relative; height: 170px; display: grid; place-items: center; }
.item { width: 130px; height: 130px; touch-action: none; cursor: grab; transition: transform .25s var(--spring), opacity .25s; animation: pop .45s var(--spring) both; user-select: none; }
.item.dragging { cursor: grabbing; transition: none; z-index: 30; filter: drop-shadow(0 12px 18px rgba(0,0,0,.18)); }
.item.gone { transform: scale(.2); opacity: 0; }
.item-name { text-align: center; font: 700 18px var(--display); min-height: 28px; }
.bins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.bin { background: var(--bg); border-radius: var(--r-m); padding: 10px 6px 12px; text-align: center; transition: transform .25s var(--spring), background .2s; }
.bin .b { width: 84px; height: 84px; margin: 0 auto; position: relative; }
.bin .mini { position: absolute; left: 50%; top: 46%; width: 34px; height: 34px; transform: translate(-50%, -50%); background: #fff; border-radius: 50%; padding: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.bin b { font: 700 14px var(--display); display: block; line-height: 1.2; }
.bin.over { transform: translateY(-6px) scale(1.04); background: var(--blue-t); }
.bin.gulp .b { animation: gulp .5s var(--spring); }
.bin.nope { animation: shake .4s; background: var(--red-t); }
@keyframes gulp { 0% { transform: scale(1); } 35% { transform: scale(1.15, .9); } 100% { transform: scale(1); } }
.float-score { position: absolute; font: 800 26px var(--display); color: var(--green); pointer-events: none; animation: floatUp .9s var(--ease) forwards; z-index: 40; }
@keyframes floatUp { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-60px); } }

/* results */
.result { text-align: center; padding: 10px 0; }
.result .trophy { width: 140px; height: 140px; margin: 0 auto; animation: pop .6s var(--spring) both; }
.result .big-stars { display: flex; justify-content: center; gap: 6px; margin: 12px 0; }
.result .big-stars i { width: 56px; height: 56px; display: block; animation: starIn .6s var(--spring) both; }
.result .big-stars i:nth-child(2) { animation-delay: .15s; } .result .big-stars i:nth-child(3) { animation-delay: .3s; }
@keyframes starIn { from { opacity: 0; transform: scale(0) rotate(-120deg); } to { opacity: 1; transform: none; } }
.result h2 { font-size: 34px; }
.result p { color: var(--ink2); font-size: 18px; margin: 6px 0 18px; }
.result .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.xp-gain { display: inline-flex; align-items: center; gap: 6px; background: var(--blue-t); color: #041E49; border-radius: 999px; height: 40px; padding: 0 16px; font: 800 18px var(--display); margin-bottom: 16px; animation: pop .5s .4s var(--spring) both; white-space: nowrap; }
.xp-gain svg { width: 22px; height: 22px; }

/* up / down game */
.updown { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.updown > div { border-radius: var(--r-m); padding: 16px; text-align: center; }
.updown .art2 { display: flex; align-items: center; justify-content: center; gap: 6px; height: 84px; }
.updown .art2 div { width: 74px; height: 74px; }
.updown .art2 svg.arr { width: 30px; height: 30px; }
.updown b { font: 800 22px var(--display); display: block; margin-top: 6px; }
.updown p { font-size: 15px; color: var(--ink2); }

/* club steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 10px 0 20px; }
.step { background: var(--bg); border-radius: var(--r-m); padding: 16px; text-align: center; opacity: 0; animation: pop .5s var(--spring) forwards; }
.step:nth-child(2) { animation-delay: .1s; } .step:nth-child(3) { animation-delay: .2s; } .step:nth-child(4) { animation-delay: .3s; }
.step .pic { width: 84px; height: 84px; margin: 0 auto 6px; }
.step .num { width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: #fff; font: 800 15px var(--display); display: inline-grid; place-items: center; margin-bottom: 4px; }
.step b { display: block; font: 700 20px var(--display); }
.step p { font-size: 15px; color: var(--ink2); }
.pledge { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.pledge input { height: 52px; border-radius: 999px; border: 0; box-shadow: inset 0 0 0 1px var(--hair); padding: 0 20px; font: 600 17px var(--display); min-width: 240px; background: var(--bg); outline: none; }
.pledge input:focus { box-shadow: inset 0 0 0 2px var(--blue); }

/* certificate (screen preview and print) */
.cert { display: none; }
.cert-in { max-width: 760px; margin: 0 auto; border-radius: var(--r-l); background: var(--surface); padding: 40px 36px; text-align: center; position: relative; overflow: hidden; box-shadow: inset 0 0 0 1px var(--hair); }
.cert-in .bini { width: 120px; height: 120px; margin: 0 auto; }
.cert-in h1 { font-size: 44px; margin: 8px 0 4px; }
.cert-in .name { font: 800 40px var(--display); color: var(--green); margin: 10px 0; }
.cert-in .medals { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.cert-in .medals i { width: 54px; height: 54px; display: block; border-radius: 50%; padding: 10px; }
.cert-in .sig { display: flex; justify-content: space-around; margin-top: 30px; color: var(--ink3); font-size: 14px; }
.cert-in .sig span { border-top: 1px solid var(--ink3); padding-top: 6px; min-width: 180px; }

/* confetti canvas */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

footer { max-width: 1080px; margin: 10px auto 0; padding: 20px 16px 34px; color: var(--ink3); font-size: 14px; display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
footer a { color: var(--blue); text-decoration: none; font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #1F1F1F; color: #fff; border-radius: 16px; padding: 12px 18px; font: 600 16px var(--display); display: flex; align-items: center; gap: 10px; z-index: 70; animation: toastIn .5s var(--spring) both; box-shadow: var(--e2); }
.toast i { width: 30px; height: 30px; display: block; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 30px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ── language picker ── */
.lang { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 6px 0 10px; border-radius: 999px; background: var(--surface); box-shadow: var(--e1); color: var(--ink2); }
.lang svg { width: 18px; height: 18px; }
.lang select { border: 0; background: none; font: 700 14px var(--display); color: var(--ink); outline: none; cursor: pointer; }

/* ── play / read switch ── */
.mode { display: flex; background: #E9EEF6; border-radius: 999px; padding: 3px; }
.mode a { height: 34px; padding: 0 16px; border-radius: 999px; display: grid; place-items: center; font: 700 15px var(--display); color: var(--ink2); text-decoration: none; transition: background .25s, color .25s; }
.mode a.on { background: var(--surface); color: var(--ink); box-shadow: var(--e1); }
.hero .btn + .btn { margin-left: 8px; }

/* ── read mode ── */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.rv.in { opacity: 1; transform: none; }
.bob { animation: float 4s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.rd-hero { text-align: center; padding: 26px 16px 8px; }
.rd-hero h1 { font-size: clamp(38px, 7vw, 64px); line-height: 1; margin-top: 8px; }
.rd-hero p { color: var(--ink2); font-size: 19px; margin-top: 10px; }
.rd-hero-art { position: relative; width: 240px; height: 200px; margin: 0 auto; }
.rd-hero-art .bini { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; transform: translate(-50%, -50%); }
.rd-hero-art .orbit { position: absolute; width: 50px; height: 50px; left: 50%; top: 50%; margin: -25px 0 0 -25px; animation: orbit 12s linear infinite; }
.rd-hero-art .o2 { animation-delay: -3s; } .rd-hero-art .o3 { animation-delay: -6s; } .rd-hero-art .o4 { animation-delay: -9s; }
@keyframes orbit { from { transform: rotate(0) translateX(100px) rotate(0); } to { transform: rotate(360deg) translateX(100px) rotate(-360deg); } }
.rd-nav { position: sticky; top: 60px; z-index: 10; display: flex; gap: 6px; overflow-x: auto; padding: 10px 2px; margin: 10px 0 6px; background: rgba(246,248,252,.9); backdrop-filter: blur(10px); scrollbar-width: none; }
.rd-nav::-webkit-scrollbar { display: none; }
.rd-nav a { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 6px; border-radius: 999px; background: var(--surface); box-shadow: var(--e1); color: var(--ink2); text-decoration: none; font: 700 15px var(--display); transition: background .25s, color .25s; }
.rd-nav a span { width: 28px; height: 28px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 13px; }
.rd-nav a.on { background: var(--green); color: #fff; }
.rd-nav a.on span { background: rgba(255,255,255,.22); }
.rd-ch { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--e1); padding: 30px 26px; margin: 18px 0; scroll-margin-top: 120px; overflow: hidden; }
.rd-kicker { font: 700 13px var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--green); }
.rd-ch h2 { font-size: clamp(28px, 4.4vw, 40px); margin: 4px 0 8px; }
.rd-ch h3 { font-size: 22px; }
.rd-lead { font-size: 19px; color: var(--ink2); max-width: 640px; margin-bottom: 18px; }
.rd-art { width: 100%; height: 100%; }
.rd-row { display: grid; grid-template-columns: 140px 1fr; gap: 18px; align-items: center; padding: 14px 0; }
.rd-row.flip-side { grid-template-columns: 1fr 140px; }
.rd-row.flip-side .rd-bubble { order: 2; }
.rd-row p { font: 600 19px/1.4 var(--display); margin: 4px 0 8px; }
.rd-bubble { position: relative; width: 140px; height: 140px; border-radius: 42px; padding: 22px; }
.rd-num { position: absolute; top: -8px; right: -8px; width: 38px; height: 38px; border-radius: 50%; background: var(--surface); box-shadow: var(--e1); display: grid; place-items: center; font: 800 18px var(--display); }
.rd-eg { display: inline-block; background: var(--bg); border-radius: 999px; padding: 6px 14px; font-weight: 600; color: var(--ink2); }
.rd-tip { display: flex; gap: 14px; align-items: center; background: var(--blue-t); color: #041E49; border-radius: var(--r-m); padding: 14px 18px; margin-top: 18px; }
.rd-tip .who { width: 64px; height: 64px; flex: 0 0 64px; }
.rd-tip p { font: 600 17px/1.4 var(--display); }
.rd-play { text-align: center; margin-top: 22px; }
.rd-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rd-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.rd-card { border-radius: var(--r-m); padding: 18px; text-align: center; }
.rd-card p { color: var(--ink2); margin: 4px 0 8px; }
.rd-card > .rd-art { width: 90px; height: 90px; margin: 0 auto 8px; }
.rd-pair { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 0; }
.rd-pair .rd-art { width: 72px; height: 72px; }
.rd-arrow { width: 54px; height: 18px; color: var(--ink3); }
.rd-arrow .draw { stroke-dasharray: 80; stroke-dashoffset: 80; transition: stroke-dashoffset 1s .3s var(--ease); }
.rd-pair.in .draw { stroke-dashoffset: 0; }
.rd-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.rd-code { background: var(--bg); border-radius: var(--r-m); padding: 14px 10px; text-align: center; }
.rd-code .c { width: 60px; height: 60px; margin: 0 auto; }
.rd-code b { font: 800 17px var(--display); display: block; }
.rd-code .things { display: flex; justify-content: center; gap: 4px; margin: 6px 0; }
.rd-code .things i { width: 42px; height: 42px; display: block; }
.rd-code small { display: block; color: var(--ink2); font-size: 13px; min-height: 36px; }
.ok { display: inline-block; border-radius: 999px; padding: 3px 10px; font: 700 12px var(--display); margin-top: 6px; }
.ok.yes { background: var(--green-t); color: #0D652D; } .ok.maybe { background: var(--yellow-t); color: #8A5A00; } .ok.no { background: var(--red-t); color: #8C1D18; }
.rd-magnet { display: grid; grid-template-columns: 1fr 1.2fr; gap: 18px; align-items: center; background: var(--purple-t); border-radius: var(--r-m); padding: 20px; margin-top: 16px; }
.rd-magnet p { font-size: 17px; color: #3D0F68; margin-top: 6px; }
.rd-mlab { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mcell { position: relative; background: rgba(255,255,255,.7); border-radius: var(--r-s); padding: 58px 8px 10px; text-align: center; overflow: hidden; }
.mcell .thing { width: 74px; height: 74px; margin: 0 auto; }
.mcell span { font: 700 14px var(--display); display: inline-block; margin-top: 4px; }
.mcell .yes { color: var(--green); } .mcell .info { color: var(--blue); }
.mag { position: absolute; left: 50%; top: 6px; width: 44px; height: 44px; margin-left: -22px; }
.rd-magnet.in .m-stick { animation: stick 3s var(--ease) infinite; }
.rd-magnet.in .m-slip { animation: slip 3s var(--ease) infinite; }
@keyframes stick { 0% { transform: translateY(-40px); } 30%, 80% { transform: translateY(14px); } 100% { transform: translateY(-40px); } }
@keyframes slip { 0% { transform: translateY(-40px); } 30% { transform: translateY(12px); } 45% { transform: translateY(0) rotate(-6deg); } 80% { transform: translateY(-30px); } 100% { transform: translateY(-40px); } }
.rd-bins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rd-bin { background: var(--bg); border-radius: var(--r-m); padding: 12px 10px 14px; text-align: center; }
.rd-bin .b { width: 92px; height: 92px; margin: 0 auto; }
.rd-bin b { font: 800 18px var(--display); display: block; }
.rd-bin small { color: var(--ink2); font-size: 13px; }
.rd-drops { display: flex; justify-content: center; gap: 2px; height: 46px; }
.rd-drops i { width: 40px; height: 40px; display: block; opacity: 0; }
.rd-bin.in .rd-drops i { animation: dropIn 2.6s var(--ease) infinite; }
@keyframes dropIn { 0% { opacity: 0; transform: translateY(-20px); } 20% { opacity: 1; transform: translateY(0); } 60% { opacity: 1; transform: translateY(0); } 85%, 100% { opacity: 0; transform: translateY(40px) scale(.5); } }
.rd-rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.rd-rule, .rd-step { position: relative; background: var(--bg); border-radius: var(--r-m); padding: 16px; text-align: center; }
.rd-rule .rd-art, .rd-step .rd-art { width: 70px; height: 70px; margin: 0 auto 6px; }
.rd-rule span, .rd-step span { width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; display: inline-grid; place-items: center; font: 800 14px var(--display); margin-bottom: 4px; }
.rd-rule b, .rd-step b { display: block; font: 800 18px var(--display); }
.rd-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rd-step p { font-size: 14px; color: var(--ink2); margin-top: 4px; }
.rd-tasks { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.rd-task { border-radius: var(--r-m); padding: 16px; background: var(--yellow-t); }
.rd-task span { font: 700 12px var(--display); letter-spacing: .08em; text-transform: uppercase; color: #8A5A00; }
.rd-task b { display: block; font: 800 19px var(--display); margin: 2px 0; }
.rd-task p { font-size: 15px; color: var(--ink2); }
.rd-end { text-align: center; margin-top: 24px; background: linear-gradient(135deg, #E8F0FE, #E6F4EA); border-radius: var(--r-m); padding: 26px 16px; }
.rd-end .bini { width: 110px; height: 110px; margin: 0 auto; }
.rd-end p { color: var(--ink2); margin: 6px 0 16px; font-size: 18px; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { grid-template-columns: 1fr; padding: 26px 20px; text-align: center; min-height: 0; }
  .hero p { margin-left: auto; margin-right: auto; }
  .hero-art { height: 220px; order: -1; }
  .hero-art .bini { width: 130px; height: 130px; }
  .stage { padding: 20px 14px; border-radius: var(--r-m); }
  .bins { grid-template-columns: repeat(2, 1fr); }
  .codes { grid-template-columns: repeat(4, 1fr); }
  .updown { grid-template-columns: 1fr; }
  .logo span { display: none; }
  .bar-in { gap: 6px; }
  .bar-in > .chip:not(.xp) { display: none; }
  .rd-ch { padding: 22px 16px; }
  .rd-row, .rd-row.flip-side { grid-template-columns: 96px 1fr; gap: 12px; }
  .rd-row.flip-side .rd-bubble { order: 0; }
  .rd-bubble { width: 96px; height: 96px; border-radius: 30px; padding: 14px; }
  .rd-two, .rd-magnet { grid-template-columns: 1fr; }
  .rd-three, .rd-rules { grid-template-columns: 1fr; }
  .rd-bins, .rd-steps { grid-template-columns: repeat(2, 1fr); }
  .mode a { padding: 0 12px; }
  .rd-nav { top: 58px; }
  .hero .btn + .btn { margin: 8px 0 0; }
  .chip { padding: 0 11px; }
}
@media (max-width: 400px) { .bar-in > .chip.xp { display: none; } .mode a { padding: 0 10px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hero-art .drop { display: none; }
  .rv { opacity: 1; transform: none; }
  .rd-arrow .draw { stroke-dashoffset: 0; }
  .rd-drops i { opacity: 1; }
}
@media print {
  body { background: #fff; }
  .bar, main, footer, #confetti, .toast { display: none !important; }
  .cert { display: block !important; padding: 0; }
  .cert-in { box-shadow: none; }
}
