* {
  box-sizing: border-box;
}

:root {
  --scene-width: 1023;
  --scene-height: 1537;
  --gold: #d5aa4d;
  --cream: #f3e7d2;
  --burgundy: #84303d;
}

html,
body,
button,
a,
input,
textarea,
video,
iframe {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M4 2 L4 25 L10 19 L15 29 L19 27 L14 17 L23 17 Z' fill='%23f7efdc' stroke='%232d2725' stroke-width='2'/%3E%3C/svg%3E")
    4 2,
    auto;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: #151311;
  font-family: "Courier New", Courier, monospace;
}

.scene-wrap {
  display: flex;
  width: 100%;
  justify-content: center;
  overflow-x: auto;
  background: #151311;
}

.scene {
  position: relative;
  flex: 0 0 auto;
  width: min(1023px, 100vw);
  aspect-ratio: 1023 / 1537;
  overflow: hidden;
  background-image: url("images/top-scene.png?v=kindle-child-bunnies-1");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-shadow: 0 0 38px rgba(0, 0, 0, .58);
}

.device-screen {
  position: absolute;
  z-index: 20;
  overflow: hidden;
  background: #101010;
}

.device-screen[hidden],
.device-screen video[hidden],
.device-screen iframe[hidden] {
  display: none;
}

/* Exact inner LCD opening of the photographed Game Boy. */
.gameboy-screen {
  left: 15.64%;
  top: 15.88%;
  width: 18.08%;
  height: 10.08%;
  clip-path: polygon(
    0 16.1%,
    88.1% 0,
    100% 84.5%,
    17.3% 100%
  );
  background: #0d1113;
}

.gameboy-screen video,
.gameboy-screen iframe {
  position: absolute;
  left: -7%;
  top: -8%;
  width: 114%;
  height: 116%;
  object-fit: cover;
  border: 0;
  background: #0d1113;
  filter: brightness(.62) saturate(.82) contrast(.96);
  transform: rotate(-8.7deg) scale(1.07);
  transform-origin: 50% 50%;
}

.gameboy-screen video {
  touch-action: manipulation;
}

.camera-lcd {
  position: absolute;
  z-index: 21;
  left: 55.62%;
  top: 8.72%;
  width: 16.72%;
  height: 7.74%;
  overflow: hidden;
  clip-path: polygon(
    14% 0,
    100% 13.4%,
    83.6% 100%,
    0 79.8%
  );
  background: transparent;
}

.camera-lcd img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(.64) saturate(.80) contrast(.97);
}

.camera-lcd::after,
.photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(20, 16, 13, .13);
  mix-blend-mode: multiply;
}

/* Exact inner LCD opening of the photographed iPod. */
.ipod-screen {
  left: 42.91%;
  top: 19.19%;
  width: 14.76%;
  height: 8.72%;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  clip-path: polygon(
    0 3.7%,
    97.4% 0,
    100% 92.5%,
    .7% 100%
  );
  background: #c8cec0;
  filter: brightness(.70) saturate(.82) contrast(.94);
  box-shadow: inset 0 0 5px rgba(31, 31, 26, .28);
  touch-action: manipulation;
}

.ipod-inner {
  width: 103%;
  height: 103%;
  transform: rotate(-1.8deg) scale(1.015);
  transform-origin: center;
}

.ipod-top {
  display: flex;
  justify-content: space-between;
  padding: 2.4% 4%;
  font-size: clamp(5px, .50vw, 8px);
  font-weight: bold;
  border-bottom: 1px solid #7d8479;
  background: linear-gradient(#e4e8df, #b9c1b3);
}

.ipod-content {
  display: grid;
  grid-template-columns: 37% 1fr;
  gap: 6%;
  padding: 5.2%;
}

.ipod-content img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid #555;
}

.ipod-content div {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: 2%;
  font-size: clamp(5px, .52vw, 8px);
  line-height: 1.32;
}

.ipod-content strong,
.ipod-content span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ipod-progress-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4%;
  align-items: center;
  padding: 0 4% 4%;
  font-size: clamp(4px, .42vw, 7px);
}

.ipod-track {
  height: clamp(3px, .50vw, 7px);
  overflow: hidden;
  border: 1px solid #6d746a;
  border-radius: 4px;
  background: #b7c0b3;
}

.ipod-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(#608bb2, #315777);
}

.invisible-button,
.kindle-hotspot {
  position: absolute;
  z-index: 30;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  touch-action: manipulation;
}

.ipod-center-button {
  left: 46.2%;
  top: 31.7%;
  width: 6.7%;
  aspect-ratio: 1;
  border-radius: 50%;
}

