/* An accessible, single-source book: ordinary pages until JS enables the 3D view. */
.rulebook-page { background: #f1efeb; color: #0c1231; }
.book-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.book-scroll { --book-height: 610px; --book-width: 927px; --book-nav: 112px; --book-view-height: 760px; background: #f1efeb; }
.book-viewport { padding: 2rem clamp(1.25rem, 4vw, 4rem) 4rem; }
.book-toolbar, .book-controls { width: min(100%, 76rem); margin-inline: auto; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; }
.book-toolbar { margin-bottom: 2rem; font-size: .875rem; }
.book-toolbar > p { font-weight: 600; }
.book-view-toggle { min-height: 44px; padding: .5rem 0; border: 0; border-bottom: 1px solid currentColor; background: none; color: #0c1231; font-size: .875rem; }
.book-view-toggle[hidden], .book-controls[hidden] { display: none; }
.book-canvas { width: min(100%, 76rem); margin-inline: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.book-backing, .book-spine, .book-binding { display: none; }
.book-leaf { display: contents; }
.book-face { position: relative; min-width: 0; padding: clamp(1.5rem, 3vw, 3rem); background: #fffefa; color: #111216; border: 1px solid #0c123118; scroll-margin-top: 9rem; }
.book-page-inner { display: flex; flex-direction: column; min-height: 24rem; height: 100%; }
.book-page-top { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.book-page-number { color: #c20d4a; font: 800 clamp(2.5rem, 5vw, 4rem)/1 var(--display); letter-spacing: -.06em; }
.book-page-kicker { font-size: .625rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; line-height: 1.4; padding-top: .5rem; }
.book-face h2 { font-size: clamp(1.5rem, 2.2vw, 2.25rem); letter-spacing: -.045em; line-height: 1.15; text-wrap: balance; margin-bottom: 1.1rem; }
.book-rule-copy { font-size: clamp(1rem, 1.15vw, 1.125rem); line-height: 1.65; }
.book-page-foot { display: flex; justify-content: space-between; gap: 1rem; margin-top: auto; padding-top: 1.5rem; padding-right: 106px; font-size: .625rem; letter-spacing: .06em; text-transform: uppercase; color: #63636b; }
.book-cover { grid-column: 1 / -1; width: min(100%, 34rem); min-height: 35rem; justify-self: center; margin-block: 1rem 3rem; background: linear-gradient(90deg, #060b20, #0c1231 8%, #111838 95%, #070c22); color: #fff; border: 1px solid #242a43; border-radius: 3px 9px 9px 3px; box-shadow: 8px 9px 0 -2px #ddd9d1, 11px 12px 0 -2px #fffefa, 15px 20px 36px #0c123122; }
.book-cover-kicker { font-size: .75rem; line-height: 1.4; letter-spacing: .04em; color: #e3e3e9; }
.book-cover-top { display: grid; gap: 1rem; }
.book-cover-badge { width: fit-content; max-width: 100%; margin: 0; padding: .55em .65em; border-radius: 4px; background: #ff246a; color: #0c1231; font: 800 clamp(1.5rem, 3.5vw, 2.75rem)/1.08 var(--display); letter-spacing: -.035em; transform: rotate(-2deg); transform-origin: center; box-shadow: 4px 5px 0 #0004; }
.book-cover-title { margin-block: 2.75rem; font: 800 clamp(4rem, 8vw, 7rem)/.93 var(--display); letter-spacing: -.07em; }
.book-cover-brand { display: block; font-size: .33em; line-height: 1.3; letter-spacing: -.04em; margin-bottom: .65em; }
.book-cover-pink { display: block; position: relative; width: fit-content; color: #ff246a; }
.book-cover-scribble { position: absolute; left: 0; bottom: -.19em; width: 105%; height: .2em; overflow: visible; fill: none; stroke: #ff246a; stroke-width: 3.5; stroke-linecap: round; }
.book-cover-bottom { margin-top: auto; padding-top: 1.5rem; padding-right: 100px; }
.book-cover-bottom p { color: #e3e3e9; font-size: .85rem; line-height: 1.5; }
.book-cover-bottom .book-cover-instruction { margin-top: .75rem; color: #ff91b5; font-weight: 600; }
.book-cover-doodle { position: absolute; bottom: 10px; right: 64px; width: 92px; height: 80px; fill: none; stroke: #ff91b5; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.book-back-cover h2 { margin-top: auto; }
.book-back-cover h2 > span { color: #ff246a; }
.book-back-cover .book-page-foot { padding-right: 0; color: #d7d9e4; }
.book-contact-link { display: inline-flex; justify-content: space-between; align-items: center; gap: 1.5rem; align-self: start; min-height: 48px; margin-top: 1rem; padding: .85rem 1rem; background: #c20d4a; color: #fff; font-weight: 600; font-size: .875rem; }
.book-controls { margin-top: 1.25rem; }
.book-scroll-hint { max-width: 21rem; font-size: .875rem; line-height: 1.4; color: #555565; }
.book-scroll-hint strong { display: block; margin-bottom: .15rem; font-size: 1rem; color: #0c1231; }
.book-page-navigation { display: flex; align-items: center; gap: 1rem; }
.book-page-navigation button { display: inline-flex; align-items: center; justify-content: center; gap: .75rem; min-height: 60px; padding: .75rem 1.25rem; border: 1px solid #0c123140; border-radius: 4px; background: transparent; color: #0c1231; font-size: 1rem; font-weight: 600; white-space: nowrap; }
.book-page-navigation button > [aria-hidden] { font-size: 1.5rem; line-height: 1; }
.book-page-navigation button:hover:not(:disabled) { background: #0c1231; color: #fff; }
.book-page-navigation button:disabled { opacity: .3; cursor: default; }
.book-page-navigation .book-next { min-width: 190px; background: #c20d4a; border-color: #c20d4a; color: #fff; font-weight: 700; box-shadow: 0 4px 12px #c20d4a26; }
.book-page-navigation .book-next:hover:not(:disabled) { background: #a50b3f; border-color: #a50b3f; }
.book-page-navigation .book-next:disabled { background: #e2dfd9; border-color: #d3cfc7; color: #555565; box-shadow: none; opacity: 1; }
.book-page-navigation button:not(:disabled), .book-page-fold { cursor: pointer; }
.book-page-fold { position: absolute; z-index: 3; right: 0; bottom: 0; width: 132px; height: 132px; color: #0c1231; touch-action: manipulation; filter: drop-shadow(-3px -3px 3px #0c123128); }
.book-page-fold::before { content: ""; position: absolute; inset: 0; clip-path: polygon(100% 0, 100% 100%, 0 100%); background: linear-gradient(135deg, #a60c42 49%, #ff6b9c 51%, #ff246a 61%); }
.book-page-fold > span { position: absolute; right: 7px; bottom: 13px; width: 66px; text-align: center; font: 800 .95rem/1.2 var(--display); }
.book-page-fold b { font-weight: 500; }
.book-page-fold:hover::before { background: linear-gradient(135deg, #a60c42 49%, #ff91b5 51%, #ff4a84 61%); }
.book-page-fold:focus-visible { outline: 3px solid #0c1231; outline-offset: -4px; }
.book-cover .book-page-fold:focus-visible { outline-color: #fff; }
.book-page-navigation output { min-width: 7rem; text-align: center; font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.scroll-rulebook a:focus-visible, .scroll-rulebook button:focus-visible, .book-canvas:focus-visible { outline: 3px solid #c20d4a; outline-offset: 5px; }
.book-cover a:focus-visible { outline-color: #ff82ae; }

/* Desktop: each physical leaf has a front and back, rotating on the central spine. */
.book-enhanced .book-scroll { height: var(--book-scroll-height); }
.book-enhanced .book-viewport { position: sticky; top: var(--book-nav); height: var(--book-view-height); padding: .75rem clamp(24px, 2.2vw, 40px); display: flex; flex-direction: column; justify-content: space-between; }
.book-enhanced .book-toolbar, .book-enhanced .book-controls { width: 100%; max-width: none; }
.book-enhanced .book-toolbar { flex: none; height: 44px; margin-bottom: .5rem; }
.book-enhanced .book-canvas { position: relative; flex: none; display: block; width: var(--book-width); height: var(--book-height); margin: auto; perspective: 2200px; transform: translateX(var(--book-shift, -25%)); }
.book-enhanced .book-leaf { position: absolute; inset: 0 0 0 50%; display: block; transform-style: preserve-3d; transform-origin: left center; transform: rotateY(var(--leaf-angle, 0deg)); }
.book-enhanced .book-face { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: clamp(1.5rem, calc(var(--book-height) * .055), 4rem); border: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 0 7px 7px 0; }
.book-enhanced .book-face-front { padding-left: clamp(3.5rem, calc(var(--book-height) * .08), 6rem); }
.book-enhanced .book-face-back { padding-right: clamp(3.5rem, calc(var(--book-height) * .08), 6rem); }
.book-enhanced .book-page-inner { min-height: 0; height: 100%; }
.book-enhanced .book-face-front { transform: rotateY(0deg) translateZ(.2px); background: linear-gradient(90deg, #e4e1d9, #fffefa 8%, #fffefa 98%, #eeeae2); }
.book-enhanced .book-face-back { transform: rotateY(180deg) translateZ(.2px); border-radius: 5px 0 0 5px; background: linear-gradient(90deg, #faf9f5, #fffefa 90%, #e2ded6); }
.book-enhanced .book-face::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: #0c1231; opacity: var(--leaf-shadow, 0); pointer-events: none; }
.book-enhanced .book-cover { background: linear-gradient(90deg, #03081c, #0c1231 8%, #151c40 96%, #070c22); box-shadow: inset 9px 0 14px #0008, inset -2px 0 1px #ffffff24, 5px 4px 0 #d1cbbb, 8px 7px 0 #faf8f1, 11px 10px 0 #aaa597, 13px 14px 0 #0c1231, 18px 24px 34px #0c12313b; border: 1px solid #303753; }
.book-enhanced .book-cover-title { margin-block: auto; padding-block: 1rem; font-size: clamp(3rem, calc(var(--book-height) * .16 * var(--book-type-scale, 1)), 10rem); }
.book-enhanced .book-cover-kicker { font-size: .6875rem; }
.book-enhanced .book-cover-badge { font-size: clamp(1.35rem, calc(var(--book-height) * .05 * var(--book-type-scale, 1)), 2.75rem); }
.book-enhanced .book-cover-bottom { margin-top: 0; }
.book-enhanced .book-page-top { margin-bottom: 1.1rem; }
.book-enhanced .book-page-number { font-size: clamp(2.25rem, calc(var(--book-height) * .11), 5rem); }
.book-enhanced .book-face h2 { font-size: clamp(1.25rem, calc(var(--book-height) * .064 * var(--book-type-scale, 1)), 3.4rem); line-height: 1.15; margin-bottom: 1.25rem; max-width: 24ch; }
.book-enhanced .book-rule-copy { font-size: clamp(.95rem, calc(var(--book-height) * .03 * var(--book-type-scale, 1)), 1.3rem); line-height: 1.6; max-width: 43ch; }
.book-enhanced .book-face[data-book-overflow] .book-page-inner { overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #c20d4a #fffefa; }
.book-enhanced .book-face[data-book-overflow] .book-page-inner > * { flex-shrink: 0; }
.book-enhanced .book-face[data-book-overflow] .book-page-foot { padding-bottom: 2rem; }
.book-enhanced .book-page-foot { padding-top: 1rem; font-size: .5625rem; }
.book-enhanced .book-backing { position: absolute; inset: -5px -5px -9px; display: block; background: #0c1231; border: 4px solid #17203f; border-radius: 9px; box-shadow: 0 3px 0 #d8d4ca, 0 5px 0 #f5f2e9, 0 7px 0 #c0baad, 0 10px 0 #f5f2e9, 0 13px 0 #0c1231, 0 28px 36px #0c12313b; opacity: var(--book-open, 0); }
.book-enhanced .book-spine { position: absolute; top: 0; bottom: 0; left: 50%; display: block; width: 16px; transform: translateX(-50%); background: linear-gradient(90deg, #77746b00, #453f354f 45%, #27231980 50%, #77746b00); z-index: 40; opacity: var(--book-open, 0); pointer-events: none; }
.book-enhanced .book-binding { position: absolute; top: 7%; bottom: 7%; left: 50%; transform: translateX(-50%); width: 62px; display: flex; flex-direction: column; justify-content: space-around; z-index: 60; pointer-events: none; }
.book-binding > span { position: relative; display: block; width: 100%; height: 22px; border: 5px solid #a0a3ac; border-top-color: #f8fafc; border-bottom-color: #676b76; border-radius: 50%; box-shadow: 0 4px 4px #0005, inset 0 3px 2px #0005; }
.book-binding > span::before, .book-binding > span::after { content: ""; position: absolute; top: 1px; width: 13px; height: 13px; border-radius: 50%; background: #37352f; box-shadow: inset 1px 1px 3px #000b, 0 0 0 2px #d0ccc0; z-index: -1; }
.book-binding > span::before { left: -6px; }
.book-binding > span::after { right: -6px; }
.book-enhanced .book-back-cover { border-radius: 9px 3px 3px 9px; box-shadow: inset -9px 0 14px #0008, inset 2px 0 1px #ffffff24, -5px 4px 0 #d1cbbb, -8px 7px 0 #faf8f1, -11px 10px 0 #aaa597, -13px 14px 0 #0c1231, -18px 24px 34px #0c12313b; }
.book-enhanced .book-back-cover h2 { font-size: clamp(1.75rem, calc(var(--book-height) * .075 * var(--book-type-scale, 1)), 4.5rem); max-width: 17ch; }
.book-enhanced .book-controls { flex: none; margin-top: 1.25rem; min-height: 60px; }

/* A proper single-page reader on phones: no miniature desktop spreads or clipped text. */
.book-mobile .book-scroll { height: auto; }
.book-mobile .book-viewport { padding: 1.25rem 1rem 2.5rem; }
.book-mobile .book-toolbar { align-items: start; gap: 1rem; font-size: .75rem; margin-bottom: 1.25rem; }
.book-mobile .book-toolbar > p { max-width: 16ch; }
.book-mobile .book-view-toggle { flex: none; font-size: .75rem; }
.book-mobile .book-canvas { display: block; position: relative; width: min(100%, 38rem); perspective: 900px; }
.book-mobile .book-face { width: 100%; min-height: 0; margin: 0; padding: 1.5rem 1.25rem 1.5rem 2.75rem; border-radius: 3px 7px 7px 3px; border-left: 5px solid #e6e2d9; box-shadow: 3px 4px 0 #d3cec1, 6px 7px 0 #fffefa, 9px 10px 0 #0c1231; transform-origin: left center; }
.book-mobile .book-face[hidden] { display: none; }
.book-mobile .book-page-inner { min-height: min(30rem, calc(100svh - 17rem)); height: auto; }
.book-mobile .book-face h2 { font-size: clamp(1.4rem, 5.8vw, 2rem); }
.book-mobile .book-rule-copy { font-size: 1rem; line-height: 1.6; }
.book-mobile .book-page-top { margin-bottom: 1.5rem; }
.book-mobile .book-page-number { font-size: 2.8rem; }
.book-mobile .book-page-foot { display: block; padding-top: 2rem; padding-right: 96px; line-height: 1.8; }
.book-mobile .book-page-foot > span { display: block; }
.book-mobile .book-cover { background: linear-gradient(90deg, #03081c, #0c1231 10%, #151c40); border-left-color: #03081c; }
.book-mobile .book-cover-title { margin-block: 2rem; font-size: clamp(4rem, 18vw, 7rem); }
.book-mobile .book-cover-badge { font-size: clamp(1.4rem, 5.8vw, 2.25rem); }
.book-mobile .book-cover-kicker { font-size: .65rem; }
.book-mobile .book-cover-bottom { padding-right: 90px; }
.book-mobile .book-binding { position: absolute; left: 0; top: 7%; bottom: 7%; width: 26px; display: flex; flex-direction: column; justify-content: space-around; z-index: 5; pointer-events: none; }
.book-mobile .book-binding > span { height: 14px; border-width: 3px; }
.book-mobile .book-binding > span::before, .book-mobile .book-binding > span::after { width: 7px; height: 7px; top: 0; }
.book-mobile .book-binding > span::before { left: -3px; }
.book-mobile .book-binding > span::after { right: -3px; }
.book-mobile .book-controls { display: block; width: min(100%, 38rem); margin-top: 1.75rem; }
.book-mobile .book-scroll-hint { max-width: none; text-align: center; margin-bottom: 1rem; }
.book-mobile .book-page-navigation { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; }
.book-mobile .book-page-navigation output { grid-row: 1; grid-column: 1 / -1; }
.book-mobile .book-page-navigation button { min-width: 0; min-height: 48px; padding: .65rem .5rem; gap: .5rem; font-size: .8rem; }

@media (max-width: 760px) {
  .book-viewport { padding: 1.5rem 1rem 3rem; }
  .book-toolbar { align-items: start; font-size: .75rem; margin-bottom: 1.5rem; }
  .book-canvas { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .book-face { scroll-margin-top: 7rem; padding: 1.5rem; border-left: 5px solid #e6e2d9; box-shadow: 3px 4px 0 #e1ddd3; }
  .book-page-inner { min-height: 23rem; }
  .book-cover { min-height: 32rem; margin-block: 0 1.25rem; border-left: 5px solid #03081c; }
  .book-cover-title { font-size: clamp(4.5rem, 20vw, 7rem); }
  .book-face h2 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) { .scroll-rulebook * { scroll-behavior: auto; transition: none; } }
@media print {
  .book-toolbar, .book-controls, .book-page-fold, .book-cover-doodle { display: none !important; }
  .book-scroll, .book-enhanced .book-scroll { height: auto !important; }
  .book-viewport, .book-enhanced .book-viewport { position: static; height: auto; display: block; padding: 0; }
  .book-canvas, .book-enhanced .book-canvas { display: block; width: auto; height: auto; transform: none !important; perspective: none; }
  .book-enhanced .book-leaf { display: contents; position: static; transform: none !important; }
  .book-face, .book-enhanced .book-face { position: static; width: 100%; height: auto; min-height: 0; transform: none !important; backface-visibility: visible; break-inside: avoid; box-shadow: none; border: 0; }
  .book-mobile .book-face[hidden] { display: block !important; }
  .book-face::after, .book-backing, .book-spine, .book-binding { display: none !important; }
}
