@import url('https://fonts.googleapis.com/css2?family=Anton&family=Condiment&family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,600&display=swap');

:root{
  --cream: #fbf1d7;
  --cream-deep: #f2e3bd;
  --teal: #0c4f52;
  --teal-dark: #063638;
  --burgundy: #7a1710;
  --burgundy-deep: #55100b;
  --gold: #c79a2e;
  --gold-light: #e3c46a;
  --ink: #2b2116;
}

*{ box-sizing: border-box; }

html,body{
  margin:0;
  padding:0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Lora', Georgia, serif;
  line-height: 1.6;
}

.wrap{
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.frame{
  position: relative;
  background: var(--cream);
  border: 2px solid var(--teal);
  border-radius: 4px;
  padding: 40px 34px 40px;
}

.frame::after{
  content: "";
  position: absolute;
  inset: 7px;
  border: 1.5px solid var(--gold);
  border-radius: 2px;
  pointer-events: none;
}

.corner{
  position: absolute;
  width: 84px;
  height: 84px;
  color: var(--gold);
  z-index: 1;
}
.corner.tl{ top: -2px; left: -2px; }
.corner.tr{ top: -2px; right: -2px; transform: scaleX(-1); }
.corner.bl{ bottom: -2px; left: -2px; transform: scaleY(-1); }
.corner.br{ bottom: -2px; right: -2px; transform: scale(-1,-1); }

header.site-head{
  position: relative;
  z-index: 2;
  text-align:center;
  margin-bottom: 22px;
}

.eyebrow{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.97rem;
  color: var(--teal);
  font-family: 'Lora', serif;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
}

.eyebrow-icon{
  height: 51px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

h1.title-image{
  margin: 6px 0 0;
}

h1.title-image img{
  display: block;
  width: 100%;
  max-width: 380px;
  height: auto;
  margin: 0 auto;
}

.byline{
  margin-top: 10px;
  font-size: 0.93rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-dark);
  font-weight: 600;
}

.rule{
  border: none;
  border-top: 1px solid var(--gold);
  margin: 22px 0;
  position: relative;
  z-index: 2;
}

.lede{
  text-align:center;
  font-size: 1.05rem;
  color: var(--ink);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.hero-portrait-wrap{
  display:flex;
  justify-content:center;
  margin: 4px 0 6px;
}

.hero-portrait{
  width: 240px;
  height: 240px;
  object-fit: cover;
  -webkit-mask-image: radial-gradient(circle, #000 58%, transparent 78%);
  mask-image: radial-gradient(circle, #000 58%, transparent 78%);
}

.hero-photo-wrap{
  display:flex;
  justify-content:center;
  margin: 10px 0 26px;
}

.hero-photo{
  width: 260px;
  height: auto;
  padding: 10px 10px 34px;
  background: #fff;
  border: 1px solid rgba(43,33,22,0.15);
  box-shadow: 0 10px 22px rgba(43,33,22,0.22);
  transform: rotate(-2.5deg);
}

.hero-photo img{
  display:block;
  width: 100%;
  height: auto;
  filter: sepia(0.28) saturate(1.05) contrast(1.02);
}

.hero-photo-caption{
  text-align: center;
  margin-top: -22px;
  font-family: 'Condiment', cursive;
  color: var(--teal-dark);
  font-size: 1rem;
  transform: rotate(-2.5deg);
}

.dog-parade{
  display:flex;
  align-items:flex-end;
  justify-content:center;
  gap: 22px;
  margin: 4px 0 22px;
  color: var(--teal);
  opacity: 0.85;
}

.dog-parade svg{ display:block; }

.mascot-cameo{
  display:flex;
  align-items:center;
  gap: 12px;
  max-width: 340px;
  margin: 0 auto 20px;
  padding: 8px 14px;
  background: var(--cream-deep);
  border: 1px solid var(--gold);
  border-radius: 999px;
}

.mascot-cameo.reverse{
  flex-direction: row-reverse;
}

.mascot-cameo.reverse img{
  transform: scaleX(-1);
}

.mascot-cameo img{
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.mascot-cameo p{
  margin:0;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--teal-dark);
  line-height:1.3;
}

.mascot-cameo.reverse p{
  text-align: right;
}

.teaser{
  text-align:center;
  font-style: italic;
  font-weight: 700;
  color: var(--teal-dark);
  font-size: 1.11rem;
  white-space: nowrap;
  margin: 4px 0 24px;
}

form.solution-form{
  margin-top: 8px;
}

.ledger-entry{
  border: 2px solid var(--teal);
  border-radius: 3px;
  background: var(--cream-deep);
  box-shadow: 3px 3px 0 rgba(122,23,16,0.10);
  margin-bottom: 24px;
}

.ledger-entry-head{
  background: var(--teal);
  color: var(--cream);
  text-align: center;
  padding: 10px 10px 8px;
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.86rem;
  line-height: 1.35;
}

.ledger-entry-head .dim{
  display: block;
  color: var(--gold-light);
  font-family: 'Lora', serif;
  font-weight: 600;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.62rem;
  margin-top: 2px;
}

/* Answer block: each label sits directly above its own box */
.ledger-fields{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 10px;
  padding-bottom: 12px;
}

.ledger-field{
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-left: 1px dashed var(--gold);
}

.ledger-field:first-child{ border-left: none; }

.ledger-label{
  padding: 10px 10px 5px;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--teal);
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 2px solid var(--ink);
}

.ledger-field input{
  width: 100%;
  border: none;
  background: transparent;
  padding: 9px 10px 0;
  font-family: 'Lora', serif;
  font-size: 0.98rem;
  color: var(--ink);
}

.ledger-field:first-child .ledger-label,
.ledger-field:first-child input{ padding-left: 0; }

.ledger-field input:focus{
  outline: none;
  background: rgba(199,154,46,0.16);
}

.ledger-field input::placeholder{
  color: rgba(43,33,22,0.35);
  font-style: italic;
  font-size: 0.88em;
  opacity: 1;
}

/* Entry page: spelling reminder under "Submit Your Solution Here." */
.teaser-note{
  text-align: center;
  font-style: italic;
  font-weight: 600;
  color: var(--burgundy);
  font-size: 0.95rem;
  margin: -18px auto 24px;
  text-wrap: balance;
}

.submit-btn{
  display:block;
  width: 100%;
  margin-top: 6px;
  padding: 14px 20px;
  background: var(--burgundy);
  color: var(--cream);
  border: 1px solid var(--gold);
  border-radius: 3px;
  font-family: 'Lora', serif;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.submit-btn:hover{ background: var(--burgundy-deep); }

footer.site-foot{
  position: relative;
  z-index: 2;
  text-align:center;
  margin-top: 30px;
  font-size: 0.72rem;
  color: var(--teal-dark);
  letter-spacing: 0.04em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

footer.site-foot .f-book{
  font-style: italic;
}

/* Result page */

.verdict{
  text-align:center;
  margin-bottom: 6px;
}

.ribbon{
  display:inline-block;
  position: relative;
  background: var(--teal);
  color: var(--cream);
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1.15rem;
  padding: 12px 34px;
  border-radius: 2px;
  margin: 6px 0 6px;
}

.ribbon::before, .ribbon::after{
  content:"";
  position:absolute;
  top:0;
  width:0;
  height:0;
  border-top: 24px solid var(--teal);
  border-bottom: 24px solid var(--teal);
}

.ribbon::before{
  left:-14px;
  border-left: 14px solid transparent;
}

.ribbon::after{
  right:-14px;
  border-right: 14px solid transparent;
}

.ribbon .accent{
  color: var(--gold-light);
}

/* "Not Quite" banner in barn red */
.ribbon.miss{ background: var(--burgundy); }
.ribbon.miss::before, .ribbon.miss::after{
  border-top-color: var(--burgundy);
  border-bottom-color: var(--burgundy);
}

.verdict-sub{
  text-align:center;
  color: var(--ink);
  margin: 14px 0 26px;
  font-size: 1rem;
}

table.ledger-check{
  width:100%;
  border-collapse: collapse;
  margin: 10px 0 28px;
  font-size: 0.95rem;
}

table.ledger-check th{
  text-align:left;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--teal);
  border-bottom: 2px solid var(--teal);
  padding: 6px 8px;
}

table.ledger-check td{
  padding: 8px;
  border-bottom: 1px solid var(--gold-light);
  vertical-align: top;
}

table.ledger-check td.mark{
  text-align:center;
  width: 34px;
  font-weight: 700;
}

.mark.yes{ color: #2f6b3a; }
.mark.no{ color: var(--burgundy); }

.section-label{
  text-align:center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--burgundy);
  font-weight: 600;
  margin: 30px 0 4px;
}

.record-card{
  background: var(--cream-deep);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 18px 22px;
  margin: 10px 0 30px;
}

.record-row{
  display:flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--gold);
  font-size: 1rem;
}

.record-row:last-child{ border-bottom:none; }

.record-row .k{
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--teal);
  font-weight: 600;
  align-self:center;
}

.record-row .v{
  font-weight: 600;
  text-align: right;
}

.congrats{
  text-align:center;
  margin: 6px 0 30px;
  font-size: 1rem;
}

/* Epilogue teaser + email gate (result page) */

.epilogue-teaser{
  position: relative;
  margin: 8px 0 6px;
  padding: 26px 22px 24px;
  background: var(--teal);
  border: 1px solid var(--gold);
  border-radius: 4px;
  color: var(--cream);
  text-align: center;
  overflow: hidden;
}

.epilogue-teaser::before{
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(199,154,46,0.5);
  border-radius: 2px;
  pointer-events: none;
}

.epilogue-teaser .bonus-label{
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 1.05rem;
  color: var(--gold-light);
  font-weight: 600;
  margin-bottom: 6px;
}

.epilogue-teaser h2{
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  font-size: 1.7rem;
  margin: 0 0 2px;
  color: var(--cream);
}

.epilogue-teaser .sub{
  font-family: 'Condiment', cursive;
  color: var(--gold-light);
  font-size: 1.7rem;
  margin: 0 0 14px;
}

.epilogue-teaser p{
  max-width: 440px;
  margin: 0 auto 18px;
  font-size: 0.96rem;
  color: rgba(251,241,215,0.92);
}

.epilogue-gate{
  display: flex;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

.epilogue-gate input[type="email"]{
  flex: 1 1 220px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--gold);
  border-radius: 3px;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Lora', serif;
  font-size: 0.92rem;
}

.epilogue-gate input[type="email"]::placeholder{
  color: rgba(43,33,22,0.4);
}

.epilogue-gate button{
  flex: 0 0 auto;
  padding: 12px 20px;
  background: var(--gold);
  color: var(--teal);
  border: none;
  border-radius: 3px;
  font-family: 'Lora', serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.82rem;
  cursor: pointer;
}

.epilogue-gate button:hover{ background: var(--gold-light); }

.epilogue-fine{
  margin: 12px auto 0;
  max-width: 400px;
  font-size: 0.7rem;
  color: rgba(251,241,215,0.6);
}

.epilogue-fine a{ color: var(--gold-light); }

.epilogue-error{
  max-width: 400px;
  margin: 0 auto 14px;
  color: var(--gold-light);
  font-size: 0.85rem;
  font-style: italic;
}

/* Epilogue page */

.epilogue{
  margin-top: 10px;
  padding-top: 22px;
  border-top: 2px solid var(--teal);
}

.epilogue .bonus-label{
  text-align:center;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--teal);
  font-weight: 600;
  margin-bottom: 4px;
}

.epilogue h2{
  text-align:center;
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  color: var(--ink);
  font-size: 1.7rem;
  margin: 0 0 2px;
}

.epilogue .sub{
  text-align:center;
  font-family: 'Condiment', cursive;
  color: var(--burgundy);
  font-size: 1.92rem;
  -webkit-text-stroke: 0.6px var(--burgundy);
  margin: 0 0 20px;
}

.epilogue p{
  margin: 0 0 16px;
  font-size: 1.02rem;
}

.epilogue p:first-of-type::first-letter{
  font-family: 'Anton', sans-serif;
  font-size: 2.6rem;
  float:left;
  line-height: 0.8;
  padding-right: 8px;
  padding-top: 4px;
  color: var(--burgundy);
}

.footnote{
  text-align:center;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px dashed var(--gold);
  font-size: 0.82rem;
  font-style: italic;
  color: var(--teal-dark);
}

.epilogue-closer{
  margin-top: 34px;
  padding-top: 28px;
  border-top: 2px solid var(--teal);
  text-align: center;
}

.epilogue-closer img{
  display: block;
  width: 100%;
  max-width: 336px;
  height: auto;
  margin: 0 auto 18px;
  padding: 6px;
  background: #fff;
  border: 1px solid rgba(43,33,22,0.15);
  box-shadow: 0 8px 18px rgba(43,33,22,0.18);
}

.epilogue-closer .closer-label{
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.95rem;
  color: var(--teal);
  font-weight: 800;
  margin-bottom: 14px;
}

.epilogue-closer p{
  max-width: 520px;
  margin: 0 auto 14px;
  font-size: 0.98rem;
  color: var(--ink);
}

.epilogue-closer p:last-of-type{
  margin-bottom: 0;
}

.epilogue-closer .sign{
  display: block;
  margin-top: 6px;
  font-family: 'Condiment', cursive;
  color: var(--burgundy);
  font-size: 1.6rem;
}

.next-book{
  margin-top: 14px;
}

.next-lead{
  font-family: 'Lora', serif;
  font-weight: 700;
  color: var(--ink);
  font-size: 1.05rem;
}

.next-book .sign{
  margin-top: 2px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
}

.next-book .sign:hover{
  text-decoration-thickness: 2px;
}

.next-cover-link{
  display: block;
  margin: 12px auto 0;
  max-width: 200px;
}

.next-cover{
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(43,33,22,0.15);
  box-shadow: 0 8px 18px rgba(43,33,22,0.22);
  transition: transform 0.15s ease;
}

.next-cover-link:hover .next-cover{
  transform: translateY(-2px);
}

.parade-caption{
  text-align:center;
  font-style: italic;
  font-size: 1.03rem;
  color: var(--teal-dark);
  margin: -8px 0 22px;
}

.again{
  text-align:center;
  margin-top: 30px;
}

.again a{
  color: var(--teal);
  font-size: 0.85rem;
  text-decoration: underline;
}

/* Results page: two-part congratulations */
.congrats{ font-weight: 600; }
.congrats strong{ color: var(--teal-dark); font-weight: 600; font-style: italic; }
.congrats + .congrats-note{ margin-top: -18px; }
.congrats-note{
  text-align:center;
  margin: 0 0 30px;
  font-size: 1rem;
}

/* Down arrows either side of Merriweather, nudging readers toward the bonus chapter */
.cameo-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 14px;
  margin: 0 auto 20px;
}
.cameo-row .mascot-cameo{
  margin: 0;
  flex: 0 1 auto;
  max-width: none;
  min-width: 0;
}
.nudge-arrow{
  width: 30px;
  height: 60px;
  flex-shrink: 0;
  color: var(--teal);
  animation: nudge 1.8s ease-in-out infinite;
}
.nudge-arrow .leaf{ fill: var(--gold); }
@keyframes nudge{
  0%, 100%{ transform: translateY(0); }
  50%{ transform: translateY(5px); }
}
@media (prefers-reduced-motion: reduce){
  .nudge-arrow{ animation: none; }
}

