/* Daily Lock: the safe, its dials, your tries, notes, today's best, and the card on the homepage.
   Same sticker look as the quick games (chunky outlines, solid drop shadows), in safe navy and gold. */
.qg[data-q=daily]{--qa:#2f3b55;--qb:#fff0bf;--qp:#ffd96a;--gold:#ffcf33;--steel:#34405a;--door:#55688f;--wh:76px;max-width:520px}
[data-theme="dark"] .qg[data-q=daily] .qstage{background:color-mix(in srgb,#ffcf33 10%,#141416)}

/* ---------- the safe ---------- */
.dsafe{position:relative;width:min(100%,390px);margin:6px auto 22px;padding:16px;border:3px solid #17171a;border-radius:30px;background:var(--steel);box-shadow:0 7px 0 #17171a,inset 0 0 0 4px rgba(255,255,255,.06);perspective:1200px}
.dvault{position:absolute;inset:16px;border-radius:20px;border:3px solid #17171a;background:radial-gradient(circle at 50% 60%,rgba(255,207,51,.55),transparent 62%),#141824;display:grid;place-items:center;align-content:center;gap:10px;overflow:hidden}
.dvault b{color:var(--gold);font-size:26px;font-weight:800;letter-spacing:-.02em;text-shadow:0 3px 0 #17171a;opacity:0;transform:scale(.5)}
.dloot{position:relative;width:150px;height:84px}
.dloot i{position:absolute;bottom:0;left:8px;width:44px;height:16px;border-radius:50%;background:var(--gold);border:3px solid #17171a;box-shadow:0 5px 0 #c99400,0 5px 0 3px #17171a;opacity:0;transform:translateY(30px)}
.dsafe.open .dvault b{animation:dpopin .5s .55s cubic-bezier(.34,1.56,.64,1) forwards}
.dsafe.open .dloot i{animation:dcoin .45s calc(.5s + var(--i) * 70ms) cubic-bezier(.34,1.56,.64,1) forwards}
.dloot i:nth-child(2){left:53px}.dloot i:nth-child(3){left:98px}.dloot i:nth-child(4){left:30px;bottom:19px}.dloot i:nth-child(5){left:76px;bottom:19px}.dloot i:nth-child(6){left:53px;bottom:38px}
@keyframes dpopin{to{opacity:1;transform:none}}
@keyframes dcoin{to{opacity:1;transform:none}}

.ddoor{position:relative;z-index:1;padding:18px 16px 14px;border:3px solid #17171a;border-radius:20px;background:var(--door);box-shadow:inset 0 -6px 0 rgba(0,0,0,.18),inset 0 3px 0 rgba(255,255,255,.14);transform-origin:-10px 50%;transition:transform 1s cubic-bezier(.3,1.25,.5,1),filter .6s;backface-visibility:visible}
.ddoor.still{transition:none}
.dsafe.open .ddoor{transform:rotateY(-76deg);filter:brightness(.8)}
.dhinge{position:absolute;left:-12px;width:12px;height:34px;border-radius:5px 0 0 5px;background:#17171a}
.dhinge.h1{top:18%}.dhinge.h2{bottom:18%}
.dfeet{position:absolute;left:34px;right:34px;bottom:-13px;display:flex;justify-content:space-between;z-index:-1}
.dfeet i{width:46px;height:13px;border-radius:0 0 9px 9px;background:#17171a}

/* lamps: the answer to each try */
.dlamps{display:flex;justify-content:center;gap:12px;margin-bottom:14px}
.dlamps i{width:18px;height:18px;border-radius:50%;background:#262e42;border:3px solid #17171a;transition:background .2s,box-shadow .2s}
.dlamps i.g{background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.25),0 0 16px rgba(34,197,94,.9)}
.dlamps i.a{background:#ffb020;box-shadow:0 0 0 3px rgba(255,176,32,.25),0 0 16px rgba(255,176,32,.9)}
.dlamps i.on{animation:dlamp .35s cubic-bezier(.34,1.56,.64,1)}
.dlamps i.off{animation:dlampx .3s ease}
@keyframes dlamp{0%{transform:scale(.4)}60%{transform:scale(1.35)}}
@keyframes dlampx{50%{background:#3a445e}}
.dsafe.lost .dlamps i{animation:dred .5s 3 ease}
@keyframes dred{50%{background:#ef4444;box-shadow:0 0 16px rgba(239,68,68,.9)}}

/* the dials: tap one to turn it up a number */
.dwin{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;padding:10px;border:3px solid #17171a;border-radius:18px;background:#1b2131;box-shadow:inset 0 5px 0 rgba(0,0,0,.35)}
.dwheel{position:relative;height:var(--wh);padding:0;border:3px solid #17171a;border-radius:12px;background:#fff7e3;color:#17171a;overflow:hidden;cursor:pointer;touch-action:none;-webkit-user-select:none;user-select:none;font:inherit;transition:transform .15s}
.dwheel::before{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(rgba(23,23,26,.28),transparent 30%,transparent 70%,rgba(23,23,26,.28))}
.dwheel::after{content:"";position:absolute;z-index:1;left:0;right:0;top:50%;height:2px;margin-top:-1px;background:rgba(23,23,26,.06);pointer-events:none}
.dwheel:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.dwheel:active{transform:scale(.95)}
.dwheel.tick{animation:dtick .22s ease}
@keyframes dtick{40%{transform:translateY(-3px)}}
.dwheel:disabled{cursor:default}
.dstrip{display:block;transform:translateY(calc(var(--i) * (6px - var(--wh))));transition:transform .26s cubic-bezier(.3,1.45,.55,1)}
.dstrip i{display:block;height:calc(var(--wh) - 6px);line-height:calc(var(--wh) - 6px);font-style:normal;font-size:calc(var(--wh) * .58);font-weight:800;letter-spacing:-.03em;font-variant-numeric:tabular-nums;text-align:center}
.dsafe.loading .dwin{opacity:.55}

/* the handle: pull it to try the code */
.dhandle{display:block;width:96px;height:96px;margin:14px auto 0;padding:0;border:0;border-radius:50%;background:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
.dhandle svg{width:100%;height:100%;overflow:visible;filter:drop-shadow(0 4px 0 #17171a)}
.dspin{transform-origin:50px 50px;transition:transform .35s cubic-bezier(.34,1.56,.64,1)}
.dhandle:hover .dspin{transform:rotate(14deg)}
.dhandle:active .dspin{transform:rotate(40deg)}
.dhandle:focus-visible{outline:3px solid var(--gold);outline-offset:4px}
.dhandle:disabled{cursor:default}
.dsafe.trying .dspin{animation:dturn .7s cubic-bezier(.45,0,.2,1)}
@keyframes dturn{to{transform:rotate(270deg)}}
.dsafe.open .dspin{transform:rotate(90deg)}
.dplate{display:table;margin:10px auto 0;padding:2px 12px;border:2px solid #17171a;border-radius:7px;background:var(--gold);color:#17171a;font-size:11px;font-weight:800;letter-spacing:.32em;text-indent:.32em}

/* ---------- controls under the safe ---------- */
.dgo{display:flex;align-items:center;justify-content:center;gap:8px;width:min(100%,390px)}
.dgo svg{width:18px;height:18px}
.qbtn:disabled{opacity:.5;pointer-events:none}

.dres{width:100%;padding:18px 16px;text-align:center;border:2px solid var(--qo);border-radius:22px;box-shadow:0 5px 0 var(--qo);animation:dpopin2 .5s cubic-bezier(.34,1.56,.64,1) both}
@keyframes dpopin2{from{transform:scale(.85);opacity:0}}
.dres.won{background:var(--gold);color:#17171a;--qo:#17171a}
.dres.lost{background:var(--qcard);color:var(--ink)}
.dres b{display:block;font-size:24px;font-weight:800;letter-spacing:-.02em}
.dres p{margin:4px 0 12px;font-size:15px}
.dres small{display:block;margin-top:10px;font-size:13px;opacity:.7}
.dres.won .qbtn{background:#17171a;color:var(--gold)}
.dcode{display:inline-flex;gap:4px;vertical-align:middle;margin-left:4px}
.dcode i{display:inline-grid;place-items:center;width:28px;height:32px;border:2px solid var(--qo);border-radius:7px;background:#fff7e3;color:#17171a;font-style:normal;font-weight:800}

.dpanel{width:100%;padding:14px;border:2px solid var(--qo);border-radius:22px;background:var(--qcard);box-shadow:0 4px 0 var(--qo)}
.dph{display:flex;align-items:center;justify-content:space-between;gap:8px 12px;flex-wrap:wrap;margin-bottom:12px}
.dph>b{font-size:16px;font-weight:750}
.dph small{font-size:12.5px;color:var(--mut)}
.dkey{display:flex;gap:12px}
.dkey span{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;color:var(--mut)}
.dkey i{width:12px;height:12px;border-radius:4px;border:2px solid var(--qo);background:transparent;flex:none}
.dkey i.g{background:#22c55e}
.dkey i.a{background:#ffb020}

/* your tries: each number is coloured, Wordle style */
.dlog{display:grid;gap:8px}
.dgr{display:grid;grid-template-columns:22px minmax(0,1fr);align-items:center;gap:10px}
.dgr.empty{opacity:.45}
.dno{font-size:13px;font-weight:800;color:var(--mut);text-align:center}
.ddg{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;max-width:300px}
.ddg b{display:grid;place-items:center;height:56px;border:2.5px solid var(--qo);border-radius:13px;background:#fff7e3;color:#17171a;box-shadow:0 3px 0 var(--qo);font-size:30px;font-weight:800;font-variant-numeric:tabular-nums}
.ddg b.g{background:#22c55e;color:#fff;text-shadow:0 2px 0 rgba(0,0,0,.25)}
.ddg b.a{background:#ffcf33;color:#17171a}
.ddg b.x{background:#d4d4d8;color:#3f3f46}
[data-theme="dark"] .ddg b.x{background:#4a4a54;color:#d4d4d8}
.dgr.empty .ddg b{height:56px;background:none;border-style:dashed;box-shadow:none}
.dgr.new .ddg b{animation:dflip .5s calc(var(--k,0) * 170ms + .1s) cubic-bezier(.3,1.4,.5,1) both}
.dgr.new .ddg b:nth-child(2){--k:1}.dgr.new .ddg b:nth-child(3){--k:2}.dgr.new .ddg b:nth-child(4){--k:3}
@keyframes dflip{0%{transform:rotateX(90deg);background:#fff7e3;color:#17171a}49%{background:#fff7e3;color:#17171a}50%{transform:rotateX(0)}70%{transform:scale(1.08)}}
.dgr.win .ddg b{animation:dhop .5s calc(var(--k,0) * 90ms + .8s) ease both}
@keyframes dhop{40%{transform:translateY(-8px)}}
.dkey{flex-wrap:wrap}
.dkey i.x{background:#d4d4d8}
[data-theme="dark"] .dkey i.x{background:#4a4a54}
.dsr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media(max-width:420px){.ddg b,.dgr.empty .ddg b{height:50px;font-size:26px}}

/* notes */
.dnotes{display:grid;grid-template-columns:repeat(10,1fr);gap:6px}
.dnotes button{position:relative;aspect-ratio:1;min-height:32px;padding:0;border:2px solid var(--qo);border-radius:10px;background:var(--qcard);color:var(--ink);font:inherit;font-size:16px;font-weight:800;cursor:pointer;transition:transform .15s,background .2s,opacity .2s}
.dnotes button:active{transform:scale(.9)}
.dnotes button.no{opacity:.4}
.dnotes button.no::after{content:"";position:absolute;left:18%;right:18%;top:50%;height:3px;margin-top:-1.5px;border-radius:2px;background:#ef4444;transform:rotate(-40deg)}
.dnotes button.yes{background:var(--gold);color:#17171a}

/* today's best */
.dboard{list-style:none;margin:0;padding:0;display:grid;gap:4px}
.dboard li{display:grid;grid-template-columns:28px 34px minmax(0,1fr) auto;align-items:center;gap:10px;padding:7px 8px;border-radius:14px}
.dboard li.me{background:color-mix(in srgb,var(--qp) 30%,transparent)}
.dboard .rk{text-align:center;font-weight:800;font-size:14px;color:var(--mut)}
.dboard .rk i{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:50%;border:2px solid #17171a;font-style:normal;color:#17171a}
.dboard .rk .m0{background:var(--gold)}.dboard .rk .m1{background:#d6dbe4}.dboard .rk .m2{background:#eaa877}
.dboard .av{width:34px;height:34px;font-size:12px}
.dboard .nm{min-width:0;line-height:1.25}
.dboard .nm b,.dboard .nm small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dboard .nm b{font-size:14.5px}.dboard .nm small{font-size:12.5px;color:var(--mut)}
.dboard .sc{text-align:right;line-height:1.25}.dboard .sc b{display:block;font-size:14px}.dboard .sc small{font-size:12.5px;color:var(--mut);font-variant-numeric:tabular-nums}
.dboard .dbe{display:block;padding:14px 6px;text-align:center;color:var(--mut);font-size:14px}

@media(max-width:420px){
  .qg[data-q=daily]{--wh:66px}
  .dsafe{padding:12px;border-radius:26px}.dvault{inset:12px}
  .ddoor{padding:14px 12px 12px}
  .dhandle{width:84px;height:84px}
  .dnotes{gap:4px}.dnotes button{font-size:14px;border-radius:8px}
}

/* ---------- the card on the homepage and at the top of Games ---------- */
.hmdaily{margin-top:14px}
.gdaily{margin:20px 0 4px}
.hmdl{position:relative;width:100%;display:flex;align-items:center;gap:14px;padding:12px 14px 12px 12px;border:2.5px solid #17171a;border-radius:22px;background:#ffe48a;color:#17171a;box-shadow:0 5px 0 #17171a;font:inherit;text-align:left;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease}
.hmdl:hover{transform:translateY(-2px);box-shadow:0 7px 0 #17171a}
.hmdl:active{transform:translateY(3px);box-shadow:0 2px 0 #17171a}
.hmdl:focus-visible{outline:3px solid #ffb020;outline-offset:3px}
.hmdl.won{background:#b8f0c8}
.hmdl.lost{background:#e4e7ee}
.hmdl.wait{cursor:default;opacity:.75}
.hmdl.wait:hover{transform:none;box-shadow:0 5px 0 #17171a}
[data-theme="dark"] .hmdl{border-color:#000;box-shadow:0 5px 0 #000}
[data-theme="dark"] .hmdl:hover{box-shadow:0 7px 0 #000}
.dlart{position:relative;flex:none;width:74px;height:62px}
.dlart .dlsvg{display:block;width:100%;height:100%}
.hmdl.new .dlart .dlsvg{animation:dwiggle 3.2s ease-in-out infinite;transform-origin:50% 90%}
@keyframes dwiggle{0%,82%,100%{transform:none}86%{transform:rotate(-7deg)}90%{transform:rotate(6deg)}94%{transform:rotate(-3deg)}}
.dlping{position:absolute;top:-3px;right:-3px;width:14px;height:14px;border-radius:50%;background:#ff4d6d;border:2.5px solid #17171a}
.dlping::after{content:"";position:absolute;inset:-3px;border-radius:50%;border:2px solid #ff4d6d;animation:dping 1.6s ease-out infinite}
@keyframes dping{from{transform:scale(.8);opacity:1}to{transform:scale(2.1);opacity:0}}
.hmdl .tx{flex:1;min-width:0;line-height:1.3}
.hmdl small{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;opacity:.75}
.hmdl b{display:block;font-size:18px;font-weight:800;letter-spacing:-.02em}
.hmdl .sub{display:block;font-size:13px;opacity:.75;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dlstk{display:inline-flex;align-items:center;gap:2px;padding:1px 7px 1px 4px;border:2px solid #17171a;border-radius:999px;background:#fff;letter-spacing:0;font-size:12px;opacity:1}
.dlfl{width:14px;height:14px}
.hmdl .go{flex:none;display:inline-flex;align-items:center;gap:6px;height:40px;padding:0 14px;border-radius:13px;background:#17171a;color:#ffe48a;font-size:14px;font-weight:750}
.hmdl.won .go{color:#b8f0c8}.hmdl.lost .go{color:#e4e7ee}
.hmdl .go svg{width:16px;height:16px}
.gart .dlsvg{position:absolute;inset:6% 0;width:100%;height:88%}
.hmdaily,.gdaily{container-type:inline-size}
.hmdl small{white-space:nowrap}
@container (max-width:470px){.hmdl .go{width:40px;padding:0;justify-content:center;font-size:0;gap:0}.hmdl b{font-size:16.5px}.dlart{width:60px;height:50px}.hmdl{gap:12px}}
@container (max-width:360px){.dlart{display:none}.hmdl{padding-left:16px}}
@media(prefers-reduced-motion:reduce){.hmdl.new .dlart .dlsvg,.dlping::after{animation:none}.ddoor,.dstrip,.dspin{transition:none}}

/* ---------- the real 3D safe (js/safe3d.js); the flat one above is the fallback ---------- */
.d3{display:none}
.is3d .d3{display:block;position:relative;width:100%;aspect-ratio:1/.92;margin:0 auto;border-radius:16px;overflow:hidden;touch-action:pan-y;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;animation:d3in .5s ease both}
.is3d .dsafe{display:none}
/* the 3D safe sits in a dark studio, in both themes */
.qg[data-q=daily] .qstage.is3d,[data-theme="dark"] .qg[data-q=daily] .qstage.is3d{background:radial-gradient(110% 85% at 42% 28%,#4a4d52 0%,#26282c 48%,#111214 100%);padding:0;overflow:hidden}
.qstage.is3d::before{display:none}
.qstage.is3d .d3{border-radius:inherit}
.d3cv{display:block;width:100%;height:100%}
@keyframes d3in{from{opacity:0}}

/* immersive 3D mode: the safe fills the stage, stats float over the room */
.qg.dl3d{position:relative;max-width:640px}
.qg.dl3d .qhud{position:absolute;top:12px;left:12px;right:12px;z-index:7;gap:8px;pointer-events:none}
.qg.dl3d .qs{flex:0 1 auto;min-width:0;padding:6px 12px 7px;border-radius:14px;background:rgba(14,15,17,.52);color:#fff;border:1px solid rgba(255,255,255,.12);box-shadow:none;-webkit-backdrop-filter:blur(12px) saturate(1.2);backdrop-filter:blur(12px) saturate(1.2)}
.qg.dl3d .qs small{color:rgba(255,255,255,.66);font-size:11px}
.qg.dl3d .qs b{font-size:19px}
.qg.dl3d .qstage{border:0;box-shadow:0 22px 60px -18px rgba(0,0,0,.55)}
.qg.dl3d .d3{aspect-ratio:auto;height:min(78svh,760px);min-height:420px}
.qg.dl3d .dgo,.qg.dl3d #dTip{display:none}
.is3d .d3::after{content:"";position:absolute;inset:0;pointer-events:none;border-radius:inherit;box-shadow:inset 0 0 140px rgba(0,0,0,.6)}
.dleg{display:none}
.is3d .dleg{display:flex;position:absolute;left:50%;bottom:14px;transform:translateX(-50%);z-index:5;gap:12px;padding:7px 13px;border-radius:999px;background:rgba(14,15,17,.52);color:rgba(255,255,255,.86);font-size:12px;font-weight:600;white-space:nowrap;pointer-events:none;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}
.dleg i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:6px;vertical-align:-1px}
.dleg .g{background:#22c55e}.dleg .a{background:#ffcf33}.dleg .x{background:#8a8f96}
@media (max-width:420px){.qg.dl3d .d3{height:min(72svh,640px)}.is3d .dleg{gap:9px;font-size:11px;padding:6px 11px}.qg.dl3d .qs{padding:5px 10px 6px}.qg.dl3d .qs b{font-size:17px}}

/* while the 3D safe is still downloading: the dark studio with a small spinner, never the flat safe */
.qstage.d3wait .d3::before{content:"";position:absolute;left:50%;top:50%;width:34px;height:34px;margin:-17px 0 0 -17px;border-radius:50%;border:3px solid rgba(255,255,255,.16);border-top-color:rgba(255,255,255,.85);animation:d3spin .8s linear infinite;z-index:2}
.qstage.d3wait .dleg{opacity:0}
@keyframes d3spin{to{transform:rotate(1turn)}}
@media (prefers-reduced-motion:reduce){.qstage.d3wait .d3::before{animation-duration:2.4s}}
