/* Pabrik Ajaib (577): arah seni di docs/GDD.md. Palet 8 warna, Lilita One (judul) + Fredoka (isi/angka). */
@font-face { font-family: 'Lilita One'; src: url('../assets/fonts/lilita-one-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: block; }
@font-face { font-family: 'Fredoka'; src: url('../assets/fonts/fredoka-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: block; }
@font-face { font-family: 'Fredoka'; src: url('../assets/fonts/fredoka-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: block; }
@font-face { font-family: 'Fredoka'; src: url('../assets/fonts/fredoka-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: block; }

:root {
  --ink: #2E2350; --wall: #4A4FA8; --lav: #8C93E8; --mint: #2BB5A5; --brass: #FFC23D; --coral: #FF6B4A; --cream: #FFF6E0; --green: #7CD957;
  --wallD: #43418A; --mintD: #2A8F88; --brassD: #C9993F; --coralD: #C9574A; --lavD: #7476C0; --mintL: #7DD3C9; --lavL: #BCC1F1; --creamD: #E6D9C2;
  --ttl: 'Lilita One', 'Trebuchet MS', 'Segoe UI', Arial, sans-serif;
  --txt: 'Fredoka', 'Trebuchet MS', 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2B2A5E; touch-action: none; user-select: none; -webkit-user-select: none; }
body { font-family: var(--txt); color: var(--ink); }
#stage { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; overflow: hidden; background: var(--wall); }
#world { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; }
#scene-root { position: absolute; inset: 0; }
#cover { position: absolute; inset: 0; background: var(--ink); opacity: 0; pointer-events: none; z-index: 50; }
#rotate { position: fixed; inset: 0; background: var(--ink); color: var(--cream); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px; z-index: 100; font: 600 22px var(--txt); text-align: center; padding: 20px; }
#rotate svg { width: 110px; height: 110px; animation: tilt 2s ease-in-out infinite; }
@keyframes tilt { 50% { transform: rotate(-90deg); } }

/* ===== Tombol "pelat tekan": badan + alas tebal + paku keling ===== */
.btn {
  position: absolute; border: 4px solid var(--ink); border-radius: 18px; padding: 0 22px; min-height: 64px; min-width: 64px;
  font: 400 30px var(--ttl); letter-spacing: .5px; color: var(--cream); cursor: pointer;
  --c: var(--coral); --d: var(--coralD); background: var(--c);
  box-shadow: 0 8px 0 0 var(--d), 0 8px 0 4px var(--ink);
  transition: transform 90ms ease-out, box-shadow 90ms ease-out, filter 120ms;
  display: flex; align-items: center; justify-content: center; gap: 10px; outline: none;
}
.btn::before { content: ''; position: absolute; left: 10px; right: 10px; top: 6px; height: 28%; border-radius: 10px; background: #fff; opacity: .22; pointer-events: none; }
.btn::after {   /* 4 paku keling kuningan */
  content: ''; position: absolute; inset: 7px; pointer-events: none;
  background:
    radial-gradient(circle at 5px 5px, var(--brass) 3px, var(--ink) 3.5px, var(--ink) 4.5px, transparent 5px) left top / 10px 10px no-repeat,
    radial-gradient(circle at 5px 5px, var(--brass) 3px, var(--ink) 3.5px, var(--ink) 4.5px, transparent 5px) right top / 10px 10px no-repeat,
    radial-gradient(circle at 5px 5px, var(--brass) 3px, var(--ink) 3.5px, var(--ink) 4.5px, transparent 5px) left bottom / 10px 10px no-repeat,
    radial-gradient(circle at 5px 5px, var(--brass) 3px, var(--ink) 3.5px, var(--ink) 4.5px, transparent 5px) right bottom / 10px 10px no-repeat;
}
.btn .lbl { position: relative; text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink); display: flex; align-items: center; gap: 10px; }
.btn .lbl .ico { filter: none; }
.btn:active:not(:disabled) { transform: translateY(6px) scale(.95); box-shadow: 0 2px 0 0 var(--d), 0 2px 0 4px var(--ink); }
.btn:focus-visible { box-shadow: 0 8px 0 0 var(--d), 0 8px 0 4px var(--ink), 0 0 0 10px rgba(255, 194, 61, .9); }
.btn:disabled { --c: var(--lavL); --d: var(--lavD); color: #fff; cursor: default; filter: saturate(.6); }
.btn:disabled .lbl { opacity: .75; }
.btn.mint { --c: var(--mint); --d: var(--mintD); }
.btn.brass { --c: var(--brass); --d: var(--brassD); }
.btn.plum { --c: var(--wall); --d: var(--wallD); }
.btn.wide { position: relative; width: 100%; margin-top: 18px; }
.ibtn { width: 72px; height: 72px; padding: 0; border-radius: 20px; }
.ibtn.small { width: 52px; height: 52px; min-width: 52px; min-height: 52px; border-radius: 16px; box-shadow: 0 5px 0 0 var(--d), 0 5px 0 3px var(--ink); border-width: 3px; }
.ibtn.small::after { display: none; }
.ibtn .lbl { text-shadow: none; }
.iconbar { position: absolute; right: 22px; top: 18px; display: flex; gap: 16px; z-index: 20; }
.iconbar .btn { position: relative; }

/* ===== Panel "pelat mesin" ===== */
.overlay { position: absolute; inset: 0; background: rgba(46, 35, 80, .62); display: flex; align-items: center; justify-content: center; z-index: 40; }
.panel { position: relative; min-width: 520px; max-width: 1040px; background: var(--cream); border: 4px solid var(--ink); border-radius: 24px; box-shadow: 0 8px 0 rgba(46, 35, 80, .45); overflow: hidden; }
.phead { background: var(--mint); border-bottom: 4px solid var(--ink); padding: 14px 92px 12px 26px; font: 400 32px var(--ttl); color: var(--cream); text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink); position: relative; }
.phead .lamp { position: absolute; top: 22px; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--ink); background: var(--lavD); right: 24px; }
.phead .lamp + .lamp { right: 52px; }
.phead .lamp.on { background: var(--green); box-shadow: 0 0 12px var(--green); }
.pbody { padding: 22px 28px 30px; font: 600 24px var(--txt); }
.panel::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 10px; height: 12px; pointer-events: none;
  background: radial-gradient(circle at 6px 6px, var(--brass) 4px, var(--ink) 4.5px, var(--ink) 6px, transparent 6.5px) left / 12px 12px no-repeat,
              radial-gradient(circle at 6px 6px, var(--brass) 4px, var(--ink) 4.5px, var(--ink) 6px, transparent 6.5px) right / 12px 12px no-repeat; }
.swrow { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 12px 0; border-bottom: 3px dashed var(--creamD); }
.swlbl { font: 600 28px var(--txt); display: flex; flex-direction: column; }
.swlbl small { font: 500 20px var(--txt); color: var(--wall); }
.btn.switch { position: relative; width: 160px; height: 64px; --c: var(--lavL); --d: var(--lavD); justify-content: flex-end; padding: 0 18px; font: 600 24px var(--txt); }
.btn.switch::after { display: none; }
.btn.switch .knob { position: absolute; left: 10px; top: 8px; width: 40px; height: 40px; border-radius: 50%; background: var(--cream); border: 4px solid var(--ink); transition: left 160ms; }
.btn.switch .swtxt { color: var(--ink); }
.btn.switch.on { --c: var(--green); --d: #5BA83E; justify-content: flex-start; }
.btn.switch.on .knob { left: 104px; }
.btn.fresh-btn { position: relative; width: 160px; height: 64px; font-size: 26px; padding: 0 10px; }
.settings .swrow { padding: 8px 0; }
.settings .btn.wide { margin-top: 14px; }
.toast { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); background: var(--ink); color: var(--cream); padding: 14px 26px; border-radius: 16px; font: 600 24px var(--txt); z-index: 60; border: 3px solid var(--brass); }

/* ===== Balon dialog (menempel ke pembicara) ===== */
.bubble { position: absolute; z-index: 15; background: var(--cream); border: 4px solid var(--ink); border-radius: 22px; padding: 12px 20px 14px; width: 330px;
  font: 600 26px/1.25 var(--txt); color: var(--ink); box-shadow: 0 6px 0 rgba(46, 35, 80, .3); transform: translate(-60px, -100%); }
.bubble::after { content: ''; position: absolute; left: 40px; bottom: -24px; width: 30px; height: 26px; background: var(--cream); border: 4px solid var(--ink); border-top: none; border-left: none; transform: skewX(-30deg); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.bubble.side { transform: translate(28px, -50%); }
.bubble.side::after { left: -22px; bottom: auto; top: 50%; margin-top: -14px; transform: rotate(90deg) skewX(30deg); }
.bubble .btxt { min-height: 32px; }
.bubble .w { border-radius: 6px; transition: background 80ms; }
.bubble .w.on { background: var(--brass); }
.bubble .ibtn { position: absolute; right: -24px; top: -52px; }
.bubble .ibtn.small { width: 64px; height: 64px; min-width: 64px; min-height: 64px; }
.bubble.pop { animation: pop 300ms cubic-bezier(.34, 1.56, .64, 1); }
@keyframes pop { from { opacity: 0; scale: .7; } to { opacity: 1; scale: 1; } }

/* ===== Tangan penunjuk ===== */
.hand { position: absolute; width: 0; height: 0; z-index: 30; pointer-events: none; }
.hand img { position: absolute; transform-origin: 5% 4%; filter: drop-shadow(0 6px 0 rgba(46, 35, 80, .3)); }
.hand.tapping img { animation: tap 900ms ease-in-out infinite; }
@keyframes tap { 0%, 100% { transform: translate(14px, 18px) scale(1); } 45% { transform: translate(0, 0) scale(.92); } }

/* ===== Layar judul ===== */
.sign { position: absolute; left: 56px; top: 64px; width: 580px; height: 250px; border: 4px solid var(--ink); border-radius: 30px; background: var(--brass); box-shadow: 0 8px 0 rgba(46, 35, 80, .35); }
.sign .in { position: absolute; inset: 18px; border-radius: 20px; background: var(--ink); border: 3px solid var(--brassD); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sign .t1 { font: 400 88px/0.95 var(--ttl); color: var(--brass); letter-spacing: 4px; text-shadow: 0 4px 0 var(--coralD); }
.sign .t2 { font: 400 108px/0.95 var(--ttl); color: var(--cream); letter-spacing: 6px; text-shadow: 4px 6px 0 var(--coral); }
.sign .bulb { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--cream); border: 2px solid var(--ink); box-shadow: 0 0 10px #fff4c0; animation: bulb 1.2s steps(1) infinite; }
.sign .bulb.b { animation-delay: .6s; }
@keyframes bulb { 50% { background: var(--brassD); box-shadow: none; } }
.ribbon { position: absolute; left: 100px; top: 330px; width: 492px; height: 64px; background: var(--mint); border: 4px solid var(--ink); border-radius: 12px; display: flex; align-items: center; justify-content: center; font: 600 30px var(--txt); color: var(--cream); text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink); }
.ribbon::before, .ribbon::after { content: ''; position: absolute; top: 8px; width: 46px; height: 48px; background: var(--mintD); border: 4px solid var(--ink); z-index: -1; }
.ribbon::before { left: -40px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 40% 50%); }
.ribbon::after { right: -40px; clip-path: polygon(0 0, 100% 0, 60% 50%, 100% 100%, 0 100%); }
.btn.start { left: 144px; top: 452px; width: 404px; height: 112px; font-size: 64px; border-radius: 24px; }
.btn.start .ico { width: 54px; height: 54px; }
.btn.start.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { scale: 1.04; } }
.title-about { position: absolute; left: 30px; top: 610px; width: 636px; display: flex; gap: 14px; }
.title-about .btn { position: relative; flex: 1 1 auto; height: 72px; padding: 0 14px; font-size: 26px; }
.title-about .btn .lbl { gap: 8px; }

/* ===== Panel Informasi, Referensi, Pengembang ===== */
.aboutpanel { width: 1040px; height: 668px; display: flex; flex-direction: column; }
.aboutpanel .pbody { flex: 1; min-height: 0; padding: 16px 28px 26px; display: flex; flex-direction: column; font: 500 24px/1.3 var(--txt); }
.aboutpanel .ttabs { display: flex; gap: 14px; margin-bottom: 14px; flex: none; }
.ab-body { flex: 1; min-height: 0; overflow: hidden; }
.ab-body h3 { margin: 12px 0 6px; font: 400 26px var(--ttl); color: var(--wall); }
.ab-body p { margin: 0; }
.ab-lead { font-weight: 600; font-size: 26px; }
.ab-note { margin-top: 14px !important; padding: 10px 16px; border-radius: 14px; background: var(--creamD); font-size: 24px; }
.ab-list { list-style: none; margin: 0; padding: 0; }
.ab-list li { position: relative; padding: 4px 0 4px 36px; }
.ab-list li::before { content: ''; position: absolute; left: 4px; top: 13px; width: 16px; height: 16px; border-radius: 50%; background: var(--brass); border: 3px solid var(--ink); }
.ab-steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.ab-steps li { counter-increment: s; position: relative; min-height: 64px; padding: 6px 0 12px 68px; font-weight: 600; font-size: 26px; display: flex; align-items: center; }
.ab-steps li::before { content: counter(s); position: absolute; left: 0; top: 4px; width: 52px; height: 52px; border-radius: 50%; background: var(--coral); border: 4px solid var(--ink); color: var(--cream); font: 400 30px/44px var(--ttl); text-align: center; }
.ab-rows { display: flex; flex-direction: column; }
.ab-row { display: grid; grid-template-columns: 190px 1fr; gap: 16px; padding: 7px 0; border-bottom: 3px dashed var(--creamD); font-size: 22px; line-height: 1.25; }
.ab-row b { font-weight: 700; color: var(--wall); }
.ab-machines .ab-row { grid-template-columns: 430px 1fr; padding: 12px 0; font-size: 24px; }
.ab-teacher .ab-row { padding: 8px 0; font-size: 24px; line-height: 1.2; grid-template-columns: 130px 1fr; }
.ab-ai { margin-top: 4px; }
.ab-ai .ab-row { grid-template-columns: 170px 1fr; padding: 6px 0; font-size: 22px; line-height: 1.2; }
.ab-cite { margin-top: 8px !important; font-size: 20px; line-height: 1.3; }
.btn.ab-close { position: relative; flex: none; align-self: center; width: 260px; height: 64px; margin-top: 10px; }
.ab-dev { display: flex; gap: 32px; align-items: center; height: 100%; }
.ab-photo { flex: none; width: 296px; height: 370px; object-fit: cover; border: 4px solid var(--ink); border-radius: 22px; box-shadow: 0 0 0 6px var(--brass), 0 0 0 10px var(--ink); margin-left: 10px; background: var(--lavL); }
.ab-name { font: 400 48px/1 var(--ttl); color: var(--wall); }
.ab-school { margin-top: 6px; font-weight: 700; font-size: 28px; }
.ab-contact { font-size: 24px; }
.ab-devinfo { min-width: 0; }
.ab-devinfo .ab-list li { font-size: 22px; line-height: 1.2; }

/* ===== Layar bermain ===== */
.hud { position: absolute; left: 16px; top: 14px; height: 70px; padding: 0 18px 0 20px; background: var(--ink); border: 4px solid var(--brass); border-radius: 20px; display: flex; align-items: center; gap: 14px; box-shadow: 0 6px 0 rgba(46, 35, 80, .35); z-index: 5; }
.hud .lv { font: 400 30px var(--ttl); color: var(--cream); letter-spacing: 1px; margin-right: 4px; }
.plamp { width: 24px; height: 24px; border-radius: 50%; border: 3px solid #1d1636; background: var(--lavD); position: relative; }
.plamp.on { background: var(--green); box-shadow: 0 0 14px var(--green); }
.plamp.cur { background: var(--brass); box-shadow: 0 0 14px var(--brass); animation: blinkL 1.2s ease-in-out infinite; }
.plamp::after { content: ''; position: absolute; left: 4px; top: 3px; width: 7px; height: 5px; border-radius: 50%; background: #fff; opacity: .6; }
@keyframes blinkL { 50% { opacity: .55; } }
.coins { position: absolute; right: 116px; top: 18px; height: 70px; min-width: 150px; padding: 0 20px 0 70px; background: var(--ink); border: 4px solid var(--brass); border-radius: 20px; font: 700 40px/62px var(--txt); color: var(--brass); text-align: right; z-index: 5; }
.coins svg { position: absolute; left: 12px; top: 9px; }
.coins.bump { animation: bump 300ms ease-out; }
@keyframes bump { 40% { scale: 1.12; } }
.eqboard { position: absolute; left: 366px; top: 12px; width: 462px; height: 82px; background: var(--ink); border: 6px solid var(--brass); border-radius: 18px; display: flex; align-items: center; justify-content: center; gap: 14px; box-shadow: 0 0 0 4px var(--ink), 0 8px 0 4px rgba(46, 35, 80, .35); z-index: 5; }
.eqboard .n { font: 700 54px var(--txt); color: var(--cream); min-width: 40px; text-align: center; }
.eqboard .op { font: 700 50px var(--txt); color: var(--mintL); }
.eqboard .n.res { color: var(--brass); }
.eqboard .q { width: 74px; height: 64px; border: 4px dashed var(--brass); border-radius: 12px; display: flex; align-items: center; justify-content: center; font: 700 50px var(--txt); color: var(--brass); background: rgba(255, 194, 61, .12); animation: qblink 1.2s ease-in-out infinite; }
.eqboard .q.filled { border-style: solid; color: var(--cream); animation: none; }
.eqboard .q.ok { border-color: var(--green); color: var(--green); background: rgba(124, 217, 87, .16); }
@keyframes qblink { 50% { border-color: rgba(255, 194, 61, .45); } }
.hl { animation: hl 700ms ease-in-out 3; border-radius: 10px; }
@keyframes hl { 50% { background: rgba(255, 194, 61, .45); box-shadow: 0 0 0 6px rgba(255, 194, 61, .45); } }

.tag-sign { position: absolute; z-index: 4; background: var(--cream); border: 4px solid var(--ink); border-radius: 12px; text-align: center; box-shadow: 0 6px 0 rgba(46, 35, 80, .3); }
.tag-sign::before { content: ''; position: absolute; left: 50%; top: -34px; height: 30px; border-left: 4px solid var(--ink); }
.tag-sign .h { font: 400 22px var(--ttl); letter-spacing: 1px; color: var(--cream); background: var(--mint); border-bottom: 4px solid var(--ink); border-radius: 8px 8px 0 0; padding: 2px 0 0; text-shadow: 0 2px 0 var(--ink); }
.tag-sign .v { font: 700 46px/1.1 var(--txt); display: flex; align-items: center; justify-content: center; gap: 8px; padding: 2px 10px 0; }
.tag-sign .v img { width: 40px; height: 40px; object-fit: contain; }
.tag-sign .u { font: 600 22px var(--txt); padding-bottom: 6px; }
.tag-sign.order .h { background: var(--coral); }
.tag-sign .qm { color: var(--coralD); }
.tag-sign.ok { border-color: #3C7A2A; }
.tag-sign.ok .h { background: var(--green); }
.stamp { position: absolute; right: -16px; bottom: -14px; width: 58px; height: 58px; border-radius: 50%; background: var(--green); border: 4px solid var(--ink); display: none; align-items: center; justify-content: center; }
.tag-sign.ok .stamp { display: flex; animation: pop 300ms cubic-bezier(.34, 1.56, .64, 1); }

.tray { position: absolute; left: 236px; top: 552px; width: 1028px; height: 160px; background: var(--wallD); border: 4px solid var(--ink); border-radius: 26px; box-shadow: 0 6px 0 rgba(46, 35, 80, .35), inset 0 12px 0 rgba(140, 147, 232, .3); z-index: 3; }
.ctl { position: absolute; top: 590px; z-index: 4; }
.ctl-lbl { position: absolute; top: 678px; width: 140px; text-align: center; font: 600 20px var(--txt); color: var(--cream); z-index: 4; pointer-events: none; }
.card {
  position: absolute; width: 124px; height: 148px; border: 4px solid var(--ink); border-radius: 14px; background: var(--cream); padding: 0; cursor: grab;
  box-shadow: 0 6px 0 rgba(46, 35, 80, .4); z-index: 6; touch-action: none; transition: transform 140ms ease-out, box-shadow 140ms; outline: none; font-family: var(--txt);
}
.card .ch { position: absolute; left: 8px; right: 8px; top: 8px; height: 26px; border-radius: 8px; border: 3px solid var(--ink); background: var(--mint);
  background-image: radial-gradient(circle, var(--ink) 4px, transparent 4.5px); background-size: 20px 26px; background-position: 6px 0; }
.card.k-num .ch, .card.k-crate .ch { background-color: var(--brass); }
.card .cv { position: absolute; left: 0; right: 0; top: 42px; font: 700 60px/1.3 var(--txt); color: var(--ink); text-align: center; }
.card .cv .x { color: var(--mintD); font-size: 52px; margin-right: 2px; }
.card .cu { position: absolute; left: 0; right: 0; bottom: 8px; font: 600 20px var(--txt); text-align: center; color: var(--wall); display: flex; align-items: center; justify-content: center; gap: 4px; }
.card .cu img { width: 32px; height: 20px; object-fit: contain; }
.card:focus-visible { box-shadow: 0 6px 0 rgba(46, 35, 80, .4), 0 0 0 8px rgba(255, 194, 61, .95); }
.card.sel { transform: translateY(-18px) rotate(-3deg); box-shadow: 0 16px 0 rgba(46, 35, 80, .3), 0 0 0 7px var(--brass); }
.card.drag { transition: none; z-index: 25; cursor: grabbing; box-shadow: 0 22px 0 rgba(46, 35, 80, .25); }
.card.gone { visibility: hidden; }
.card.hint { animation: cardhint 900ms ease-in-out infinite; }
@keyframes cardhint { 50% { box-shadow: 0 6px 0 rgba(46, 35, 80, .4), 0 0 0 9px var(--green); } }
.card.wob { animation: wob 420ms ease-in-out; }
@keyframes wob { 20% { rotate: -6deg; } 50% { rotate: 5deg; } 80% { rotate: -2deg; } }
.card-slot { position: absolute; width: 124px; height: 148px; border: 4px dashed var(--lav); border-radius: 14px; z-index: 4; pointer-events: none; }
.target { position: absolute; z-index: 7; background: transparent; border: 0; padding: 0; border-radius: 20px; cursor: pointer; outline: none; }
.target:focus-visible, .target.armed { box-shadow: 0 0 0 6px rgba(255, 194, 61, .95); }
.target.armed { animation: armed 900ms ease-in-out infinite; }
@keyframes armed { 50% { box-shadow: 0 0 0 10px rgba(255, 194, 61, .35); } }
.target.lever { border-radius: 50%; }
.target:disabled { pointer-events: none; box-shadow: none; animation: none; }

/* ===== Tabel perkalian ===== */
.ttable { display: grid; grid-template-columns: repeat(11, 58px); gap: 4px; justify-content: center; }
.ttable div { height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font: 600 20px var(--txt); background: #fff; border: 2px solid var(--creamD); position: relative; }
.ttable .hd { background: var(--wall); color: var(--cream); border-color: var(--ink); }
.ttable .seen { background: var(--lavL); }
.ttable .ok { background: var(--green); border-color: #3C7A2A; }

/* ===== Layar hasil ===== */
.res-left { position: absolute; left: 40px; top: 30px; width: 600px; height: 660px; }
.res-title { position: absolute; left: 0; right: 0; top: -6px; text-align: center; font: 400 64px var(--ttl); color: var(--cream); text-shadow: 0 5px 0 var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 -3px 0 var(--ink); }
.res-sub { position: absolute; left: 0; right: 0; top: 78px; text-align: center; font: 600 26px var(--txt); color: var(--cream); text-shadow: 0 2px 0 var(--ink); }
.res-skills { position: absolute; left: 20px; right: 20px; top: 384px; background: var(--cream); border: 4px solid var(--ink); border-radius: 24px; padding: 14px 22px 18px; box-shadow: 0 6px 0 rgba(46, 35, 80, .3); }
.res-skills h3 { margin: 0 0 6px; font: 400 26px var(--ttl); color: var(--mintD); }
.res-skills li { font: 600 22px/1.35 var(--txt); list-style: none; padding-left: 34px; position: relative; margin: 4px 0; }
.res-skills li::before { content: ''; position: absolute; left: 0; top: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--green); border: 3px solid var(--ink); }
.res-skills li.todo::before { background: var(--lavL); }
.res-skills ul { margin: 0; padding: 0; }
.res-coins { position: absolute; left: 50%; top: 300px; transform: translateX(-50%); }
.teacher { position: absolute; left: 676px; top: 30px; width: 572px; height: 554px; }
.teacher .pbody { padding: 16px 22px 26px; font: 500 20px/1.35 var(--txt); }
.teacher table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.teacher td, .teacher th { text-align: left; padding: 6px 4px; border-bottom: 2px solid var(--creamD); font: 500 20px var(--txt); vertical-align: top; }
.teacher th { font-weight: 700; }
.teacher .st { white-space: nowrap; font-weight: 600; }
.teacher .dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); margin-right: 6px; vertical-align: -1px; }
.teacher p { margin: 6px 0; }
.res-btns { position: absolute; left: 676px; top: 606px; width: 572px; display: flex; gap: 16px; }
.res-btns .btn { position: relative; flex: 1; height: 80px; font-size: 28px; padding: 0 12px; }

/* ===== Level 2-4 ===== */
.card .cv.long { font-size: 44px; line-height: 1.75; }
.card .cv .d { color: var(--coralD); font-size: 56px; margin-right: 2px; }
.card .cv .p { color: var(--wall); font-size: 52px; margin-right: 2px; }
.tag-sign .v .dot-ico { width: 36px; height: 36px; }
.eqboard.inv { border-color: var(--green); }
.eqboard.inv .n { animation: pop 300ms cubic-bezier(.34, 1.56, .64, 1); }
.eqboard .lbl { font: 400 34px var(--ttl); color: var(--mintL); letter-spacing: 1px; margin-right: 6px; }
.eqboard .q.filled { width: auto; min-width: 74px; padding: 0 10px; }
.eqboard.l4 { left: 340px; width: 490px; gap: 2px; }
.eqboard.l4 .n { font-size: 34px; min-width: 24px; }
.eqboard.l4 .n.dim { color: var(--lav); }
.eqboard.l4 .n.mid { color: var(--green); }
.eqboard.l4 .q { width: 62px; height: 52px; font-size: 32px; border-width: 3px; }
.eqboard.l4 .q.filled { min-width: 62px; padding: 0 6px; }
.eqboard .ar { width: 28px; height: 24px; flex: none; }
.timer { position: absolute; left: 16px; top: 96px; height: 52px; padding: 0 16px 0 10px; background: var(--ink); border: 4px solid var(--brass); border-radius: 16px; display: flex; align-items: center; gap: 8px; font: 700 28px var(--txt); color: var(--cream); z-index: 5; }
.timer.out { border-color: var(--lav); color: var(--lavL); }
.mid-lbl { position: absolute; width: 140px; text-align: center; font: 400 22px var(--ttl); letter-spacing: 1px; color: var(--cream); text-shadow: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink); z-index: 3; pointer-events: none; }

/* tabel pasangan Level 3: pelat mesin berisi layar digit */
.pairs { position: absolute; z-index: 4; background: var(--cream); border: 4px solid var(--ink); border-radius: 24px; box-shadow: 0 8px 0 rgba(46, 35, 80, .35); padding: 0 18px 18px; overflow: hidden; transition: border-color 200ms; }
.pairs.ok { border-color: #3C7A2A; }
.pairs .ph { display: grid; grid-template-columns: 120px 52px 120px 1fr; gap: 10px; margin: 0 -18px 14px; padding: 8px 18px 6px; background: var(--mint); border-bottom: 4px solid var(--ink); font: 400 24px var(--ttl); letter-spacing: 1px; color: var(--cream); text-shadow: 0 2px 0 var(--ink); text-align: center; }
.pairs.ok .ph { background: var(--green); }
.pairs .pr { display: grid; grid-template-columns: 120px 52px 120px 1fr; gap: 10px; align-items: center; height: 104px; border-radius: 16px; padding: 0 0; }
.pairs .pr + .pr { border-top: 3px dashed var(--creamD); }
.pairs .pr.hl { animation: hl 700ms ease-in-out 3; }
.pairs .dg { height: 80px; border-radius: 12px; background: var(--ink); border: 4px solid var(--brass); display: flex; align-items: center; justify-content: center; font: 700 48px var(--txt); color: var(--cream); }
.pairs .dg.out { color: var(--brass); }
.pairs .ar { width: 48px; height: 32px; justify-self: center; }
.pairs .res { height: 80px; border-radius: 12px; border: 4px dashed var(--lavL); display: flex; align-items: center; justify-content: center; gap: 8px; font: 700 40px var(--txt); color: var(--ink); }
.pairs .res small { font: 600 20px/1 var(--txt); color: var(--wall); white-space: nowrap; }
.pairs .res.good { border: 4px solid #3C7A2A; background: rgba(124, 217, 87, .25); animation: pop 300ms cubic-bezier(.34, 1.56, .64, 1); }
.pairs .res.bad { border: 4px solid var(--brassD); background: rgba(255, 194, 61, .22); animation: pop 300ms cubic-bezier(.34, 1.56, .64, 1); }
.pairs .res .mk svg { width: 40px; height: 40px; display: block; }
.flynum { position: absolute; z-index: 12; min-width: 76px; height: 60px; padding: 0 12px; background: var(--cream); border: 4px solid var(--ink); border-radius: 12px; font: 700 36px/52px var(--txt); text-align: center; box-shadow: 0 6px 0 rgba(46, 35, 80, .3); pointer-events: none; }

/* ===== Pilih Mesin ===== */
.lv-title { position: absolute; left: 0; right: 0; top: 34px; text-align: center; font: 400 64px var(--ttl); color: var(--cream); text-shadow: 0 5px 0 var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 -3px 0 var(--ink); pointer-events: none; }
.lv-row { position: absolute; left: 40px; right: 40px; top: 150px; display: flex; gap: 20px; justify-content: center; }
.lvcard { position: relative; width: 224px; height: 380px; padding: 0; border: 4px solid var(--ink); border-radius: 24px; background: var(--cream); box-shadow: 0 8px 0 var(--creamD), 0 8px 0 4px var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; font-family: var(--txt); color: var(--ink); overflow: hidden; outline: none; transition: transform 90ms ease-out, box-shadow 90ms ease-out; }
.lvcard:active:not(:disabled):not(.locked) { transform: translateY(6px) scale(.95); box-shadow: 0 2px 0 var(--creamD), 0 2px 0 4px var(--ink); }
.lvcard:focus-visible { box-shadow: 0 8px 0 var(--creamD), 0 8px 0 4px var(--ink), 0 0 0 10px rgba(255, 194, 61, .9); }
.lvcard.next { animation: pulse 1.6s ease-in-out infinite; }
.lvcard .lh { align-self: stretch; background: var(--mint); border-bottom: 4px solid var(--ink); padding: 8px 0 6px; font: 400 30px var(--ttl); color: var(--cream); text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink); }
.lvcard .lm { position: relative; width: 160px; height: 168px; margin-top: 12px; }
.lvcard .lm img { width: 160px; height: 168px; object-fit: contain; }
.lvcard .lg { position: absolute; left: 47px; top: 54px; width: 63px; height: 38px; display: flex; align-items: center; justify-content: center; font: 700 34px var(--txt); color: var(--brass); }
.lvcard .ln { font: 600 24px/1.15 var(--txt); padding: 6px 12px 0; height: 66px; display: flex; align-items: center; text-align: center; }
.lvcard .lst { display: flex; gap: 10px; margin-top: 8px; }
.lvcard .slamp { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--ink); background: var(--lavL); }
.lvcard .slamp.on { background: var(--brass); box-shadow: 0 0 12px var(--brass); }
.lvcard.locked { background: var(--creamD); cursor: default; }
.lvcard.locked .lh { background: var(--wall); }
.lvcard.locked .lm img { filter: grayscale(.8); opacity: .5; }
.lvcard .lk { position: absolute; left: 38px; top: 42px; width: 84px; height: 84px; }
.lvcard .lk svg { display: block; }
.lvcard .lhint { font: 600 20px/28px var(--txt); margin-top: 8px; color: var(--ink); }
.lvcard.wob { animation: wob 420ms ease-in-out; }
.btn.lv-back { left: 40px; top: 598px; width: 220px; height: 80px; }

.btn.lv-table { left: 280px; top: 598px; width: 196px; height: 80px; }
.btn.lv-practice { left: 496px; top: 598px; width: 236px; height: 80px; }

/* ===== Fase 3: Santai, balon pelanggan, Level 5 ===== */
.timer.santai { color: var(--mintL); border-color: var(--mint); }
.bubble.cust { width: 420px; font-size: 24px; transform: translate(calc(-100% + 60px), -100%); }
.bubble.cust::after { left: auto; right: 34px; transform: skewX(30deg); clip-path: polygon(0 0, 100% 0, 0 100%); border-right: none; border-left: 4px solid var(--ink); }
.bubble.cust .ibtn { right: auto; left: -22px; }
.bubble .w.key { background: rgba(255, 194, 61, .55); box-shadow: 0 0 0 2px rgba(255, 194, 61, .55); }
.check-lbl { width: 180px; }
.eqboard.l5 { gap: 8px; }
.eqboard.l5 .n { font-size: 46px; }
.eqboard.l5 .q { width: 96px; height: 60px; font-size: 40px; }
.eqboard.l5 .q.filled { min-width: 96px; }
.steps { position: absolute; z-index: 8; background: var(--cream); border: 4px solid var(--ink); border-radius: 22px; box-shadow: 0 8px 0 rgba(46, 35, 80, .35); padding: 0 18px 14px; overflow: hidden; }
.steps .ph { margin: 0 -18px 10px; padding: 6px 18px 4px; background: var(--mint); border-bottom: 4px solid var(--ink); font: 400 26px var(--ttl); letter-spacing: 1px; color: var(--cream); text-shadow: 0 2px 0 var(--ink); }
.steps .srow { font: 700 34px/1.5 var(--txt); color: var(--ink); opacity: .15; border-radius: 10px; padding: 0 10px; transition: opacity 200ms; }
.steps .srow.on { opacity: 1; }
.steps .srow.res { background: rgba(124, 217, 87, .35); }

/* ===== Tabel perkalian bantu ===== */
.tablepanel { max-width: 1060px; }
.twrap { display: flex; gap: 22px; align-items: flex-start; }
.ttable button.tc { height: 44px; border-radius: 8px; padding: 0; display: flex; align-items: center; justify-content: center; gap: 1px; font: 600 20px var(--txt); background: #fff; border: 2px solid var(--creamD); color: var(--ink); cursor: pointer; outline: none; position: relative; }
.ttable .hd { height: 44px; }
.ttable .hd.on { background: var(--brass); color: var(--ink); }
.ttable button.tc.seen { background: var(--lavL); }
.ttable button.tc.ok { background: var(--green); border-color: #3C7A2A; }
.ttable button.tc.one { background: var(--cream); color: var(--wall); }
.ttable button.tc .ck { position: absolute; right: 1px; top: 1px; width: 13px; height: 13px; }
.ttable button.tc:active { transform: scale(.95); }
.card:active:not(.drag):not(.sel) { transform: scale(.95); }
.ttable button.tc.pick, .ttable button.tc:focus-visible { box-shadow: 0 0 0 4px var(--coral); z-index: 1; }
.ttable { grid-template-columns: repeat(11, 54px); }
.tside { width: 300px; display: flex; flex-direction: column; gap: 10px; }
.tinfo { min-height: 236px; background: #fff; border: 3px solid var(--creamD); border-radius: 16px; padding: 10px 14px; text-align: center; }
.tinfo .tpick { margin: 40px 0 0; font: 500 20px/1.35 var(--txt); color: var(--wall); }
.tfact { font: 700 34px var(--txt); }
.tinv { font: 600 22px/1.3 var(--txt); color: var(--mintD); margin: 2px 0 6px; }
.tdots { display: block; margin: 0 auto; max-width: 150px; max-height: 110px; }
.tst { margin-top: 6px; font: 600 20px var(--txt); display: inline-block; padding: 2px 12px; border-radius: 10px; background: var(--cream); border: 2px solid var(--creamD); }
.tst.ok { background: var(--green); border-color: #3C7A2A; }
.tst.seen { background: var(--lavL); }
.tlegend { display: flex; flex-direction: column; gap: 4px; font: 500 20px var(--txt); }
.tlegend span { display: flex; align-items: center; gap: 8px; }
.tlegend .sw { width: 26px; height: 22px; border-radius: 6px; border: 2px solid var(--creamD); background: #fff; position: relative; }
.tlegend .sw.ok { background: var(--green); border-color: #3C7A2A; }
.tlegend .sw.seen { background: var(--lavL); }
.tlegend .sw .ck { position: absolute; left: 4px; top: 1px; width: 16px; height: 16px; }
.tcount { margin: 0; font: 600 20px var(--txt); color: var(--wall); }
.tside .btn.wide { margin-top: 4px; }

/* ===== Pabrikku (hiasan) ===== */
.deco-panel { position: absolute; left: 22px; top: 10px; width: 336px; background: var(--ink); border: 4px solid var(--brass); border-radius: 20px; padding: 4px 14px 5px; color: var(--cream); box-shadow: 0 6px 0 rgba(46, 35, 80, .35); z-index: 5; }
.deco-panel .dh { display: flex; justify-content: space-between; align-items: center; }
.deco-panel .dt { font: 400 26px var(--ttl); letter-spacing: 1px; }
.deco-panel .ds { font: 700 26px var(--txt); color: var(--brass); display: flex; align-items: center; gap: 4px; }
.deco-panel .db { display: flex; gap: 10px; margin: 2px 0; }
.deco-panel .badge { width: 46px; height: 46px; border-radius: 50%; background: var(--wallD); border: 3px solid var(--lavD); display: flex; align-items: center; justify-content: center; }
.deco-panel .badge.on { background: var(--cream); border-color: var(--brass); box-shadow: 0 0 10px rgba(255, 194, 61, .7); }
.deco-panel .dn { font: 500 20px var(--txt); color: var(--lavL); }

/* ===== Latihan bebas ===== */
.pr-sub { position: absolute; left: 0; right: 0; top: 112px; text-align: center; font: 600 28px var(--txt); color: var(--cream); text-shadow: 0 2px 0 var(--ink); pointer-events: none; }
.pr-grid { position: absolute; left: 150px; top: 170px; width: 980px; display: flex; flex-wrap: wrap; gap: 26px 28px; justify-content: center; }
.pr-grid .btn.ptab { position: relative; width: 172px; height: 162px; flex-direction: column; border-radius: 24px; padding: 0; }
.ptab .lbl { flex-direction: column; gap: 8px; }
.ptab .pt { font: 400 60px var(--ttl); line-height: 1; }
.ptab .pl { display: grid; grid-template-columns: repeat(5, 18px); gap: 5px; justify-content: center; text-shadow: none; }
.flamp { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--ink); background: var(--lavL); }
.flamp.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.btn.lv-back.wide2 { width: 280px; }
.btn.pr-tbl { left: 340px; }

/* ===== Hasil (Fase 3) ===== */
.unlock { position: absolute; left: 40px; right: 40px; top: 108px; height: 48px; background: var(--cream); border: 4px solid var(--ink); border-radius: 26px; display: flex; align-items: center; justify-content: center; gap: 10px; font: 700 24px var(--txt); color: var(--ink); box-shadow: 0 6px 0 rgba(46, 35, 80, .3), 0 0 0 4px var(--brass); z-index: 3; }
.res-skills { padding: 10px 20px 12px; }
.res-skills h3 { font-size: 24px; margin: 4px 0 2px; }
.res-skills li { font: 600 20px/1.3 var(--txt); margin: 3px 0; padding-left: 30px; }
.res-skills li::before { width: 20px; height: 20px; top: 2px; }
.res-skills li.alg::before { border-radius: 6px; background: var(--brass); }
.res-skills li.alg.todo::before { background: var(--lavL); }
.ttabs { display: flex; gap: 10px; padding: 12px 22px 0; }
.ttabs .btn.tab { position: relative; flex: 1; min-height: 48px; height: 48px; font: 600 22px var(--txt); --c: var(--creamD); --d: #CDBF9F; color: var(--ink); box-shadow: 0 5px 0 0 var(--d), 0 5px 0 3px var(--ink); border-width: 3px; border-radius: 14px; }
.ttabs .btn.tab::after { display: none; }
.ttabs .btn.tab .lbl { text-shadow: none; }
.ttabs .btn.tab.on { --c: var(--brass); --d: var(--brassD); }
.teacher .pbody { padding: 14px 22px 26px; }
.teacher table.alg td.st { width: 1%; }
.teacher .st small { font: 500 20px var(--txt); color: var(--wall); }
.teacher .slamp { display: inline-block; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ink); background: var(--lavL); margin-right: 4px; vertical-align: -3px; }
.teacher .slamp.on { background: var(--brass); }

body.reduce .pop, body.reduce .card.wob, body.reduce .coins.bump, body.reduce .pairs .res.good, body.reduce .pairs .res.bad, body.reduce .tag-sign.ok .stamp, body.reduce .eqboard.inv .n, body.reduce .timer,
body.reduce .lvcard.next, body.reduce .lvcard.wob, body.reduce .pairs .pr.hl,
body.reduce .hl { animation: none; background: rgba(255, 194, 61, .45); box-shadow: 0 0 0 6px rgba(255, 194, 61, .45); }
body.reduce .btn.start.pulse, body.reduce .sign .bulb, body.reduce .plamp.cur, body.reduce .eqboard .q, body.reduce .hand.tapping img, body.reduce .card.hint, body.reduce .target.armed { animation: none; }
