/* Twelve Magical Nights, the free tool. A copy of the app's exercise in the app's dress (GP-64).
   It shares no code or storage with the app. */
@font-face{font-family:Lora;src:url("assets/fonts/Lora-variable.ttf") format("truetype");font-weight:400 700;font-style:normal;font-display:swap}
@font-face{font-family:Lora;src:url("assets/fonts/Lora-italic-variable.ttf") format("truetype");font-weight:400 700;font-style:italic;font-display:swap}
@font-face{font-family:Inter;src:url("assets/fonts/Inter-variable.ttf") format("truetype");font-weight:100 900;font-display:swap}

:root{
  --bg:#EDE4D4;--card:#FBF8F2;--sunken:#E2D6C2;--text:#2A211C;--muted:#6E6055;--label:#9E9184;
  --action:#5A2F2C;--on-action:#FBF3E8;--gold:#D5B468;--wish:#D9AF6F;
  --well:#F1EADF;--well-rim:#E9DFCF;--strip:#F5EAD8;--strip-hover:#F0E0C6;--strip-on:#EFDDBE;
  --cut-lg:18px;--cut-md:11px;--cut-sm:7px;
  --shear-lg:polygon(var(--cut-lg) 0,100% 0,100% calc(100% - var(--cut-lg)),calc(100% - var(--cut-lg)) 100%,0 100%,0 var(--cut-lg));
  --shear-md:polygon(var(--cut-md) 0,100% 0,100% calc(100% - var(--cut-md)),calc(100% - var(--cut-md)) 100%,0 100%,0 var(--cut-md));
  --shear-sm:polygon(var(--cut-sm) 0,100% 0,100% calc(100% - var(--cut-sm)),calc(100% - var(--cut-sm)) 100%,0 100%,0 var(--cut-sm));
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;-webkit-print-color-adjust:exact;print-color-adjust:exact}
body{display:flex;flex-direction:column;margin:0;min-height:100vh;min-height:100dvh;padding:24px 16px 12px;background:var(--bg);color:var(--text);font:400 15px/1.55 Inter,system-ui,sans-serif}
h1,h2,h3,p,ol{margin:0}
button,input,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:2px solid var(--action);outline-offset:2px}

/* The paper */
.paper{flex:none;width:100%;max-width:640px;margin:0 auto;padding:28px 28px 22px;background:var(--card);clip-path:var(--shear-lg);border-top:5px solid var(--wish)}
.paper.wide{max-width:760px}
.head{display:flex;align-items:center;gap:12px;margin-bottom:16px}
.head img{width:44px;height:44px;flex:none}
h1{font:italic 500 28px/1.15 Lora,serif;outline:0}
.lead{color:var(--muted)}
.q{font:italic 400 16px/1.5 Lora,serif;color:var(--muted);margin-bottom:10px}
.hint{font-size:13px;color:var(--muted)}

/* The opening */
.open-sub{margin:-8px 0 18px;font:italic 400 16px/1.45 Lora,serif;color:var(--muted)}
.beats{display:grid;gap:11px;margin-bottom:18px;padding:14px 16px;background:var(--strip);clip-path:var(--shear-md)}
.beats b{display:block;font:600 14.5px/1.3 Lora,serif}
.beats p{font-size:13.5px;line-height:1.45;color:var(--muted)}
.open-go{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:18px}
.open-go .done{margin-left:auto}

/* The walk: one card, one breath */
[hidden]{display:none!important}
.quote{margin:4px 0 12px;padding-left:12px;border-left:2px solid var(--wish);font:italic 400 16px/1.45 Lora,serif}
.walk-body{font:400 14.5px/1.6 Lora,serif}
.walk-body+.walk-body{margin-top:9px}
.paint h1{font-size:24px}
.paint .q{font-size:14.5px}
.stay-q{margin-top:8px}
.next-q{margin-bottom:2px}
.next-help{margin-bottom:10px}
.stuck .hint{margin-bottom:8px}
.far{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:16px}
.far button{min-height:48px;padding:8px 10px;border:0;background:var(--strip);clip-path:var(--shear-sm);font-size:14px;font-weight:500;transition:background .2s}
.far button:hover{background:var(--strip-hover)}
.far button[aria-pressed=true]{background:var(--strip-on);font-weight:600}
.when{margin:-4px 0 6px}
.next{margin-top:16px}
.next-q{color:var(--text)}
.next .split{margin-bottom:6px}
.jump{margin:-10px 0 -8px}
.guide{margin-top:22px}
.guide h2{margin-bottom:6px;font:italic 500 17.5px/1.25 Lora,serif}