.ipod-bottom-button {
  left: 47.2%;
  top: 35.7%;
  width: 4.7%;
  height: 2.7%;
  border-radius: 50%;
}
.kindle-hotspot {
  left: 55.2%;
  top: 38.7%;
  width: 23.8%;
  height: 24%;
  transform: rotate(6deg);
}

.photo-frame {
  position: absolute;
  z-index: 22;
  overflow: hidden;
  background: transparent;
}

.photo-frame img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(.64) saturate(.80) contrast(.97);
}

.photo-frame img[hidden],
.camera-lcd img[hidden],
.kindle-cover-frame img[hidden] {
  display: none;
}

/* Exact photographed openings for every replaceable photo. */
.friend-photo-one {
  left: 10.17%;
  top: 48.47%;
  width: 16.91%;
  height: 13.21%;
  clip-path: polygon(0 11.3%, 81.5% 0, 100% 83.3%, 17.9% 100%);
}

.friend-photo-two {
  left: 24.83%;
  top: 46.84%;
  width: 13.20%;
  height: 11.97%;
  clip-path: polygon(0 12.3%, 100% 0, 97.8% 94.6%, 23% 100%);
}

.friend-photo-three {
  left: 38.71%;
  top: 47.17%;
  width: 14.57%;
  height: 11.65%;
  clip-path: polygon(7.4% 0, 100% 7.3%, 87.9% 100%, 0 92.2%);
}

/* Jake's Polaroid photo opening, leaving the white border and kiss visible. */
.jake-photo {
  left: 79.96%;
  top: 40.14%;
  width: 17.50%;
  height: 14.44%;
  clip-path: polygon(17.3% 0, 100% 13.1%, 81.6% 100%, 0 85.6%);
}

/* Childhood opening measured from the actual scrapbook photo corners. */
.childhood-photo {
  left: 77.32%;
  top: 65.97%;
  width: 14.17%;
  height: 11.19%;
  clip-path: polygon(
    17.2% 0,
    100% 10.5%,
    89.7% 100%,
    0 87.8%
  );
  background: transparent;
}

.childhood-photo img {
  filter: grayscale(1) brightness(.64) contrast(1.04);
}


/* Optional Honeybun and Cinnabun locket charms on the ends of the BFF bracelet. */
.bunny-photo-charm {
  position: absolute;
  z-index: 25;
  width: 4.65%;
  aspect-ratio: 1;
  overflow: hidden;
  padding: .38%;
  border: 1px solid rgba(96, 69, 30, .9);
  border-radius: 50%;
  background: linear-gradient(145deg, #efd99d, #9b6926 58%, #e5c77c);
  box-shadow:
    2px 3px 6px rgba(0, 0, 0, .38),
    inset 0 1px 1px rgba(255, 255, 255, .35);
  pointer-events: none;
}

.bunny-photo-charm img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  filter: brightness(.66) saturate(.80) contrast(.98);
}

.bunny-photo-charm img[hidden] {
  display: none;
}

.honeybun-charm {
  left: 21.7%;
  top: 58.62%;
  transform: rotate(-9deg);
}

.cinnabun-charm {
  left: 48.1%;
  top: 58.72%;
  transform: rotate(8deg);
}

/* Kindle screen centered to match the photographed e-reader display.
   The black panel covers the original printed cover, while the uploaded
   book remains fully visible and centered with even screen margins. */
.kindle-cover-frame {
  position: absolute;
  z-index: 24;
  left: 60.66%;
  top: 41.98%;
  width: 14.23%;
  height: 12.23%;
  overflow: hidden;
  pointer-events: none;
background: #AD8F79;
transform: rotate(10deg);
  transform-origin: center;
}
.kindle-cover-frame::before {
  content: "";
  position: absolute;
top: 0;
bottom: 0;
left: 8%;
right: 8%;  background: #AD8F79;
  z-index: 0;
}

.kindle-cover-frame img {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 94%;
  height: 96%;
  object-fit: contain;
  object-position: center;
  transform: translate(-50%, -50%);
  filter: brightness(.65) saturate(.72) contrast(.98);
}

/* Editable writing placed on a fully opaque clean notebook sheet.
   The journal stays in the exact same position; only the entry copy scrolls. */
