/* CHEATWRITER — W.G.'s drawer (js/cheatwriter-drawer.js).
   On the painted desk (css/cheatwriter-ui.css): sizes in cqw of the
   stage, so it reads the same at any window size. */

/* the manila envelope, bottom right, half off the desk's edge */
.cw2 .cw2-env {
  position: absolute; z-index: 7; left: 77.6%; top: 89%; width: 11.5%; height: 8.4%;
  padding: 0; border: 0; cursor: pointer; transform: rotate(-4deg);
  background: linear-gradient(170deg, #c99b5e, #a77a42 70%, #8e6634);
  box-shadow: 0 .4cqw .8cqw rgba(0,0,0,.6), inset 0 0 0 1px rgba(60,40,15,.35);
  filter: brightness(.82) sepia(.15);
  transition: transform .2s, filter .2s;
}
.cw2 .cw2-env:hover { transform: rotate(-2deg) translateY(-.4cqw); filter: brightness(.95) sepia(.1); }
.cw2 .cw2-env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 55%;
  background: linear-gradient(180deg, rgba(90,60,25,.25), transparent);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.cw2 .cw2-env-label { position: absolute; left: 8%; bottom: 14%; font-family: 'Caveat', cursive; font-size: 1.5cqw; color: #2c1d0e; transform: rotate(-3deg); }
.cw2 .cw2-env-n { position: absolute; right: 8%; bottom: 16%; font-family: 'Special Elite', monospace; font-size: .75cqw; color: #3a2814; letter-spacing: .08em; }

/* the drawer: a tray of frames */
.cw2 .cw2-drawer, .cw2 .cw2-view {
  position: absolute; inset: 0; z-index: 42; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(8,6,4,.72); animation: cw2DrIn .25s ease both;
}
@keyframes cw2DrIn { from { opacity: 0; } to { opacity: 1; } }
.cw2 .cw2-drawer-box {
  position: relative; width: 62%; max-height: 82%; overflow: auto; padding: 1.6cqw 2cqw 2cqw;
  background: linear-gradient(175deg, #3b2a1c, #2a1d13); border: 1px solid rgba(196,168,122,.35);
  box-shadow: inset 0 0 3cqw rgba(0,0,0,.6), 0 1cqw 3cqw rgba(0,0,0,.7);
}
.cw2 .cw2-drawer-h { font-family: 'Special Elite', monospace; font-size: 1.15cqw; letter-spacing: .3em; color: #e3cfa6; margin-bottom: 1.2cqw; }
.cw2 .cw2-drawer-h small { display: block; margin-top: .3cqw; font-family: 'Caveat', cursive; font-size: 1.05cqw; letter-spacing: .02em; color: #b99b6c; }
.cw2 .cw2-drawer-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.1cqw; margin-bottom: 1.4cqw; }
.cw2 .cw2-drawer-book { font-family: 'Special Elite', monospace; font-size: .8cqw; letter-spacing: .3em; color: #c4a87a; margin: .2cqw 0 .7cqw; border-bottom: 1px dashed rgba(196,168,122,.3); padding-bottom: .3cqw; }
.cw2 .cw2-th-n { position: absolute; right: 6%; bottom: 4%; font-family: 'Caveat', cursive; font-size: .95cqw; color: #3a2814; }
.cw2 .cw2-drawer-none { grid-column: 1 / -1; font-family: 'Caveat', cursive; font-size: 1.2cqw; color: #b99b6c; }
.cw2 .cw2-slot {
  position: relative; aspect-ratio: 4 / 5; padding: 0; border: 0; cursor: pointer; background: none;
  display: flex; align-items: center; justify-content: center;
}
.cw2 .cw2-slot-empty { cursor: default; border: 1px dashed rgba(196,168,122,.35); border-radius: .2cqw; }
.cw2 .cw2-slot-empty span { font-family: 'Special Elite', monospace; font-size: 2cqw; color: rgba(196,168,122,.35); }
.cw2 .cw2-slot-limited.cw2-slot-empty { border-color: rgba(160,50,30,.6); }
.cw2 .cw2-slot-lim {
  position: absolute; left: 50%; bottom: -.2cqw; transform: translateX(-50%) rotate(-3deg); white-space: nowrap;
  font-family: 'Caveat', cursive; font-size: .85cqw; color: #e7b39a; background: rgba(90,20,12,.85); padding: 0 .4cqw;
}
.cw2 .cw2-th-photo {
  width: 100%; height: 100%; box-sizing: border-box; padding: 6% 6% 22%;
  background: #ece4d2; box-shadow: 0 .3cqw .6cqw rgba(0,0,0,.55); transform: rotate(-2deg);
}
.cw2 .cw2-slot:nth-child(even) .cw2-th-photo { transform: rotate(2deg); }
.cw2 .cw2-th-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; display: block; filter: sepia(.35) contrast(.92) brightness(.92) saturate(.8); }
.cw2 .cw2-th-page {
  width: 92%; height: 100%; box-sizing: border-box; padding: 10% 8%; text-align: center;
  background: linear-gradient(175deg, #efe6cf, #ddd0b0); box-shadow: 0 .3cqw .6cqw rgba(0,0,0,.55); transform: rotate(1.5deg);
  font-family: 'Special Elite', monospace; color: #2a1d14; display: flex; flex-direction: column; gap: .6cqw;
}
.cw2 .cw2-th-page b { font-weight: normal; font-size: .7cqw; color: #6a5440; }
.cw2 .cw2-th-page i { font-style: normal; font-size: .78cqw; line-height: 1.3; }
.cw2 .cw2-ph-missing {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  background: repeating-linear-gradient(135deg, #3a2e24 0 .6cqw, #33281f .6cqw 1.2cqw);
  font-family: 'Caveat', cursive; font-size: 1cqw; color: #b99b6c;
}
.cw2 .cw2-drawer-x {
  position: absolute; top: .8cqw; right: .9cqw; width: 2.2cqw; height: 2.2cqw; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(235,214,170,.45); background: rgba(10,8,6,.6); color: #e8d8b8; font-size: 1cqw;
}
.cw2 .cw2-view > .cw2-drawer-x { top: 2%; right: 1.2%; width: 2.6cqw; height: 2.6cqw; font-size: 1.2cqw; }

/* one thing, up close */
.cw2 .cw2-view-h { font-family: 'Caveat', cursive; font-size: 1.4cqw; color: #e3cfa6; margin-bottom: 1cqw; animation: cw2DrIn .6s ease both; }
.cw2 .cw2-view-hint { margin-top: 1cqw; font-family: 'Special Elite', monospace; font-size: .75cqw; letter-spacing: .25em; color: rgba(227,207,166,.6); text-transform: uppercase; }
.cw2 .cw2-view-row { display: flex; align-items: center; justify-content: center; gap: 2.4cqw; max-width: 92%; }
.cw2 .cw2-pol { position: relative; perspective: 120cqw; cursor: pointer; flex: none; animation: cw2Slide .7s cubic-bezier(.2,.8,.3,1) both; }
@keyframes cw2Slide { from { transform: translateY(-30%) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.cw2 .cw2-pol-in { position: relative; display: block; transition: transform .7s ease; transform-style: preserve-3d; transform: rotate(-2deg); }
.cw2 .cw2-pol-flip .cw2-pol-in { transform: rotate(-2deg) rotateY(180deg); }
.cw2 .cw2-pol-front { position: relative; backface-visibility: hidden; background: #ece4d2; padding: .9cqw .9cqw 3.6cqw; box-shadow: 0 1cqw 2cqw rgba(0,0,0,.7); }
.cw2 .cw2-pol-front::after {   /* grain and a tired vignette */
  content: ''; position: absolute; left: .9cqw; top: .9cqw; right: .9cqw; bottom: 3.6cqw; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(40,25,10,.35)), repeating-radial-gradient(circle at 30% 20%, rgba(255,255,255,.035) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.cw2 .cw2-pol-img { display: block; max-height: 40cqw; max-width: 36cqw; filter: sepia(.35) contrast(.92) brightness(.92) saturate(.8); }
.cw2 .cw2-pol .cw2-ph-missing { width: 26cqw; height: 32cqw; }
.cw2 .cw2-pol .cw2-view-hint { text-align: center; }
.cw2 .cw2-pol-back {
  position: absolute; inset: 0; backface-visibility: hidden; box-shadow: 0 1cqw 2cqw rgba(0,0,0,.7);
  transform: rotateY(180deg); display: flex; align-items: center; justify-content: center; padding: 10%; box-sizing: border-box;
  background: linear-gradient(170deg, #e6dcc6, #d4c6a6);
}
.cw2 .cw2-pol-back span { font-family: 'Caveat', cursive; font-size: 2.1cqw; color: #2b1d10; transform: rotate(-6deg); text-align: center; }
.cw2 .cw2-page {
  width: 38%; max-height: 80%; overflow: auto; padding: 2.4cqw 2.8cqw; box-sizing: border-box;
  background: linear-gradient(175deg, #efe6cf, #ddd0b0); box-shadow: inset 0 0 2.5cqw rgba(120,80,40,.22), 0 1cqw 2cqw rgba(0,0,0,.65);
  font-family: 'Special Elite', 'Courier New', monospace; color: #241a12; transform: rotate(-1deg);
  animation: cw2Slide .7s cubic-bezier(.2,.8,.3,1) both;
}
.cw2 .cw2-page-bk { text-align: center; font-size: .62cqw; letter-spacing: .25em; color: #8a7058; margin-bottom: .5cqw; }
.cw2 .cw2-page-no { text-align: center; font-size: .8cqw; color: #6a5440; }
.cw2 .cw2-view-row .cw2-page { width: 34cqw; max-height: 44cqw; flex: none; }
.cw2 .cw2-page-t { text-align: center; font-size: 1.1cqw; letter-spacing: .2em; margin: .6cqw 0 1.2cqw; }
.cw2 .cw2-page p { font-size: .98cqw; line-height: 1.55; margin: 0 0 .9cqw; text-indent: 1.6cqw; }
.cw2 .cw2-obj { width: 30%; text-align: center; }
.cw2 .cw2-obj img { width: 100%; filter: drop-shadow(0 1cqw 1.4cqw rgba(0,0,0,.6)); }
.cw2 .cw2-obj span { display: block; margin-top: .8cqw; font-family: 'Caveat', cursive; font-size: 1.3cqw; color: #e3cfa6; }
