/* Kiểu dáng đạo cụ của các trò tư duy (js/thinking-games.js). Chuyển động dùng PropFx (js/prop-fx.js), không dùng transition tuyến tính. */

/* ---- Lối nhỏ thông minh: Bíp nhìn theo đường chạy ---- */
.maze{position:relative}
/* hộp của Bíp: đặt bằng left/top tại ô đang đứng (mã trò tính theo cỡ ô), không nhận chạm để bé vẫn chạm được ô bên dưới */
.mazeBip{position:absolute;left:0;top:0;width:78px;height:78px;pointer-events:none;z-index:3}
.mazeBipArt{display:block;width:100%;height:100%;transform-origin:50% 88%}
.mazeShadow{position:absolute;left:25%;right:23%;top:76%;height:11%;border-radius:50%;background:radial-gradient(closest-side,rgba(52,74,46,.36),rgba(52,74,46,0))}
.maze button.current{text-align:left;padding-left:5px}
/* ngôi nhà đứng ở góc ô đích (tranh assets/ai/node_house.png, cắt bỏ lề trong suốt); số của ô dịch sang trái cho khỏi bị che */
.maze button[data-cell="3"]{padding-right:30px}
.maze button .mazeHome{position:absolute;right:-11px;top:-23px;width:46px;height:56px;margin:0;overflow:hidden;pointer-events:none;transform-origin:50% 100%}
.maze button .mazeHome img{position:absolute;left:-20px;top:-15px;width:87px;height:87px;max-width:none}
@media(max-width:600px){
  .maze button[data-cell="3"]{padding-right:24px}
  .maze button .mazeHome{right:-9px;top:-19px;width:38px;height:46px}
  .maze button .mazeHome img{left:-17px;top:-13px;width:72px;height:72px}
}
@media(max-height:630px) and (min-width:601px){
  .maze button[data-cell="3"]{padding-right:24px}
  .maze button .mazeHome{right:-8px;top:-16px;width:34px;height:42px}
  .maze button .mazeHome img{left:-15px;top:-11px;width:64px;height:64px}
}

