/* The directory is a set of numbered cartridges. The guide is its folded insert. */
.puzzle-library, .how-guide {
  --box-ink: #202443;
  --box-stock: #fff1d5;
  --box-blue: #293db5;
  --board-well: #34395c;
  --fixed-piece: #ffedc1;
  --fixed-dot: #c5aa7c;
  --domino: #ff805f;
  margin-block: clamp(24px, 4.8vw, 65px) clamp(42px, 6vw, 88px);
}
.edition-heading { display: grid; grid-template-columns: 1fr minmax(0, 1fr); align-items: end; gap: clamp(16px, 6vw, 80px); }
.edition-heading h1 { margin: 0; font: 850 clamp(3.15rem, 7vw, 6.5rem)/.98 var(--display, system-ui); letter-spacing: -.018em; overflow-wrap: anywhere; }
.edition-heading .page-lede { margin: 0; font-size: clamp(1rem, 1.5vw, 1.16rem); font-weight: 530; line-height: 1.5; }
.puzzle-library { color: var(--box-stock); }
.puzzle-group { margin-top: clamp(27px, 3.6vw, 46px); }
.puzzle-group h2 { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; font: 760 clamp(1.2rem, 2.4vw, 1.6rem)/1.2 var(--display, system-ui); }
.puzzle-group h2::after { content: ''; height: 1px; flex: 1; background: currentColor; opacity: .55; }
.puzzle-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; gap: clamp(12px, 1.8vw, 23px); margin: 0; padding: 0; list-style: none; }
.puzzle-cards li { display: flex; min-width: 0; }
.puzzle-card {
  display: flex; flex-direction: column; width: 100%; background: var(--box-stock); color: var(--box-ink);
  border: 2px solid var(--box-ink); border-radius: 6px 6px 12px 4px; text-decoration: none;
  box-shadow: 3px 4px 0 var(--box-ink); transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.cartridge-face {
  position: relative; display: grid; grid-template-columns: .55fr 1fr; align-items: start; gap: 5px;
  padding: clamp(9px, 1.3vw, 15px); background: #ebd8ad; border-bottom: 2px solid var(--box-ink); border-radius: 4px 4px 0 0;
}
.cartridge-face::before { content: ''; position: absolute; left: clamp(10px, 1.3vw, 16px); bottom: 12px; height: 18%; width: 20%; opacity: .76; background: repeating-linear-gradient(90deg, var(--box-ink) 0 2px, transparent 2px 5px); }
.puzzle-number { font: 900 clamp(2.25rem, 4.5vw, 3.75rem)/.92 var(--display, system-ui); letter-spacing: -.035em; color: var(--box-ink); font-variant-numeric: tabular-nums; }
.puzzle-caption { display: flex; flex: 1; flex-direction: column; gap: 7px; min-width: 0; padding: clamp(11px, 1.45vw, 18px); }
.puzzle-title h3 { margin: 0; font: 790 clamp(1.15rem, 1.9vw, 1.5rem)/1.12 var(--display, system-ui); letter-spacing: -.012em; overflow-wrap: anywhere; }
.puzzle-caption p { margin: 0 0 5px; color: #42445a; font-size: clamp(.93rem, 1.2vw, 1rem); line-height: 1.4; }
.puzzle-card-action { margin-top: auto; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; justify-content: space-between; padding-top: 8px; border-top: 1px dashed #867d6d; font-size: .91rem; font-weight: 750; color: var(--box-blue); }
.solved-mark { color: var(--box-ink); font-size: .8rem; }
.puzzle-card:focus-visible { outline: 3px solid #ffc45b; outline-offset: 4px; }
@media (hover: hover) { .puzzle-card:hover { transform: translate(-1px, -2px); box-shadow: 4px 6px 0 var(--box-ink); }.puzzle-card:hover .puzzle-card-action > span:first-child { text-decoration: underline; } }
.puzzle-card:active { transform: translate(1px, 2px); box-shadow: 1px 1px 0 var(--box-ink); }
.mini-board {
  box-sizing: border-box; width: 100%; aspect-ratio: 1; display: grid; grid-template-rows: repeat(5, 1fr); gap: 3%; padding: 5%;
  border-radius: 8%; background: var(--box-ink); box-shadow: 0 2px 0 #0f1129, inset 0 1px 0 #747891;
}
.mini-board > div { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3%; min-height: 0; }
.mini-board i { position: relative; border-radius: 17%; background: var(--board-well); box-shadow: inset 1px 2px 1px #272b4b; }
.mini-board .tile { background: radial-gradient(circle at center, var(--fixed-dot) 0 10%, transparent 13%), var(--fixed-piece); box-shadow: inset 0 -2px #cfb58b; }
.mini-board .new-tile { background: repeating-linear-gradient(135deg, #ffad90 0 3px, var(--domino) 3px 7px); box-shadow: inset 0 -2px #b75647; }
.mini-board .dot::after { position: absolute; content: ''; width: 30%; aspect-ratio: 1; left: 35%; top: 35%; border-radius: 50%; background: var(--box-ink); }
/* The dark board bridges the open pages; the center crease separates the two states. */
.how-guide { position: relative; color: var(--box-ink); background: var(--box-stock); border: 2px solid var(--box-ink); box-shadow: 4px 6px 0 #171a46; padding: clamp(20px, 3.8vw, 52px); }
.how-guide .edition-heading { align-items: start; gap: clamp(16px, 4vw, 50px); }
.how-guide .edition-heading h1 { font-size: clamp(2.8rem, 6vw, 5rem); }
.how-guide .page-lede { font-weight: 550; }
.move-example { margin-block: clamp(24px, 4vw, 45px) 0; padding-block: 16px 22px; border-block: 2px solid var(--box-ink); }
.move-example h2, .guide-notes h2 { margin: 0; font: 790 clamp(1.3rem, 2.6vw, 1.85rem)/1.16 var(--display, system-ui); letter-spacing: -.012em; }
.example-steps { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(26px, 6vw, 84px); padding-block: clamp(16px, 2.4vw, 25px) 12px; }
.example-steps::before { content: ''; position: absolute; pointer-events: none; left: 50%; top: 18px; bottom: 8px; border-left: 1px dashed #887d68; }
.example-steps figure { min-width: 0; margin: 0; }
.diagram-frame { position: relative; display: grid; place-items: center; padding: clamp(11px, 1.5vw, 22px); background: #eeddb8; border: 1px solid #c8b991; }
.diagram-frame .mini-board { width: min(100%, 210px); padding: min(3.5%, 10px); }
.example-steps figure:first-child .diagram-frame::after { content: ''; position: absolute; z-index: 1; width: 32px; height: 16px; top: calc(50% - 8px); right: calc(-1 * clamp(26px, 6vw, 84px) / 2 - 16px); background: var(--box-ink); clip-path: polygon(0 39%, 65% 39%, 65% 0, 100% 50%, 65% 100%, 65% 61%, 0 61%); }
.example-steps figcaption { display: block; margin-top: 13px; color: #42445a; font-size: clamp(.95rem, 1.3vw, 1.05rem); line-height: 1.48; }
.example-steps figcaption strong { display: block; margin: 0 0 4px; color: var(--box-ink); font: 770 1.12em/1.2 var(--display, system-ui); }
.guide-cta { display: inline-flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 44px; margin-top: 7px; padding: 8px 16px; color: var(--box-ink); border: 2px solid var(--box-ink); background: #ffc45b; box-shadow: 2px 2px 0 var(--box-ink); text-decoration: none; font-weight: 780; }
.guide-cta:hover { background: #ffd48b; }.guide-cta:focus-visible { outline: 3px solid var(--box-blue); outline-offset: 4px; }
.guide-rules { margin-block: 24px; }
.guide-rules ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px 22px; list-style: none; margin: 0; padding: 0; }
.guide-rules li { padding-left: 10px; border-left: 4px solid #9a4c36; line-height: 1.5; }
.guide-rules li:nth-child(2) { border-color: #aa7420; }.guide-rules li:nth-child(3) { border-color: #39867d; }
.guide-notes { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 5vw, 60px); padding-top: 22px; border-top: 1px solid #b2a68d; }
.guide-notes p { margin: 9px 0 0; color: #42445a; line-height: 1.5; }
@media (max-width: 830px) {
  .puzzle-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cartridge-face { grid-template-columns: .7fr 1fr; }
  .cartridge-face .mini-board { justify-self: end; max-width: 145px; }
  .guide-rules ul { display: flex; flex-direction: column; gap: 12px; }
}
@media (max-width: 610px) {
  .edition-heading { grid-template-columns: 1fr; gap: 12px; }
  .edition-heading h1 { font-size: clamp(2.85rem, 13vw, 4.05rem); }
  .edition-heading .page-lede { font-size: 1rem; }
  .puzzle-group { margin-top: 24px; }.puzzle-group h2 { font-size: 1.18rem; }
  .puzzle-cards { gap: 14px 12px; }
  .cartridge-face { grid-template-columns: .45fr 1fr; padding: 8px; }
  .puzzle-number { font-size: clamp(1.7rem, 8.3vw, 2.6rem); }
  .cartridge-face::before { left: 9px; width: 18%; height: 12%; bottom: 9px; }
  .puzzle-caption { padding: 10px; }.puzzle-title h3 { font-size: 1.12rem; }.puzzle-caption p { font-size: .91rem; }
  .how-guide { padding: 18px 15px; }
  .how-guide .edition-heading h1 { font-size: clamp(2.2rem, 9vw, 3.2rem); }
  .example-steps { gap: 20px; }.diagram-frame { padding: 6px; }
  .example-steps figure:first-child .diagram-frame::after { right: -18px; width: 16px; height: 10px; top: calc(50% - 5px); }
  .example-steps figcaption { font-size: .93rem; }.example-steps figcaption strong { font-size: 1.04rem; }
  .guide-notes { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .puzzle-card { transition: none; } }
