@font-face{font-family:Hand;src:url('https://whose-wish-playtest-d7f43.yokingchan888.workers.dev/caveat.ttf') format('truetype');font-display:swap}
:root{color-scheme:dark;--brass:#dab77a;--paper:#fbf7ed;--ink:#302723;--soft:#d3c7b5;--wax:#b6382d}
*{box-sizing:border-box}body{margin:0;background:#211d20 url('/_a/velvet.a7546661b8.png') repeat;color:var(--paper);font:16px/1.45 "DM Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
main{width:min(1180px,100%);margin:auto;padding:0 clamp(16px,4vw,54px) 20px}.mast,footer{display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:1280px;margin:auto;padding:16px clamp(18px,5vw,66px);border-bottom:1px solid #68544475}.mast a,footer a{color:var(--soft);font-size:14px;text-underline-offset:4px}.mast .brand{font:italic 25px/1 Georgia,serif;letter-spacing:-1.5px;text-decoration:none;color:var(--paper)}.mark{color:var(--brass);font:25px Georgia}
.heading{padding:clamp(25px,5vw,58px) 0 22px}.eyebrow,.plate,#progress,.folio,.casefoot,.mini{font:600 11px/1.45 ui-monospace,monospace;letter-spacing:.09em;text-transform:uppercase}.eyebrow,.mini{color:#e0bd83;margin:0 0 7px}
h1,h2,h3{font-family:"Baskervville",Georgia,serif;letter-spacing:-.045em;line-height:1.03;margin:0;font-weight:500}h1{font-size:clamp(38px,5.25vw,75px);text-wrap:balance;overflow-wrap:anywhere}h2{font-size:clamp(24px,2.8vw,38px)}h3{font-size:22px}.heading>p:last-child{margin:11px 0 0;color:#ddd1c1;max-width:66ch}
.layout{display:grid;grid-template-columns:minmax(0,1.46fr) minmax(280px,.85fr);align-items:start;gap:clamp(18px,3vw,48px)}
.case{position:relative;background:#2a2322 url('/_a/velvet.a7546661b8.png');border:3px solid #a48551;outline:1px solid #4f3e2c;border-radius:13px;padding:clamp(12px,2vw,24px);box-shadow:inset 0 0 0 2px #e2bf80,inset 0 0 0 5px #55412d,inset 0 0 24px 8px #100b0a,0 12px 25px #07050570}
.metalhead,.casefoot,.row,.seals,.sheethead{display:flex;align-items:center;justify-content:space-between;gap:9px}.metalhead{margin-bottom:16px}.plate{border:1px solid #f3d399;border-radius:3px;background:linear-gradient(168deg,#e4c68d,#ba945a 52%,#e1bd7a);color:#322417;padding:4px 8px;max-width:66%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 1px #f8dfa7}.plate:before{content:"•";margin-right:6px}.plate:after{content:"•";margin-left:6px}#progress,.casefoot{color:#e1cba9}.tray{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(5px,1vw,12px)}
button,input,textarea,select{font:inherit}button{cursor:pointer}button:disabled{cursor:default;opacity:.6}.slot{position:relative;min-width:0;min-height:50px;aspect-ratio:1.32;display:flex;flex-direction:column;align-items:center;justify-content:center;background:transparent;border:none;color:#fff1d7;padding:0}
.slot:not(.empty){aspect-ratio:auto;justify-content:flex-start}
.slot .envelope{width:100%;height:auto;flex:none;object-fit:contain;filter:drop-shadow(1px 3px 2px #0e0a0a);transition:transform .18s}.slot:not(.empty):hover .envelope,.slot:focus-visible .envelope{transform:translateY(-3px) rotate(-2deg)}.slot .sender{flex:none;max-width:100%;padding-inline:.1em;overflow-wrap:anywhere;font:600 clamp(13px,1.65vw,21px)/1.35 Hand,Georgia,serif}.slot.empty{border:1px dashed #6c5849;border-radius:4px;background:#171314;box-shadow:inset 1px 3px 7px #070505;color:#ae9e8b;font:12px ui-monospace,monospace}
.tag{position:absolute;top:-7px;left:4px;background:#a62d27;border:1px solid #ce6451;color:white;border-radius:3px;padding:1px 5px;font:650 9px/1.4 system-ui;transform:rotate(-5deg);z-index:1}.casefoot{margin-top:12px;font-size:10px;text-transform:none;letter-spacing:.01em}.casefoot button{color:var(--paper);background:#3c3232;border:1px solid #887356;border-radius:4px;min-height:30px;padding:3px 6px}.casefoot #pages{display:flex;gap:5px;align-items:center}
.controls,dialog{background:var(--paper) url('/_a/paper.10520617b2.png');color:var(--ink);border:1px solid #d9cbb0;border-radius:11px;padding:clamp(17px,2.5vw,32px);box-shadow:0 6px 0 #9f8970,0 12px 23px #0e0c0d55;color-scheme:light}.folio{color:#755b42;margin:0 0 8px}.controls p{margin:8px 0 14px}.controls .fine,.fine{font-size:13px;color:#625348}.controls h2{margin-bottom:14px}
label{display:block;font-size:14px;font-weight:650;margin:10px 0 5px}input,textarea,select{width:100%;max-width:100%;min-width:0;min-height:43px;background:#fffdf7;border:1px solid #bbaa91;border-radius:5px;color:var(--ink);padding:8px 10px}textarea{resize:vertical}.primary,.secondary,a.secondary{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:6px;font-weight:650;min-height:44px;padding:10px 13px;text-decoration:none;font-size:14px}.primary{background:#ad342b;color:#fff8e9;border:1px solid #8e2c22;box-shadow:inset 0 1px #d6725b,0 2px 0 #76231f}.secondary{background:#f6e8cd;color:#413221;border:1px solid #c3aa7c}.controls form .primary,.writer .primary{width:100%;margin-top:14px}.row{justify-content:flex-start;flex-wrap:wrap}.link,.close{background:none;color:#754728;border:0;text-decoration:underline;text-underline-offset:4px;padding:7px 0;min-height:38px}.link{font-size:13px}.controls hr{border:none;border-top:1px solid #d0c0a5;margin:14px 0}
dialog{position:relative;width:min(480px,calc(100% - 26px));max-height:90dvh;overflow:auto;padding:clamp(20px,4vw,34px)}dialog::backdrop{background:#110d10ca;backdrop-filter:blur(3px)}.close{position:absolute;right:10px;top:6px;text-decoration:none;font-size:27px;width:38px;z-index:1}.sheethead{padding-right:44px}.waxbig{width:64px;filter:drop-shadow(1px 3px 2px #6d40273d)}.letter{font:500 clamp(25px,4vw,33px)/1.18 Hand,Georgia,serif;white-space:pre-wrap;overflow-wrap:anywhere;padding:18px 2px 22px;margin:10px 0 12px;border-top:1px solid #bda981;border-bottom:1px solid #bda981;animation:unseal .35s ease-out;transform-origin:top}.sig{overflow-wrap:anywhere;font:600 27px/1.2 Hand,Georgia;text-align:right}.writer textarea{border:0;border-radius:0;font:500 24px/29px Hand,Georgia,serif;min-height:132px}
/* Start each ruling just below the handwriting baseline, measured from the text's first line box. */
.letter{line-height:round(nearest,1.18em,1px)}
.letter,.writer textarea{
  --rule-y:calc(.5lh + .33em);
  background:linear-gradient(to bottom,
    transparent var(--rule-y), #b59c6d49 var(--rule-y) calc(var(--rule-y) + 1px),
    transparent calc(var(--rule-y) + 1px)) top left / 100% 1lh repeat-y content-box;
}
.writer textarea{background-attachment:local}
.seals{justify-content:flex-start;gap:7px;margin:9px 0}.waxopt{background:transparent;padding:1px;border:2px solid transparent;border-radius:50%;width:42px;height:42px}.waxopt[aria-pressed=true]{border-color:#80603f}.waxopt img{width:100%}.err{color:#8c2626}.shareart{display:block;width:min(100%,220px);margin:10px auto;border:1px solid #947b58}.toast{color:#ebc18c}footer{border-top:1px solid #68544475;border-bottom:0;font-size:12px;color:#bcb0a1}#notice{min-height:1em;margin:9px 0 0}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid #d99540;outline-offset:3px}
@keyframes unseal{from{transform:perspective(600px) rotateX(-44deg);opacity:.45}to{transform:none;opacity:1}}
@media(max-width:720px){.mast,footer{padding:10px 16px}.mast .brand{font-size:21px}.mast a:not(.brand){font-size:12px}.heading{padding:18px 0 13px}.heading h1{font-size:clamp(34px,8.5vw,50px)}.heading>p:last-child{font-size:14px;margin-top:5px}.layout{grid-template-columns:1fr;gap:15px}.metalhead{margin-bottom:11px}.eyebrow{font-size:10px}.slot{aspect-ratio:1.42}.controls h2{font-size:25px;margin-bottom:6px}.controls .folio{margin:0 0 5px}#progress,.plate{font-size:9px}.casefoot{margin-top:8px}.controls{padding:15px}.controls label{margin-top:7px}.formpair{display:grid;grid-template-columns:1fr 1fr;gap:9px}.slot .sender{font-size:14px}.sheethead h2{font-size:30px}#notice:empty{display:none}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
@media(max-width:720px){.formpair{grid-template-columns:minmax(85px,.84fr) minmax(0,1.8fr)}.formpair select,.formpair input{font-size:14px;min-height:42px;padding:7px}}

#book-jump{display:inline-block;margin-top:8px;color:var(--brass);font-size:13px;text-underline-offset:3px}
#guestbook{max-width:720px;margin:27px 0 10px;padding:clamp(18px,3vw,29px);background:var(--paper) url('/_a/paper.10520617b2.png');border:1px solid #d9cbb0;border-radius:11px;color:var(--ink);color-scheme:light;scroll-margin-top:12px}
#guestbook h2{font-size:clamp(25px,3.1vw,39px)}#guestbook a{color:#754728}#guestbook p{margin:8px 0 12px}
#book-privacy{font-size:14px;color:#594633}.book-actions,.book-byline,.book-pager{display:flex;align-items:end;gap:12px;justify-content:space-between}
.book-actions>div{flex:1}.book-actions label{margin-top:6px}.book-actions button{white-space:nowrap}.book-actions small{font-weight:400}
#book-list{list-style:none;padding:0;margin:14px 0 0}#book-list li{border-top:1px solid #d2c2a8;padding:10px 0;overflow-wrap:anywhere}
#book-list p{margin:3px 0;white-space:pre-wrap}.book-byline{align-items:center}.book-byline .link{min-height:32px;padding:0 3px}.book-empty,#book-status{font-size:14px;color:#695341}
#guestbook [hidden],#book-jump[hidden]{display:none}