.journal-entry {
  position: absolute;
  z-index: 26;
  left: 20.80%;
  top: 64.45%;
  width: 25.80%;
  height: 27.15%;
  overflow: hidden;
  padding: 2.1% 1.45% 1.1% 1.7%;
  color: #342d27;
  transform: rotate(-6.15deg);
  transform-origin: center;
  isolation: isolate;
  opacity: 1;
  display: flex;
  flex-direction: column;
  background-color: #c9b8a0;
  background-image:
    linear-gradient(100deg, rgba(255,255,255,.08), rgba(93,66,47,.04)),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 7.45%,
      rgba(105, 88, 73, .30) 7.65%,
      transparent 7.90%
    );
  border: 1px solid rgba(91, 68, 51, .24);
  border-radius: 1.8%;
  box-shadow:
    inset 0 0 12px rgba(67, 49, 39, .16),
    0 0 1px rgba(31, 22, 17, .35);
  pointer-events: auto;
}

.journal-entry::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 18%, rgba(255,255,255,.09), transparent 24%),
    radial-gradient(circle at 76% 68%, rgba(84,60,44,.045), transparent 28%);
  pointer-events: none;
}

.journal-date {
  flex: 0 0 auto;
  margin: 0 0 .58em;
  font-family: "Bradley Hand", "Comic Sans MS", cursive;
  font-size: clamp(9px, 1.30vw, 18px);
  line-height: 1.15;
}

.journal-copy {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-right: .35em;
  white-space: pre-line;
  font-family: "Bradley Hand", "Comic Sans MS", cursive;
  font-size: clamp(7px, .94vw, 14px);
  line-height: 1.54;
  scrollbar-width: none;
}

.journal-copy::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.guestbook-hotspot {
  left: 1.2%;
  top: 81.1%;
  width: 20%;
  height: 12.9%;
}

/* Easter egg hotspots deliberately have no visible labels or hover outlines. */
.key-hotspot {
  left: 61%;
  top: 22.5%;
  width: 16.5%;
  height: 18.2%;
  transform: rotate(-8deg);
}

.kiss-hotspot {
  left: 80%;
  top: 52.0%;
  width: 15.5%;
  height: 5.2%;
  transform: rotate(4deg);
}

.croissant-hotspot {
  left: 51.5%;
  top: 68.8%;
  width: 35%;
  height: 26%;
  overflow: visible;
}

.croissant-hotspot.bitten {
  animation: croissant-wiggle .35s ease;
}

@keyframes croissant-wiggle {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-1.2deg) scale(.995); }
  65% { transform: rotate(.8deg) scale(1.005); }
}


.croissant-hotspot:focus,
.key-hotspot:focus,
.kiss-hotspot:focus {
  outline: none;
}

/* Old Windows-style guestbook */
dialog {
  width: min(430px, calc(100% - 24px));
  padding: 0;
  border: 3px outset #aaa;
  background: #c0c0c0;
  box-shadow: 10px 12px 22px rgba(0, 0, 0, .55);
}

dialog::backdrop {
  background: rgba(0, 0, 0, .42);
}

.guestbook-window {
  margin: 0;
}

.window-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 7px;
  color: white;
  font-family: Arial, sans-serif;
  font-size: .78rem;
  font-weight: bold;
  background: linear-gradient(90deg, #173d7a, #2e75c6);
}

.window-title button {
  width: 22px;
  height: 21px;
  padding: 0;
  color: #111;
  font-weight: bold;
  border: 2px outset #ddd;
  background: #c0c0c0;
}

.window-body {
  padding: 15px;
  font-size: .78rem;
}

.window-body label {
  display: block;
  margin: 10px 0;
}

.optional-label {
  color: #5a5a5a;
  font-size: .68rem;
}

.window-body input,
.window-body textarea {
  width: 100%;
  margin-top: 4px;
  padding: 6px;
  border: 2px inset #ddd;
  background: white;
}

.window-body textarea {
  min-height: 90px;
  resize: vertical;
}

.submit-button {
  padding: 6px 12px;
  border: 2px outset #ddd;
  background: #c0c0c0;
}

/* Shared guestbook history */
#guestbook-dialog {
  width: min(680px, calc(100% - 24px));
  max-height: min(88vh, 720px);
  overflow: hidden;
}

.guestbook-window {
  width: 100%;
}

.guestbook-body {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 14px;
  max-height: min(76vh, 625px);
  overflow: auto;
}

.guestbook-sign-panel,
.guestbook-history-section {
  min-width: 0;
}

.guestbook-sign-panel > p {
  margin-top: 0;
}

#guestbook-response {
  min-height: 2.6em;
  margin: 9px 0 0;
  line-height: 1.35;
}

.guestbook-history-section {
  display: flex;
  min-height: 330px;
  flex-direction: column;
  padding: 8px;
  border: 2px inset #ddd;
  background: #efefef;
}

