/* The table behind the pie, the folded zine and the shelf. Sits on top of pie.css: same night, same one explicit theme. */
main.room { max-width: 940px; }

.cloth { width: 100%; padding: 22px 18px 26px; border-radius: 18px; border: 3px solid var(--gold);
  background: radial-gradient(ellipse at 50% 30%, #5a1f45 0%, #3a1230 55%, #220a1d 100%);
  box-shadow: 0 18px 40px #000a, inset 0 0 60px #0008; outline: 2px dashed #c9a24b55; outline-offset: -10px; }
.top { display: flex; gap: 22px; align-items: center; justify-content: center; flex-wrap: wrap; min-height: 150px; }

.deck { width: 84px; height: 143px; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 7px;
  filter: drop-shadow(2px 2px 0 #c9a24b) drop-shadow(4px 4px 0 #1d1640) drop-shadow(6px 6px 0 #c9a24b) drop-shadow(0 12px 12px #000a);
  transition: transform .2s ease; }
.deck:hover, .deck:focus-visible { transform: translateY(-3px) rotate(-2deg); outline: none; }
.deck:focus-visible { box-shadow: 0 0 0 3px var(--teal); }
.deck.spent { opacity: .35; cursor: default; transform: none; }
.deck svg { display: block; width: 100%; height: auto; }

.strips { display: grid; gap: 10px; width: min(100%, 340px); }
.strips[hidden], .tools[hidden], .link[hidden] { display: none; }
.strip, .line { font: 17px/1.35 Georgia, "Times New Roman", serif; color: var(--ink); background: #f3e6d3; border: 0; border-radius: 2px;
  padding: 8px 10px; box-shadow: 0 5px 12px #0008; width: 100%; }
.strip { transform: rotate(-.6deg); font-size: 20px; }
.strip.small { width: 70%; font-size: 16px; transform: rotate(.5deg); font-style: italic; }
.strip::placeholder, .line::placeholder { color: #9a8a7c; font-style: italic; }
.strip:focus-visible, .line:focus-visible { outline: 3px dashed var(--teal); outline-offset: 2px; }

.spread { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 18px 14px; justify-content: center; min-height: 40px; }
.place { width: 132px; display: grid; gap: 10px; justify-items: center; align-content: start; animation: land .5s cubic-bezier(.2, .9, .3, 1.15); }
@keyframes land { from { transform: translateY(-120px) rotate(-8deg); opacity: 0; } }
.place:nth-child(odd) .turn { rotate: -1.2deg; }
.place:nth-child(even) .turn { rotate: 1deg; }

.turn { width: 118px; height: 200px; padding: 0; border: 0; background: transparent; cursor: pointer; perspective: 700px; }
.turn:focus-visible { outline: 3px dashed var(--teal); outline-offset: 4px; border-radius: 8px; }
.turn .both { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.3, 1.2, .5, 1); }
.turn.up .both { transform: rotateY(180deg); }
.turn .side { position: absolute; inset: 0; backface-visibility: hidden; filter: drop-shadow(0 8px 10px #0009); }
.turn .side.front { transform: rotateY(180deg); }
.turn .side.front.fell { transform: rotateY(180deg) rotate(180deg); }
.turn .side svg, .turn .side img { display: block; width: 100%; height: 100%; }
.turn.up { cursor: default; }

.line { resize: none; height: 108px; font-size: 15px; transform: rotate(.4deg); }
.place:nth-child(odd) .line { transform: rotate(-.5deg); }
.paw { width: 26px; height: 26px; fill: #f6e3da88; margin-top: -4px; }

.tools { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.tag { font: italic 16px/1 Georgia, serif; color: var(--ink); background: #e9d3a6; border: 0; padding: 10px 16px 10px 26px; cursor: pointer; text-decoration: none;
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 50%); transition: transform .2s ease; }
.tag:hover, .tag:focus-visible { transform: translateY(-2px) rotate(-1deg); outline: none; background: #ffe9a8; }
.tag.plain { background: #6f6796; color: var(--blush); }
.tag.sure { background: var(--foxglove); color: #fff; }
.link { width: min(100%, 470px); font: 13px/1.2 Consolas, monospace; padding: 8px 10px; border: 1px dashed var(--gold); border-radius: 3px; background: #0d0a1c; color: #ffe9a8; }

.door.crust { background: linear-gradient(180deg, #e2b06a, #8a5a2b); }
.door.shelfdoor { background: repeating-linear-gradient(180deg, #4a2f5e 0 14px, #2a1c2e 14px 17px); }
.door.clothdoor { background: linear-gradient(180deg, #5a1f45, #220a1d); }

/* the zine, on a screen: eight small pages in the order they are read */
.sheet { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; width: 100%; }
.page { position: relative; width: 210px; height: 324px; padding: 14px 14px 18px; background: #fbf5ea; color: #120a15; border-radius: 2px; box-shadow: 0 10px 22px #000a;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; overflow: hidden; }
.page .pic { width: 52%; flex: none; }
.page .pic.fell { transform: rotate(180deg); }
.page .pic svg, .page .pic img { display: block; width: 100%; height: auto; }
.page p { margin: 0; font: 13px/1.35 Georgia, serif; overflow-wrap: anywhere; }
.page .no { position: absolute; bottom: 5px; left: 0; right: 0; font: 9px/1 Georgia, serif; color: #8a7a6c; }
.page.cover h2 { margin: 0; font: bold 24px/1.15 Georgia, serif; overflow-wrap: anywhere; }
.page.cover .pic { width: 34%; }
.page.cover p { font-style: italic; font-size: 15px; }
.page.last { justify-content: flex-end; }
.page.last .mark { font: 56px/1 Georgia, serif; color: #c9a24b; margin-bottom: auto; margin-top: auto; }
.page.last p { font-size: 10px; letter-spacing: .08em; }

/* the shelf */
.shelves { width: 100%; display: grid; gap: 34px; }
.shelf { display: grid; gap: 0; }
.plate { justify-self: start; margin: 0 0 8px 8px; font: 12px/1 Georgia, serif; letter-spacing: .14em; text-transform: uppercase; color: #2a1c08; background: linear-gradient(180deg, #e2c77a, #a9822a); padding: 5px 10px; border-radius: 2px; }
.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; padding: 0 12px; min-height: 120px; }
.board { height: 14px; border-radius: 2px; background: linear-gradient(180deg, #8a5a2b, #4e3216); box-shadow: 0 10px 18px #000a; }
.kept { width: 96px; height: 148px; padding: 8px 7px; background: #fbf5ea; color: #120a15; text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center;
  box-shadow: 3px 0 0 #e4d8c4, 0 6px 12px #0009; transition: transform .25s ease; }
.kept:nth-child(3n) { transform: rotate(-2deg); } .kept:nth-child(3n+1) { transform: rotate(1.5deg); }
.kept:hover, .kept:focus-visible { transform: translateY(-10px) rotate(0deg); outline: none; }
.kept b { font: bold 12px/1.15 Georgia, serif; overflow-wrap: anywhere; }
.kept i { font: italic 10px/1.1 Georgia, serif; }
.kept .pic { width: 44%; } .kept .pic svg, .kept .pic img { display: block; width: 100%; height: auto; }
.gap { width: 96px; height: 148px; border: 2px dashed #c9a24b55; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) { .place { animation: none; } .turn .both, .deck, .tag, .kept { transition: none !important; } }

/* the zine, on paper: one sheet, eight pages, laid out so that one cut and four folds make a book.
   Bottom row, left to right: back, front, 2, 3. Top row, upside down, left to right: 7, 6, 5, 4. */
@media print {
  @page { size: landscape; margin: 0; }
  html, body { background: #fff !important; min-height: 0; }
  .tools, .doors, h1 { display: none !important; }
  main.room { max-width: none; padding: 0; margin: 0; display: block; }
  .sheet { position: fixed; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr 1fr; gap: 0; }
  .page { width: auto; height: auto; box-shadow: none; border-radius: 0; background: #fff; padding: 5mm 6mm 7mm; border-left: 1px dotted #bbb; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .page .pic { width: 46%; }
  .p8 { grid-area: 2 / 1; border-left: 0; } .p1 { grid-area: 2 / 2; } .p2 { grid-area: 2 / 3; } .p3 { grid-area: 2 / 4; }
  .p7 { grid-area: 1 / 1; } .p6 { grid-area: 1 / 2; } .p5 { grid-area: 1 / 3; } .p4 { grid-area: 1 / 4; border-left: 0; }
  .p4, .p5, .p6, .p7 { transform: rotate(180deg); }
  .sheet::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dotted #bbb; z-index: 2; }
  .sheet::after { content: "\2702"; position: absolute; left: 25%; right: 25%; top: 50%; border-top: 2px dashed #555; font: 14px/0 "Segoe UI Symbol", serif; color: #555; z-index: 3; }
}