/* The split */
.split{display:flex;gap:2px;margin-bottom:14px}
.split button{flex:1;min-height:44px;padding:6px 10px;border:0;background:var(--well);color:var(--muted);font-size:14px;font-weight:500}
.split button:first-child{clip-path:polygon(var(--cut-md) 0,100% 0,100% 100%,0 100%,0 var(--cut-md))}
.split button:last-child{clip-path:polygon(0 0,100% 0,100% calc(100% - var(--cut-md)),calc(100% - var(--cut-md)) 100%,0 100%)}
.split button[aria-pressed=true]{background:var(--strip-on);color:var(--text);font-weight:600}

/* The one well. 16px, because iPhones zoom the page on anything smaller. */
.well{display:block;width:100%;padding:10px 14px;border:0;border-radius:0;background:var(--well);clip-path:var(--shear-md);font:400 16px/1.55 Lora,serif;box-shadow:inset 0 0 0 2px transparent;transition:background .15s}
.well:focus{outline:0;background:var(--card);box-shadow:inset 0 0 0 2px var(--well-rim)}
.well::placeholder{font-style:italic;color:var(--label)}
textarea.well{min-height:260px;resize:vertical}

/* Stuck? */
.stuck{margin-top:12px}
.stuck summary{display:inline-flex;gap:7px;min-height:44px;align-items:center;cursor:pointer;font-size:14px;font-weight:500;color:var(--muted)}
.stuck summary::-webkit-details-marker{display:none}
.stuck summary::before{content:"";width:6px;height:6px;margin-left:2px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);transition:transform .15s}
.stuck[open] summary::before{transform:rotate(45deg)}
.pieces{display:flex;flex-wrap:wrap;gap:6px 4px;margin-top:4px}
.piece{min-height:36px;padding:6px 14px;border:0;background:var(--well);clip-path:var(--shear-sm);font-size:13px;color:var(--muted)}
.piece[aria-pressed=true]{background:var(--strip-on);color:var(--text);font-weight:600}
.thread-q{margin-top:8px;font:italic 400 15px/1.5 Lora,serif;color:var(--muted)}