.guestbook-history-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 7px;
  font-family: Arial, sans-serif;
}

.guestbook-refresh-button {
  padding: 3px 7px;
  border: 2px outset #ddd;
  background: #c0c0c0;
  font-size: .68rem;
}

.guestbook-refresh-button:active:not(:disabled),
.submit-button:active:not(:disabled) {
  border-style: inset;
}

.guestbook-refresh-button:disabled,
.submit-button:disabled {
  color: #777;
}

.guestbook-history {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 430px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 7px;
  border: 2px inset #ddd;
  background: white;
  scrollbar-color: #808080 #dfdfdf;
  scrollbar-width: thin;
}

.guestbook-entry {
  margin: 0 0 9px;
  padding: 9px;
  border: 1px solid #b8b8a5;
  background: #fffde8;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, .12);
}

.guestbook-entry:last-child {
  margin-bottom: 0;
}

.guestbook-entry-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 5px;
  border-bottom: 1px dotted #9d9d8e;
  font-family: Arial, sans-serif;
}

.guestbook-entry-header strong {
  overflow-wrap: anywhere;
}

.guestbook-entry-header time {
  flex: 0 0 auto;
  color: #666;
  font-size: .64rem;
}

.guestbook-entry p {
  margin: 7px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.guestbook-history-status {
  margin: 0;
  padding: 14px 8px;
  color: #555;
  text-align: center;
  line-height: 1.45;
}

@media (max-width: 640px) {
  #guestbook-dialog {
    width: calc(100% - 14px);
    max-height: 92vh;
  }

  .guestbook-body {
    grid-template-columns: 1fr;
    max-height: 82vh;
  }

  .guestbook-history-section {
    min-height: 270px;
  }

  .guestbook-history {
    max-height: 300px;
  }
}

/* Cursor sparkle trail */
.cursor-sparkle {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  animation: sparkle-fade .72s forwards;
}

.cursor-sparkle.gold {
  color: var(--gold);
}

.cursor-sparkle.cream {
  color: var(--cream);
}

.cursor-sparkle.burgundy {
  color: var(--burgundy);
}

@keyframes sparkle-fade {
  from {
    opacity: .95;
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }

  to {
    opacity: 0;
    transform: translate(-50%, -95%) scale(.25) rotate(100deg);
  }
}

/* Mobile: preserve the exact composition while scaling every overlay together. */
@media (max-width: 640px) {
  .scene {
    width: 100vw;
  }

  /* Slightly larger touch areas without changing the visible layout. */
  .ipod-center-button {
    width: 8.5%;
    margin-left: -1%;
    margin-top: -1%;
  }

  .ipod-bottom-button {
    width: 7%;
    height: 4%;
    margin-left: -1%;
    margin-top: -0.6%;
  }

  .key-hotspot,
  .kiss-hotspot,
  .croissant-hotspot,
  .guestbook-hotspot {
    touch-action: manipulation;
  }

  dialog {
    width: calc(100% - 18px);
  }

  .journal-entry {
    padding-top: 3%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-sparkle,
  .croissant-hotspot.bitten {
    animation: none;
  }
}

/* The scene and every interactive layer share the same aspect ratio on phones. */
@media (max-width: 600px) {
  .scene-wrap {
    overflow: hidden;
  }

  .scene {
    width: 100vw;
    max-width: 1023px;
  }

  .invisible-button {
    min-width: 26px;
    min-height: 26px;
  }
}


/* The screen itself is also a play/pause button. */
.ipod-screen:focus-visible {
  outline: 1px dotted rgba(244, 232, 205, .7);
  outline-offset: 2px;
}

.honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* =========================================================
   KAYLEE'S RECIPE BOX
   Added below the existing scene. None of the original scene
   dimensions, positions, or interactive layers are changed.
   ========================================================= */

.recipe-shelf {
  width: min(1023px, 100%);
  margin: 0 auto;
  padding: 46px 18px 64px;
  color: #3f2b24;
  text-align: center;
  border-top: 1px solid rgba(213, 170, 77, .45);
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 247, 224, .08) 0 2px, transparent 3px),
    radial-gradient(circle at 74% 62%, rgba(255, 247, 224, .06) 0 2px, transparent 3px),
    linear-gradient(rgba(37, 28, 24, .90), rgba(20, 17, 15, .96)),
    #151311;
  background-size: 52px 52px, 68px 68px, auto, auto;
}