/* Epilogue page: special teal-and-gold chapter header */
.epilogue-head{
  position: relative;
  margin: 4px 6px 26px;
  padding: 26px 20px 22px;
  background: var(--teal);
  border: 2px solid var(--gold);
  border-radius: 4px;
  box-shadow: 0 0 0 4px var(--cream), 0 0 0 5.5px var(--gold);
  text-align: center;
}
.epilogue-head::before{
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(227,196,106,0.55);
  border-radius: 2px;
  pointer-events: none;
}
.epilogue .epilogue-head .bonus-label{
  color: var(--gold-light);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  margin-bottom: 6px;
}
.epilogue .epilogue-head .bonus-label::before{ content: "\2726\00a0\00a0"; color: var(--gold); }
.epilogue .epilogue-head .bonus-label::after{ content: "\00a0\00a0\2726"; color: var(--gold); }
.epilogue .epilogue-head h2{
  color: var(--cream);
  text-shadow: 0 2px 0 rgba(0,0,0,0.25);
}
.epilogue .epilogue-head .sub{
  color: var(--gold-light);
  -webkit-text-stroke: 0.6px var(--gold-light);
  margin: 0;
}

/* Ribbon notches stretch to the banner's full height, so a two-line banner on phones still looks right */
.ribbon{ text-wrap: balance; }
.ribbon::before, .ribbon::after{
  top: 0;
  bottom: 0;
  width: 14px;
  height: auto;
  border: 0;
  background: inherit;
}
.ribbon::before{ clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 100% 50%); }
.ribbon::after{ clip-path: polygon(0 0, 100% 0, 0 50%, 100% 100%, 0 100%); }