/* ---- Hai giỏ nhiều cách: quả nhảy sang giỏ kia, cách chia đã lưu bay xuống ô ghi ---- */
/* quả không đổi màu khi sang giỏ khác (cùng một quả), có cuống và lá */
.splitBasket button,.splitBasket.b button{position:relative;background:radial-gradient(circle at 34% 26%,#ffe3b0 0 10%,#f8ad66 46%,#e47d4b 100%);box-shadow:0 3px 0 #c56f43}
.splitBasket button::before{content:'';position:absolute;left:50%;top:-4px;width:2px;height:6px;margin-left:-1px;border-radius:1px;background:#8a5a3a}
.splitBasket button::after{content:'';position:absolute;left:53%;top:-6px;width:9px;height:6px;border-radius:0 90% 0 90%;background:#86b96f}
/* chữ "Giỏ trống" chỉ hiện sau khi quả cuối đã nhún lấy đà và bay khỏi giỏ (không in đè lên quả đang rời đi) */
.splitBasket:empty::before{animation:splitEmptyIn .2s .3s both}
@keyframes splitEmptyIn{from{opacity:0}}
@media(prefers-reduced-motion:reduce){.splitBasket:empty::before{animation:none}}
.splitEquation .eqParts{display:inline-block}
.splitEquation .eqA,.splitEquation .eqB{display:inline-block;min-width:.62em;text-align:center}
/* ba ô ghi có sẵn: ô trống viền đứt, ô đã lưu là thẻ xanh cùng cỡ (thêm thẻ không làm xô các thẻ khác) */
.splitRecord{min-height:36px;align-items:center}
.splitRecord i,.splitRecord span{box-sizing:border-box;min-width:78px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center}
.splitRecord i{position:relative;font-style:normal;border:2px dashed #d5dcc4;background:#ffffff70}
.splitRecord i>span{position:absolute;left:-2px;top:-2px;right:-2px;bottom:-2px;min-width:0;height:auto;padding:0}

/* ---- Xưởng chục và đơn vị: mười que bay ra, khép lại, được BUỘC thành một bó ---- */
/* ô trong bố cục (được trượt khi các ô khác dồn chỗ); bó và que bên trong mới là thứ được diễn hoạt */
.tenSlot,.oneSlot{display:block;flex:none}
/* que trong bó và que rời cùng một cỡ: bó đúng là mười que rời đứng sát nhau */
.tenBundle{gap:1px;background:none;border-color:transparent}
.tenBundle::after{content:none}
.tenBundle i{position:relative;width:4px}
.oneStick{display:block;width:4px;border-radius:2px}
.tenBundle .wrap{position:absolute;left:-1px;top:-1px;right:-1px;bottom:-1px;border-radius:7px;background:#dce8c6;border:1px solid #b1c69b}
.tenBundle .tie{position:absolute;left:-3px;right:-3px;top:50%;height:7px;margin-top:-4px;border-radius:4px;background:#f0a0b0;box-shadow:inset 0 -2px 0 #dc7f93}
.tenBundle .bow{position:absolute;left:50%;top:50%;width:18px;height:11px;margin:-6px 0 0 -9px;background:radial-gradient(ellipse at 24% 50%,#f7b9c5 0 58%,transparent 60%),radial-gradient(ellipse at 76% 50%,#f7b9c5 0 58%,transparent 60%)}
.tenBundle .bow::after{content:'';position:absolute;left:50%;top:50%;width:6px;height:7px;margin:-4px 0 0 -3px;border-radius:3px;background:#dc7f93}
@media(max-width:600px){.tenBundle i{width:2px}.oneStick{width:3px}.tenBundle .bow{width:14px;height:9px;margin:-5px 0 0 -7px}}
/* Màn rộng: đủ chỗ cho năm bó mỗi hàng. Để nút xác nhận sát phần giải thích. */
.placeControls{display:flex;flex-direction:column;align-items:center;gap:10px}
@media(min-width:700px){.placeWork .placeBoard{grid-template-columns:57% 43%}#tens{max-width:348px}}
@media (orientation:landscape) and (max-height:550px){
  .stage:is(.mazeStage,.placeStage){flex-direction:row;gap:clamp(8px,2vw,22px);padding:5px 10px;align-items:safe center;justify-content:safe center}
  .stage:is(.mazeStage,.placeStage)>.prompt{flex:0 1 175px;font-size:clamp(14px,2.2vw,19px);padding:8px 10px}
  .stage :is(.mazeWork,.placeWork){width:auto;max-width:calc(100% - 122px);display:grid;grid-template-columns:auto minmax(68px,105px);gap:9px;align-items:center}
  .stage .placeWork{width:min(530px,calc(100% - 130px));grid-template-columns:minmax(0,1fr) minmax(80px,110px)}
  .stage .placeWork .placeBoard{grid-template-columns:64% 36%}
  .stage .maze{width:clamp(164px,33vw,254px);gap:5px}
  .stage .maze button{height:clamp(30px,calc((100vh - 216px) / 4),45px);min-height:0;border-radius:12px;font-size:20px}
  .stage .maze button .mazeHome{top:0}
  .stage .placeCol{gap:5px;padding:6px 7px}
  .stage .placeCol h3{font-size:9px;letter-spacing:0}
  .stage .placeCol>b{font-size:20px;padding:0 8px}
  .stage .placeAdjust button{width:38px;min-height:36px;height:36px}
  .stage .placeBoard .bundles{min-height:51px;gap:4px}
  .stage .placeBoard #tens{width:100%;max-width:none;gap:3px}
  .stage .tenBundle{padding:2px}
  .stage .tenBundle i,.stage .oneStick{height:21px;width:2.3px}
  .stage .placeControls .mathConfirm{min-height:44px;min-width:0;width:100%;padding:5px 9px;font-size:14px}
  .stage :is(#mazeNote,#placeNote){font-size:11px}
}

/* ---- Cây cầu xăng-ti-mét: tấm ván gỗ được đặt dọc theo thước, chỗ đọc được chỉ ra ---- */
.rulerWork{position:relative}
/* ván gỗ (vân gỗ, hai đinh ở hai đầu) nằm sát thước hơn để đầu ván gióng thẳng xuống vạch */
.rulerObject{margin-top:11px;margin-bottom:10px;font-size:0;background:
  radial-gradient(circle at 6px 50%,#a57049 0 2px,transparent 2.6px),
  radial-gradient(circle at calc(100% - 6px) 50%,#a57049 0 2px,transparent 2.6px),
  repeating-linear-gradient(180deg,rgba(150,98,62,0) 0 10px,rgba(150,98,62,.2) 10px 11px,rgba(150,98,62,0) 11px 17px),
  linear-gradient(#f1bb91,#ce9472)}
/* các ô 1 cm trên ván: chỉ hiện (lần lượt) khi bé trả lời đúng */
.rulerObject .plankCm{position:absolute;left:0;top:0;right:0;bottom:0;display:flex}
.rulerObject .plankCm i{flex:1;min-width:0;display:grid;place-items:center;font:800 17px var(--display);color:#fffaf0;text-shadow:0 1px 0 #a9744f;border-right:2px dashed rgba(255,246,226,.85);opacity:0}
.rulerObject .plankCm i:last-child{border-right:0}
/* đường gióng từ cuối ván xuống vạch của thước */
.rulerObject .rulerDrop{position:absolute;right:-1px;top:-7px;width:0;height:calc(100% + 40px);border-left:2px dashed #d2684c;opacity:0;transform-origin:50% 0}
.ruler span.hit{color:#c24d32;font-weight:800;font-size:19px}
.ruler span.hit::before{background:#c24d32;width:3px}
@media(max-width:600px){.rulerObject .plankCm i{font-size:14px}}

/* ---- Thám tử Bíp: Bíp là nhân vật từng khung, phép tính nằm trong bong bóng lời của Bíp ---- */
.claimBip{width:85px;flex:none}
.robotClaim b{position:relative;background:#fff;border:2px solid #e6ecd8;border-radius:20px;padding:4px 20px;transform-origin:0% 55%}
.robotClaim b::before{content:'';position:absolute;left:-11px;top:50%;margin-top:-9px;border:9px solid transparent;border-left-width:0;border-right-color:#e6ecd8}
.robotClaim b::after{content:'';position:absolute;left:-8px;top:50%;margin-top:-7px;border:7px solid transparent;border-left-width:0;border-right-color:#fff}
.robotClaim .claimRes{display:inline-block;min-width:.6em;text-align:center}
.robotClaim .claimRes.doubt{color:#d2684c}
.robotClaim .claimRes.fixed{color:#3f9a52}
@media(max-width:600px){.claimBip{width:65px}.robotClaim b{padding:3px 13px}}