.recipe-shelf-kicker {
  margin: 0 0 6px;
  color: #d8bd82;
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(.68rem, 1.4vw, .82rem);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.recipe-shelf-title {
  margin: 0 0 24px;
  color: #f3e7d2;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 4vw, 2.35rem);
  font-weight: normal;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}

.recipe-card-trigger {
  position: relative;
  display: inline-block;
  width: min(640px, 92vw);
  padding: 13px 13px 42px;
  color: #3d2d28;
  border: 1px solid #9f8c6f;
  background: #eee4cf;
  box-shadow:
    0 16px 25px rgba(0, 0, 0, .42),
    inset 0 0 0 3px rgba(255, 255, 255, .45);
  transform: rotate(-1.1deg);
  transition: transform .18s ease, box-shadow .18s ease;
}

.recipe-card-trigger::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 50%;
  top: -13px;
  width: 118px;
  height: 27px;
  background: rgba(215, 195, 151, .78);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
  transform: translateX(-50%) rotate(1.5deg);
}

.recipe-card-trigger:hover,
.recipe-card-trigger:focus-visible {
  transform: rotate(.15deg) translateY(-4px);
  box-shadow:
    0 20px 31px rgba(0, 0, 0, .48),
    inset 0 0 0 3px rgba(255, 255, 255, .5);
}

.recipe-card-trigger:focus-visible {
  outline: 2px dotted #f3e7d2;
  outline-offset: 7px;
}

.recipe-card-trigger img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(92, 76, 58, .38);
  filter: sepia(.05) contrast(.98) brightness(.95);
}

.recipe-card-trigger span {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 11px;
  font-family: "Comic Sans MS", "Bradley Hand", cursive;
  font-size: clamp(.78rem, 2vw, 1rem);
}

/* Large scrapbook-style recipe popup. */
#recipe-book-dialog {
  width: min(940px, calc(100% - 24px));
  max-width: 940px;
  max-height: min(88vh, 820px);
  padding: 0;
  overflow: hidden;
  color: #34251f;
  border: 2px solid #5b3b35;
  border-radius: 2px;
  background: #eadfc8;
  box-shadow: 14px 18px 42px rgba(0, 0, 0, .62);
}

#recipe-book-dialog::backdrop {
  background: rgba(13, 10, 9, .68);
  backdrop-filter: blur(1px);
}

.recipe-book-window {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 820px);
}

.recipe-book-titlebar {
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 8px 10px 8px 14px;
  color: #fff8e9;
  border-bottom: 2px solid #5b3b35;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .045) 0 4px, transparent 4px 8px),
    #84303d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  letter-spacing: .02em;
}

.recipe-book-close {
  flex: 0 0 auto;
  width: 29px;
  height: 27px;
  padding: 0;
  color: #2e241f;
  border: 2px outset #efe5d0;
  background: #d9ccb2;
  font-size: 1.15rem;
  font-weight: bold;
  line-height: 1;
}

.recipe-book-body {
  min-height: 0;
  overflow-y: auto;
  padding: 19px;
  background:
    linear-gradient(90deg, transparent 31px, rgba(159, 69, 69, .18) 32px, transparent 33px),
    repeating-linear-gradient(0deg, #f6ecd7 0 28px, #d4d8c1 29px);
}

.recipe-book-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0 0 17px;
  padding: 10px 12px;
  border: 1px solid #a48d68;
  background: rgba(245, 231, 199, .92);
  box-shadow: 3px 4px 0 rgba(79, 56, 43, .16);
}

.recipe-book-toolbar p {
  margin: 0;
  font-size: .72rem;
  line-height: 1.4;
}

.recipe-paper-button {
  padding: 7px 11px;
  color: #fff8e9;
  border: 1px solid #5e2b34;
  border-radius: 2px;
  background: #84303d;
  box-shadow: 2px 2px 0 rgba(69, 42, 35, .25);
  font-family: "Courier New", Courier, monospace;
  font-size: .72rem;
  font-weight: bold;
}

.recipe-paper-button.secondary {
  color: #3e2c24;
  border-color: #8c795d;
  background: #ded0b3;
}

.recipe-paper-button.danger {
  color: #6c2430;
  border-color: #9a6d6d;
  background: #ead1cb;
}

.recipe-paper-button:focus-visible,
.recipe-form input:focus,
.recipe-form textarea:focus {
  outline: 2px dotted #84303d;
  outline-offset: 2px;
}

.recipe-grid-popup {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}

.recipe-popup-card {
  position: relative;
  min-width: 0;
  padding: 11px;
  border: 1px solid #8b775c;
  background: rgba(255, 248, 229, .96);
  box-shadow: 4px 5px 0 rgba(76, 55, 42, .18);
}