/* Balanced line breaks, no lone words */
.congrats, .congrats-note, .verdict-sub, .epilogue-gate button,
.epilogue-teaser .bonus-label, .epilogue-teaser h2, .epilogue-teaser .sub,
.epilogue-head h2, .epilogue-head .sub{ text-wrap: balance; }

@media (max-width: 560px){
  .ribbon{ font-size: 1rem; padding: 10px 24px; }
  .epilogue .epilogue-head .sub{ font-size: 1.6rem; }
  .epilogue-head{ padding: 22px 14px 18px; }
}

/* Results page: big, celebratory "Case Closed" banner (correct answers only) */
.verdict .ribbon.win{
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-weight: normal;
  line-height: 1.05;
  padding: 16px 44px 14px;
  margin: 10px 0 4px;
  box-shadow: inset 0 0 0 5px var(--teal), inset 0 0 0 6.5px var(--gold);
  animation: stamp-in 0.65s cubic-bezier(.2,1.3,.4,1) both;
}
.verdict .ribbon.win::before{ left: -26px; width: 26px; }
.verdict .ribbon.win::after{ right: -26px; width: 26px; }
.win-main{
  font-size: 2.6rem;
  letter-spacing: 0.06em;
  text-shadow: 0 3px 0 rgba(0,0,0,0.25);
}
.win-accent{
  font-family: 'Condiment', cursive;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.75rem;
  color: var(--gold-light);
  margin-top: 4px;
}
.win-star{
  display: inline-block;
  color: var(--gold);
  font-size: 0.7em;
  vertical-align: 0.15em;
  animation: twinkle 1.6s ease-in-out infinite;
}
.win-star:last-child{ animation-delay: 0.8s; }
@keyframes stamp-in{
  0%{ transform: scale(1.8) rotate(-8deg); opacity: 0; }
  55%{ transform: scale(0.94) rotate(1.5deg); opacity: 1; }
  78%{ transform: scale(1.04) rotate(-0.5deg); }
  100%{ transform: scale(1) rotate(0); }
}
@keyframes twinkle{
  0%, 100%{ transform: scale(1) rotate(0); opacity: 1; }
  50%{ transform: scale(0.6) rotate(45deg); opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce){
  .verdict .ribbon.win, .win-star{ animation: none; }
}

/* Bonus chapter card: bigger "The Whodunit & Epilogue", gold letters outlined in the site's barn red (--burgundy, #7a1710) */
.epilogue-teaser .sub{
  font-size: 2.35rem;
  line-height: 1.15;
  margin: 4px 0 16px;
  text-shadow:
    2px 0 0 var(--burgundy), -2px 0 0 var(--burgundy),
    0 2px 0 var(--burgundy), 0 -2px 0 var(--burgundy),
    1.5px 1.5px 0 var(--burgundy), -1.5px 1.5px 0 var(--burgundy),
    1.5px -1.5px 0 var(--burgundy), -1.5px -1.5px 0 var(--burgundy),
    0 3.5px 0 var(--burgundy);
}
/* Email box and full-width "Unlock the Rest of the Story" button */
.epilogue-gate{ max-width: 420px; }
.epilogue-gate button{ flex: 1 1 auto; padding: 13px 20px; font-size: 0.86rem; }

/* Results page: Mister's photo now closes the page */
.hero-photo-wrap.at-bottom{ margin: 44px 0 26px; }

/* Epilogue page: lead-in to Book One */
.epilogue-closer .next-book .next-note{
  max-width: 460px;
  margin: 6px auto 4px;
  font-style: italic;
  font-size: 0.98rem;
}

/* Epilogue page: small Mister snapshots tucked beside the story */
.story-art{
  width: 190px;
  margin: 6px 0 12px;
  padding: 6px;
  background: #fff;
  border: 1px solid rgba(43,33,22,0.15);
  box-shadow: 0 6px 14px rgba(43,33,22,0.18);
}
.story-art.right{ float: right; margin-left: 22px; transform: rotate(2deg); }
.story-art.left{ float: left; margin-right: 22px; transform: rotate(-2deg); }
.story-art img{
  display: block;
  width: 100%;
  height: auto;
  filter: sepia(0.28) saturate(1.05) contrast(1.02);
}
.epilogue::after{ content: ""; display: block; clear: both; }

/* Epilogue closer: "Charlee's to tell" with a round Mister cameo, then a small break */
.closer-tell{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.closer-tell p{ margin: 0; }
.epilogue-closer .closer-mister{
  display: block;
  width: 108px;
  height: 108px;
  max-width: none;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  flex-shrink: 0;
  object-fit: cover;
  -webkit-mask-image: radial-gradient(circle, #000 58%, transparent 78%);
  mask-image: radial-gradient(circle, #000 58%, transparent 78%);
}
.epilogue-closer .next-book{ margin-top: 26px; }
.epilogue-closer .next-book::before{
  content: "\2726\00a0\00a0\2726\00a0\00a0\2726";
  display: block;
  color: var(--gold);
  font-size: 0.8rem;
  margin-bottom: 18px;
}

/* Not Quite page: "The Complete Solution" in teal, a little larger */
.section-label.on-miss{ color: var(--teal); font-size: 0.95rem; }

/* Epilogue page header: every line outlined in barn red (--burgundy, #7a1710), like the bonus card on the results page */
.epilogue .epilogue-head .bonus-label{
  text-shadow:
    1.2px 0 0 var(--burgundy), -1.2px 0 0 var(--burgundy),
    0 1.2px 0 var(--burgundy), 0 -1.2px 0 var(--burgundy),
    1px 1px 0 var(--burgundy), -1px 1px 0 var(--burgundy),
    1px -1px 0 var(--burgundy), -1px -1px 0 var(--burgundy);
}
.epilogue .epilogue-head h2{
  text-shadow:
    2px 0 0 var(--burgundy), -2px 0 0 var(--burgundy),
    0 2px 0 var(--burgundy), 0 -2px 0 var(--burgundy),
    1.5px 1.5px 0 var(--burgundy), -1.5px 1.5px 0 var(--burgundy),
    1.5px -1.5px 0 var(--burgundy), -1.5px -1.5px 0 var(--burgundy),
    0 3.5px 0 var(--burgundy);
}
.epilogue .epilogue-head .sub{
  text-shadow:
    2px 0 0 var(--burgundy), -2px 0 0 var(--burgundy),
    0 2px 0 var(--burgundy), 0 -2px 0 var(--burgundy),
    1.5px 1.5px 0 var(--burgundy), -1.5px 1.5px 0 var(--burgundy),
    1.5px -1.5px 0 var(--burgundy), -1.5px -1.5px 0 var(--burgundy),
    0 3.5px 0 var(--burgundy);
}

/* Entry page: one-time spelling recheck for near-miss answers */
.recheck-note{
  margin: 0 0 14px;
  padding: 12px 16px;
  text-align: center;
  background: var(--burgundy);
  color: var(--cream);
  border: 1px solid var(--gold);
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.45;
  text-wrap: balance;
}
.ledger-field.needs-check{
  background: #f7c28f; /* soft orange, stands out clearly from the cream ledger */
  box-shadow: inset 0 0 0 2px var(--burgundy);
  border-radius: 2px;
}
.ledger-field.needs-check .ledger-label{ color: var(--burgundy); }
.ledger-field.needs-check .ledger-label,
.ledger-field.needs-check input{ padding-left: 10px; }
.ledger-field.needs-check input{ padding-bottom: 8px; }

/* Footer: small sassy Merriweather */
footer.site-foot .f-mascot{
  display: block;
  height: 64px;
  width: auto;
  margin: 0 auto 8px;
}

/* Epilogue: "break the seal" opening (plays once, right after the email unlock) */
html.seal-lock, html.seal-lock body{ overflow: hidden; }
.seal-overlay{
  --w: min(440px, 86vw);
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 42%, #11666a 0%, var(--teal-dark) 55%, #021c1d 100%);
  overflow: hidden;
  font-family: 'Lora', Georgia, serif;
  animation: sealFadeIn .5s ease both;
}
.seal-overlay::before{ /* a soft spotlight */
  content: ""; position: absolute; left: 50%; top: 46%; width: 140vmax; height: 140vmax;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(227,196,106,0.16) 0%, rgba(227,196,106,0) 32%);
  pointer-events: none;
}
.seal-stage{ position: relative; display: flex; flex-direction: column; align-items: center; perspective: 1400px; }
.seal-kicker{
  margin: 0 0 22px; color: var(--gold-light); text-transform: uppercase;
  letter-spacing: 0.2em; font-size: calc(var(--w) * 0.03); font-weight: 600; text-align: center;
  animation: sealRise .6s .25s ease both;
}
.seal-kicker::before, .seal-kicker::after{ content: "\2726"; color: var(--gold); margin: 0 0.8em; }
.seal-hint{
  margin: 26px 0 0; color: var(--cream); font-style: italic; font-weight: 600;
  font-size: calc(var(--w) * 0.05); text-align: center;
  animation: sealRise .6s 1.15s ease both, hintPulse 2.2s 1.8s ease-in-out infinite;
}
.seal-env{
  position: relative; width: var(--w); height: calc(var(--w) * 0.68);
  transform-style: preserve-3d;
  animation: envDrop 1s .1s cubic-bezier(.3,1.35,.5,1) both, envThunk .35s .78s ease both;
}
.env-back{
  position: absolute; inset: 0; border-radius: 6px;
  background: linear-gradient(180deg, #b99556, #cfae6e);
  box-shadow: 0 22px 50px rgba(0,0,0,0.45), 0 4px 10px rgba(0,0,0,0.3);
}
.env-letter{
  position: absolute; left: 6%; right: 6%; bottom: 5%; height: 88%;
  background: var(--cream); border-radius: 3px; padding: 5% 6%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  text-align: center; z-index: 1;
  transition: transform .8s cubic-bezier(.2,.8,.3,1);
}
.letter-head{
  display: block; background: var(--teal); border: 2px solid var(--gold); border-radius: 3px;
  padding: 5% 4%; box-shadow: 0 0 0 3px var(--cream), 0 0 0 4px var(--gold);
}
.letter-head span{ display: block; line-height: 1.2; }
.letter-label{ color: var(--gold-light); text-transform: uppercase; letter-spacing: 0.16em; font-size: calc(var(--w) * 0.026); font-weight: 600; }
.letter-title{ color: var(--cream); font-family: 'Anton', Impact, sans-serif; text-transform: uppercase; letter-spacing: 0.04em; font-size: calc(var(--w) * 0.068); margin: 3% 0; }
.letter-sub{ color: var(--gold-light); font-family: 'Condiment', cursive; font-size: calc(var(--w) * 0.06); }
.letter-line{ margin: 6% 0 0; color: var(--burgundy); font-style: italic; font-weight: 600; font-size: calc(var(--w) * 0.036); }
.env-front{
  position: absolute; inset: 0; z-index: 2; border-radius: 6px;
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
  background:
    linear-gradient(to top right, transparent calc(50% - 1px), rgba(90,60,20,0.25) 50%, transparent calc(50% + 1px)) left bottom / 50% 50% no-repeat,
    linear-gradient(to top left, transparent calc(50% - 1px), rgba(90,60,20,0.25) 50%, transparent calc(50% + 1px)) right bottom / 50% 50% no-repeat,
    linear-gradient(180deg, #e4c98f, #d7b878);
}
.env-tag{
  position: absolute; left: 6%; bottom: 9%;
  font-family: 'Courier New', Courier, monospace; font-weight: 700; color: #3b2a14;
  font-size: calc(var(--w) * 0.028); line-height: 1.35; letter-spacing: 0.04em;
  background: #f6ecd2; padding: 1.4% 2.4%; border: 1px solid rgba(59,42,20,0.35);
  transform: rotate(-1.5deg);
}
.env-stamp{
  position: absolute; right: 5%; bottom: 10%;
  font-family: 'Anton', Impact, sans-serif; text-transform: uppercase; letter-spacing: 0.1em;
  font-size: calc(var(--w) * 0.045); color: var(--burgundy);
  border: 3px double var(--burgundy); padding: 0.5% 3%; border-radius: 4px;
  opacity: 0.85; transform: rotate(-11deg);
  -webkit-mask-image: repeating-radial-gradient(circle at 30% 40%, #000 0 2px, rgba(0,0,0,0.75) 2px 3px);
          mask-image: repeating-radial-gradient(circle at 30% 40%, #000 0 2px, rgba(0,0,0,0.75) 2px 3px);
  animation: stampThunk .4s .62s cubic-bezier(.5,0,.75,1.4) both;
}
.env-flap{
  position: absolute; left: 0; right: 0; top: 0; height: 100%; z-index: 3;
  clip-path: polygon(0 0, 100% 0, 50% 58%);
  background: linear-gradient(180deg, #d9bb7c, #c9a663);
  transform-origin: 50% 0;
  transition: transform .6s cubic-bezier(.4,0,.2,1);
  filter: drop-shadow(0 3px 2px rgba(0,0,0,0.25));
}
.seal-btn{
  position: absolute; left: 50%; top: 55%; z-index: 4;
  width: calc(var(--w) * 0.3); height: calc(var(--w) * 0.3);
  margin: calc(var(--w) * -0.15) 0 0 calc(var(--w) * -0.15);
  padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
  animation: sealBeckon 3s 2s ease-in-out infinite;
}
.seal-btn:focus-visible{ outline: 3px solid var(--gold-light); outline-offset: 6px; }
.seal-btn:hover .seal-piece{ filter: brightness(1.08); }
.seal-piece, .seal-cracks{ position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.seal-piece{ filter: drop-shadow(0 4px 4px rgba(0,0,0,0.35)); }
.seal-glow{
  position: absolute; inset: -30%; border-radius: 50%;
  background: radial-gradient(circle, rgba(227,196,106,0.6) 0%, rgba(227,196,106,0) 62%);
  animation: glowPulse 2.2s 1.4s ease-in-out infinite both;
}
.seal-cracks polyline{
  fill: none; stroke: #1f0402; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: var(--len); stroke-dashoffset: var(--len);
}
.seal-skip{
  position: absolute; right: 16px; bottom: 16px; z-index: 2;
  background: transparent; color: var(--cream); border: 1px solid rgba(227,196,106,0.6);
  font-family: 'Lora', Georgia, serif; font-size: 0.85rem; padding: 6px 14px; border-radius: 3px; cursor: pointer;
  opacity: 0.75;
}
.seal-skip:hover{ opacity: 1; }
.seal-crumb, .seal-spark, .seal-flash{ position: absolute; pointer-events: none; z-index: 5; }
.seal-crumb{ background: #7d1a12; border-radius: 40%; box-shadow: inset -1px -1px 0 rgba(0,0,0,0.3); }
.seal-spark{ line-height: 1; text-shadow: 0 0 6px rgba(227,196,106,0.8); }
.seal-flash{
  width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  border: 3px solid var(--gold-light); box-shadow: 0 0 30px 8px rgba(227,196,106,0.7);
  animation: flashRing .7s ease-out forwards;
}

/* The sequence after a tap */
.cracking .seal-btn{ animation: sealShake .5s ease both; }
.cracking .seal-glow{ animation: glowHot .5s ease both; }
.cracking .seal-cracks polyline{ transition: stroke-dashoffset .42s ease-in; stroke-dashoffset: 0; }
.broken .seal-cracks, .broken .seal-glow{ opacity: 0; transition: opacity .15s; }
.broken .seal-env{ animation: envJolt .35s ease both; }
.broken .seal-hint{ animation: none; opacity: 0; transition: opacity .3s; }
.broken .seal-kicker{ animation: none; opacity: 0; transition: opacity .3s; }
.opening .env-flap{ transform: rotateX(180deg); }
.flap-back .env-flap{ z-index: 0; }
.letter-out .env-letter{ transform: translateY(-62%); }
.revealing{ animation: sealFadeOut .75s ease forwards; }
.revealing .seal-stage{ transition: transform .75s cubic-bezier(.5,0,.3,1); transform: scale(1.35) translateY(-6%); }

/* After the overlay lifts: the chapter header glows into place */
html.seal-revealed .epilogue-head{ animation: headReveal 1.1s ease both; }
.epilogue-head h2:focus{ outline: none; }

@keyframes sealFadeIn{ from{ opacity: 0; } to{ opacity: 1; } }
@keyframes sealFadeOut{ to{ opacity: 0; visibility: hidden; } }
@keyframes sealRise{ from{ opacity: 0; transform: translateY(10px); } to{ opacity: 1; transform: none; } }
@keyframes envDrop{ from{ opacity: 0; transform: translateY(-70vh) rotate(-9deg); } 70%{ opacity: 1; } to{ opacity: 1; transform: rotate(-1.2deg); } }
@keyframes envThunk{ 0%{ transform: rotate(-1.2deg); } 35%{ transform: rotate(-1.2deg) translateY(4px) scale(0.985); } 100%{ transform: rotate(-1.2deg); } }
@keyframes stampThunk{ from{ opacity: 0; transform: rotate(-20deg) scale(2.6); } to{ opacity: 0.85; transform: rotate(-11deg) scale(1); } }
@keyframes hintPulse{ 0%,100%{ opacity: 1; } 50%{ opacity: 0.55; } }
@keyframes glowPulse{ 0%,100%{ opacity: 0.55; transform: scale(0.92); } 50%{ opacity: 1; transform: scale(1.08); } }
@keyframes glowHot{ to{ opacity: 1; transform: scale(1.35); } }
@keyframes sealBeckon{ 0%,82%,100%{ transform: rotate(0); } 86%{ transform: rotate(-7deg) scale(1.04); } 90%{ transform: rotate(6deg) scale(1.04); } 94%{ transform: rotate(-3deg); } }
@keyframes sealShake{
  0%{ transform: scale(0.93); } 20%{ transform: scale(0.95) rotate(-5deg) translateX(-2px); }
  40%{ transform: scale(0.96) rotate(5deg) translateX(2px); } 60%{ transform: scale(0.98) rotate(-4deg); }
  80%{ transform: scale(1.03) rotate(3deg); } 100%{ transform: scale(1.06); }
}
@keyframes envJolt{ 0%{ transform: rotate(-1.2deg); } 30%{ transform: rotate(-1.2deg) translateY(7px); } 100%{ transform: rotate(-1.2deg); } }
@keyframes flashRing{ from{ opacity: 1; transform: scale(0.5); } to{ opacity: 0; transform: scale(9); } }
@keyframes headReveal{
  0%{ opacity: 0; transform: scale(0.94); box-shadow: 0 0 0 4px var(--cream), 0 0 0 5.5px var(--gold), 0 0 60px 20px rgba(227,196,106,0.9); }
  60%{ opacity: 1; transform: scale(1.01); }
  100%{ transform: scale(1); box-shadow: 0 0 0 4px var(--cream), 0 0 0 5.5px var(--gold), 0 0 0 0 rgba(227,196,106,0); }
}

/* Reduce Motion: the envelope simply appears; a tap draws the cracks, the pieces part a little and fade,
   with a soft glow and a few twinkles, then the flap opens (no shake, flying pieces, flash ring or zoom) */
.seal-softglow{
  position: absolute; pointer-events: none; z-index: 4;
  width: 170px; height: 170px; margin: -85px 0 0 -85px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,243,201,0.85) 0%, rgba(227,196,106,0.55) 30%, rgba(227,196,106,0) 66%);
  animation: softGlow 1.2s ease-out forwards;
}
@keyframes softGlow{ 0%{ opacity: 0; transform: scale(0.7); } 35%{ opacity: 1; } 100%{ opacity: 0; transform: scale(1.25); } }
.seal-overlay.calm .seal-env, .seal-overlay.calm .env-stamp, .seal-overlay.calm .seal-kicker,
.seal-overlay.calm .seal-btn, .seal-overlay.calm .seal-glow{ animation: none; }
.seal-overlay.calm .seal-hint{ animation: none; }
.seal-overlay.calm.revealing .seal-stage{ transform: none; }
.seal-overlay.calm.revealing{ animation-duration: .5s; }
@media (prefers-reduced-motion: reduce){
  html.seal-revealed .epilogue-head{ animation: none; }
}

/* Epilogue part headings (The Whodunit / The Epilogue), 2026-11-21 */
.epilogue h3.part-head{
  clear: both;
  text-align: center;
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 1.05rem;
  color: var(--teal);
  margin: 30px 0 16px;
}
.epilogue h3.part-head:first-of-type{ margin-top: 4px; }
.epilogue h3.part-head::before{ content: "\2726\00a0\00a0"; color: var(--gold); }
.epilogue h3.part-head::after{ content: "\00a0\00a0\2726"; color: var(--gold); }
.epilogue h3.part-head + p::first-letter{
  font-family: 'Anton', sans-serif;
  font-size: 2.6rem;
  float: left;
  line-height: 0.8;
  padding-right: 8px;
  padding-top: 4px;
  color: var(--burgundy);
}

/* Mobile overrides — kept last so they win the cascade over same-specificity base rules */
@media (max-width: 560px){
  .frame{ padding: 30px 20px 30px; }
  .wrap{ padding: 16px 12px 40px; }
  .corner{ width: 56px; height: 56px; }
  /* Header: Merriweather on top, then the series name, centered on two tidy lines */
  .eyebrow{
    flex-direction: column;
    gap: 4px;
    white-space: normal;
    text-align: center;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
  }
  .eyebrow-icon{ height: 60px; }
  .eyebrow .eb-series{ display: block; font-size: 1.45em; letter-spacing: 0.14em; line-height: 1.25; }
  .eyebrow .eb-kind{ display: block; }

  .verdict .ribbon.win{ padding: 14px 24px 12px; }
  .verdict .ribbon.win::before{ left: -18px; width: 18px; }
  .verdict .ribbon.win::after{ right: -18px; width: 18px; }
  .win-main{ font-size: 2.15rem; }
  .win-accent{ font-size: 1.4rem; }
  .epilogue-teaser .sub{ font-size: 2rem; }
  .epilogue-gate button{ font-size: 0.8rem; padding: 13px 12px; letter-spacing: 0.03em; }
  .story-art.right, .story-art.left{ float: none; width: 220px; margin: 6px auto 20px; }
}

/* Answer block on phones and small tablets: one field per line, label above its writing line */
@media (max-width: 700px){
  .ledger-fields{ grid-template-columns: 1fr; margin: 0 16px; padding: 2px 0 16px; }
  .ledger-field{ border-left: none; padding-top: 14px; }
  .ledger-label,
  .ledger-field:first-child .ledger-label{ padding: 0 0 2px; border-bottom: none; font-size: 0.7rem; }
  .ledger-field input,
  .ledger-field:first-child input{
    padding: 6px 4px 5px;
    border-bottom: 2px solid var(--ink);
    font-size: 1rem; /* 16px keeps iPhones from zooming in when a box is tapped */
  }
  .ledger-field.needs-check{ padding: 10px 10px 8px; margin-top: 10px; }
  .ledger-field.needs-check .ledger-label,
  .ledger-field.needs-check input{ padding-left: 0; }
}

/* Larger screens: scale the whole page up proportionally so it fills laptops, desktops and iPads in landscape */
@media (min-width: 1000px){
  .wrap{ zoom: 1.15; }
}
@media (min-width: 1400px){
  .wrap{ zoom: 1.3; }
}
