/* กิจกรรมค้นรหัส: ใช้วัสดุตู้เดิมและพื้นดำแดง ไม่มีกรอบย่อยทับซ้อน */
.safe-memory{display:flex!important;justify-content:center;padding-top:0!important}.safe-memory .safe-cabinet-side{width:100%;max-width:460px}.safe-event-caption>small{display:block;font-size:9px;color:#aa9690;margin-top:5px}.safe-memory .lock-cabinet{width:260px;height:280px}.safe-wheel{padding:0!important;border:0!important;background:#17130f url('assets/rituals/lock-number-wheel.png') center/100% 100%!important;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;min-width:0;height:57px;border-radius:3px!important;touch-action:none;user-select:none;position:relative;color:#d9cdb7}.safe-wheel strong{font:600 25px/28px 'Chakra Petch',sans-serif}.safe-upper,.safe-lower{font-size:8px;line-height:9px;opacity:.24}.safe-wheel i{position:absolute;bottom:2px;left:3px;right:3px;height:1px;background:#a43b4b;opacity:0}.safe-wheel-selected i{opacity:1}.safe-roller-controls{display:flex;align-items:center;justify-content:center;gap:18px;margin-top:12px}.safe-roller-controls button{border:1px solid #b4936430;border-radius:25px;background:#1a1115;color:#d1bfb7;font-size:11px;padding:6px 16px}.safe-selected{font-size:11px;color:#b49364;min-width:45px;text-align:center}.safe-wheel-help{font-size:9px;line-height:1.7;text-align:center;color:#9b8782;margin:5px 0 0}.safe-memory .safe-unlock{margin-top:7px}.safe-memory .safe-status{margin-top:6px}.safe-item-list{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}.safe-item-list button{font-size:11px;border-radius:20px;padding:8px 13px}.safe-item-paper{padding:20px 10px;background:radial-gradient(ellipse at left,#68332730,transparent 85%);min-height:130px}.safe-item-paper h3{font-size:19px;color:#dbc7b2;margin:4px 0 12px}.safe-item-paper p{font-size:13px;line-height:1.9;white-space:pre-line}.safe-item-paper small{color:#b49364;font-size:10px}
.ritual-hall[data-mode="lock"] .pack-panel[hidden]{display:none!important}.ritual-hall[data-mode="lock"] .ticket-balance,.ritual-hall[data-mode="lock"] #history{display:none!important}.ritual-hall[data-mode="lock"] .scene-heading{display:none}.ritual-hall[data-mode="lock"] .scene-footer{display:none}
.ritual-hall[data-mode="lock"]:has(.safe-event) .ceremony{height:500px}.ritual-hall[data-mode="lock"]:has(.safe-event) .stage{top:12px;left:5%;width:90%;height:470px;transform:none}.safe-event{display:grid;grid-template-columns:290px minmax(0,1fr);gap:35px;width:100%;height:100%;pointer-events:auto;padding:8px 15px;color:#ead7d2}.safe-cabinet-side{display:flex;flex-direction:column;align-items:center;position:relative}.safe-event-caption{font-size:13px;color:#b49364;text-align:center;margin-bottom:12px}.safe-count{display:block;font-size:10px;color:#b8aaa4;margin-top:4px}.safe-event .lock-cabinet{width:250px;height:269px;flex-shrink:0}.safe-code-bank{position:absolute;left:7%;right:7%;top:48%;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));padding:5px;gap:2px;background:linear-gradient(100deg,#34281c,#080707,#3c3022);border-radius:7px;box-shadow:inset 0 1px 2px #b4936477,0 3px 5px #000}.safe-digit{width:100%;height:48px;border:0!important;border-radius:3px!important;padding:0!important;text-align:center;font:600 25px 'Chakra Petch',sans-serif;color:#e5d6bc;background:#17130f url('assets/rituals/lock-number-wheel.png') center/100% 100%;box-shadow:inset 0 4px 5px #000a;appearance:textfield}.safe-digit:disabled{opacity:.8}.safe-digit:focus{outline:1px solid #b49364;outline-offset:1px}.safe-unlock{margin-top:14px;padding:8px 25px;border-radius:30px;background:linear-gradient(100deg,#6c1829,#41121b);border:1px solid #8c2d3d;color:#ead7d2;font-size:12px}.safe-unlock:disabled{opacity:.45}.safe-status{font-size:10px;text-align:center;color:#b9aaa6;min-height:28px;margin:8px 0 3px;white-space:pre-line}.safe-stamp,.safe-found-stamp{color:#c1a16d;font-size:11px;border-block:1px solid #b4936470;padding:3px 8px;transform:rotate(-5deg);display:inline-block}.safe-stamp[hidden],.safe-found-stamp[hidden]{display:none}.safe-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:12px}.safe-section-head h2{font-size:18px;margin:0}.safe-section-head small{font-size:9px;color:#a9978f}.safe-search-list{display:grid;grid-template-columns:1fr 1fr;gap:6px}.safe-search-point{padding:8px 11px;border-radius:24px;text-align:left;border:1px solid #b493642c;background:linear-gradient(110deg,#411b2240,#131012);color:#d0beb6;font:11px inherit;line-height:1.5}.safe-search-point[data-found=true]{color:#c4a575;border-color:#b4936444}.safe-clue-reading{position:relative;min-height:101px;padding:13px 0 8px;background:radial-gradient(ellipse at left,#64273324,transparent 75%)}.safe-clue-reading>small{font-size:9px;letter-spacing:.4px;color:#b49364}.safe-clue-reading p{font-size:11px;line-height:1.8;color:#d0c1b9;margin:4px 0;white-space:pre-line}.safe-found-stamp{position:absolute;right:0;bottom:9px;font-size:9px}.safe-notebook{display:flex;gap:8px;margin:7px 0 12px}.safe-note-digit{flex:1;text-align:center;border-bottom:1px solid #b4936444;padding-bottom:5px}.safe-note-digit small{display:block;font-size:8px;color:#a08c86}.safe-note-digit strong{font:500 22px 'Chakra Petch',sans-serif;color:#c0a06c}.safe-rewards>small{font-size:9px;color:#ab9990}.safe-rewards>div{display:flex;gap:14px;margin-top:8px;flex-wrap:wrap}.safe-rewards>div>span{display:flex;align-items:center;gap:5px;font-size:9px;color:#c8b8b0}.safe-rewards img{width:28px;height:30px;object-fit:contain}.safe-event .lock-interior{display:flex;align-items:center;justify-content:center;gap:4px}.safe-inside-item{width:49px;height:65px;object-fit:contain;filter:drop-shadow(0 5px 4px #000)}.safe-open-static .lock-door{transform:rotateY(-78deg);backface-visibility:hidden}.safe-event[data-status=claimed] .safe-search-point{opacity:.8}
@media(max-height:800px){.ritual-hall[data-mode="lock"]:has(.safe-event) .ceremony{height:405px}.ritual-hall[data-mode="lock"]:has(.safe-event) .stage{height:390px;top:5px}.safe-event{grid-template-columns:245px minmax(0,1fr);gap:20px;padding:0 8px}.safe-event .lock-cabinet{width:210px;height:226px}.safe-event-caption{margin-bottom:7px;font-size:12px}.safe-section-head{margin-bottom:7px}.safe-section-head h2{font-size:15px}.safe-search-point{font-size:10px;padding:6px 9px}.safe-clue-reading{min-height:90px;padding-top:8px}.safe-clue-reading p{font-size:10px}.safe-notebook{margin:4px 0 8px}.safe-unlock{margin-top:9px}.safe-status{font-size:9px}.safe-code-bank{padding:3px}.safe-digit{height:40px;font-size:22px}}
@media(max-width:800px){.safe-event{grid-template-columns:190px minmax(0,1fr);gap:12px;padding:0}.safe-event .lock-cabinet{width:180px;height:194px}.safe-search-list{grid-template-columns:1fr}.safe-section-head small{display:none}.safe-search-point{font-size:9px;padding:4px 8px}.safe-clue-reading p{font-size:9px}.safe-found-stamp{position:static}.safe-notebook{gap:3px}.safe-rewards>div{gap:5px}.safe-code-bank{top:48%}.safe-digit{height:34px;font-size:19px}}
.safe-memory{min-height:0;flex-shrink:1;height:100%}.safe-memory .safe-cabinet-side{display:grid;grid-template-rows:32px 250px 30px 28px 32px 18px 27px;gap:4px;justify-items:center;align-content:start;min-height:0}.safe-memory .lock-cabinet{width:232px;height:250px}.safe-memory .safe-event-caption,.safe-memory .safe-roller-controls,.safe-memory .safe-wheel-help,.safe-memory .safe-unlock,.safe-memory .safe-status{margin:0;min-height:0}.safe-memory .safe-wheel-help{font-size:8px}.safe-memory .safe-unlock{padding:4px 25px}.safe-memory .safe-status{font-size:9px}.safe-memory .safe-stamp{align-self:center}.safe-memory .safe-wheel{height:48px}.safe-memory .safe-wheel strong{font-size:23px;line-height:25px}
@media(max-height:800px){.safe-memory .safe-cabinet-side{grid-template-rows:28px 200px 28px 25px 30px 16px 25px}.safe-memory .lock-cabinet{width:186px;height:200px}.safe-memory .safe-code-bank{left:4%;right:4%;padding:3px}.safe-memory .safe-wheel{height:39px}.safe-memory .safe-wheel strong{font-size:20px;line-height:23px}.safe-memory .safe-upper,.safe-memory .safe-lower{font-size:7px;line-height:7px}.safe-memory .safe-roller-controls button{padding:4px 13px;font-size:10px}}
/* รุ่น42: รายละเอียดวัสดุเคลื่อนเฉพาะจังหวะ ไม่มีแสงวนหรือเฉลยรหัส */
.safe-memory .lock-door{isolation:isolate;overflow:visible;transform-style:preserve-3d}.safe-door-thickness{position:absolute;top:1%;bottom:1%;right:-4px;width:5px;border-radius:0 2px 2px 0;background:linear-gradient(90deg,#15100e,#6b5b49 26%,#29231e 63%,#100d0c);box-shadow:2px 1px 3px #000b;transform:rotateY(18deg);transform-origin:left center;pointer-events:none;z-index:-1}.safe-door-reflection{position:absolute;inset:3% 1%;border-radius:3px;opacity:0;pointer-events:none;background:linear-gradient(108deg,transparent 25%,#cfbaa82b 44%,#f0e0c73d 48%,transparent 65%);mix-blend-mode:screen;clip-path:inset(0);z-index:1}.safe-steel-bolts{position:absolute;right:-4px;top:13%;bottom:13%;width:7px;display:flex;flex-direction:column;justify-content:space-between;pointer-events:none;z-index:-2}.safe-steel-bolts i{display:block;width:8px;height:13px;border-radius:0 3px 3px 0;background:linear-gradient(#171513,#aa9f87 25%,#514939 50%,#171310 90%);box-shadow:1px 2px 2px #000c}.safe-memory .lock-cabinet[data-motion=opening] .safe-steel-bolts,.safe-memory .lock-cabinet[data-motion=settled] .safe-steel-bolts,.safe-open-static .safe-steel-bolts{transform:translateX(-6px)}.safe-memory .lock-interior{background:radial-gradient(ellipse at 45% 25%,#b4936420,transparent 65%),linear-gradient(120deg,#070607,#1a1210 55%,#090708);box-shadow:inset 7px 5px 12px #000,inset -3px 0 4px #000c}.safe-memory .safe-code-bank{box-shadow:inset 0 1px 1px #ab977b80,inset 0 -1px 1px #060504,0 3px 5px #000c,0 -1px 0 #342b23;perspective:160px}.safe-memory .safe-code-bank::before,.safe-memory .safe-code-bank::after{content:'';position:absolute;top:2px;width:3px;height:3px;border-radius:50%;background:linear-gradient(135deg,#786b59,#171310 60%,#aaa18a);box-shadow:0 1px 1px #0009;pointer-events:none}.safe-memory .safe-code-bank::before{left:1px}.safe-memory .safe-code-bank::after{right:1px}.safe-memory .safe-wheel{box-shadow:inset 0 5px 6px #000d,inset 0 -5px 6px #000b,inset 1px 0 0 #b5a18622;perspective:90px;overflow:hidden}.safe-memory .safe-wheel-selected{box-shadow:inset 0 5px 6px #000d,inset 0 -5px 6px #000b,inset 0 0 0 1px #ad8c573d}.safe-memory .safe-wheel strong{transform-origin:50% 50%;text-shadow:0 2px 1px #000,0 -1px #bfb49933}.safe-memory .lock-opening .lock-door{box-shadow:6px 4px 14px #000c,inset -2px 0 1px #8d7b5a}.safe-memory .safe-inside-item{filter:drop-shadow(0 7px 4px #000b) brightness(.95)}.safe-memory .safe-open-static .lock-interior{box-shadow:inset 7px 5px 12px #000,inset -3px 0 4px #000c}
@media(prefers-reduced-motion:reduce){.safe-door-reflection{display:none}.safe-memory .lock-opening .lock-door{animation:none;transform:rotateY(-67deg)}}
.safe-memory .safe-door-reflection{opacity:1;background:none;overflow:hidden;mix-blend-mode:normal}.safe-door-reflection>i{position:absolute;inset:0;display:block;opacity:0;background:linear-gradient(108deg,transparent 25%,#cfbaa82b 44%,#f0e0c73d 48%,transparent 65%);mix-blend-mode:screen;pointer-events:none}
/* รุ่น43: บานมีด้านหน้า/หลัง แกนซ้ายคงที่ และมุมจบตรงกับตอนเปิดกลับ */
.safe-memory .lock-door{background:none;box-shadow:none;isolation:auto;backface-visibility:visible;transform-origin:0 50%;transform-style:preserve-3d}.safe-door-front,.safe-door-back{position:absolute;inset:0;border-radius:3px;pointer-events:none;backface-visibility:hidden}.safe-door-front{background:transparent url('assets/rituals/lock-cabinet-real.png') 49.4% 54.1%/133.51% 136.99% no-repeat;transform:translateZ(2px);box-shadow:inset -1px 0 2px #0009}.safe-door-back{transform:rotateY(180deg) translateZ(2px);background:repeating-linear-gradient(96deg,#ffffff02 0 1px,transparent 1px 4px),linear-gradient(110deg,#1d1916,#3b322a 45%,#161310);box-shadow:inset 0 0 0 6px #211b17,inset 0 0 0 7px #79634c55,inset 0 5px 12px #000b}.safe-door-back::after{content:'';position:absolute;inset:15% 23%;border-left:4px solid #171310;border-right:4px solid #171310;box-shadow:inset 1px 0 #77634b55,1px 0 #77634b55}.safe-memory .safe-code-bank{transform:translateZ(3px);backface-visibility:hidden}.safe-memory .safe-door-reflection{transform:translateZ(3px);backface-visibility:hidden}.safe-memory .safe-steel-bolts{backface-visibility:hidden}.safe-memory .safe-open-static .lock-door{transform:rotateY(-104deg);backface-visibility:visible}.safe-memory .lock-opening .lock-door{animation:safe-door-swing 1.1s cubic-bezier(.22,.55,.3,1) 1 forwards;box-shadow:none;backface-visibility:visible}
@keyframes safe-door-swing{from{transform:rotateY(0)}to{transform:rotateY(-104deg)}}
@media(prefers-reduced-motion:reduce){.safe-memory .lock-opening .lock-door{animation:none;transform:rotateY(-104deg)}}
.safe-memory .lock-opening .lock-door{animation-duration:1.4s;animation-timing-function:cubic-bezier(.36,0,.2,1)}.safe-memory[data-preview-test=true] .safe-status{color:#c3a373}.preview-tools #test-safe-opening{border-color:#a8854d88;color:#ead7b5;background:linear-gradient(110deg,#57212a,#211519)}
.safe-reward-outside{position:absolute;left:calc(100% + 20px);top:20%;width:175px;display:flex;flex-direction:column;gap:8px;z-index:8;pointer-events:none}.safe-reward-token{display:flex;align-items:center;gap:10px;min-height:42px;color:#dfccb6;filter:drop-shadow(0 5px 4px #000a)}.safe-reward-token>img{width:43px;height:43px;object-fit:contain}.safe-reward-token>span{font-size:10px;line-height:1.6;text-shadow:0 1px 3px #000}.safe-memory .safe-inside-item[hidden]{display:none}
@media(max-height:800px){.safe-reward-outside{left:calc(100% + 14px);width:150px;gap:5px;top:15%}.safe-reward-token{gap:7px;min-height:36px}.safe-reward-token>img{width:36px;height:36px}.safe-reward-token>span{font-size:9px}}
/* รุ่น45: ของพุ่งมาด้านหน้า ขยายภาพและแยกจำนวนให้เห็นชัด */
.safe-memory .safe-reward-outside{left:50%;top:16%;width:420px;transform:translateX(-50%);flex-direction:row;align-items:flex-start;justify-content:center;gap:18px;z-index:20;perspective:700px}.safe-memory .safe-reward-token{position:relative;display:flex;flex-direction:column;align-items:center;gap:9px;width:124px;min-height:0;flex:0 0 124px;filter:drop-shadow(0 13px 8px #000c);transform-origin:50% 45%;text-align:center}.safe-memory .safe-reward-token::before{content:'';position:absolute;left:-18px;right:-18px;top:34px;height:98px;background:radial-gradient(ellipse,#ad855724,transparent 70%);z-index:-1;pointer-events:none}.safe-memory .safe-reward-token>img{width:96px;height:96px;object-fit:contain;filter:drop-shadow(0 7px 3px #000c)}.safe-memory .safe-reward-token>span{display:flex;flex-direction:column;align-items:center;font-size:12px;line-height:1.5;text-shadow:0 2px 5px #000,0 0 8px #000}.safe-reward-name{color:#ead7cf}.safe-reward-quantity{font:600 21px/1.3 'Chakra Petch',sans-serif;color:#d0af79;margin-top:3px}
@media(max-height:800px){.safe-memory .safe-reward-outside{width:340px;gap:12px;top:16%}.safe-memory .safe-reward-token{width:104px;flex-basis:104px;gap:6px}.safe-memory .safe-reward-token>img{width:76px;height:76px}.safe-memory .safe-reward-token>span{font-size:10px}.safe-reward-quantity{font-size:18px}.safe-memory .safe-reward-token::before{height:76px;top:24px}}

/* รุ่น46: เหลือเฉพาะลูกกลิ้ง แยกชุดเลขก่อนแสดงของ ไม่มีตู้หรือประตู */
.safe-memory .safe-code-device{width:420px;height:250px;position:relative;display:flex;align-items:center;justify-content:center;perspective:700px}
.safe-memory .safe-code-device .safe-code-bank{position:relative;inset:auto;display:flex;gap:0;padding:0;background:none;box-shadow:none;transform:none;isolation:isolate;perspective:700px}
.safe-code-device .safe-code-bank::before,.safe-code-device .safe-code-bank::after{display:none}
.safe-code-half{display:grid;grid-template-columns:repeat(3,48px);gap:4px;padding:12px 9px;background:repeating-linear-gradient(97deg,#ffffff03 0 1px,transparent 1px 4px),linear-gradient(#5c4a3c,#201713 12%,#110e0d 48%,#3b2b22 88%,#746048);box-shadow:inset 0 1px 1px #c0a57b77,inset 0 -3px 4px #000b,0 12px 18px #000b;transform-origin:center;will-change:transform,opacity}
.safe-code-half-0{border-radius:22px 2px 2px 22px;padding-left:16px}.safe-code-half-1{border-radius:2px 22px 22px 2px;padding-right:16px}
.safe-memory .safe-code-device .safe-wheel{height:88px;border-radius:9px!important}.safe-memory .safe-code-device .safe-wheel strong{font-size:36px;line-height:40px}.safe-memory .safe-code-device .safe-upper,.safe-memory .safe-code-device .safe-lower{font-size:14px;line-height:19px}
.safe-code-device.code-open .safe-code-half{opacity:0;pointer-events:none}.safe-code-device .safe-reward-outside{top:16%}
@media(max-height:800px){.safe-memory .safe-code-device{width:340px;height:200px}.safe-code-half{grid-template-columns:repeat(3,38px);gap:3px;padding:10px 7px}.safe-code-half-0{padding-left:14px}.safe-code-half-1{padding-right:14px}.safe-memory .safe-code-device .safe-wheel{height:74px}.safe-memory .safe-code-device .safe-wheel strong{font-size:30px;line-height:34px}.safe-memory .safe-code-device .safe-upper,.safe-memory .safe-code-device .safe-lower{font-size:11px;line-height:16px}}
@media(prefers-reduced-motion:reduce){.safe-code-half{will-change:auto}}

/* รุ่น47: แสงผ่านครั้งเดียวและเงาแรงส่ง ไม่เปลี่ยนระยะจัดวาง */
.safe-code-glint{position:absolute;left:8%;right:8%;top:calc(50% - 54px);height:108px;border-radius:24px;overflow:hidden;pointer-events:none;opacity:0;z-index:5;background:linear-gradient(105deg,transparent 33%,#a5854b33 44%,#d7bb8370 50%,transparent 59%);mask-image:linear-gradient(transparent,#000 20% 80%,transparent)}
.safe-memory .safe-reward-ground{position:absolute;left:50%;top:90px;width:83px;height:12px;background:radial-gradient(ellipse,#000c,transparent 72%);transform:translateX(-50%);opacity:.42;z-index:-1;pointer-events:none}
@media(max-height:800px){.safe-code-glint{top:calc(50% - 47px);height:94px}.safe-memory .safe-reward-ground{top:71px;width:67px;height:10px}}
@media(prefers-reduced-motion:reduce){.safe-code-glint{display:none}}

/* รุ่น48: โลหะสลักเลขและรอยต่อสะดุดเฉพาะรหัสผิด */
.safe-memory .safe-code-device .safe-wheel{isolation:isolate;background-blend-mode:soft-light,normal!important;background-image:repeating-linear-gradient(101deg,transparent 0 7px,#c8b58b12 8px,transparent 9px 19px),url('assets/rituals/lock-number-wheel.png')!important}
.safe-memory .safe-code-device .safe-wheel::before{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:3;background:linear-gradient(#050403dc 0%,#08060445 19%,transparent 38% 62%,#09060566 83%,#030202dd 100%);box-shadow:inset 1px 0 #b79b6226,inset -1px 0 #000a}
.safe-memory .safe-code-device .safe-wheel::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:2;background:linear-gradient(98deg,transparent 25%,#e1c99b0d 43%,transparent 61%)}
.safe-memory .safe-code-device .safe-wheel strong{color:#d0c4a9;text-shadow:0 1px 0 #eee0bb60,0 -1px 1px #000,1px 0 2px #000;position:relative;z-index:1}
.safe-memory .safe-code-device .safe-upper,.safe-memory .safe-code-device .safe-lower{transform-origin:center;backface-visibility:hidden}
.safe-code-seam{position:absolute;left:calc(50% - 3px);top:calc(50% - 53px);width:6px;height:106px;border-radius:50%;background:linear-gradient(transparent,#8e2333 27% 73%,transparent);box-shadow:0 0 11px #7f172a99;opacity:0;pointer-events:none;z-index:6}
@media(max-height:800px){.safe-code-seam{top:calc(50% - 46px);height:92px}}