.recipe-popup-card:nth-child(odd) {
  transform: rotate(-.35deg);
}

.recipe-popup-card:nth-child(even) {
  transform: rotate(.35deg);
}

.recipe-popup-photo {
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 3;
  place-items: center;
  overflow: hidden;
  color: #8c6f59;
  border: 1px solid #a18c6c;
  background: #e6dac0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
}

.recipe-popup-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-popup-copy h3 {
  margin: 10px 0 3px;
  color: #7c2f3c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
}

.recipe-popup-meta,
.recipe-popup-notes {
  margin: 4px 0;
  font-size: .72rem;
  line-height: 1.45;
}

.recipe-popup-stars {
  color: #a8791d;
  letter-spacing: .08em;
}

.recipe-popup-notes {
  min-height: 2.2em;
  font-family: "Comic Sans MS", "Bradley Hand", cursive;
}

.recipe-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.recipe-details {
  margin-top: 10px;
  border-top: 1px dashed #a58e70;
}

.recipe-details summary {
  padding: 8px 0 2px;
  color: #6e3340;
  font-size: .72rem;
  font-weight: bold;
}

.recipe-details-text {
  margin: 7px 0 2px;
  padding: 9px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid #c1ad89;
  background: #f7efd9;
  font-family: "Courier New", Courier, monospace;
  font-size: .7rem;
  line-height: 1.55;
}

.recipe-empty-state {
  grid-column: 1 / -1;
  padding: 35px 15px;
  text-align: center;
  border: 1px dashed #9f896b;
  background: rgba(255, 247, 226, .82);
  font-family: "Comic Sans MS", "Bradley Hand", cursive;
}

.recipe-editor {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid #8f775e;
  background: rgba(244, 229, 197, .97);
  box-shadow: 4px 5px 0 rgba(76, 55, 42, .16);
}

.recipe-editor[hidden] {
  display: none;
}

.recipe-editor h2 {
  margin: 0 0 12px;
  color: #7c2f3c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

.recipe-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, .75fr);
  gap: 12px 15px;
}

.recipe-form label,
.recipe-rating-label {
  display: block;
  color: #4a342b;
  font-size: .7rem;
  font-weight: bold;
}

.recipe-form .full-row {
  grid-column: 1 / -1;
}

.recipe-form input,
.recipe-form textarea {
  width: 100%;
  margin-top: 5px;
  padding: 8px;
  color: #34251f;
  border: 1px solid #927c5f;
  background: #fffaf0;
  font-family: "Courier New", Courier, monospace;
  font-size: .75rem;
}

.recipe-form textarea {
  min-height: 80px;
  resize: vertical;
}

#recipe-details-input {
  min-height: 155px;
}

.recipe-rating-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 5px;
}

.recipe-rating-choice {
  padding: 1px 2px;
  color: #a9997f;
  border: 0;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
}

.recipe-rating-choice.active {
  color: #a8791d;
  text-shadow: 0 1px 0 #fff;
}

.recipe-photo-preview {
  display: grid;
  width: 100%;
  min-height: 120px;
  margin-top: 7px;
  place-items: center;
  overflow: hidden;
  color: #7d6853;
  border: 1px dashed #9b8466;
  background: #e8dcc1;
  font-size: .7rem;
}

.recipe-photo-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.recipe-photo-preview img[hidden] {
  display: none;
}

.recipe-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.recipe-save-message {
  min-height: 1.25em;
  margin: 8px 0 0;
  color: #6d3d32;
  font-size: .7rem;
}

@media (max-width: 700px) {
  .recipe-shelf {
    padding-top: 34px;
  }

  .recipe-card-trigger {
    width: min(92vw, 640px);
    padding: 8px 8px 38px;
  }

  #recipe-book-dialog {
    width: calc(100% - 12px);
    max-height: 94vh;
  }

  .recipe-book-window {
    max-height: 94vh;
  }

  .recipe-book-body {
    padding: 12px;
  }

  .recipe-grid-popup,
  .recipe-form-grid {
    grid-template-columns: 1fr;
  }

  .recipe-form .full-row {
    grid-column: 1;
  }

  .recipe-popup-card:nth-child(n) {
    transform: none;
  }
}
/* Tiny tucked-away trinket frame */
.journal-animation-frame {
  position: absolute;
  z-index: 25;
  left: 41.1%;
  top: 93.4%;
  width: 7%;
  aspect-ratio: 1 / 1;
  padding: 0.42%;
  overflow: visible;

  border: 1px solid #4d3415;
  border-radius: 3px;
  transform: rotate(4deg);
  opacity: 0.94;

  background:
    linear-gradient(
      145deg,
      #5e4018 0%,
      #94702f 24%,
      #4b3112 48%,
      #806026 72%,
      #39250d 100%
    );

  box-shadow:
    1px 3px 5px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(218, 186, 112, 0.25),
    inset 0 -1px 2px rgba(38, 24, 7, 0.55);
}