/* Find your wishes */
.picture{white-space:pre-wrap;font:400 17px/1.8 Lora,serif}
.paint-wrap{position:relative}
.picture{line-height:1.95;-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
.picture ::selection{background:color-mix(in srgb,var(--gold) 55%,transparent)}
.w{cursor:pointer}
/* The app's highlighter: gold at 45%, the same on every line of a wrapped highlight. */
.w.hl{padding:2px 0;background:color-mix(in srgb,var(--gold) 45%,transparent);-webkit-box-decoration-break:clone;box-decoration-break:clone}
.selbar{position:absolute;z-index:4;display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:8px 16px 8px 12px;border:0;background:var(--action);color:var(--on-action);clip-path:var(--shear-md);font-size:14px;font-weight:600;white-space:nowrap}
.selbar svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.selbar .gold{stroke:var(--gold)}

/* Notice: one strip per highlight, one open at a time */
.strips{display:grid;gap:7px}
.strip{background:var(--strip);clip-path:var(--shear-md);transition:background .2s}
.strip:not(.on):hover{background:var(--strip-hover)}
.strip-line{display:flex;align-items:center;gap:10px;width:100%;min-height:48px;padding:9px 14px;border:0;background:none;text-align:left;font:400 16px/1.4 Lora,serif}
.strip-line img{width:20px;height:20px;flex:none}
.strip-words{min-width:0;overflow-wrap:anywhere}
.strip.on .strip-line{display:none}
.adder{margin-top:7px}
.strip-add{display:block;width:100%;min-height:48px;padding:9px 14px;border:0;background:var(--well);clip-path:var(--shear-md);color:var(--muted);font:500 14px/1.4 Inter,sans-serif;text-align:left;transition:background .2s}
.strip-add:hover{background:var(--strip-hover);color:var(--text)}
.added-note{margin-bottom:8px}
.strip-inner{padding:14px 16px 12px}
.origin{margin:1px 0 12px;font:400 16px/1.7 Lora,serif}
.origin mark{padding:2px 0;color:inherit;background:color-mix(in srgb,var(--gold) 45%,transparent);-webkit-box-decoration-break:clone;box-decoration-break:clone}
.strip-inner .q{margin-bottom:6px;color:var(--text)}
.strip-inner .well{background:var(--card)}
.strip-inner textarea.well{min-height:76px}
.starters{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 8px}
.starter{min-height:44px;padding:8px 12px;border:0;background:#EFDFC4;clip-path:var(--shear-sm);font:italic 400 14px/1.3 Lora,serif;text-align:left}
.starter:hover{background:#E9D4B1}
.strip-go{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:8px}

/* Your thirteen */
.thirteen{display:grid;gap:7px;padding-left:28px;color:var(--muted);font-size:13px}
.thirteen li{padding-left:2px}
.thirteen .well{padding:7px 14px;color:var(--text)}

/* The foot */
.foot{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:20px}
.foot .right{margin-left:auto}
.ghost{min-height:44px;padding:6px 2px;border:0;background:none;color:var(--muted);font-size:14px;font-weight:500}
.ghost:hover{color:var(--text)}
.done{min-height:44px;padding:9px 26px;border:0;background:var(--action);color:var(--on-action);clip-path:var(--shear-md);font-size:14px;font-weight:600}
.done:hover{background:#6E4340}
.done:disabled{background:color-mix(in srgb,var(--sunken) 70%,var(--card));color:var(--label);cursor:default}
.count{min-height:20px;margin-top:10px}
.foot.counted{flex-wrap:nowrap;gap:8px}
.foot-count{flex:1;text-align:center;font:italic 400 14px/1.2 Lora,serif;color:var(--text);white-space:nowrap}
.counted .done{margin-left:0;padding-inline:16px;white-space:nowrap}
/* The small reminder, under the card and quieter than anything on it. */
.page-note{flex:none;width:100%;max-width:520px;margin:auto auto 0;padding-top:16px;text-align:center;font-size:11.5px;line-height:1.45;color:var(--muted)}
.clear{display:flex;align-items:center;justify-content:center;gap:2px 14px;flex-wrap:wrap}
.clear .ghost{min-height:32px;padding:4px 2px;font-size:11.5px;font-weight:400;text-decoration:underline;text-underline-offset:2px}
.lang-switch{margin:6px 0 0}
.lang-switch a{display:inline-block;padding:6px 4px;color:inherit;text-underline-offset:2px}

/* The door to the app */
.app-door{margin-top:18px;padding:14px 18px;background:var(--action);color:var(--on-action);clip-path:var(--shear-md);font-size:14px}
.app-door b{display:block;font-weight:600}
.app-door a{color:inherit;font-weight:600;text-underline-offset:2px}

/* The sheets. Real millimetres, so the preview is the print. */
.preview{margin-top:18px;overflow:hidden}
.sheet{width:186mm;background:#fff;color:var(--text);padding:0}
.preview .sheet{margin-bottom:34px;outline:10px solid #fff;box-shadow:0 0 0 11px var(--well-rim)}
.preview .sheet:last-child{margin-bottom:0}
.frame{padding:11px}

.s-head{display:flex;align-items:center;gap:4mm;padding-bottom:3mm;border-bottom:.6pt solid var(--gold)}
.s-head img{width:12mm;height:12mm;flex:none}
.s-head h2{font:italic 500 23pt/1.1 Lora,serif;color:var(--text)}
.s-head p{font:400 10pt/1.3 Inter,sans-serif;color:var(--muted);margin-top:.6mm}
.s-keep h3{font:600 12.5pt/1.25 Lora,serif;margin:5mm 0 2mm}
.s-list{columns:2;column-gap:7mm;padding-left:5mm;font:400 11pt/1.35 Lora,serif}
.s-list li{break-inside:avoid;padding:0 0 1.5mm 1mm}
.s-list li::marker{font:400 8.5pt Inter,sans-serif;color:var(--label)}
.s-picture{white-space:pre-wrap;overflow-wrap:anywhere;font:400 10.5pt/1.55 Lora,serif}
.s-how{display:grid;grid-template-columns:repeat(3,1fr);gap:5mm;margin-top:5mm;padding-top:3.5mm;border-top:.6pt solid var(--gold);break-inside:avoid}
.s-how b{display:block;font:600 10pt/1.25 Lora,serif;margin-bottom:.8mm}
.s-how p{font-size:8.3pt;line-height:1.45;color:var(--muted)}
.s-foot{display:flex;align-items:center;justify-content:space-between;gap:5mm;margin-top:4mm;break-inside:avoid;font-size:8.3pt;line-height:1.4;color:var(--muted)}
.s-foot img{height:15mm;width:auto;flex:none}
.s-foot b{display:block;font-weight:600;color:var(--action)}

.s-slips{break-before:page}
.slip-head{display:flex;align-items:baseline;justify-content:space-between;gap:4mm;height:11mm}
.slip-head h2{font:italic 500 15pt/1.1 Lora,serif;white-space:nowrap}
.slip-head p{font-size:8pt;color:var(--muted);text-align:right}
.stack{border-top:.6pt dashed var(--label)}
/* Fold in half: the right half closes exactly over the words. */
.slip{position:relative;display:grid;grid-template-columns:1fr 1fr;height:18.4mm;border-bottom:.6pt dashed var(--label)}
.slip::before,.slip::after{content:"";position:absolute;left:50%;width:0;height:2mm;border-left:.7pt solid var(--gold)}
.slip::before{top:0}.slip::after{bottom:0}
.slip-words{height:18.4mm;display:flex;align-items:center;padding:1.2mm 4mm;overflow:hidden}
.slip-words p{width:100%;font-family:Lora,serif;line-height:1.25;overflow-wrap:anywhere}
.stayed{display:flex;align-items:center;justify-content:center;gap:2mm;font:italic 400 9.6pt/1 Lora,serif;color:var(--muted);white-space:nowrap}
.stayed img{width:5mm;height:5mm}
.slip.too-long .slip-words{background:#F6E3DC}

.noscript{max-width:640px;margin:16px auto;text-align:center}

@media (max-width:480px){.paper{padding:24px 18px 18px}h1{font-size:25px}.paint h1{font-size:22px}}

.deck-nav{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;min-height:44px}
.deck-nav .ghost{justify-self:start}
.deck-nav .done{justify-self:end;padding-inline:22px}
.deck-mid{display:grid;justify-items:center;line-height:1.3}
.deck-count{font-size:13px;color:var(--muted)}
.deck-swipe{font-size:11.5px;color:var(--muted);white-space:nowrap}

/* On a phone: a deck. Every card shares one grid cell, so the deck is as tall as its tallest card and nothing scrolls inside it. */
@media (max-width:959px){
  .paper.paint{width:calc(100% + 32px);max-width:none;margin:0 -16px;padding:0 16px;background:none;border:0;clip-path:none;overflow-x:clip}
  .paint .head{margin-bottom:6px}
  .paint .jump{margin:0 0 6px}
  .guide-cols{display:grid;padding-bottom:28px;touch-action:pan-y}
  .guide-cols.dragging{-webkit-user-select:none;user-select:none}
  .guide-read,.guide-write{display:contents}
  .paint .guide{grid-area:1/1;min-width:0;margin:0;padding:22px 22px 20px;background:var(--card);border-top:4px solid var(--wish);clip-path:var(--shear-lg);transform-origin:50% 100%;transition:transform .32s cubic-bezier(.2,.7,.2,1),opacity .25s,background .2s}
  .paint .guide.under{background:#F4EDE1}
  .paint textarea.well{min-height:170px}
  .desk-foot{display:none}
}

/* On a computer: read on the left, write on the right. The writing side stays in view while the guide scrolls. */
@media (min-width:960px){
  .paper.paint{max-width:1080px;padding:28px 36px 22px}
  .jump,.deck-nav{display:none}
  .guide-cols{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:44px;align-items:start}
  .guide-read .guide:first-child,.guide-write .guide{margin-top:4px}
  .guide-write{position:sticky;top:16px}
  .guide-write textarea.well{min-height:clamp(200px,40vh,380px);font-size:15px}
  .far{grid-template-columns:repeat(4,1fr)}
  .far button{min-height:40px;font-size:13px}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}

/* Printing: only the sheets, at their true size, on A4 or US Letter. */
@page{margin:12mm}
@media print{
  html,body{background:#fff;min-height:0}
  body{display:block;padding:0}
  .no-print{display:none!important}
  .paper,.paper.wide{max-width:none;width:auto;padding:0;margin:0;background:none;border:0;clip-path:none}
  .preview{margin:0;overflow:visible}
  .frame{padding:0;zoom:1!important}
  .preview .sheet{margin:0;outline:0;box-shadow:none}
  .slip.too-long .slip-words{background:none}
}
