:root{--ink:#433729;--wine:#712d36;--muted:#897860;--paper:#eee2c8}*{box-sizing:border-box}body{margin:0;color:var(--ink);font-family:Amiri,Georgia,serif;background:#e8e1d4;background-image:radial-gradient(#98866c18 .7px,transparent .7px);background-size:5px 5px}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}button:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--wine);outline-offset:5px}header{height:86px;border-bottom:1px solid #6e594123;display:flex;align-items:center;justify-content:space-between;margin:0 6%;gap:20px}.brand{font-size:23px;text-decoration:none;color:var(--ink)}.brand span{color:var(--wine);margin-right:12px}.edition,.eyebrow{font-size:14px;color:var(--muted);letter-spacing:1px}header button{background:none;border:1px solid #9b876653;border-radius:30px;padding:6px 18px;color:var(--ink)}main{max-width:1550px;margin:auto}.intro{text-align:center;margin:34px 0 26px}.intro h1{font-size:42px;font-weight:400;margin:7px 0}.intro p{color:var(--muted);margin:0;font-size:17px}.desk{position:relative;display:flex;align-items:center;justify-content:center;gap:40px;padding:15px 50px 30px;direction:ltr}.outside-photo{width:200px;padding:11px 11px 22px;background:#f5eedf;transform:rotate(-7deg);box-shadow:3px 12px 22px #33251233;text-align:center;position:relative;flex-shrink:0}.outside-photo img{width:100%;height:285px;object-fit:cover;filter:sepia(.3)}.outside-photo p{font-size:19px;margin:12px 0 0}.tiny{font-size:11px;color:var(--muted)}.tape{position:absolute;top:-13px;left:60px;width:82px;height:28px;background:#bba98380;transform:rotate(5deg);z-index:2}.book-shell{width:min(880px,75vw);position:relative;perspective:1600px;flex-shrink:1;background:#4e3029;padding:8px 10px 11px;border-radius:9px 14px 15px 9px;box-shadow:0 24px 30px #33201238,0 3px 5px #29161066}.book{height:485px;display:grid;grid-template-columns:1fr 1fr;position:relative;direction:ltr;border-radius:3px 8px 8px 3px;overflow:hidden;background:var(--paper)}.page{position:relative;padding:32px 34px 26px;direction:rtl;overflow:hidden;background:radial-gradient(ellipse at 50% 40%,#f8efdc,#ecdfc4 80%,#dfcdab);display:flex;flex-direction:column;align-items:center;text-align:center}.left{box-shadow:inset -16px 0 24px -22px #3f2509,inset 2px 0 5px #82663b44}.right{box-shadow:inset 18px 0 27px -22px #3f2509,inset -2px 0 5px #82663b44}.page:after{content:'';position:absolute;inset:16px;border:1px solid #a58b582b;pointer-events:none}.spine{position:absolute;width:30px;height:100%;left:calc(50% - 15px);background:linear-gradient(90deg,transparent,#6a4b3229, #fff3,transparent);pointer-events:none}.bookmark{position:absolute;right:48px;top:-7px;background:var(--wine);width:23px;height:55px;z-index:3;clip-path:polygon(0 0,100% 0,100% 100%,50% 80%,0 100%)}.page-edges{height:6px;background:repeating-linear-gradient(#c4b08e 0 1px,#f1e5cd 1px 2px);margin:0 5px;border-radius:0 0 50% 50%}.page-number{position:absolute;bottom:15px;color:#947f5f;font-size:12px}.kicker{font-size:12px;color:#967c55;letter-spacing:2px}.page h2{font-size:36px;font-weight:400;margin:15px 0;line-height:1.5}.page p{font-size:18px;line-height:1.9;margin:8px 0}.ornament{color:#a28a61;letter-spacing:9px;font-size:20px;margin:10px}.cover-title{border:1px solid #af96635e;padding:25px 15px;margin:17px 0;width:100%;position:relative}.cover-title h2{font-size:44px;line-height:1.45;margin:8px 0}.seal{display:grid;place-items:center;width:54px;height:54px;border-radius:50%;background:var(--wine);box-shadow:inset 0 0 0 4px #8b4a4c,inset 0 0 0 5px #4f192b;color:#edc9ad;font-size:28px;margin:10px auto}.child-photo{height:285px;width:220px;object-fit:cover;object-position:50% 45%;border:10px solid #faf4e7;box-shadow:2px 5px 10px #56401b33;transform:rotate(4deg);filter:sepia(.35)}.handwritten{font-style:italic;color:var(--wine)}.desk-note{position:absolute;left:7%;bottom:-4px;transform:rotate(-8deg);color:#89745a;font-size:16px;line-height:1.5}.desk-note span{font-size:32px;position:absolute;right:-35px;top:-20px}.book-nav{display:flex;justify-content:center;align-items:center;gap:65px;direction:rtl}.book-nav button{border:0;background:none;color:var(--ink);font-size:16px}.book-nav button:disabled{opacity:.3;cursor:default}#chapters{display:flex;gap:12px;direction:ltr}#chapters button{width:6px;height:6px;padding:0;border-radius:50%;background:#b6a88f}#chapters button.active{background:var(--wine);box-shadow:0 0 0 4px #712d3610}.footer-note{text-align:center;font-size:13px;color:#8d7d66;margin:24px}.footer-note span{color:var(--wine);margin:0 7px}.footer-note small{display:block;font-size:11px;color:#a79a85;margin-top:4px}.primary{background:var(--wine);color:#f5e9ce;border:0;padding:7px 25px;border-radius:2px;font-size:17px}.outline{background:transparent;border:1px solid #ad946d;color:var(--ink);padding:5px 17px}.photo-small{width:180px;height:185px;object-fit:cover;filter:sepia(.5);border:7px solid #fbf2e2;transform:rotate(-4deg);box-shadow:2px 5px 9px #55402325}.cassette{width:190px;height:120px;background:url(assets/cassette.jpg) center 47%/125% auto;border-radius:7px;box-shadow:3px 8px 10px #3a230c55;touch-action:none;cursor:grab;border:1px solid #4a3526;position:relative;margin:22px 0;z-index:5;user-select:none}.cassette:after{content:'اسحبني إلى المشغّل';position:absolute;bottom:-27px;left:0;right:0;font-size:13px;color:var(--wine)}.player{width:100%;max-width:285px;background:linear-gradient(#674737,#37291f);padding:20px 20px 12px;border:5px solid #8b6b47;border-radius:8px;box-shadow:0 7px 14px #48351944;color:#e4cea5;margin-top:15px}.grille{height:55px;background:repeating-linear-gradient(0deg,transparent 0 3px,#c2a66b99 3px 4px),repeating-linear-gradient(90deg,#382e20 0 3px,#c2a66b99 3px 4px);border:1px solid #c3a76b}.slot{height:55px;border:2px solid #af8e5b;margin:15px 0 10px;background:#1f1a15;display:flex;align-items:center;justify-content:center;font-size:14px;transition:.2s}.slot.over{outline:3px dashed #d1b77d;transform:scale(1.04)}.player button{font-size:14px;border:1px solid #ad946d;background:#e5d4ae;color:#3c2c21;margin:0 3px;padding:2px 12px}.player button:disabled{opacity:.35}.envelope{width:250px;height:170px;object-fit:cover;object-position:center;mix-blend-mode:multiply}.locked{filter:grayscale(.3);opacity:.8}.game{width:100%;height:235px;background:linear-gradient(#222b28d9,#101a15eb),repeating-linear-gradient(45deg,#52604b 0 20px,#34432f 20px 40px);position:relative;overflow:hidden;border:5px solid #665b40;cursor:crosshair;direction:ltr}.game:before{content:'OPERATION · BIRTHDAY';position:absolute;top:10px;left:10px;font:10px monospace;color:#b9c9a5;letter-spacing:1px}.target{position:absolute;border:2px solid #d7b57a;color:#e7d5b1;background:#5e372d;border-radius:50%;width:44px;height:44px;font:28px Georgia;box-shadow:0 0 0 7px #d9b87815}.game-info{font-size:13px!important;color:#7e704f}.status{font-size:14px;min-height:25px}.flip{animation:turn .55s ease}@keyframes turn{0%{transform:rotateY(0)}48%{transform:rotateY(-12deg);filter:brightness(.85)}100%{transform:rotateY(0)}}dialog{border:1px solid #b89d73;background:#f0e4cb;color:var(--ink);max-width:560px;width:90%;padding:40px 45px;box-shadow:0 20px 80px #0006;text-align:center;font-family:Amiri,serif}dialog::backdrop{background:#241a13ab;backdrop-filter:blur(5px)}dialog h2{font-size:32px;font-weight:400}.letter-text{white-space:pre-line;font-size:21px;line-height:1.9}.signature{color:var(--wine);font-style:italic}.close{position:absolute;top:8px;left:15px;background:none;border:0;font-size:28px;color:var(--ink)}#music-panel{position:fixed;bottom:20px;right:20px;width:340px;background:#eee2c8;padding:15px;z-index:20;box-shadow:0 8px 40px #0004;border:1px solid #b69a70}#music-panel iframe{width:100%;height:180px;border:0}#music-panel p{margin:0 0 10px;font-size:16px}#music-panel a{font-size:13px;color:var(--wine)}#close-music{float:left;border:0;background:none;font-size:23px} @media(min-width:1500px){.desk{gap:70px}.book-shell{width:920px}.book{height:520px}}@media(max-width:1050px){.desk{gap:20px;padding:15px 25px 30px}.outside-photo{width:150px}.outside-photo img{height:240px}.page{padding:30px 24px}.book{height:470px}.desk-note{display:none}.page h2{font-size:29px}.cover-title h2{font-size:38px}.child-photo{width:180px;height:260px}}@media(max-width:740px){header{height:70px;margin:0 5%}.brand{font-size:18px}.edition,header button span{display:none}.intro{margin:25px 15px}.intro h1{font-size:29px}.intro p{font-size:15px}.desk{padding:15px 10px 25px;display:block}.outside-photo{display:none}.book-shell{width:100%;padding:5px}.book{height:450px}.page{padding:28px 15px 23px}.page h2{font-size:25px}.cover-title h2{font-size:31px}.cover-title{padding:20px 5px}.page p{font-size:16px}.child-photo{width:135px;height:235px;border:6px solid #faf4e7}.photo-small{width:130px;height:170px}.kicker{font-size:10px;letter-spacing:0}.cassette{width:140px;height:90px}.player{padding:12px 8px;border-width:3px}.player button{padding:2px 6px}.page .envelope{width:140px;height:140px}.book-nav{gap:28px}.game{height:210px}.primary{font-size:15px;padding:5px 12px}.letter-text{font-size:18px}dialog{padding:35px 25px}.bookmark{right:25px;width:17px}.grille{height:40px}.game-info{font-size:11px!important}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
.desk:before{content:'';position:absolute;inset:0;background:linear-gradient(#2e211f45,#2e211f45),url(assets/letter-desk-no-candle.png) center/cover;border-radius:8px;z-index:-1;opacity:.94}.desk{isolation:isolate;margin:0 3%;padding-top:30px;padding-bottom:40px}.desk-note{color:#e8d5af;bottom:9px}.outside-photo{width:185px}.outside-photo img{height:270px}.book-nav{margin-top:22px}.primary:disabled{opacity:.5;cursor:default}@media(max-width:740px){.desk{margin:0 2%;padding:18px 8px 25px}.outside-photo{display:block;width:100px;position:absolute;top:-11px;left:12px;z-index:4;padding:5px;transform:rotate(-9deg)}.outside-photo img{height:108px}.outside-photo p,.outside-photo .tiny,.outside-photo .tape{display:none}.book-shell{margin-top:70px}.intro h1{font-size:28px}.book{height:480px}.desk-note{display:none}.page p{line-height:1.75}}
.turning-leaf{position:absolute;top:0;left:50%;width:50%;height:100%;z-index:10;transform-origin:left center;backface-visibility:hidden;box-shadow:-8px 0 20px #38251033;animation:leaf-turn .62s ease-in-out forwards;pointer-events:none;direction:rtl}.turning-leaf.reverse{left:0;transform-origin:right center;animation:leaf-return .62s ease-in-out forwards}@keyframes leaf-turn{0%{transform:rotateY(0)}100%{transform:rotateY(-180deg);filter:brightness(.85)}}@keyframes leaf-return{0%{transform:rotateY(0)}100%{transform:rotateY(180deg);filter:brightness(.85)}}
body{min-height:100vh;background:#33261e url(assets/letter-desk-no-candle.png) center/cover fixed}body:before{content:'';position:fixed;inset:0;background:#241a1280;z-index:-1}header{border-color:#d6bb8a30}.brand,header button{color:#f0dfbd}header button{border-color:#e1c99c55}.edition,.intro .eyebrow{color:#d8bf97}.intro h1{color:#f6e8cd}.intro p{color:#c9b28b}.desk:before{display:none}.desk{background:none}.book-nav button{color:#efdfbb}.book-nav button:disabled{color:#b9a688}.footer-note{color:#e3ccaa}.footer-note small{color:#c1a98a}.footer-note span{color:#d7a8a6}.diary-cover{position:absolute;inset:0;background:radial-gradient(ellipse at top left,#643e39,#3c2423 75%);border:3px solid #3b2420;border-radius:8px 13px 13px 8px;z-index:15;color:#dfc28b;padding:17px;transform-origin:0 50%;box-shadow:inset 10px 0 12px #170b0966,inset 0 0 0 1px #ad89553d;transition:transform 1.1s ease-in-out,opacity .9s ease;backface-visibility:hidden;direction:rtl}.cover-frame{height:100%;border:1px solid #c5a06b77;outline:1px solid #b28d5540;outline-offset:-7px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative}.cover-frame:before,.cover-frame:after{content:'❦';position:absolute;top:13px;font-size:24px;color:#b28c57}.cover-frame:before{right:18px}.cover-frame:after{left:18px;transform:scaleX(-1)}.cover-frame .kicker{color:#cbb183}.cover-frame h2{font-size:38px;line-height:1.3;font-weight:400;text-align:center;margin:12px 0 6px}.cover-portrait{width:170px;height:195px;position:relative;background:radial-gradient(ellipse,#b7915e55,transparent 70%)}.cover-portrait img{width:100%;height:100%;object-fit:contain;filter:sepia(.18);drop-shadow:0 5px 8px #0003}.cover-frame p{font-size:18px;margin:5px 0 12px}.cover-open{border:1px solid #c5a06b99;background:#b18c5120;padding:7px 32px;font-size:17px;color:#f2ddb4}.cover-open:hover{background:#b18c5144}.cover-year{font:8px Georgia;letter-spacing:3px;margin:16px 0 10px;color:#bd9b67}.diary-cover.cover-opened{transform:rotateY(-165deg);opacity:0;pointer-events:none}.birthday-candle{position:relative;border:0;background:none;width:120px;height:155px;margin:5px auto;display:block}.candle-wax{position:absolute;left:50px;top:42px;width:20px;height:60px;background:repeating-linear-gradient(35deg,#d6bd88 0 10px,#793942 10px 15px);border-radius:3px}.flame{position:absolute;left:52px;top:12px;width:16px;height:28px;border-radius:80% 0 60% 50%;transform:rotate(-30deg);background:#f5bf54;box-shadow:0 0 20px #f5bd5899;animation:flicker 1s ease-in-out infinite}.cake-base{position:absolute;left:12px;top:102px;width:96px;height:36px;background:#bca281;border-radius:10px 10px 2px 2px;border-top:8px solid #efdec1;color:#78343a}.blown .flame{opacity:0;animation:none}.wish-notes{display:flex;gap:7px;margin-top:8px}.wish-notes button{border:1px dashed #ad946d;background:#e4d4b4;padding:5px 10px;color:var(--ink);box-shadow:1px 2px 3px #38271222;font-size:14px;transform:rotate(-3deg)}.wish-notes button:nth-child(2){transform:rotate(3deg)}.wish-notes .revealed{background:#d5bd94}.page .wish-text{font-size:16px;color:var(--wine);min-height:40px;animation:fade-in .5s}.birthday-spark{position:fixed;top:40%;font-style:normal;pointer-events:none;z-index:30;animation:spark-fall 2s ease-out forwards;font-size:18px}@keyframes spark-fall{to{transform:translate(var(--drift),45vh) rotate(200deg);opacity:0}}@keyframes flicker{50%{transform:rotate(-25deg) scale(.9)}}.outside-photo{cursor:zoom-in}#photo-dialog{padding:25px;max-width:440px}#photo-dialog img{max-height:70vh;max-width:100%;filter:sepia(.15)}#photo-dialog p{margin:8px 0 0;font-size:22px}.game{height:270px;border-width:3px;cursor:crosshair;overflow:visible}.game:has(canvas){background:#343d31;height:auto}.game:has(canvas):before{display:none}.game canvas{width:100%;display:block;aspect-ratio:400/270;image-rendering:pixelated;touch-action:none}.touch-controls{display:flex;gap:3px;background:#292e24;padding:6px;justify-content:center}.touch-controls button{background:#5e644b;border:1px solid #a6a17a;color:#f4e6be;font:14px Amiri;padding:0 8px;touch-action:none;min-height:28px}.touch-controls #fire-touch{background:#7c443a;margin-left:5px}.battle-result{text-align:center;color:#eee0b9;padding-top:25px;direction:rtl}.battle-result>span{font-size:30px}.battle-result p{font-size:19px}.page .game-info{font-size:11px!important;line-height:1.5!important;margin:5px 0}.opening-envelope{position:absolute;width:280px;height:175px;top:150px;left:calc(50% - 140px);z-index:5;pointer-events:none;opacity:0;perspective:700px}.envelope-body{position:absolute;inset:0;background:linear-gradient(145deg,#d2bb91,#efe0bc);clip-path:polygon(0 0,50% 48%,100% 0,100% 100%,0 100%);z-index:3;box-shadow:0 5px 10px #55372144}.envelope-flap{position:absolute;inset:0;background:#d4bd94;clip-path:polygon(0 0,100% 0,50% 55%);transform-origin:top;z-index:4}.envelope-paper{position:absolute;inset:10px 15px;background:#f7efd9;color:#8c4c4b;font-size:40px;padding:20px;z-index:2}.wax-stamp{position:absolute;top:65px;left:120px;background:#783542;border:3px double #a36a66;border-radius:50%;width:40px;height:40px;z-index:6;color:#e7bc9e;line-height:34px}.unsealing .opening-envelope{animation:envelope-exit 2s both}.unsealing .wax-stamp{animation:seal-break .5s .25s both}.unsealing .envelope-flap{animation:flap-open .6s .65s both}.unsealing .envelope-paper{animation:paper-rise .7s 1s both}.unsealing>h2,.unsealing>.eyebrow,.unsealing>.letter-text,.unsealing>.signature{animation:letter-reveal 2.5s both}@keyframes seal-break{to{transform:scale(1.8) rotate(25deg);opacity:0}}@keyframes flap-open{to{transform:rotateX(180deg)}}@keyframes paper-rise{to{transform:translateY(-130px)}}@keyframes envelope-exit{0%,80%{opacity:1}100%{opacity:0;transform:translateY(35px)}}@keyframes letter-reveal{0%,70%{opacity:0;transform:translateY(25px)}100%{opacity:1;transform:translateY(0)}}#letter.unsealing{animation:fade-in .3s ease}@keyframes fade-in{from{opacity:0}to{opacity:1}}@media(max-width:740px){body{background-position:center;background-attachment:scroll}.cover-frame h2{font-size:33px}.cover-portrait{height:205px;width:175px}.cover-frame .kicker{font-size:12px}.cover-frame p{font-size:17px}.game{height:220px}.touch-controls{padding:4px 2px;gap:2px}.touch-controls button{padding:0 5px;font-size:12px}.page .game-info{font-size:10px!important}.page:has(.game){padding:28px 10px 23px}.page:has(.game) h2{font-size:23px}.page:has(.game)>p{font-size:13px!important}.wish-notes{gap:4px}.wish-notes button{font-size:12px;padding:4px 6px}.birthday-candle{height:145px}.intro h1{font-size:27px}}
/* Lighter stationery setting and restrained diary details. */
body{background:#e5d7bf url(assets/letter-desk-no-candle.png) center/100% 100% fixed no-repeat}body:before{background:#f9f0dc12}.brand,header button{color:#493a2c}header{border-color:#74593b33}header button{border-color:#85654266;background:#f7efdd80}.edition,.intro .eyebrow{color:#735c43}.intro h1{color:#493526}.intro p{color:#78614a}.book-nav button{color:#503d2d}.footer-note,.footer-note small{color:#715b43}.brand span,.ornament,.seal,.cover-frame:before,.cover-frame:after{display:none}.desk{padding:14px 40px 24px;margin:0 6%;min-height:530px}.book-shell{width:min(810px,78vw);margin-top:0}.book{height:495px}.book-nav{margin-top:6px}.intro{margin:27px 15px 20px}.intro h1{font-size:37px}.footer-note{margin:17px}.diary-photo{position:relative;width:205px;height:290px;flex-shrink:0;background:radial-gradient(ellipse at 50% 70%,#e0cda333,transparent 68%);margin:19px auto 6px;padding:0;border:0;border-bottom:1px solid #b79c6c66;display:flex;align-items:flex-end;justify-content:center}.diary-photo:before{content:'';position:absolute;inset:6px 13px 0;border:1px solid #b79c6c55;border-radius:100px 100px 0 0;pointer-events:none}.diary-photo img{position:relative;max-width:100%;width:100%;height:100%;object-fit:contain;object-position:bottom;filter:sepia(.2);z-index:1}.childhood{height:300px;width:205px}.portrait-in-book{height:270px;width:210px;cursor:zoom-in}.page:has(.portrait-in-book) h2{font-size:29px;margin:12px 0 6px}.page:has(.game){padding-top:30px}.page .mission-title{font-size:25px;margin:0 0 17px}.game:before{display:none}.page .game-info{max-width:270px;margin-top:13px;font-size:12px!important}.game{height:300px}.page:has(.envelope){justify-content:center;padding-bottom:50px}.page:has(.envelope) h2{margin:10px 0}.page:has(.envelope) .envelope{width:250px;height:170px}.page:has(.envelope) #lock-text:empty{display:none}.page:has(.envelope) .primary{margin-top:15px}.cover-year{display:none}.cover-frame h2{margin-top:20px}.cover-open{margin:12px 0}.cover-frame{padding-bottom:10px}.cover-portrait img{filter:sepia(.18) drop-shadow(0 5px 8px #0002)}#photo-dialog img{background:radial-gradient(ellipse,#ddcaaa66,transparent 70%)}.battle-result>span{display:none}@media(min-width:1500px){.book-shell{width:850px}.book{height:510px}.desk{min-height:545px}}@media(max-width:740px){body{background-size:100% 100%;background-attachment:fixed}.intro{margin:24px 45px 18px}.intro h1{font-size:28px}.intro p{font-size:14px}.desk{padding:12px 8px 22px;margin:0 5%;min-height:0}.book-shell{width:100%;margin-top:0}.book{height:480px}.diary-photo{width:140px;height:275px;margin-top:20px}.childhood{height:290px;width:145px}.portrait-in-book{width:145px;height:270px}.page:has(.portrait-in-book) h2{font-size:23px}.page:has(.envelope) .envelope{width:145px;height:140px}.page:has(.game){padding:30px 10px 23px}.page .mission-title{font-size:23px;margin-bottom:20px}.game{height:290px}.page .game-info{font-size:11px!important;line-height:1.7!important}.book-nav{margin-top:8px}.intro .eyebrow{font-size:12px}.page:has(.envelope){padding:30px 12px 40px}.cover-frame{padding:8px}.cover-frame:before,.cover-frame:after{display:none}}
/* Keep the stationery photograph at its natural proportions. */
body{background:#e6d7ba;background-image:radial-gradient(#a58d6020 .6px,transparent .8px);background-size:4px 4px;background-attachment:fixed}body:before{background:url(assets/letter-desk-no-candle.png) center center/cover no-repeat;opacity:.88;pointer-events:none}.game{background:radial-gradient(ellipse at top,#59604b,#252e26);border:3px solid #6b684e;overflow:hidden;height:300px}.mission-lobby,.combat-result{height:100%;min-height:280px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:20px 12px;direction:rtl;color:#e7ddc1;background:linear-gradient(135deg,#5e644425,transparent),repeating-linear-gradient(0deg,transparent 0 3px,#00000006 3px 4px)}.combat-label{font:8px Georgia,serif;letter-spacing:2px;color:#bcb99d}.mission-mark{width:35px;height:40px;border:2px solid #b4b292;margin:20px 0 4px;clip-path:polygon(0 0,100% 0,100% 65%,50% 100%,0 65%);background:linear-gradient(90deg,transparent 43%,#b4b292 43% 57%,transparent 57%)}.mission-lobby h3,.combat-result h3{font:400 25px Amiri;margin:10px 0 0}.mission-lobby p,.combat-result p{font-size:14px!important;color:#c3c2a7;line-height:1.6!important;margin:5px 0 18px!important}.mission-start{display:flex;align-items:center;justify-content:center;gap:20px;width:100%;max-width:210px;min-height:43px;padding:7px 15px;background:#c6bc96;color:#293026;border:1px solid #dfd3ad;font:700 18px Amiri;box-shadow:0 3px 0 #141d1766;transition:background .2s}.mission-start:hover{background:#ded2ab}.mission-lobby small{color:#979e86;font-size:11px;margin-top:15px}.combat-toolbar{display:flex;align-items:center;justify-content:space-between;background:#202a22;padding:6px 8px;color:#bcc5aa;font:7px monospace;letter-spacing:1px}.combat-toolbar button{border:1px solid #737e60;background:none;color:#d9d9bf;font:12px Amiri;padding:0 9px}.game:has(canvas){height:auto;overflow:hidden;background:#202a22}.combat-hud{display:flex;justify-content:space-between;gap:5px;background:#1d271f;padding:8px;color:#dce0c3;font:10px monospace}.touch-controls{flex-wrap:wrap;gap:4px;padding:7px 4px}.touch-controls button{min-width:25px;min-height:30px}.touch-controls #fire-touch{padding:0 12px}.game:fullscreen{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:15px;background:#172019;border:0}.game:fullscreen canvas{width:auto;max-width:100%;max-height:75vh;aspect-ratio:640/440;object-fit:contain}.game:fullscreen .combat-toolbar,.game:fullscreen .combat-hud,.game:fullscreen .touch-controls{width:min(100%,1000px)}.game:fullscreen .combat-toolbar{font-size:12px}.game:fullscreen .combat-hud{font-size:16px}.game:fullscreen .touch-controls button{min-width:45px;min-height:40px}.page:has(.game){padding:27px 24px}.page .game-info{font-size:11px!important}.page .mission-title{margin-bottom:13px}.book-shell{width:min(840px,78vw)}@media(max-width:740px){body:before{background-size:auto 100%;background-position:center top}.desk{margin:0 4%;padding:12px 6px 22px}.book-shell{width:100%}.page:has(.game){padding:28px 10px 23px}.mission-lobby,.combat-result{padding:16px 9px;min-height:270px}.mission-lobby h3{font-size:22px}.mission-start{font-size:16px;gap:12px;min-height:42px}.combat-hud{font-size:8px;padding:6px}.combat-toolbar{font-size:6px;padding:5px}.touch-controls{gap:3px}.touch-controls button{min-width:22px;padding:0 4px;font-size:11px}.touch-controls #fire-touch{padding:0 7px}.game{height:290px}.page .game-info{font-size:10px!important}.combat-label{font-size:7px;letter-spacing:1px}}
.easy-controls{display:flex;justify-content:space-between;align-items:center;gap:16px;direction:ltr;background:#263127;padding:12px 18px;min-height:118px}.joystick{width:92px;height:92px;border-radius:50%;background:#111c1580;border:1px solid #aebc7d55;position:relative;touch-action:none;flex-shrink:0;user-select:none}.stick-ring{position:absolute;inset:15px;border:1px dashed #b3ba9466;border-radius:50%;pointer-events:none}.stick-knob{position:absolute;width:36px;height:36px;left:27px;top:27px;border-radius:50%;border:1px solid #b6bd9b;background:radial-gradient(circle at 35% 25%,#a5ae8a,#5d7052);box-shadow:0 3px 8px #0005;pointer-events:none}.joystick small{position:absolute;bottom:-16px;left:0;right:0;text-align:center;font:11px Amiri;color:#cbd0b6;pointer-events:none}.fire-actions{display:flex;align-items:center;gap:10px;flex-direction:row-reverse}.fire-actions button{touch-action:none;user-select:none;cursor:pointer;font:18px Amiri}.fire-actions #fire-touch{min-width:76px;min-height:76px;border-radius:50%;background:#a08b58;border:2px solid #dfc68e;color:#19251b;box-shadow:0 3px 0 #111a1466;font-weight:700}.fire-actions #reload{min-height:44px;min-width:48px;border:1px solid #8b977a;background:#465840;color:#e5e9d4;font-size:14px}.mobile-battle-dialog{max-width:850px;width:calc(100vw - 20px);max-height:96dvh;margin:auto;padding:10px;background:#1b261f;border:1px solid #9b986f;overflow:auto;color:#e0d6b6}.mobile-battle-dialog::backdrop{background:#11180fe8}.mobile-battle-header{display:flex;align-items:center;justify-content:space-between;padding:5px 4px 12px;font-size:19px}.mobile-battle-header button{border:1px solid #aaa88c;color:#e1dfc5;background:none;min-height:40px;padding:3px 15px;font:15px Amiri}.mobile-battle-dialog .game{width:100%;height:auto;margin:0;border:1px solid #717860}.mobile-battle-dialog .combat-toolbar{font-size:10px}.mobile-battle-dialog .combat-toolbar button{display:none}.mobile-battle-dialog .combat-hud{font-size:14px;padding:11px}.mobile-battle-dialog canvas{width:100%;max-height:55dvh;object-fit:contain;background:#424b40}.mobile-battle-dialog .easy-controls{padding:15px 22px 24px;min-height:145px}.dedication{width:100%;text-align:center;position:relative;padding:6px 0}.dedication-date{font-size:12px;color:#927b57;letter-spacing:1px}.dedication h2{display:flex;flex-direction:column;line-height:1.2!important;margin:15px 0 10px!important;font-weight:400}.dedication h2 span{animation:ink-appear 1.2s both}.dedication-top{font-size:33px}.dedication-mid{font-size:26px;color:#806c4e;animation-delay:.15s!important;margin:6px}.dedication-love{font-size:49px;color:#70353a;animation-delay:.3s!important}.dedication-rule{height:1px;width:75px;background:linear-gradient(90deg,transparent,#ac8e5b,transparent);margin:15px auto 8px}.dedication>p{font-size:15px!important;color:#8c7454}.poetry-vignette{width:100%;height:95px;object-fit:contain;margin:5px 0;filter:sepia(.1);animation:ink-appear 1.5s .3s both}.tucked-note{border:1px solid #b29a7177;background:linear-gradient(165deg,#eee1c3,#e4d1ac);font:15px Amiri;color:#624a30;padding:7px 20px;min-height:39px;width:90%;box-shadow:1px 4px 7px #624a3015;transition:padding .4s,transform .4s}.tucked-note.unfolded{padding:13px 15px;transform:rotate(-2deg);font-size:14px;line-height:1.7}.page:has(.dedication){padding-top:28px}.page:has(.dedication)>.kicker,.page:has(.dedication)>span.kicker:last-of-type{display:none}@keyframes ink-appear{from{opacity:0;transform:translateY(9px)}to{opacity:1;transform:none}}@media(max-width:600px){header{height:60px;margin:0 6%}.intro{margin:19px 20px 14px}.intro h1{font-size:27px;margin:6px 0}.intro p{font-size:14px}.intro .eyebrow{font-size:12px}.desk{margin:0 5%;padding:8px 0 16px}.book-shell{width:100%;max-width:430px;margin:0 auto;border-radius:7px 13px 13px 7px;padding:7px 9px 10px}.book{display:block;height:540px}.page{display:none;height:100%;width:100%;padding:33px 27px 35px}.book .left{display:flex;box-shadow:inset 9px 0 18px -17px #3f2509,inset -1px 0 4px #82663b33}.book .right{display:none}.book.show-right .left{display:none}.book.show-right .right{display:flex;box-shadow:inset 9px 0 18px -17px #3f2509,inset -1px 0 4px #82663b33}.spine{display:none}.page:after{inset:15px}.page h2{font-size:31px}.kicker{font-size:12px}.page p{font-size:18px}.diary-photo,.childhood{height:340px;width:215px;margin-top:22px}.portrait-in-book{height:305px;width:220px}.page:has(.portrait-in-book) h2{font-size:28px}.book-nav{gap:27px;padding:0 15px;margin-top:0}.book-nav>button{min-height:46px;padding:5px 10px;font-size:17px}#chapters{gap:12px}.footer-note{margin:12px 15px 22px}.diary-cover{padding:14px}.cover-frame h2{font-size:35px}.cover-portrait{width:205px;height:245px}.cover-frame p{font-size:20px}.cover-open{font-size:19px;min-height:46px;margin-top:12px}.page:has(.game){padding:29px 22px 30px}.page .mission-title{font-size:27px;margin-bottom:18px}.game{height:345px}.mission-lobby,.combat-result{min-height:340px;padding:22px}.mission-lobby h3{font-size:29px}.mission-start{font-size:20px;min-height:49px}.mission-lobby p{font-size:17px!important}.combat-label{font-size:9px;letter-spacing:2px}.page .game-info{font-size:13px!important}.page:has(.envelope){padding:35px 25px 45px}.page:has(.envelope) .envelope{width:270px;height:205px}.page:has(.envelope) .primary{min-height:46px;min-width:160px;font-size:19px}.turning-leaf{width:100%;left:0}.page:has(.dedication){padding:28px 25px}.dedication{padding-top:10px}.dedication-top{font-size:37px}.dedication-mid{font-size:29px}.dedication-love{font-size:58px}.dedication h2{margin-top:20px!important}.poetry-vignette{height:125px;margin:8px 0}.dedication>p{font-size:17px!important}.tucked-note{font-size:17px;min-height:46px}.tucked-note.unfolded{font-size:16px}.page:has(.dedication)>.kicker:last-child{display:none}.page .player{max-width:265px;padding:18px}.page .grille{height:55px}.page .cassette{width:190px;height:120px}.page:has(.cassette) h2{font-size:34px}.page .photo-small{width:150px!important;height:140px!important}}
@media(max-width:740px){body:before{background-image:url(assets/diary-mobile-no-candle.png);background-size:cover;background-position:center;opacity:.95}}@media(max-width:600px){.page:has(.dedication)>.kicker{display:none}}@media(prefers-reduced-motion:reduce){.dedication h2 span,.poetry-vignette{animation:none}}
.dedication-wish{position:relative;min-height:122px;margin:0 auto}.dedication-candle{height:73px;width:70px;margin:0 auto}.dedication-candle .candle-wax{top:29px;left:29px;width:13px;height:34px}.dedication-candle .flame{width:11px;height:20px;left:30px;top:5px}.candle-dish{position:absolute;bottom:3px;left:14px;width:44px;height:5px;border-radius:50%;background:#b29b70}.dedication-wish .wish-invitation{font-size:13px!important;line-height:1.4!important;margin:1px 0!important;color:#8f7654;transition:opacity .4s}.dedication-wish-text{opacity:0;transform:translateY(10px);max-height:0;overflow:hidden;color:#773a3c;font-size:16px!important;line-height:1.6!important;margin:0!important;transition:opacity .9s .25s,transform .9s .25s,max-height .7s}.wish-revealed .dedication-wish-text{opacity:1;transform:none;max-height:65px}.wish-revealed .wish-invitation{opacity:0;height:0}.dedication .poetry-vignette{height:70px;margin:3px 0}.dedication h2{margin-bottom:5px!important}.dedication-rule{margin-top:10px}.dedication-love{font-size:45px}@media(max-width:600px){.dedication-love{font-size:53px}.dedication .poetry-vignette{height:92px;margin:3px 0}.dedication h2{margin-top:15px!important}.dedication-top{font-size:34px}.dedication-mid{font-size:26px}.dedication-candle{height:78px}.dedication-wish-text{font-size:18px!important}.dedication-wish .wish-invitation{font-size:15px!important}.page:has(.mobile-cassette-source){padding:22px 20px 30px;justify-content:flex-start}.mobile-cassette-source,.mobile-cassette-player{width:100%;display:flex;flex-direction:column;align-items:center}.mobile-cassette-source .kicker{font-size:11px}.mobile-cassette-source h2{font-size:24px;line-height:1.2;margin:7px 0}.mobile-cassette-source h2 br{display:none}.page .mobile-cassette-source .cassette{width:145px;height:91px;margin:14px 0 18px}.mobile-cassette-source .cassette:after{font-size:12px;bottom:-23px}.mobile-cassette-source>p{font-size:14px;line-height:1.2;margin:4px 0!important}.mobile-cassette-source>p:first-of-type{margin-top:12px!important}.mobile-cassette-player>.photo-small,.mobile-cassette-player>.kicker{display:none}.mobile-cassette-player .player{margin-top:13px;padding:12px 15px 10px;max-width:245px}.mobile-cassette-player .grille{height:38px}.mobile-cassette-player .slot{height:42px;margin:10px 0}.mobile-cassette-player .status{font-size:12px;line-height:1.4;min-height:18px;margin:7px 0}.page .mobile-cassette-player .player button{min-height:31px;font-size:15px;padding:0 14px}.mobile-cassette-player{padding-top:4px}}
.page:has(.dedication){justify-content:center}.dedication{padding:10px 0}.dedication-date{display:none}.dedication h2{margin-top:10px!important}.dedication-wish{margin-top:24px;min-height:145px}.dedication-candle{height:85px}.intro{margin:23px 15px 19px}.intro h1{font-size:34px}@media(max-width:600px){.intro{margin:20px 12px 13px}.intro h1{font-size:26px}.page:has(.dedication){padding:30px 25px}.dedication-top{font-size:38px}.dedication-mid{font-size:29px;margin:12px 0}.dedication-love{font-size:60px}.dedication-rule{margin:23px auto 12px}.dedication-wish{margin-top:29px}.dedication-wish-text{font-size:18px!important}.dedication>p{margin:10px 0!important}}
/* Preserve photo proportions and leave a quiet lower background on phones. */
.page img,.cover-portrait img,#photo-dialog img{max-width:100%;object-fit:contain}.book-shell{border-radius:9px 14px 18px 14px}.book{border-radius:4px 8px 12px 8px}@media(max-width:740px){body{background-color:#eadcc3}body:before{background-image:url(assets/diary-mobile-no-candle.png);background-size:100% auto;background-position:center top;background-repeat:no-repeat;opacity:.85;-webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 25%,transparent 67%);mask-image:linear-gradient(to bottom,#000 0%,#000 25%,transparent 67%)}.cover-portrait,.diary-photo{max-width:100%}.diary-photo img,.cover-portrait img{width:100%;height:100%;object-fit:contain}.page .envelope{max-width:100%;height:auto;aspect-ratio:1.4;object-fit:contain}.page .photo-small{max-width:100%;object-fit:contain}.book-nav{gap:clamp(8px,4vw,22px);padding-inline:4px}.book-nav>button{white-space:nowrap}.footer-note{padding-bottom:max(18px,env(safe-area-inset-bottom))}.book-shell{border-radius:9px 14px 19px 14px}}@media(max-width:600px){.book{height:clamp(510px,64svh,550px)}.diary-photo,.childhood{height:clamp(285px,40svh,335px);width:min(215px,100%)}.portrait-in-book{height:clamp(265px,36svh,305px);width:min(220px,100%)}.cover-portrait{height:clamp(205px,28svh,245px);width:min(205px,100%)}.cover-frame h2{font-size:32px}.cover-frame p{font-size:18px}}
.music-artist{display:flex;gap:12px;align-items:center;justify-content:center;margin:28px 0 8px;text-align:right}.music-artist>img{display:none;width:57px;height:66px;object-fit:cover;border:3px solid #f5ecdc;border-radius:4px;filter:sepia(.35);box-shadow:0 2px 5px #57401d25}.music-artist>div{display:flex;flex-direction:column;gap:3px}.music-artist strong{font-size:19px;font-weight:400}.music-artist span{font-size:14px;color:#7d4944}.birthday-finale{width:100%;margin-top:18px;border-top:1px solid #a38a6133;padding-top:10px}.page .finale-caption{font-size:13px;line-height:1.5;margin:0 0 6px;color:#8a7351}.finale-candles{display:flex;justify-content:center;gap:15px}.mini-candle{border:0;background:none;position:relative;width:58px;height:91px;touch-action:manipulation}.final-flame{position:absolute;top:3px;left:24px;width:11px;height:19px;border-radius:80% 0 60% 50%;transform:rotate(-28deg);background:linear-gradient(#f3c576,#cf8b3a);box-shadow:0 0 12px #e4b35c66;animation:flicker 1.3s infinite;transition:opacity .45s,filter .45s}.final-wax{position:absolute;top:28px;left:22px;width:15px;height:36px;border-radius:2px;background:repeating-linear-gradient(35deg,#c6ae7d 0 9px,#79484b 9px 13px);box-shadow:1px 2px 2px #57422c22}.mini-candle:nth-child(2) .final-wax{height:44px;top:20px;background:repeating-linear-gradient(35deg,#d2c4a0 0 9px,#78826b 9px 13px)}.mini-candle:nth-child(2) .final-flame{top:-5px}.mini-candle span{position:absolute;bottom:0;left:0;right:0;font:13px Amiri;color:#887253}.mini-candle.unlit .final-flame{opacity:0;filter:blur(5px);animation:none}.mini-candle.unlit span{color:#713c3e}.page .final-wish{font-size:13px;line-height:1.5;color:#8d7356;min-height:40px;margin:10px 0 0}.final-wish.wish-visible{animation:ink-appear .8s both;color:#71383c}.all-wished{border-top-color:#9e765166}.page:has(.birthday-finale){justify-content:flex-start;padding-top:27px;padding-bottom:30px}.page:has(.birthday-finale) h2{font-size:29px;margin:5px 0}.page:has(.birthday-finale) .envelope{height:115px;width:190px;aspect-ratio:auto;object-fit:contain}.page:has(.birthday-finale) .primary{font-size:16px;padding:5px 22px;margin-top:6px;min-height:35px}.page:has(.birthday-finale) #lock-text{font-size:14px;margin:3px 0}.page:has(.birthday-finale) .kicker{font-size:11px}#letter{max-height:88svh;overflow-y:auto;overscroll-behavior:contain}.letter-text{font-size:20px;line-height:1.85}.page:has(.mobile-cassette-source) .music-artist{margin:24px 0 4px;gap:12px}.mobile-cassette-source .music-artist>img{display:block}.mobile-cassette-source .music-artist strong{font-size:17px}.mobile-cassette-source .music-artist span{font-size:13px}.mobile-cassette-source .music-artist{min-height:65px}.mobile-cassette-player{padding-top:0}.mobile-cassette-player .player{margin-top:9px}@media(max-width:600px){.page:has(.birthday-finale){padding:26px 25px 32px}.page:has(.birthday-finale) h2{font-size:31px;margin:7px 0}.page:has(.birthday-finale) .envelope{width:230px;height:145px}.page:has(.birthday-finale) .primary{font-size:18px;min-height:42px}.birthday-finale{margin-top:16px;padding-top:13px}.page .finale-caption{font-size:15px}.finale-candles{gap:20px}.mini-candle{height:98px;width:60px}.mini-candle span{font-size:15px}.page .final-wish{font-size:15px;min-height:46px;margin-top:7px}.letter-text{font-size:18px;line-height:1.9}.mobile-cassette-source h2{font-size:22px}.page .mobile-cassette-source .cassette{margin:12px 0 12px;width:140px;height:88px}.mobile-cassette-source .music-artist{margin-top:22px}.mobile-cassette-player .player{padding:10px 15px 8px;margin-top:8px}.mobile-cassette-player .grille{height:33px}.mobile-cassette-player .slot{height:37px;margin:9px 0}.mobile-cassette-player .status{font-size:11px}.mobile-cassette-source .music-artist>img{width:54px;height:61px}}
@media(max-width:740px){body:before{background-image:url(assets/diary-mobile-no-candle.png)}}
body:before{background-image:url(assets/letter-desk-no-candle.png)}@media(max-width:740px){body:before{background-image:url(assets/diary-mobile-no-candle.png)}}
.birth-date{font-size:21px;color:#d6ba87;letter-spacing:3px;direction:ltr;margin:6px 0 0;font-variant-numeric:tabular-nums}.page h2.music-quote{font-size:27px;line-height:1.65;margin:14px 0}.page:has(.portrait-in-book)>.handwritten{font-size:16px;line-height:1.8;max-width:260px}@media(max-width:600px){.cover-frame h2{font-size:30px;margin-top:8px}.cover-portrait{height:215px}.cover-frame p{margin:5px 0}.cover-open{margin:9px 0}.birth-date{font-size:21px;margin:5px 0}.mobile-cassette-source h2.music-quote{font-size:21px;line-height:1.5;margin:7px 0}.mobile-cassette-source h2.music-quote br{display:block}.mobile-cassette-source .music-artist{margin-top:21px}.page:has(.portrait-in-book)>.handwritten{font-size:17px;line-height:1.8;margin:5px 0}.portrait-in-book{height:285px}}
.code-letter,.code-result{width:100%;text-align:right}.code-letter h2,.code-result h2{font-size:29px;margin:10px 0 15px}.language-label,.editor-label,.code-result>label{font-size:14px;display:block;color:#7b674d;margin:9px 0 5px}.code-letter select{width:100%;border:1px solid #ae95704d;background:#f8efdb;color:#493b2d;padding:7px 10px;border-radius:3px;font:14px Georgia;min-height:38px;direction:ltr}.code-letter textarea{display:block;width:100%;height:130px;resize:vertical;max-height:200px;background:#2c302b;color:#f0e8ce;border:1px solid #5b624c;padding:13px;border-radius:3px;font:13px/1.8 ui-monospace,monospace;text-align:left;tab-size:2;touch-action:pan-y}.code-letter #code-help{font-size:12px;line-height:1.6;color:#897254;margin:7px 0 13px}.code-letter .primary{width:100%;min-height:40px}.code-output{font:17px/1.8 Amiri,serif;white-space:pre-wrap;overflow-wrap:anywhere;overflow:auto;min-height:140px;max-height:220px;margin:0;padding:14px;background:#f8f0de;border:1px solid #b5a17b66;color:#4b3a28;user-select:text;text-align:start}.code-result>label{direction:ltr;font:12px monospace;text-align:left}.whatsapp-link{display:block;text-align:center;background:#4d624c;color:#f8eed8;text-decoration:none;font:17px Amiri;padding:8px 12px;border-radius:3px;min-height:42px}.whatsapp-link[aria-disabled=true]{opacity:.45;cursor:default}.code-result .whatsapp-note{font-size:12px;line-height:1.8;color:#897252;margin:10px 0}.code-result #code-error{min-height:26px;font-size:13px;line-height:1.5;color:#8b303c;margin:8px 0}.page:has(.code-letter),.page:has(.code-result){padding:27px 30px 32px}.page:has(.code-letter):after,.page:has(.code-result):after{pointer-events:none}@media(max-width:600px){.page:has(.code-letter){padding:21px 22px 28px;overflow-y:auto;display:flex;justify-content:flex-start}.book.show-right .page:has(.code-letter){display:none}.code-letter>.kicker{font-size:10px}.code-letter h2{font-size:26px;margin:5px 0 8px}.code-letter .language-label{display:inline-block;margin:0 0 5px;font-size:13px}.code-letter select{min-height:35px;padding:5px 10px}.code-letter .editor-label{font-size:12px;margin:7px 0 4px}.code-letter textarea{height:95px;min-height:80px;font-size:12px;padding:10px}.code-letter #code-help{font-size:10px;margin:5px 0 7px}.code-letter .primary{min-height:37px;font-size:16px;padding:4px 15px}.code-result{margin-top:10px;padding-top:9px;border-top:1px solid #b29b6f44}.code-result h2,.result-kicker{display:none}.code-result>label{margin:0 0 5px;font-size:11px}.code-output{min-height:65px;max-height:110px;padding:8px 10px;font-size:16px;line-height:1.6}.code-result #code-error{min-height:0;font-size:12px;margin:4px 0}.code-result #code-error:empty{display:none}.whatsapp-link{min-height:38px;font-size:16px;padding:5px 9px;margin-top:7px}.code-result .whatsapp-note{font-size:10px;line-height:1.6;margin:6px 0 0}}
#music-panel audio{display:block;width:100%;height:44px;margin-top:12px}#music-panel{max-width:calc(100vw - 28px);right:14px;bottom:calc(14px + env(safe-area-inset-bottom));border-radius:5px}#music-panel p{padding-left:20px}
main{padding-top:12px}@media(max-width:600px){main{padding-top:14px}.intro{margin-top:12px}}