/* Subtle inner engraved edge */
.journal-animation-frame::before {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: 2;
  border: 1px solid rgba(180, 138, 58, 0.45);
  border-radius: 2px;
  pointer-events: none;
}

/* Tiny loop at the top, like a hanging trinket */
.journal-animation-frame::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: -7px;
  width: 10px;
  height: 9px;
  border: 2px solid #63451b;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  transform: translateX(-50%);
  background: transparent;
  box-shadow: inset 0 1px rgba(196, 153, 68, 0.25);
}

.journal-animation-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid #3b270f;
  border-radius: 2px;
  filter: brightness(0.9) saturate(0.88);
}

@media (max-width: 640px) {
  .journal-animation-frame {
    left: 40.1%;
    top: 93.4%;
    width: 7.5%;
  }
}
/* =========================================================
   FINAL SCREEN + PHOTO ALIGNMENT
   Calibrated for the 1024 × 1536 background
   ========================================================= */

.scene {
  width: min(1024px, 100vw) !important;
  aspect-ratio: 2 / 3 !important;
}

/* -------------------------
   GAME BOY SCREEN
   ------------------------- */

.gameboy-screen {
  left: 16.113% !important;
  top: 15.495% !important;
  width: 18.75% !important;
  height: 12.109% !important;

  clip-path: polygon(
    86.98% 0%,
    0% 15.05%,
    14.58% 100%,
    100% 83.87%
  ) !important;
}

.gameboy-screen video,
.gameboy-screen iframe {
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;

  object-fit: cover !important;
  object-position: center !important;

  transform: none !important;
  transform-origin: center !important;
}

/* -------------------------
   CAMERA LCD
   ------------------------- */

.camera-lcd {
  left: 54.785% !important;
  top: 7.813% !important;
  width: 17.48% !important;
  height: 10.026% !important;

  clip-path: polygon(
    10.61% 0%,
    0% 83.77%,
    89.39% 100%,
    100% 15.58%
  ) !important;
}

.camera-lcd {
  background: #070707 !important;
}

.camera-lcd img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
}

/* -------------------------
   IPOD LCD
   ------------------------- */

.ipod-screen {
  left: 43.262% !important;
  top: 19.466% !important;
  width: 14.844% !important;
  height: 8.659% !important;

  clip-path: polygon(
    99.34% 0%,
    0% .75%,
    .66% 100%,
    100% 97.74%
  ) !important;
}

.ipod-inner {
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
}

/* -------------------------
   FRIEND POLAROID ONE
   ------------------------- */

.friend-photo-one {
  left: 10.547% !important;
  top: 49.023% !important;
  width: 16.992% !important;
  height: 13.346% !important;

  clip-path: polygon(
    79.89% 0%,
    0% 17.07%,
    20.69% 100%,
    100% 81.46%
  ) !important;
}

/* -------------------------
   FRIEND POLAROID TWO
   ------------------------- */

.friend-photo-two {
  left: 25.586% !important;
  top: 47.201% !important;
  width: 12.988% !important;
  height: 12.24% !important;

  clip-path: polygon(
    100% 0%,
    0% 16.49%,
    24.06% 100%,
    94.74% 93.09%
  ) !important;
}

/* -------------------------
   FRIEND POLAROID THREE
   ------------------------- */

.friend-photo-three {
  left: 39.063% !important;
  top: 47.591% !important;
  width: 14.453% !important;
  height: 11.914% !important;

  clip-path: polygon(
    10.81% 0%,
    0% 92.35%,
    89.19% 100%,
    100% 7.10%
  ) !important;
}

/* Make all three photos fully fill their openings. */

.friend-photo-one img,
.friend-photo-two img,
.friend-photo-three img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}

/* -------------------------
   JAKE'S POLAROID
   ------------------------- */

.jake-photo {
  left: 79.785% !important;
  top: 40.56% !important;
  width: 18.066% !important;
  height: 14.583% !important;

  clip-path: polygon(
    21.62% 0%,
    0% 85.71%,
    78.92% 100%,
    100% 15.63%
  ) !important;
}

