/* =================================================================
   eliazile's den — one stylesheet for the whole room.
   Cozy hand-drawn Capoo-comic look: wobbly outlines, round shapes,
   cream walls, warm wood, a night sky through the window.
   ================================================================= */
:root {
  --line: #3f3a39;
  --lw: 3.2px;
  --ink: #4a3b33;
  --ink-soft: #93806d;
  --cream: #fffaf3;
  --paper: #fffdf7;
  --wood: #cf9a68;
  --wood-d: #b07a4a;
  --wood-l: #e0b384;
  --blue: #5ec6e8;
  --pink: #f6b7c2;
  --red: #e9827a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body {
  font-family: "Mali", system-ui, sans-serif;
  color: var(--ink);
  background: #ece0cb;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
img { max-width: 100%; }

/* =================================================================
   Capoo
   ================================================================= */
.capoo { display: block; width: 100%; height: auto; overflow: visible; filter: url(#boil1); animation: boil 0.54s steps(1, end) infinite; }
.capoo .cp-body { fill: var(--blue); stroke: var(--line); stroke-width: 3.2; stroke-linejoin: round; }
.capoo .cp-stripe { fill: none; stroke: #2b8db5; stroke-width: 4; stroke-linecap: round; }
.capoo .cp-line { fill: none; stroke: var(--line); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.capoo .cp-line.thick { stroke-width: 3.6; }
.capoo .cp-eye { fill: var(--line); }
.capoo .cp-white { fill: #fff; stroke: var(--line); stroke-width: 2.8; }
.capoo .cp-shine { fill: #fff; }
.capoo .cp-mouth { fill: #d0606b; stroke: var(--line); stroke-width: 2.8; stroke-linejoin: round; }
.capoo .cp-tongue { fill: #f4a0ab; }
.capoo .cp-tear { fill: #d6f2ff; stroke: var(--line); stroke-width: 2; }
.capoo .cp-spark { fill: #ffe066; }
.capoo .cp-snot { fill: rgba(222, 245, 255, 0.92); stroke: var(--line); stroke-width: 2.2; transform-box: fill-box; transform-origin: 0% 50%; animation: snot 3.2s ease-in-out infinite; }
.capoo .cp-box { fill: #f0d682; stroke: var(--line); stroke-width: 3.2; stroke-linejoin: round; }
.capoo .cp-flap { fill: #e8c96c; stroke: var(--line); stroke-width: 3.2; stroke-linejoin: round; }
.capoo .cp-eye { transform-box: fill-box; transform-origin: center; }

.capoo .face { display: none; }
.capoo .f-open { display: inline; }
[data-face]:not([data-face="open"]) .capoo .f-open { display: none; }
[data-face="teary"] .capoo .f-teary,
[data-face="happy"] .capoo .f-happy,
[data-face="sleep"] .capoo .f-sleep { display: inline; }
[data-face="teary"] .capoo { animation: boil 0.54s steps(1, end) infinite, tremble 0.3s linear infinite; }
[data-face="teary"] .capoo .cp-tear { animation: tear 1.1s ease-in infinite; }
.blink .capoo .f-open .cp-eye { transform: scaleY(0.12); }

@keyframes boil { 0% { filter: url(#boil1); } 33% { filter: url(#boil2); } 66% { filter: url(#boil3); } }
@keyframes snot { 50% { transform: scale(1.7); } }
@keyframes tremble { 25% { translate: 0.7px 0; } 75% { translate: -0.7px 0; } }
@keyframes tear { 0% { transform: translateY(-3px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(8px); opacity: 0; } }

/* =================================================================
   Front door
   ================================================================= */
.door {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 45%, #fffdf6, #f3e6d0 62%, #e3cfae);
  transition: opacity 0.8s ease, visibility 0.8s;
  outline: none;
}
.door.gone { opacity: 0; visibility: hidden; }
.door-card { text-align: center; animation: bob 2.8s ease-in-out infinite; }
.door-cat { width: 190px; margin: 0 auto 10px; }
.door-title { font-family: "Gaegu", sans-serif; font-weight: 700; font-size: clamp(2.6rem, 7vw, 3.6rem); color: var(--line); }
.door-hint { font-family: "Gaegu", sans-serif; font-size: 21px; color: var(--ink-soft); animation: pulse 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-9px); } }
@keyframes pulse { 50% { opacity: 0.45; } }

/* =================================================================
   Stage: fixed design size, scaled to fit. Wide = landscape, tall = portrait.
   ================================================================= */
.viewport { position: fixed; inset: 0; overflow: hidden; }
body.editing.is-reading .viewport { display: none; }
.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 50% 50%;
  opacity: 0;
  transition: opacity 0.9s ease 0.15s;
}
body.entered .stage { opacity: 1; }
body.is-reading .viewport, body.is-reading .dust, body.is-reading .night { display: none; }

.stage.land { --floor: 742px; }
.stage.port { --floor: 992px; }

/* wall + floor stretch far past the stage so any screen shape is covered */
.wall, .floor { position: absolute; left: -3000px; right: -3000px; }
.wall {
  top: -3000px;
  bottom: calc(100% - var(--floor));
  background:
    radial-gradient(circle at 50% 92%, rgba(255, 226, 176, 0.9), rgba(255, 220, 165, 0) 660px),
    url("/paper.svg") 0 0 / 200px 200px,
    radial-gradient(circle, rgba(120, 100, 80, 0.1) 1.4px, transparent 2px) 0 0 / 56px 56px,
    linear-gradient(#f0e6d3, #fbf4e7 62%);
}
.floor {
  top: var(--floor);
  bottom: -3000px;
  background:
    repeating-linear-gradient(90deg, transparent 0 168px, rgba(63, 58, 57, 0.75) 168px 170.5px),
    url("/grain.svg") 0 0 / 260px 260px,
    linear-gradient(var(--wood), var(--wood-d) 460px);
  border-top: var(--lw) solid var(--line);
}
.baseboard {
  position: absolute;
  left: -3000px;
  right: -3000px;
  top: calc(var(--floor) - 20px);
  height: 24px;
  background: #efe3cf;
  border-top: var(--lw) solid var(--line);
  border-bottom: var(--lw) solid var(--line);
}

/* ---------- fairy lights ---------- */
.fairy { position: absolute; z-index: 2; height: 62px; }
.fairy svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fairy path { fill: none; stroke: var(--line); stroke-width: 2; vector-effect: non-scaling-stroke; }
.fairy span {
  position: absolute;
  width: 12px;
  height: 15px;
  margin: -2px 0 0 -6px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: var(--c);
  border: 2px solid var(--line);
  box-shadow: 0 0 12px 3px color-mix(in srgb, var(--c) 70%, transparent);
  animation: glow 2.8s ease-in-out infinite alternate;
}
.fairy span::before { content: ""; position: absolute; left: 3px; top: -5px; width: 4px; height: 5px; border-radius: 1px; background: var(--line); }
@keyframes glow { from { opacity: 0.55; } to { opacity: 1; } }
.land .fairy { left: 90px; top: 20px; width: 1420px; }
.port .fairy { left: 14px; top: 16px; width: 512px; height: 46px; }

/* ---------- placed art ---------- */
.art { position: absolute; z-index: 3; }
.art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.art-window { filter: url(#boil2); }
.art-frame1, .art-frame2, .art-frame3, .art-clock { filter: url(#boil3); }
.art-lamp { filter: url(#boil1); }
.art-plant { filter: url(#boil2); }

.land .art-window { left: 120px; top: 96px; width: 330px; height: 300px; }
.land .art-frame1 { left: 1102px; top: 132px; width: 104px; height: 130px; }
.land .art-frame2 { left: 1232px; top: 168px; width: 88px; height: 88px; }
.land .art-frame3 { left: 1090px; top: 306px; width: 128px; height: 92px; }
.land .art-clock { left: 1360px; top: 104px; width: 84px; height: 84px; }
.land .art-lamp { left: 1224px; top: 352px; width: 150px; height: 400px; }
.land .art-plant { left: 118px; top: 470px; width: 228px; height: 300px; }

.port .art-window { left: 26px; top: 58px; width: 232px; height: 180px; }
.port .art-frame1 { left: 330px; top: 96px; width: 92px; height: 116px; }
.port .art-frame2 { left: 436px; top: 122px; width: 78px; height: 78px; }
.port .art-frame3 { display: none; }
.port .art-clock { display: none; }
.port .art-lamp { display: none; }
.port .art-plant { display: none; }

/* ---------- name sign ---------- */
.shelf-wrap {
  position: absolute;
  z-index: 5;
  left: 50%;
  width: 540px;
  margin-left: -270px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.land .shelf-wrap { top: 44px; }
.port .shelf-wrap { top: 248px; }

.sign {
  padding: 10px 32px 6px;
  border-radius: 999px;
  background: #fffdf7;
  border: 4px solid var(--line);
  box-shadow: 0 6px 0 rgba(63, 58, 57, 0.18);
  margin-bottom: 84px;
  filter: url(#boil3);
  max-width: 100%;
}
.sign span {
  font-family: "Gaegu", sans-serif;
  font-weight: 700;
  font-size: 40px;
  line-height: 1.15;
  color: var(--line);
  white-space: nowrap;
}
.port .sign { padding: 8px 22px 4px; margin-bottom: 74px; }
.port .sign span { font-size: 30px; }

/* ---------- bookcase ---------- */
.bookcase { position: relative; width: 500px; --bw: 54px; }
.bookcase::after {
  content: "";
  position: absolute;
  left: -26px;
  right: -26px;
  bottom: -18px;
  height: 34px;
  border-radius: 50%;
  background: rgba(70, 45, 25, 0.22);
  filter: blur(7px);
  z-index: -1;
}

.case-top {
  position: relative;
  z-index: 4;
  height: 28px;
  margin: 0 -14px;
  border-radius: 12px;
  background: linear-gradient(var(--wood-l), var(--wood));
  border: var(--lw) solid var(--line);
}
.case-top::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 6px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.35);
}

.deco { position: absolute; display: block; }
.deco svg { display: block; width: 100%; height: 100%; overflow: visible; }
.deco-jar { left: 26px; bottom: 100%; width: 58px; height: 74px; margin-bottom: 2px; filter: url(#boil1); }
.deco-mini { left: 96px; bottom: 100%; width: 68px; height: 78px; margin-bottom: 2px; filter: url(#boil2); }
.deco-bookend { left: 6px; bottom: 18px; width: 52px; height: 78px; filter: url(#boil3); }
.deco-candle { right: 6px; bottom: 18px; width: 62px; height: 80px; filter: url(#boil1); }
.deco-lying { left: 2px; bottom: 20px; width: 76px; height: 56px; filter: url(#boil2); }
.deco-globe { right: 2px; bottom: 20px; width: 66px; height: 76px; filter: url(#boil3); }

.case-body {
  position: relative;
  padding: 0 16px;
  background: linear-gradient(90deg, var(--wood-l) 0 16px, var(--wood) 16px calc(100% - 16px), var(--wood-l) calc(100% - 16px));
  border-left: var(--lw) solid var(--line);
  border-right: var(--lw) solid var(--line);
}
/* inner back wall */
.case-body::before {
  content: "";
  position: absolute;
  inset: 0 16px;
  background: #8a5f3d;
  border-left: var(--lw) solid var(--line);
  border-right: var(--lw) solid var(--line);
}

.shelf {
  position: relative;
  z-index: 2;
  height: 268px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  padding: 0 4px 20px;
  box-shadow: inset 0 20px 0 -12px rgba(40, 20, 10, 0.3);
}
.shelf::after {
  content: "";
  position: absolute;
  left: -16px;
  right: -16px;
  bottom: 0;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(#efc79a, var(--wood) 55%, var(--wood-d));
  border-top: var(--lw) solid var(--line);
  border-bottom: var(--lw) solid var(--line);
  z-index: 5;
}

.case-feet { display: flex; justify-content: space-between; padding: 0 14px; position: relative; z-index: 1; }
.case-feet span {
  width: 30px;
  height: 18px;
  border-radius: 0 0 10px 10px;
  background: var(--wood-d);
  border: var(--lw) solid var(--line);
  border-top: none;
}

/* ---------- books ---------- */
.books { display: flex; align-items: flex-end; gap: 6px; position: relative; z-index: 3; }

.book {
  position: relative;
  display: block;
  width: var(--bw);
  height: calc(var(--h) * 226px);
  flex-shrink: 0;
  text-decoration: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 3;
}
.book-in {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-origin: 50% 100%;
  transition: transform 0.55s cubic-bezier(0.25, 1.35, 0.4, 1), filter 0.4s ease;
}
.book.out .book-in { transform: translateY(-18px) scale(1.06); filter: drop-shadow(0 14px 12px rgba(50, 20, 5, 0.35)); }
.book.picked .book-in { transform: translateY(-34px) scale(1.12); transition-duration: 0.45s; }
.book.lean-l .book-in { transform: rotate(-2.4deg); transform-origin: 0% 100%; }
.book.lean-r .book-in { transform: rotate(2.4deg); transform-origin: 100% 100%; }

.spine {
  position: absolute;
  inset: 0;
  border-radius: 12px 12px 6px 6px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.34) 0 18%, rgba(255, 255, 255, 0.06) 40%, rgba(0, 0, 0, 0.05) 75%), var(--c);
  border: var(--lw) solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 0;
  overflow: hidden;
  filter: url(#boil2);
}
.book.out .spine { filter: url(#boil1); box-shadow: 0 0 0 3px #fffdf0, 0 0 22px rgba(255, 232, 170, 0.8); }
.spine .band { width: 100%; height: 3px; flex-shrink: 0; background: var(--line); opacity: 0.55; }
.spine .band.low { position: absolute; bottom: 14px; }
.sticker {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 12px 0 10px;
  border-radius: 50%;
  background: #fffdf7;
  border: 2.6px solid var(--line);
}
.sticker svg { width: 19px; height: 19px; fill: var(--line); stroke: var(--line); stroke-width: 0.6; }
.spine .title {
  writing-mode: vertical-rl;
  font-family: "Gaegu", sans-serif;
  font-weight: 700;
  font-size: 23px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--line);
}
.bookcase.crowded .spine .title { font-size: 19px; }
.bookcase.crowded .sticker { width: 26px; height: 26px; }
.bookcase.crowded .sticker svg { width: 15px; height: 15px; }
.top-pages {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 2px;
  height: 0;
  border-radius: 6px 6px 0 0;
  background: repeating-linear-gradient(90deg, #fffdf7 0 3px, #ded3bf 3px 4px);
  border: 2px solid var(--line);
  border-bottom: none;
  transform: translateY(-100%);
  transition: height 0.5s cubic-bezier(0.25, 1.35, 0.4, 1);
}
.book.out .top-pages, .book.picked .top-pages { height: 8px; }
.ribbon {
  position: absolute;
  top: -11px;
  left: 64%;
  width: 8px;
  height: 20px;
  background: var(--r);
  border: 2px solid var(--line);
  border-bottom: none;
  clip-path: polygon(0 0, 50% 24%, 100% 0, 100% 100%, 0 100%);
}
.book:focus-visible .spine { outline: 3px solid #fff; outline-offset: 4px; }

/* new-book button (edit mode only) */
.add-book {
  display: none;
  margin-top: 26px;
  padding: 8px 20px;
  border-radius: 999px;
  border: 3px dashed var(--line);
  background: #fffdf7;
  font-family: "Gaegu", sans-serif;
  font-weight: 700;
  font-size: 22px;
  cursor: pointer;
}
body.editing .add-book { display: block; }
.add-book:hover { background: #fff3d8; }

/* ---------- resting Capoo ---------- */
.rester {
  position: absolute;
  z-index: 4;
  right: 10px;
  top: -58px;
  width: 100px;
  transform-origin: 50% 100%;
  transition: transform 0.3s cubic-bezier(0.5, 0, 0.5, 1), opacity 0.2s;
  animation: snooze 3.6s ease-in-out infinite;
}
.rester.away { transform: translateY(16px) scaleY(0.35); opacity: 0; animation: none; }
@keyframes snooze { 50% { transform: scale(1.025, 1.05); } }

/* ---------- peeking Capoo (pops up from behind the bookcase) ---------- */
.peeker {
  --x: 250px;
  position: absolute;
  z-index: 3;
  left: 0;
  top: 3px;
  width: 0;
  height: 0;
  pointer-events: none;
  transform: translateX(var(--x));
}
.peek-clip {
  position: absolute;
  left: -50px;
  bottom: 0;
  width: 100px;
  height: 100px;
  overflow: hidden;
}
.peek-head {
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100px;
  transform: translateY(104%);
  transition: transform 0.2s cubic-bezier(0.5, 0, 0.75, 0);
}
.peeker.up .peek-head { transform: translateY(0); transition: transform 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
.peek-paws {
  position: absolute;
  z-index: 6;
  left: -50px;
  top: -11px;
  width: 100px;
  opacity: 0;
  transform: translateY(10px) scaleY(0.6);
  transform-origin: 50% 100%;
  transition: opacity 0.1s, transform 0.15s;
}
.peeker.up .peek-paws { opacity: 1; transform: none; transition: opacity 0.12s 0.14s, transform 0.32s cubic-bezier(0.2, 1.8, 0.4, 1) 0.14s; }
.peeker.wiggle .peek-head { animation: wiggle 0.65s ease-in-out; }
@keyframes wiggle {
  0%, 100% { rotate: 0deg; }
  20% { rotate: -8deg; }
  45% { rotate: 7deg; }
  70% { rotate: -4deg; }
}

.bubble {
  position: absolute;
  z-index: 7;
  left: 50px;
  bottom: 62px;
  padding: 4px 14px;
  border-radius: 18px;
  background: #fffdf7;
  border: 3px solid var(--line);
  font-family: "Gaegu", sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--line);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px) scale(0.72);
  transform-origin: 0% 100%;
  transition: opacity 0.2s, transform 0.3s cubic-bezier(0.3, 1.7, 0.5, 1);
}
.bubble::after {
  content: "";
  position: absolute;
  left: -10px;
  bottom: 12px;
  width: 12px;
  height: 12px;
  background: #fffdf7;
  border-left: 3px solid var(--line);
  border-bottom: 3px solid var(--line);
  transform: rotate(45deg);
}
.bubble.show { opacity: 1; transform: none; }
.peeker.bl .bubble { left: auto; right: 50px; transform-origin: 100% 100%; }
.peeker.bl .bubble::after { left: auto; right: -10px; border-left: none; border-bottom: none; border-right: 3px solid var(--line); border-top: 3px solid var(--line); }
.peeker:not(.up) .bubble { opacity: 0; }

/* ---------- rug, cushion, sleeping Capoo ---------- */
.art-rug { left: 50%; margin-left: -380px; width: 760px; height: 150px; z-index: 6; }
.land .art-rug { top: 766px; width: 720px; margin-left: -360px; height: 132px; }
.port .art-rug { top: 1032px; width: 560px; margin-left: -280px; height: 120px; }

.art-zabuton { width: 240px; height: 70px; z-index: 7; }
.land .art-zabuton { left: 880px; top: 806px; width: 216px; height: 63px; }
.port .art-zabuton { left: 262px; top: 1082px; width: 210px; height: 62px; }

.sleeper { position: absolute; z-index: 8; cursor: pointer; }
.land .sleeper { left: 900px; top: 750px; width: 184px; }
.port .sleeper { left: 280px; top: 1032px; width: 176px; }
.sleeper-body { animation: nap 3.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes nap { 50% { transform: scale(1.025, 1.05); } }
.sleeper.poked .sleeper-body { animation: poke 0.5s ease-in-out, nap 3.4s ease-in-out 0.5s infinite; }
@keyframes poke { 30% { transform: scale(1.1, 0.85); } 60% { transform: scale(0.95, 1.1) translateY(-7px); } }

.zzz { position: absolute; left: 66%; top: -42px; width: 80px; height: 90px; pointer-events: none; }
.zzz span {
  position: absolute;
  left: 0;
  bottom: 0;
  font-family: "Gaegu", sans-serif;
  font-weight: 700;
  color: var(--line);
  opacity: 0;
  animation: zzz 3.6s ease-in-out infinite;
}
.zzz span:nth-child(1) { font-size: 24px; }
.zzz span:nth-child(2) { font-size: 31px; animation-delay: 1.2s; }
.zzz span:nth-child(3) { font-size: 38px; animation-delay: 2.4s; }
@keyframes zzz {
  0% { transform: translate(0, 12px) rotate(-8deg) scale(0.6); opacity: 0; }
  15% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(44px, -64px) rotate(10deg) scale(1.1); opacity: 0; }
}

/* ---------- floor things ---------- */
.art-mug { width: 70px; height: 76px; z-index: 8; }
.land .art-mug { left: 742px; top: 800px; width: 62px; height: 68px; }
.port .art-mug { left: 158px; top: 1104px; width: 56px; height: 62px; }

.art-pile { width: 100px; height: 70px; z-index: 8; }
.land .art-pile { left: 812px; top: 808px; width: 86px; height: 60px; }
.port .art-pile { left: 224px; top: 1112px; width: 80px; height: 56px; }

.art-keyboard { width: 300px; height: 122px; z-index: 9; }
.land .art-keyboard { left: 372px; top: 786px; width: 268px; height: 108px; }
.port .art-keyboard { left: 20px; top: 1010px; width: 226px; height: 92px; }

.art-switches { width: 130px; height: 84px; z-index: 9; }
.land .art-switches { left: 296px; top: 816px; width: 116px; height: 74px; }
.port .art-switches { left: 208px; top: 1112px; width: 100px; height: 64px; }

.art-keycap { width: 74px; height: 74px; z-index: 9; }
.land .art-keycap { left: 664px; top: 802px; width: 64px; height: 64px; }
.port .art-keycap { left: 322px; top: 1122px; width: 54px; height: 54px; }

/* soft glow animations in the art */
.lamp-glow { animation: flick 7s ease-in-out infinite; }
@keyframes flick { 50% { opacity: 0.82; } }
.candle-glow { animation: flick 3.2s ease-in-out infinite; }
.flame { transform-origin: 35px 32px; animation: flame 1.6s ease-in-out infinite; }
.flame2 { transform-origin: 35px 32px; animation: flame 1.6s ease-in-out infinite reverse; }
@keyframes flame { 25% { transform: scale(0.92, 1.06) rotate(-4deg); } 60% { transform: scale(1.05, 0.95) rotate(3deg); } }
.steam { animation: steam 3.4s ease-in-out infinite; }
.steam path:nth-child(2) { animation-delay: -1.1s; }
@keyframes steam { 50% { opacity: 0.15; transform: translateY(-4px); } }
.teru { transform-origin: 165px 20px; animation: teru 5s ease-in-out infinite; }
@keyframes teru { 50% { transform: rotate(3.5deg); } }
.cable { animation: cable 4s ease-in-out infinite; }
@keyframes cable { 50% { transform: translateX(3px); } }

/* ---------- bottom text ---------- */
.bottom-text { position: absolute; z-index: 10; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.land .bottom-text { top: 902px; }
.port .bottom-text { top: 1158px; gap: 4px; padding: 0 18px; }

.hint span {
  display: inline-block;
  padding: 5px 22px;
  border-radius: 999px;
  background: #fffdf7;
  border: 3px solid var(--line);
  font-family: "Gaegu", sans-serif;
  font-weight: 700;
  font-size: 23px;
  color: var(--line);
  filter: url(#boil3);
}
.port .hint span { font-size: 18px; padding: 4px 14px; text-align: center; white-space: nowrap; }
.foot { font-family: "Gaegu", sans-serif; font-size: 19px; color: rgba(74, 59, 51, 0.65); }
.port .foot { font-size: 16px; }

/* =================================================================
   Wall switch + lights out
   ================================================================= */
.switch {
  position: absolute;
  z-index: 9;
  width: 42px;
  height: 62px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fffdf7;
  border: var(--lw) solid var(--line);
  cursor: pointer;
  transition: transform 0.18s;
  filter: url(#boil1);
}
.switch .toggle {
  width: 16px;
  height: 28px;
  border-radius: 5px;
  border: 2.6px solid var(--line);
  background: linear-gradient(#fff 0 50%, #e0d3bd 50%);
}
body.dark .switch .toggle { background: linear-gradient(#e0d3bd 0 50%, #fff 50%); }
.switch:hover { transform: rotate(-4deg) scale(1.06); }
.land .switch { left: 1078px; top: 430px; }
.port .switch { left: 470px; top: 226px; width: 34px; height: 52px; }

.night {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  background: #0a0912;
  transition: opacity 0.32s steps(3, end);
}
body.dark .night { opacity: 0.95; }
body.dark .switch, body.dark .sound-toggle, body.dark .lock-btn { z-index: 45; }
body.dark .art, body.dark .sleeper, body.dark .rester { filter: brightness(0.12); }

.eyes { position: fixed; inset: 0; z-index: 44; pointer-events: none; }
.eyes .eye {
  position: absolute;
  width: calc(var(--s) * 26px);
  height: calc(var(--s) * 34px);
  margin: calc(var(--s) * -17px) 0 0 calc(var(--s) * -13px);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #fff 0 34%, #fff6c0 52%, #ffe066 70%);
  box-shadow: 0 0 calc(var(--s) * 10px) #fff3a0, 0 0 calc(var(--s) * 28px) rgba(255, 230, 110, 0.55);
  transform: scale(0);
  animation: eyesPop 0.45s cubic-bezier(0.2, 1.9, 0.4, 1) forwards, eyesBlink 4s ease-in-out infinite;
}
@keyframes eyesPop { 0% { transform: scale(0); } 60% { transform: scale(1.4); } 100% { transform: scale(1); } }
@keyframes eyesBlink { 0%, 90%, 100% { scale: 1 1; } 94% { scale: 1 0.08; } }

.dust { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 11; pointer-events: none; }

/* =================================================================
   Buttons
   ================================================================= */
.pill {
  padding: 8px 22px;
  border-radius: 999px;
  border: 3px solid var(--line);
  background: #fffdf7;
  color: var(--line);
  font-family: "Gaegu", sans-serif;
  font-weight: 700;
  font-size: 22px;
  box-shadow: 0 4px 0 var(--line);
  cursor: pointer;
  transition: transform 0.14s, box-shadow 0.14s;
}
.pill:hover, .pill:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 0 var(--line); outline: none; }
.pill:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
.pill.small { font-size: 19px; padding: 6px 16px; }
.pill.ghost { background: transparent; box-shadow: none; border-style: dashed; }

.sound-toggle, .lock-btn {
  position: fixed;
  right: 16px;
  z-index: 50;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--line);
  background: #fffdf7;
  box-shadow: 0 4px 0 var(--line);
  font-size: 1.15rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.14s;
}
.sound-toggle { bottom: 16px; }
.lock-btn { bottom: 74px; font-size: 1rem; }
.sound-toggle:hover, .lock-btn:hover { transform: translateY(-2px); }
.lock-btn.unlocked { background: #fff0b8; }

/* =================================================================
   Opened book page
   ================================================================= */
.reading {
  position: relative;
  z-index: 20;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 26px 20px 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255, 244, 214, 0.9), transparent 70%),
    url("/paper.svg") 0 0 / 200px 200px,
    radial-gradient(circle, rgba(120, 100, 80, 0.1) 1.4px, transparent 2px) 0 0 / 56px 56px,
    #f0e6d3;
}
.reading[hidden] { display: none; }

.reading-top, .flip-nav { width: min(1020px, 100%); display: flex; gap: 12px; align-items: center; }
.reading-top { justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; }
.flip-nav { justify-content: space-between; margin-top: 22px; }
.book-tools { display: none; gap: 10px; }
body.editing .book-tools.on { display: flex; }

.open-book {
  position: relative;
  width: min(1020px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  padding: 16px;
  border-radius: 26px;
  background: var(--c, #f6b7c2);
  border: var(--lw) solid var(--line);
  box-shadow: 0 10px 0 var(--line), 0 30px 60px rgba(90, 40, 20, 0.25);
  animation: bookIn 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}
@keyframes bookIn { from { opacity: 0; transform: translateY(28px) scale(0.95); } }
.open-book.turn { animation: turn 0.5s ease both; }
@keyframes turn { 40% { opacity: 0; transform: translateX(-10px); } 41% { transform: translateX(10px); } 100% { opacity: 1; } }

.bk-page {
  position: relative;
  min-height: 540px;
  padding: 34px 38px 48px;
  background:
    repeating-linear-gradient(transparent 0 34px, rgba(120, 150, 190, 0.12) 34px 35px),
    var(--paper);
  border: 3px solid var(--line);
  font-size: 17px;
  line-height: 1.7;
  overflow-wrap: break-word;
}
.bk-page.left { border-radius: 16px 4px 4px 16px; box-shadow: inset -20px 0 24px -20px rgba(120, 70, 30, 0.4); }
.bk-page.right { border-radius: 4px 16px 16px 4px; border-left: none; box-shadow: inset 20px 0 24px -20px rgba(120, 70, 30, 0.4); }

.pg-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 18px; }
.pg-sticker {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--c, #f6b7c2);
  border: 3px solid var(--line);
  box-shadow: 0 3px 0 var(--line);
}
.pg-sticker svg { width: 26px; height: 26px; fill: var(--line); stroke: var(--line); stroke-width: 0.6; }
.bk-page h2 { font-family: "Gaegu", sans-serif; font-weight: 700; font-size: 54px; line-height: 1.05; color: var(--line); }
.bk-page h3 {
  font-family: "Gaegu", sans-serif;
  font-weight: 700;
  font-size: 30px;
  color: var(--line);
  margin: 4px 0 10px;
}
.bk-page p + p { margin-top: 10px; }

/* ---------- blocks ---------- */
.blk { position: relative; margin-bottom: 20px; }
.blk:last-child { margin-bottom: 0; }

.blk-text.style-note {
  padding: 12px 16px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--c, #f6b7c2) 26%, #fffdf7);
  border: 3px dashed color-mix(in srgb, var(--c, #f6b7c2) 60%, var(--line));
}
.blk-text.style-card {
  padding: 14px 18px;
  border-radius: 18px;
  background: #fff;
  border: 3px solid var(--line);
  box-shadow: 0 4px 0 rgba(63, 58, 57, 0.15);
}
.blk-text.style-card h3 { margin-top: 0; }

.entries { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.entries li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 18px;
  background: #fff;
  border: 3px solid var(--line);
  box-shadow: 0 3px 0 rgba(63, 58, 57, 0.12);
}
.entries strong { display: block; font-weight: 700; }
.entries small { display: block; color: var(--ink-soft); font-size: 14px; line-height: 1.4; }

.tag {
  flex-shrink: 0;
  padding: 2px 12px;
  border-radius: 999px;
  border: 2.5px solid var(--line);
  font-family: "Gaegu", sans-serif;
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
  color: var(--line);
  background: color-mix(in srgb, var(--c, #f6b7c2) 65%, #fff);
}

.facts { display: flex; flex-direction: column; gap: 8px; }
.facts.cards { display: grid; grid-template-columns: 1fr 1fr; }
.fact {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 16px;
  background: #fff;
  border: 3px solid var(--line);
}
.facts.cards .fact { flex-direction: column; gap: 0; }
.fact dt { color: var(--ink-soft); font-weight: 700; font-size: 14px; }
.fact dd { font-weight: 700; text-align: right; }
.facts.cards .fact dd { text-align: left; }

.review {
  padding: 14px 16px;
  margin-bottom: 12px;
  border-radius: 20px;
  background: #fff;
  border: 3px solid var(--line);
  box-shadow: 0 4px 0 rgba(63, 58, 57, 0.12);
}
.review-photo { display: block; width: 100%; max-height: 210px; object-fit: cover; border-radius: 14px; border: 2.5px solid var(--line); margin-bottom: 10px; }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.review-head strong { font-weight: 700; }
.rating { font-size: 20px; letter-spacing: 2px; color: #e3d8c8; }
.rating .on { color: #f5b942; }
.review p { font-size: 15px; color: #7d6352; }

.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shot {
  position: relative;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.16s;
}
.shot:hover { transform: translateY(-3px) rotate(-1deg); }
.shot img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.shot .ph { display: grid; place-items: center; aspect-ratio: 1; background: color-mix(in srgb, var(--c, #f6b7c2) 22%, #fff); }
.shot .ph svg { width: 34px; height: 34px; fill: var(--ink-soft); }
.shot figcaption { padding: 6px 10px 8px; font-size: 14px; line-height: 1.35; }

/* music */
.tracks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.track {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 18px;
  background: #fff;
  border: 3px solid var(--line);
  box-shadow: 0 3px 0 rgba(63, 58, 57, 0.12);
}
.track.shake { animation: shake 0.4s; }
@keyframes shake { 25% { translate: -4px 0; } 75% { translate: 4px 0; } }
.track .play {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  background: color-mix(in srgb, var(--c, #f6b7c2) 55%, #fff);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.track .play .ico { width: 0; height: 0; border-left: 10px solid var(--line); border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-left: 3px; }
.track.playing .play .ico { width: 8px; height: 10px; margin-left: 0; border: none; background: linear-gradient(90deg, var(--line) 0 3px, transparent 3px 5px, var(--line) 5px); }
.track-meta { flex: 1; min-width: 0; }
.track-meta strong { display: block; font-size: 15px; }
.track-meta small { color: var(--ink-soft); font-size: 13px; }
.track .bar { flex: 1; height: 8px; border-radius: 999px; background: #efe6d7; border: 2px solid var(--line); cursor: pointer; overflow: hidden; }
.track .bar i { display: block; width: 0; height: 100%; background: var(--c, #f6b7c2); }
.track .time { font-size: 12px; color: var(--ink-soft); min-width: 62px; text-align: right; font-variant-numeric: tabular-nums; }

.embed { position: relative; padding: 0; border-radius: 16px; overflow: hidden; border: 3px solid var(--line); background: #000; margin-bottom: 10px; }
.embed iframe { display: block; width: 100%; border: 0; height: 92px; }
.embed.tall iframe { height: 220px; }
.embed.music-embed iframe { height: 152px; }
.embed-cap { font-size: 14px; color: var(--ink-soft); }
.embed-bad { padding: 12px 14px; border: 3px dashed var(--line); border-radius: 14px; color: var(--ink-soft); font-size: 14px; }

/* socials */
.links { display: flex; flex-direction: column; gap: 10px; }
.link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 18px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  background: #fff;
  border: 3px solid var(--line);
  box-shadow: 0 3px 0 rgba(63, 58, 57, 0.14);
  transition: transform 0.15s;
}
.link-card:hover, .link-card:focus-visible { transform: translateY(-2px) rotate(-0.6deg); outline: none; }
.link-card .ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--c, #f6b7c2) 60%, #fff); border: 2.5px solid var(--line); flex-shrink: 0; }
.link-card svg { width: 19px; height: 19px; fill: var(--line); }
.link-card .lbl { flex: 1; }
.link-card .arrow { color: var(--ink-soft); }

/* reading list */
.reads { display: flex; flex-direction: column; gap: 12px; }
.read { display: flex; gap: 12px; padding: 12px; border-radius: 20px; background: #fff; border: 3px solid var(--line); box-shadow: 0 3px 0 rgba(63, 58, 57, 0.12); }
.read .cover { flex-shrink: 0; width: 74px; height: 104px; border-radius: 10px; object-fit: cover; border: 2.5px solid var(--line); }
.read .cover.ph { display: grid; place-items: center; background: color-mix(in srgb, var(--c, #f6b7c2) 25%, #fff); }
.read .cover.ph svg { width: 28px; height: 28px; fill: var(--ink-soft); }
.read-body { min-width: 0; flex: 1; }
.read-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.read-head strong { font-weight: 700; }
.read-body small { display: block; color: var(--ink-soft); font-size: 14px; }
.read-body p { margin-top: 6px; font-size: 14px; color: #7d6352; }

/* q&a */
.qa { margin-bottom: 14px; }
.qa .q, .qa .a { width: fit-content; max-width: 92%; padding: 8px 15px; border-radius: 20px; border: 3px solid var(--line); font-size: 15px; }
.qa .q { background: #fff; border-bottom-left-radius: 6px; font-weight: 700; }
.qa .a { margin: 6px 0 0 auto; background: color-mix(in srgb, var(--c, #f6b7c2) 55%, #fff); border-bottom-right-radius: 6px; text-align: right; }
.bk-page .qa p + p { margin-top: 6px; }

.doodle { display: grid; place-items: center; gap: 6px; min-height: 320px; align-content: center; opacity: 0.92; }
.doodle .capoo { width: 210px; }
.doodle p { font-family: "Gaegu", sans-serif; font-size: 20px; color: var(--ink-soft); }

/* =================================================================
   Edit mode
   ================================================================= */
.edit-bar {
  position: fixed;
  z-index: 60;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(-140%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 16px;
  border-radius: 999px;
  background: #fffdf7;
  border: 3px solid var(--line);
  box-shadow: 0 5px 0 var(--line);
  font-family: "Gaegu", sans-serif;
  font-size: 20px;
  transition: transform 0.28s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.edit-bar.on { transform: translateX(-50%) translateY(0); }
.edit-dot { width: 11px; height: 11px; border-radius: 50%; background: #7fd18b; border: 2px solid var(--line); animation: pulse 1.6s infinite; }
.edit-status { color: var(--ink-soft); font-size: 17px; }

.bk-page .blk.editable { outline: 3px dashed color-mix(in srgb, var(--line) 35%, transparent); outline-offset: 6px; border-radius: 10px; }
.blk-tools { position: absolute; top: -14px; right: -6px; display: none; gap: 6px; z-index: 5; }
body.editing .blk.editable:hover .blk-tools, body.editing .blk.editable:focus-within .blk-tools { display: flex; }

.mini {
  padding: 3px 11px;
  border-radius: 999px;
  border: 2.5px solid var(--line);
  background: #fffdf7;
  font-family: "Gaegu", sans-serif;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
}
.mini:hover { background: #fff2d6; }
.mini.danger { color: #b23b3b; }

.drawer {
  position: fixed;
  z-index: 70;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(430px, 100%);
  padding: 20px 20px 30px;
  background: #fffaf1;
  border-left: var(--lw) solid var(--line);
  box-shadow: -8px 0 30px rgba(60, 40, 20, 0.18);
  overflow-y: auto;
  transform: translateX(102%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.3, 1.1, 0.5, 1), visibility 0.32s;
}
.drawer.open { transform: none; visibility: visible; }
.drawer-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--line); background: #fff; cursor: pointer; }
.drawer h3 { font-family: "Gaegu", sans-serif; font-weight: 700; font-size: 30px; margin-bottom: 14px; padding-right: 40px; }
.drawer-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 3px dashed #e2d3bd; }

.fields { display: flex; flex-direction: column; gap: 14px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld-label { font-family: "Gaegu", sans-serif; font-size: 19px; font-weight: 700; color: var(--ink); }
.fld-hint { color: var(--ink-soft); font-size: 13px; }
.fld-in {
  width: 100%;
  padding: 9px 12px;
  border-radius: 14px;
  border: 2.5px solid var(--line);
  background: #fff;
  font-family: "Mali", inherit;
  font-size: 15px;
  color: var(--ink);
}
.fld-in:focus { outline: none; border-color: #e9827a; box-shadow: 0 0 0 3px rgba(233, 130, 122, 0.22); }
textarea.fld-in { resize: vertical; line-height: 1.5; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid var(--line); background: var(--s); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--line); }
.sticker-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.sticker-opt { width: 38px; height: 38px; border-radius: 50%; border: 2.5px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; }
.sticker-opt svg { width: 20px; height: 20px; fill: var(--ink); }
.sticker-opt.on { background: var(--pink); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--line); }
.star-pick { display: flex; gap: 4px; }
.star-pick button { font-size: 26px; line-height: 1; border: none; background: none; color: #ddd0bd; cursor: pointer; }
.star-pick button.on { color: #f5b942; }
.range-wrap { display: flex; align-items: center; gap: 10px; }
.fld-range { flex: 1; accent-color: #e9827a; }
.range-out { font-family: "Gaegu", sans-serif; font-size: 18px; width: 44px; }

.file-pick { border: 2.5px dashed var(--line); border-radius: 14px; padding: 10px; background: #fff; }
.file-pick > img { display: block; max-height: 120px; border-radius: 10px; margin-bottom: 8px; border: 2px solid var(--line); }
.file-name, .file-none { font-size: 13px; color: var(--ink-soft); word-break: break-all; }
.audio-chip { display: inline-block; font-size: 14px; padding: 4px 10px; border-radius: 999px; background: #eef6ff; border: 2px solid var(--line); }
.file-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.fld-file { font-size: 13px; max-width: 100%; }
.fld-progress { width: 100%; margin-top: 8px; accent-color: #7fd18b; }

.items { display: flex; flex-direction: column; gap: 10px; }
.item-card { border: 2.5px solid var(--line); border-radius: 16px; padding: 10px 12px; background: #fff; }
.item-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.item-n { flex: 1; font-family: "Gaegu", sans-serif; font-weight: 700; color: var(--ink-soft); }
.item-body { display: flex; flex-direction: column; gap: 10px; }
.add-item {
  margin-top: 4px;
  padding: 8px;
  border-radius: 14px;
  border: 2.5px dashed var(--line);
  background: #fff
  ;
  font-family: "Gaegu", sans-serif;
  font-weight: 700;
  font-size: 19px;
  cursor: pointer;
}

.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tpl {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px;
  border-radius: 16px;
  border: 2.5px solid var(--line);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.14s, background 0.14s;
}
.tpl:hover { transform: translateY(-3px) rotate(-1deg); background: #fff5dd; }
.tpl-icon { font-size: 22px; }
.tpl strong { font-family: "Gaegu", sans-serif; font-size: 21px; }
.tpl small { color: var(--ink-soft); font-size: 12.5px; line-height: 1.3; }

/* password modal */
.pw-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  background: rgba(30, 22, 14, 0.42);
  backdrop-filter: blur(3px);
}
.pw-modal.open { display: grid; }
.pw-card {
  width: min(340px, 90vw);
  padding: 24px 22px;
  border-radius: 26px;
  background: #fffaf1;
  border: var(--lw) solid var(--line);
  box-shadow: 0 8px 0 var(--line);
  text-align: center;
}
.pw-card.shake { animation: shake 0.4s; }
.pw-jp { font-size: 30px; }
.pw-card h3 { font-family: "Gaegu", sans-serif; font-size: 30px; margin-top: 4px; }
.pw-sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 14px; }
.pw-card input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  border: 3px solid var(--line);
  background: #fff;
  font-family: "Gaegu", sans-serif;
  font-size: 26px;
  letter-spacing: 0.3em;
  text-align: center;
}
.pw-card input:focus { outline: none; border-color: #e9827a; box-shadow: 0 0 0 3px rgba(233, 130, 122, 0.22); }
.pw-err { min-height: 20px; color: #b23b3b; font-size: 14px; margin: 6px 0; }
.pw-row { display: flex; justify-content: center; gap: 12px; }

/* =================================================================
   Page-transition wipe
   ================================================================= */
.wipe {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: grid;
  place-items: center;
  visibility: hidden;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #fffdf6, #f3e6d0 70%);
  clip-path: circle(0 at var(--x, 50%) var(--y, 50%));
}
.wipe.on { visibility: visible; clip-path: circle(150% at var(--x, 50%) var(--y, 50%)); transition: clip-path 0.55s cubic-bezier(0.65, 0, 0.35, 1); }
.wipe.on.out { clip-path: circle(0 at 50% 50%); transition: clip-path 0.48s cubic-bezier(0.65, 0, 0.35, 1); }
.wipe-cat { width: 140px; animation: bob 0.6s ease-in-out infinite; }

/* =================================================================
   Hand cursor (desktop): simple round hand + bare arm
   ================================================================= */
html.has-hand, html.has-hand * { cursor: none !important; }
.hand {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  will-change: transform;
}
.hand.on { opacity: 1; }
.hand .hi { transform-origin: var(--tipx) var(--tipy); transition: transform 0.18s cubic-bezier(0.3, 1.6, 0.5, 1); }
.hand.point .hi { transform: scale(1.08); }
.hand.down .hi { transform: scale(0.86) translateY(2px); }
.hand svg { display: block; overflow: visible; filter: drop-shadow(3px 4px 4px rgba(70, 40, 20, 0.25)); }

/* =================================================================
   Smaller screens
   ================================================================= */
@media (max-width: 780px) {
  .reading { padding: 16px 12px 90px; justify-content: flex-start; }
  .open-book { grid-template-columns: minmax(0, 1fr); padding: 10px; border-radius: 22px; }
  .bk-page { min-height: 0; padding: 24px 20px 40px; font-size: 16px; }
  .bk-page.left { border-radius: 16px 16px 4px 4px; box-shadow: none; }
  .bk-page.right { border-radius: 4px 4px 16px 16px; border: 3px solid var(--line); border-top: none; box-shadow: none; }
  .bk-page h2 { font-size: 40px; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .facts.cards { grid-template-columns: 1fr; }
  .flip-nav .pill { max-width: 47%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .drawer { width: 100%; border-left: none; border-top: var(--lw) solid var(--line); top: auto; height: 78vh; border-radius: 24px 24px 0 0; transform: translateY(102%); }
  .drawer.open { transform: none; }
  .edit-bar { width: calc(100% - 24px); justify-content: center; font-size: 18px; flex-wrap: wrap; }
  .book-tools { width: 100%; justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .capoo { filter: url(#boil1); }
}