.jake-photo img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}

/* =========================================================
   WATCH-ONLY LCD CLEANUP LAYER — V2
   This PNG is transparent everywhere except the inner LCD.
   ========================================================= */

.watch-lcd-cleaner {
  position: absolute;
  inset: 0;
  z-index: 39;

  display: block;
  width: 100%;
  height: 100%;

  border: 0;
  outline: 0;
  pointer-events: none;

  background-image:
    url("images/watch-lcd-clean-v2.png?v=20260802-0145");
  background-position: 0 0;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

/* =========================================================
   LIVE Y2K WATCH DISPLAY — V2
   Text only: the cleanup PNG supplies the LCD surface.
   ========================================================= */

.watch-display {
  position: absolute;
  z-index: 40;

  /* Exact bounding box of the photographed inner LCD */
  left: 87.793%;
  top: 31.380%;
  width: 7.715%;
  height: 3.841%;

  overflow: hidden;
  pointer-events: none;

  /* Exact four photographed LCD corners */
  clip-path: polygon(
    2.5% 0,
    100% 23.7%,
    82.3% 100%,
    0 74.6%
  );

  color: #5c3040;
  font-family: "Courier New", Courier, monospace;
  font-variant-numeric: tabular-nums;

  /* No rectangle or sticker background */
  background: transparent;
  box-shadow: none;
  filter: none;
  isolation: isolate;
}

.watch-display::before,
.watch-display::after {
  content: none;
  display: none;
}

.watch-inner {
  position: relative;
  z-index: 1;

  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 4%;
  padding: 8% 7% 7%;
  text-align: center;

  /* Aligns the digits to the physical LCD angle */
  transform: rotate(9.7deg) scale(.92);
  transform-origin: center;
}

/* Day and date */
.watch-inner > span {
  display: block;
  margin: 0;

  color: #6a3448;
  font-size: clamp(3px, .39vw, 6px);
  font-weight: bold;
  line-height: 1;
  letter-spacing: -.03em;
  white-space: nowrap;

  text-shadow:
    0 0 1px rgba(246, 205, 220, .80),
    0 0 2px rgba(213, 170, 77, .28);
}

.watch-clock {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  line-height: 1;
  white-space: nowrap;
}

/* Hour and minute */
.watch-clock strong {
  display: block;

  color: #48212f;
  font-size: clamp(7px, .90vw, 13px);
  font-weight: bold;
  line-height: .86;
  letter-spacing: -.10em;

  text-shadow:
    0 0 1px rgba(246, 205, 220, .86),
    0 0 3px rgba(213, 170, 77, .30);
}

/* Seconds */
.watch-clock small {
  display: block;
  margin: 0 0 .02em .12em;

  color: #663246;
  font-size: clamp(3px, .29vw, 5px);
  font-weight: bold;
  line-height: 1;

  text-shadow:
    0 0 1px rgba(246, 205, 220, .72);
}
.journal-entry {
  position: relative;
}

.journal-content {
  height: 100%;
}

.journal-text {
  max-height: 230px;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
}

.journal-arrow {
  position: absolute;
  top: 50%;
  z-index: 20;

  width: 34px;
  height: 28px;
  padding: 0;

  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(220, 215, 235, 0.95) 45%,
      rgba(173, 163, 196, 0.95) 52%,
      rgba(235, 225, 240, 0.95) 100%
    );

  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 1),
    inset 0 -2px 3px rgba(90, 70, 110, 0.25),
    0 2px 4px rgba(70, 50, 80, 0.28);

  color: #66526f;
  font-family: Arial, sans-serif;
  font-size: 21px;
  font-weight: bold;
  line-height: 24px;

  cursor: pointer;
  transform: translateY(-50%);
  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    opacity 0.15s ease;
}

.journal-arrow::after {
  content: "✦";
  position: absolute;
  top: -7px;
  right: -5px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 9px;
  text-shadow: 0 0 4px rgba(190, 160, 220, 0.9);
  pointer-events: none;
}

.journal-prev {
  left: 8px;
}

.journal-next {
  right: 8px;
}

.journal-arrow:hover:not(:disabled) {
  transform: translateY(-50%) scale(1.08);
  filter: brightness(1.08);
}

.journal-arrow:active:not(:disabled) {
  transform: translateY(-50%) scale(0.96);
}

.journal-arrow:disabled {
  opacity: 0.28;
  cursor: default;
  filter: grayscale(0.5);
}

.journal-counter {
  margin-top: 8px;
  text-align: center;
  font-size: 10px;
  opacity: 0.55;
}