:root {
  --cream: #fff7e8;
  --paper: #fffaf0;
  --ink: #3d281f;
  --brown: #6b3925;
  --brown-dark: #442419;
  --orange: #d8743f;
  --gold: #eab463;
  --green: #758256;
  --shadow: 0 20px 60px rgba(49, 25, 15, .24);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: #2c1812;
}
button { font: inherit; }
button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
[hidden] { display: none !important; }

.game { position: relative; width: 100%; height: 100%; overflow: hidden; background: #2c1812; }
.topbar {
  position: fixed;
  z-index: 30;
  inset: max(12px, env(safe-area-inset-top)) 18px auto 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.top-left { display: flex; align-items: center; gap: 9px; pointer-events: auto; }
.brand, .progress, .notebook-button, .click-counter, .music-button, .restart-button {
  pointer-events: auto;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(56, 29, 20, .78);
  color: white;
  box-shadow: 0 8px 28px rgba(22,10,6,.2);
  backdrop-filter: blur(14px);
}
.click-counter { position:relative; display:flex; align-items:center; justify-content:center; gap:3px; min-width:68px; height:50px; border-radius:16px; padding:0 9px; font-weight:900; }
.click-counter b { font-size:20px; line-height:1; }
.click-counter small { color:#f3d9c2; font-size:11px; }
.click-counter:hover .control-tooltip, .click-counter:focus-visible .control-tooltip { opacity:1; visibility:visible; transform:translate(-50%,0); }
.icon-control { position: relative; }
.scene-back-button, .restart-button {
  pointer-events: auto; display: grid; place-items: center; width: 50px; height: 50px;
  border: 1px solid rgba(255,255,255,.35); border-radius: 16px; padding: 0;
  color: white; background: rgba(56,29,20,.78); box-shadow: 0 8px 28px rgba(22,10,6,.2);
  backdrop-filter: blur(14px); cursor: pointer;
}
.scene-back-button:hover, .restart-button:hover { background: rgba(100,52,33,.92); }
.scene-back-button .control-icon { font: 500 25px/1 system-ui,sans-serif; }
.restart-icon { font:700 28px/1 system-ui,sans-serif; transform:translateY(-1px); }
.control-tooltip { position:absolute; z-index:80; top:calc(100% + 8px); left:50%; transform:translate(-50%,-4px); padding:7px 10px; border-radius:8px; color:#fff9ec; background:rgba(65,35,23,.96); box-shadow:0 5px 14px rgba(38,18,8,.24); font-size:12px; font-weight:800; white-space:nowrap; opacity:0; visibility:hidden; pointer-events:none; transition:opacity .18s ease,transform .18s ease,visibility .18s ease; }
.control-tooltip::before { content:""; position:absolute; left:50%; bottom:100%; transform:translateX(-50%); border:5px solid transparent; border-bottom-color:rgba(65,35,23,.96); }
.icon-control:hover .control-tooltip, .icon-control:focus-visible .control-tooltip, .notebook-back-button:hover .control-tooltip, .notebook-back-button:focus-visible .control-tooltip, .photo-return-button:hover .control-tooltip, .photo-return-button:focus-visible .control-tooltip { opacity:1; visibility:visible; transform:translate(-50%,0); }
.brand { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; padding: 6px; cursor:pointer; }
.brand:hover { background:rgba(100,52,33,.92); }
.brand-paw { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: #f3c078; }
.scene-menu { position:fixed; z-index:42; top:max(78px,calc(env(safe-area-inset-top) + 70px)); left:18px; width:min(560px,calc(100vw - 36px)); border:1px solid rgba(255,255,255,.72); border-radius:22px; padding:18px; color:#4c2b1e; background:rgba(255,250,236,.97); box-shadow:var(--shadow); backdrop-filter:blur(14px); }
.scene-menu p { margin:0 0 14px; line-height:1.65; font-size:14px; }
.scene-menu-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:8px; }
.scene-menu-grid button { display:grid; place-items:center; gap:5px; min-width:0; border:1px solid #e6c8a2; border-radius:14px; padding:10px 5px; color:#563223; background:#fffaf0; cursor:pointer; }
.scene-menu-grid button:hover { border-color:#b76038; background:#fff1d6; transform:translateY(-1px); }
.scene-menu-grid button span { font-size:24px; }
.scene-menu-grid button b { font-size:12px; }
.top-actions { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.music-button { position:relative; display:flex; align-items:center; justify-content:center; width:50px; height:50px; border-radius:16px; padding:0; cursor:pointer; }
.music-button:hover { background:rgba(100,52,33,.92); }
.music-cat { font-size:22px; line-height:1; }
.music-note { margin:-17px 0 0 -2px; color:#ffd58e; font-size:17px; font-weight:900; transform-origin:center bottom; animation:music-note-bob 1.1s ease-in-out infinite; }
.music-button[aria-pressed="false"] .music-note { opacity:.35; animation:none; }
.music-button[aria-pressed="false"]::after { content:""; position:absolute; width:29px; height:2px; border-radius:2px; background:#ffd7bd; transform:rotate(-42deg); }
.progress { border-radius: 999px; padding: 10px 14px; font-weight: 800; }
.progress span:first-child { color: #ffd58e; font-size: 19px; }
.notebook-button {
  position: relative; display: flex; align-items: center;
  border-radius: 15px; padding: 6px; cursor: pointer;
}
.notebook-button:hover { background: rgba(100, 52, 33, .92); }
.notebook-icon { position: relative; display: grid; place-items: center; width: 48px; height: 39px; border: 2px solid #774716; border-radius: 5px 10px 10px 5px; background: linear-gradient(145deg,#ffe478,#efb72f); box-shadow: inset 8px 0 #9b5d20, 0 2px 5px rgba(38,18,8,.3); }
.notebook-icon::before { content:""; position:absolute; left:5px; top:4px; bottom:4px; width:3px; border-radius:3px; background: repeating-linear-gradient(to bottom,#f7d378 0 3px,#704018 3px 6px); }
.notebook-label { display:grid; place-items:center; width:25px; height:23px; margin-left:7px; border:1px solid rgba(107,65,25,.3); border-radius:4px; background:#fffdf5; color:#6b3c25; font-size:14px; line-height:1; box-shadow:0 1px 2px rgba(79,43,17,.2); }
.notebook-tooltip { position:absolute; top:calc(100% + 8px); right:0; z-index:6; padding:7px 10px; border-radius:8px; background:rgba(65,35,23,.96); color:#fff9ec; font-size:13px; font-weight:800; white-space:nowrap; opacity:0; visibility:hidden; transform:translateY(-4px); pointer-events:none; transition:opacity .18s ease, transform .18s ease, visibility .18s ease; box-shadow:0 5px 14px rgba(38,18,8,.24); }
.notebook-tooltip::before { content:""; position:absolute; right:16px; bottom:100%; border:5px solid transparent; border-bottom-color:rgba(65,35,23,.96); }
.notebook-button:hover .notebook-tooltip, .notebook-button:focus-visible .notebook-tooltip { opacity:1; visibility:visible; transform:translateY(0); }
.badge {
  position:absolute; right:-4px; top:-4px; width:14px; height:14px; min-width:14px; padding:0;
  display:block; overflow:hidden; border-radius:999px; background:#df342e; color:transparent;
  border:2px solid white; font-size:0; animation:badge-pop .45s cubic-bezier(.2,1.7,.4,1);
}

.viewport { position:absolute; inset:0; overflow:hidden; overflow:clip; user-select:none; }
.panorama {
  position:absolute; left:0; top:50%; width:100%; height:100%;
  transform:translate3d(var(--scene-x,0px),-50%,0); transform-origin:left center; will-change:transform;
}
.room-image { position:absolute; inset:0; width:100%; height:100%; object-fit:fill; pointer-events:none; opacity:1; transition:opacity .14s ease,filter .14s ease; }
.room-image.scene-changing { opacity: .82; filter: brightness(.92); }
.panorama::after { content:""; position:absolute; inset:0; pointer-events:none; background: linear-gradient(180deg, rgba(20,7,2,.13), transparent 18%, transparent 75%, rgba(34,12,4,.08)); }

.wand-hotspot {
  position: absolute; z-index: 12; left: 51.7%; top: 26.2%; width: 6.6%; height: 4.2%;
  border: 0; padding: 0; background: transparent; cursor: pointer; color: white;
}
.wand-hotspot:focus-visible, .travel-hotspot:focus-visible { outline: none; }
.hotspot-label { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%,5px); white-space: nowrap; border-radius: 999px; padding: 6px 10px; font-size: 11px; color: white; background: rgba(65,31,20,.84); opacity: 0; pointer-events: none; backdrop-filter: blur(8px); transition: opacity .25s, transform .25s; }
.wand-hotspot:hover .hotspot-label, .wand-hotspot:focus-visible .hotspot-label { opacity: 1; transform: translate(-50%,0); }
.wand-hotspot.waving { animation: wand-area-wave .21s ease-in-out 8 alternate; }

.travel-hotspot { position: absolute; z-index: 11; width: 42px; height: 50px; transform: translate(-50%,-50%); border: 0; padding: 0; background: transparent; cursor: pointer; color: white; }
.travel-hotspot span { position:absolute; left:50%; top:50%; display:grid; place-items:center; width:30px; height:42px; border:0; border-radius:10px; color:rgba(255,250,238,.88); background:rgba(52,29,21,.34); box-shadow:0 3px 12px rgba(35,17,11,.18); transform:translate(-50%,-50%); opacity:1; font:500 38px/1 Georgia,serif; text-shadow:0 1px 4px rgba(30,13,8,.55); transition:transform .2s,background .2s,color .2s; }
.travel-hotspot em { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%,5px); white-space: nowrap; padding: 7px 11px; border-radius: 999px; color: white; background: rgba(55,29,20,.86); box-shadow: 0 7px 18px rgba(31,13,7,.2); font-size: 12px; font-style: normal; opacity: 0; pointer-events: none; backdrop-filter: blur(8px); transition: opacity .25s, transform .25s; }
.travel-hotspot:hover span, .travel-hotspot:focus-visible span { transform:translate(-50%,-50%) scale(1.1); color:#fffdf6; background:rgba(52,29,21,.58); }
.travel-hotspot:hover em, .travel-hotspot:focus-visible em { opacity: 1; transform: translate(-50%,0); }
.balcony-hotspot { left: 5.4%; top: 42%; }
.primary-bedroom-hotspot { left: 62.1%; top: 39%; }
.bathroom-hotspot { left: 68.3%; top: 42%; }
.secondary-bedroom-hotspot { left: 75.1%; top: 39%; }
.dining-hotspot { left: 88.5%; top: 55%; }

.object-hotspot { position:absolute; z-index:12; border:0; padding:0; color:white; background:transparent; cursor:pointer; }
.object-hotspot em { position:absolute; left:50%; bottom:calc(100% + 8px); transform:translate(-50%,5px); white-space:nowrap; padding:7px 11px; border-radius:999px; color:white; background:rgba(55,29,20,.86); box-shadow:0 7px 18px rgba(31,13,7,.2); font-size:12px; font-style:normal; opacity:0; pointer-events:none; backdrop-filter:blur(8px); transition:opacity .2s,transform .2s; }
.object-hotspot:hover em, .object-hotspot:focus-visible em { opacity:1; transform:translate(-50%,0); }
.lounger-photo-hotspot { left:0; top:63%; width:11%; height:19%; }
.bow-photo-hotspot { left:67.5%; top:43%; width:13%; height:14%; }
.dafa-bowl-hotspot { left:15.6%; top:55%; width:4.2%; height:10%; }
.dafa-cabinet-hotspot { left:78%; top:48%; width:13%; height:30%; }
.dafa-tent-bowl-hotspot { left:35%; top:80%; width:7%; height:12%; }
.nuonuo-toilet-hotspot { left:37.2%; top:38.4%; width:10%; height:24%; }
.nuonuo-laundry-hotspot { left:31%; top:56%; width:9%; height:25%; }
.nuonuo-computer-hotspot { left:47.9%; top:47.8%; width:9.2%; height:4%; }
.jingzhang-leaves-hotspot { left:53%; top:0; width:37%; height:34%; }
.jingzhang-tv-hotspot { left:23%; top:15%; width:27%; height:33%; }
.jingzhang-sink-hotspot { left:2%; top:32%; width:31%; height:28%; }
.fufu-box-hotspot { left:25.8%; top:59.5%; width:7.2%; height:10%; }
.fufu-figurine-hotspot { left:5%; top:23.5%; width:7.5%; height:11.5%; }
.fufu-pot-hotspot { left:89%; top:37%; width:9%; height:15%; }
.feifei-drawer-hotspot { left:61.4%; top:49.8%; width:8.6%; height:8.7%; }
.feifei-bush-hotspot { left:59.2%; top:54.5%; width:18.2%; height:18.5%; }
.feifei-fabric-hotspot { left:39.8%; top:47.5%; width:7%; height:32.5%; }
.feixian-cabinet-hotspot { left:71%; top:0; width:5.2%; height:23.5%; }
.feixian-clothes-hotspot { left:25.5%; top:12.5%; width:4.7%; height:28.5%; }
.feixian-curtain-hotspot { left:4.4%; top:69%; width:18.3%; height:29%; }
.object-hotspots { position:absolute; inset:0; z-index:11; pointer-events:none; }
.object-hotspots .object-hotspot { z-index:14; pointer-events:auto; }
.dafa-eating { position:absolute; z-index:13; left:10%; top:60%; width:13%; height:18%; object-fit:contain; pointer-events:none; filter:drop-shadow(0 8px 9px rgba(55,25,15,.3)); transform-origin:center bottom; }
.dafa-eating.found-pop { animation:dafa-found-pop .65s cubic-bezier(.2,1.25,.35,1) both; }
.scene-cat { position:absolute; z-index:13; object-fit:contain; pointer-events:none; filter:drop-shadow(0 8px 10px rgba(45,23,15,.28)); transform-origin:center bottom; animation:dafa-found-pop .65s cubic-bezier(.2,1.25,.35,1) both; }
.nuonuo-toilet-cat { left:37.1%; top:40%; width:8.5%; height:18%; }
.jingzhang-tree-cat { left:76%; top:9%; width:9%; height:18%; }
.fufu-bedroom-cat { left:30%; top:67%; width:14%; height:24%; }
.feifei-desk-cat { position:absolute; z-index:13; left:56.25%; top:43.5%; width:8.5%; height:8.5%; object-fit:contain; object-position:center bottom; pointer-events:none; filter:drop-shadow(0 4px 5px rgba(45,23,15,.28)); transform-origin:center bottom; animation:dafa-found-pop .65s cubic-bezier(.2,1.25,.35,1) both; }
.feixian-kitchen-cat { position:absolute; z-index:13; left:54%; top:51%; width:12%; height:17%; object-fit:contain; object-position:center bottom; pointer-events:none; filter:drop-shadow(0 7px 8px rgba(30,18,14,.35)); transform-origin:center bottom; animation:dafa-found-pop .65s cubic-bezier(.2,1.25,.35,1) both; }

.cat { position: absolute; z-index: 9; width: 19%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 12px 13px rgba(54,25,15,.34)); }
.cat-running { left:31%; bottom:4%; width:17%; opacity:0; transform-origin:center bottom; }
.cat-running.enter { animation: cat-arrive 1.55s cubic-bezier(.22,.72,.2,1) forwards; }
.cat-running.settled { opacity:1; transform:scale(.92); }

.pan-control {
  position:absolute; z-index:24; left:50%; bottom:max(16px,env(safe-area-inset-bottom)); transform:translateX(-50%);
  width:min(520px,calc(100vw - 40px)); display:grid; grid-template-columns:auto auto 1fr auto; align-items:center; gap:10px;
  border:1px solid rgba(255,255,255,.44); border-radius:999px; padding:9px 16px; color:#fff8e8;
  background:rgba(48,25,18,.44); box-shadow:0 8px 25px rgba(35,15,8,.16); backdrop-filter:blur(12px) saturate(1.12);
}
.pan-control > span:not(.pan-label) { color:#ffd18d; font:700 22px/1 Georgia,serif; }
.pan-label { white-space:nowrap; font-size:12px; font-weight:800; letter-spacing:.05em; }
.pan-control input { width:100%; height:22px; margin:0; accent-color:#f1bd6e; cursor:ew-resize; }
.toast {
  position: fixed; z-index: 50; left: 50%; top: 86px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; min-width: min(390px, calc(100vw - 30px));
  border: 1px solid rgba(255,255,255,.72); border-radius: 19px; padding: 13px 18px;
  color: #4c2b1e; background: rgba(255,250,236,.94); box-shadow: var(--shadow); backdrop-filter: blur(12px);
  animation: toast-in .45s cubic-bezier(.2,1.4,.4,1);
}
.toast-paw { font-size: 27px; }
.toast b, .toast small { display: block; }
.toast small { color: #8a624c; margin-top: 3px; }
.destination-toast { position: fixed; z-index: 48; left: 50%; bottom: max(86px, calc(env(safe-area-inset-bottom) + 70px)); transform: translateX(-50%); min-width: min(330px,calc(100vw - 32px)); border: 1px solid rgba(255,255,255,.62); border-radius: 17px; padding: 12px 16px; color: #4c2b1e; background: rgba(255,249,234,.94); box-shadow: var(--shadow); text-align: center; backdrop-filter: blur(10px); animation: toast-in .35s ease-out; }

.dialogue {
  position: fixed; z-index: 45; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(760px, calc(100vw - 28px)); display: grid; grid-template-columns: 112px 1fr; gap: 16px;
  padding: 18px 22px 18px 18px; border: 2px solid rgba(255,255,255,.7); border-radius: 28px;
  background: linear-gradient(135deg,rgba(255,251,239,.98),rgba(255,238,211,.96)); box-shadow: var(--shadow);
  animation: dialogue-in .55s cubic-bezier(.18,1.25,.28,1);
}
.dialogue-cat { width: 112px; height: 112px; border-radius: 22px; overflow: hidden; border: 4px solid white; box-shadow: 0 8px 20px rgba(80,40,22,.18); }
.dialogue-cat img { width: 100%; height: 100%; object-fit: contain; background:#f5e5ca; }
.dialogue-copy h2 { margin: 3px 34px 13px 0; font: 700 clamp(17px,2.1vw,25px)/1.4 Georgia,"Noto Serif SC",serif; }
.eyebrow { margin: 0; color: #b55d35; font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.choices { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.choices button, .quiz-options button {
  border: 1px solid #e3bf93; border-radius: 13px; padding: 10px 12px; color: #563223; background: #fffaf0; cursor: pointer; text-align: left;
}
.choices button:hover, .quiz-options button:hover { border-color: #b76038; background: #fff1d6; transform: translateY(-1px); }
.choices span, .quiz-options span { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 5px; border-radius: 8px; color: white; background: #9b5636; font-weight: 900; }
.dialogue-close, .modal-close { position: absolute; right: 14px; top: 12px; border: 0; background: transparent; color: #784b38; font-size: 28px; cursor: pointer; }
.notebook-back-button { position:absolute; z-index:4; left:14px; top:12px; display:grid; place-items:center; width:38px; height:38px; border:0; border-radius:11px; color:#fff5df; background:rgba(55,29,20,.72); font-size:22px; cursor:pointer; }
.notebook-back-button:hover { background:rgba(94,50,32,.94); }

.modal-backdrop { position: fixed; z-index: 60; inset: 0; background: rgba(25,12,8,.58); backdrop-filter: blur(8px); }
.celebration-effects { position:fixed; z-index:76; inset:0; overflow:hidden; pointer-events:none; }
.confetti-piece { position:absolute; left:var(--x); top:-24px; width:var(--size); height:calc(var(--size) * 1.8); border-radius:2px; background:var(--color); opacity:0; animation:confetti-fall var(--duration) cubic-bezier(.18,.72,.34,1) var(--delay) forwards; }
.confetti-piece:nth-child(3n) { border-radius:50%; height:var(--size); }
.confetti-piece:nth-child(4n) { clip-path:polygon(50% 0,100% 100%,0 100%); }
.firework-burst { position:absolute; width:1px; height:1px; animation:firework-pop 1.25s ease-out var(--burst-delay) both; }
.firework-spark { position:absolute; left:-3px; top:-3px; width:7px; height:7px; border-radius:50%; background:var(--color); box-shadow:0 0 9px var(--color); transform:rotate(var(--angle)) translateX(0); animation:firework-spark 1.15s cubic-bezier(.12,.7,.25,1) var(--burst-delay) both; }
.celebration-cheer { position:absolute; left:50%; top:15%; transform:translate(-50%,-50%); border:3px solid rgba(255,255,255,.86); border-radius:999px; padding:12px 25px; color:#fff8df; background:linear-gradient(135deg,#e56c55,#b9538b); box-shadow:0 13px 35px rgba(70,22,25,.28); font:900 clamp(26px,5vw,48px)/1 Georgia,"Noto Serif SC",serif; letter-spacing:.08em; animation:cheer-pop 1.8s cubic-bezier(.17,1.35,.35,1) .12s both; }
.modal {
  position: fixed; z-index: 70; left: 50%; top: 50%; transform: translate(-50%,-50%);
  box-shadow: 0 30px 90px rgba(20,8,4,.42); animation: modal-in .35s ease-out;
}
.photo-reveal-modal { width:min(760px,calc(100vw - 28px)); max-height:calc(100vh - 34px); overflow:hidden; border:4px solid #74432f; border-radius:25px; padding:16px 16px 18px; background:#fff8e9; }
.photo-reveal-modal > img { display:block; width:100%; max-height:68vh; border-radius:16px; object-fit:contain; background:#f3e7ce; }
.photo-reveal-modal p { margin:14px 44px 0; color:#563223; font:700 16px/1.65 Georgia,"Noto Serif SC",serif; text-align:center; }
.photo-return-button { position:absolute; z-index:4; right:26px; top:26px; display:grid; place-items:center; width:42px; height:42px; border:1px solid rgba(255,255,255,.7); border-radius:13px; color:white; background:rgba(55,29,20,.8); box-shadow:0 5px 14px rgba(38,18,8,.24); font-size:24px; cursor:pointer; }
.photo-return-button:hover { background:rgba(94,50,32,.96); }
.completion-modal, .restart-modal { width:min(520px,calc(100vw - 30px)); border:4px solid #74432f; border-radius:28px; padding:34px; color:#563223; background:#fff8e9; text-align:center; }
.completion-paw { display:grid; place-items:center; width:72px; height:72px; margin:0 auto 12px; border-radius:50%; background:#f4e2bd; font-size:34px; }
.completion-modal h2, .restart-modal h2 { margin:8px 0 10px; font:800 32px/1.35 Georgia,"Noto Serif SC",serif; }
.completion-modal > p:not(.eyebrow) { margin:0; color:#76513e; line-height:1.7; }
.completion-actions, .restart-actions { display:flex; justify-content:center; gap:10px; margin-top:24px; }
.restart-modal-icon { display:grid; place-items:center; width:72px; height:72px; margin:0 auto 16px; border-radius:50%; color:#fff7e8; background:#b76038; font:800 42px/1 system-ui,sans-serif; }
.secondary-button { border:1px solid #b88768; border-radius:14px; padding:13px 22px; color:#70422d; background:#fffaf0; font-weight:800; cursor:pointer; }
.notebook-modal {
  width: min(1080px, calc(100vw - 34px)); height: min(760px, calc(100vh - 42px));
  display: grid; grid-template-columns: 120px 1fr; overflow: hidden; border-radius: 24px;
  background: #eee0bd; border: 5px solid #6a3926;
}
.notebook-tabs { display: flex; flex-direction: column; gap: 5px; padding: 56px 0 20px 12px; background: #5b3323; }
.cat-tab { position:relative; display: flex; align-items: center; gap: 7px; min-height: 52px; border: 0; border-radius: 12px 0 0 12px; padding: 9px 10px; color: #fff1da; background: rgba(255,255,255,.08); text-align: left; }
.cat-tab.active { color: #55311f; background: #fffaf0; }
.cat-tab.locked { opacity: .48; }
.tab-update-dot { position:absolute; right:8px; top:7px; width:9px; height:9px; border-radius:50%; background:#d63b32; box-shadow:0 0 0 2px #fffaf0; }
.tab-number { font: 700 12px Georgia,serif; }
.notebook-page { position: relative; overflow: auto; padding: 36px 42px 32px; background-color: var(--paper); background-image: linear-gradient(rgba(137,91,56,.08) 1px,transparent 1px); background-size: 100% 29px; }
.notebook-page::before { content:""; position: absolute; top: 0; bottom: 0; left: 49%; width: 1px; background: rgba(108,66,39,.1); box-shadow: 0 0 18px rgba(74,41,24,.12); }
.notebook-heading { position: relative; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #b97b56; padding-bottom: 14px; }
.notebook-heading h2 { margin: 3px 0; font: 800 38px Georgia,"Noto Serif SC",serif; }
.cat-subtitle { margin: 0; color: #7c5a46; }
.cat-profile-card { position:relative; flex:0 0 auto; width:116px; height:102px; overflow:hidden; border:7px solid #fffaf0; border-radius:8px; background:#eadcbd; box-shadow:0 6px 16px rgba(80,40,22,.18); transform:rotate(2deg); }
.cat-profile-card > img { display:block; width:100%; height:100%; object-fit:contain; }
.mystery-cat { display:grid; place-content:center; gap:2px; width:100%; height:100%; color:#94745e; background:repeating-linear-gradient(135deg,#eee1c6 0,#eee1c6 10px,#e6d6b8 10px,#e6d6b8 20px); text-align:center; }
.mystery-cat span { font:800 38px Georgia,serif; }
.mystery-cat small { font-size:11px; font-weight:800; }
.found-stamp { position:absolute; right:-8px; bottom:3px; transform:rotate(-10deg); border:3px double #6d7b4a; border-radius:50%; padding:9px 7px; color:#6d7b4a; background:rgba(255,250,240,.82); font:800 11px Georgia,"Noto Serif SC",serif; }
.notebook-grid { position: relative; display: grid; grid-template-columns: .92fr 1.08fr; gap: 34px; padding-top: 22px; }
.profile-copy section { margin-bottom: 14px; }
.profile-copy h3, .album-title h3 { margin: 0 0 6px; font: 800 18px Georgia,"Noto Serif SC",serif; color: #6a3926; }
.profile-copy p { margin: 0; font-size: 14px; line-height: 1.75; }
.clue-card { margin-top: 18px; border: 1px dashed #b76b43; border-radius: 14px; padding: 13px 14px; background: #fff1d5; transform: rotate(-.5deg); }
.clue-card span { color: #b05931; font-weight: 900; }
.clue-card p { margin-top: 5px; }
.album-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.album-title span { color: #98705b; font-size: 12px; }
.album-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.photo-card { position: relative; margin: 0; padding: 8px 8px 12px; background: white; box-shadow: 0 7px 18px rgba(76,39,22,.15); transform: rotate(-1deg); }
.photo-card:nth-child(2) { transform: rotate(1.2deg); }
.photo-card:nth-child(3) { transform: rotate(-.4deg); }
.photo-card:nth-child(4) { transform: rotate(.8deg); }
.photo-card > img { display:block; width:100%; height:146px; border-radius:2px; object-fit:contain; background:#f1e5c9; }
.photo-card > img.transparent-cat-photo { object-fit:contain; }
.photo-placeholder { width: 100%; height: 146px; display: grid; place-content: center; gap: 7px; color: #8b6956; background: repeating-linear-gradient(135deg,#f0e5cc 0,#f0e5cc 10px,#e9dcc0 10px,#e9dcc0 20px); text-align: center; }
.photo-placeholder span { font-size: 28px; filter: grayscale(.45); }
.photo-placeholder small { font: 12px Georgia,"Noto Serif SC",serif; }
.photo-card figcaption { padding: 8px 4px 0; font: 13px/1.5 Georgia,"Noto Serif SC",serif; }
.photo-card:not(.locked-photo) { cursor:zoom-in; }
.photo-card:not(.locked-photo):hover, .photo-card:not(.locked-photo):focus-visible { outline:3px solid rgba(183,96,56,.5); outline-offset:3px; transform:rotate(0) translateY(-2px); }
.photo-lock { display: none; }
.locked-photo > img { filter: grayscale(1) blur(3px); opacity:.26; }
.locked-photo .photo-lock { position: absolute; z-index: 2; display: grid; place-items: center; inset: 8px 8px auto; height: 146px; color: #805d48; font: 800 18px Georgia,serif; background: rgba(238,222,187,.72); }
.unlock-photo-button { position:relative; z-index:3; width:100%; margin-top:9px; border:0; border-radius:10px; padding:9px 8px; color:white; background:#9b5636; font-size:12px; font-weight:800; cursor:pointer; }
.unlock-photo-button:hover { background:#743c29; }
.photo-card:not(.locked-photo) .unlock-photo-button { display:none; }
.quiz-unlock-note { display:block; padding:8px 4px 0; color:#8b6956; font-size:11px; line-height:1.45; }
.photo-card:not(.locked-photo) .quiz-unlock-note { display:none; }
.reset-link { display: block; margin: 20px 0 0 auto; border: 0; color: #9a6548; background: transparent; font-size: 12px; text-decoration: underline; cursor: pointer; }

.quiz-modal { width: min(620px,calc(100vw - 30px)); border: 4px solid #7a432b; border-radius: 26px; padding: 34px; background: #fff9e9; }
.quiz-heading { padding: 5px 30px 20px 0; }
.quiz-kicker { display: inline-block; border-radius: 999px; padding: 5px 10px; color: white; background: #b9663f; font-size: 12px; font-weight: 800; }
.quiz-heading h2 { margin: 12px 0 0; font: 800 28px Georgia,"Noto Serif SC",serif; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-options button { min-height: 58px; }
.quiz-options button.correct { border-color: #66804b; color: #43522f; background: #e9f0d8; }
.quiz-options button.wrong { border-color: #b9574a; background: #ffe2db; }
.multi-select-options button[aria-pressed="true"], .multi-select-options button.selected { border-color:#8b5b39; background:#f6dfb8; box-shadow:inset 0 0 0 2px rgba(139,91,57,.16); }
.quiz-submit { display:block; margin:14px 0 0 auto; }
.quiz-result { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: start; margin-top: 18px; border-radius: 16px; padding: 15px; background: #f1e5c9; }
.result-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 50%; color: white; background: #74864d; font-size: 24px; }
.quiz-result h3 { margin: 1px 0 5px; font-size: 18px; }
.quiz-result p { margin: 0; line-height: 1.65; font-size: 14px; }
.primary-button { border: 0; border-radius: 14px; padding: 13px 22px; color: white; background: linear-gradient(135deg,#b9673e,#7b3d29); box-shadow: 0 8px 18px rgba(108,50,27,.2); font-weight: 800; cursor: pointer; }
.quiz-modal > .primary-button { margin: 18px 0 0 auto; }

.welcome { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(34,16,10,.5); backdrop-filter: blur(10px); }
.welcome-card { width: min(520px,100%); border: 1px solid rgba(255,255,255,.75); border-radius: 30px; padding: 34px; background: rgba(255,248,231,.96); box-shadow: 0 30px 100px rgba(23,9,4,.42); }
.welcome-card h1 { margin: 8px 0 12px; font: 800 clamp(30px,5vw,48px)/1.15 Georgia,"Noto Serif SC",serif; }
.welcome-card > p:not(.eyebrow) { color: #6f4b3b; line-height: 1.7; }
.welcome-clue { margin: 20px 0; border-radius: 15px; padding: 13px 14px; background: #f4e2bd; color: #70482e; line-height: 1.5; }
.welcome-clue span { margin-right: 8px; color: #a65332; font-weight: 900; }

@keyframes pulse { 0%{transform:scale(.75);opacity:.9} 100%{transform:scale(1.45);opacity:0} }
@keyframes wand-area-wave { from{transform:rotate(-1deg)} to{transform:rotate(1deg)} }
@keyframes travel-dot-breathe { 0%,100%{opacity:.2;transform:translate(-50%,-50%) scale(.82)} 50%{opacity:.72;transform:translate(-50%,-50%) scale(1.08)} }
@keyframes cat-arrive {
  0% { transform:translate(-90px,55px) scale(.18); opacity:0; }
  18% { opacity:1; }
  38% { transform:translate(-58px,-25px) scale(.58); }
  56% { transform:translate(-36px,4px) scale(.68); }
  72% { transform:translate(-18px,-18px) scale(.8); }
  86% { transform:translate(-8px,2px) scale(.87); }
  100% { transform:translate(0,0) scale(.92); opacity:1; }
}
@keyframes dafa-found-pop { from{opacity:0;transform:translateY(18px) scale(.68)} to{opacity:1;transform:none} }
@keyframes settle-in { from{opacity:0;transform:translateY(25px) scale(.85)} to{opacity:1;transform:none} }
@keyframes toast-in { from{opacity:0;transform:translate(-50%,-20px) scale(.92)} to{opacity:1;transform:translate(-50%,0) scale(1)} }
@keyframes dialogue-in { from{opacity:0;transform:translate(-50%,30px) scale(.95)} to{opacity:1;transform:translate(-50%,0) scale(1)} }
@keyframes modal-in { from{opacity:0;transform:translate(-50%,-47%) scale(.96)} to{opacity:1;transform:translate(-50%,-50%) scale(1)} }
@keyframes badge-pop { from{transform:scale(0)} to{transform:scale(1)} }
@keyframes music-note-bob { 0%,100%{transform:translateY(1px) rotate(-5deg)} 50%{transform:translateY(-3px) rotate(7deg)} }
@keyframes confetti-fall { 0%{transform:translate3d(0,-5vh,0) rotate(0);opacity:0} 8%{opacity:1} 100%{transform:translate3d(var(--drift),108vh,0) rotate(var(--spin));opacity:.92} }
@keyframes firework-pop { 0%{opacity:0;transform:scale(.25)} 10%,72%{opacity:1} 100%{opacity:0;transform:scale(1.18)} }
@keyframes firework-spark { 0%{transform:rotate(var(--angle)) translateX(0) scale(.2);opacity:0} 12%{opacity:1} 72%{opacity:1} 100%{transform:rotate(var(--angle)) translateX(var(--distance)) scale(.15);opacity:0} }
@keyframes cheer-pop { 0%{opacity:0;transform:translate(-50%,-50%) scale(.45) rotate(-6deg)} 18%{opacity:1;transform:translate(-50%,-50%) scale(1.12) rotate(3deg)} 35%,72%{opacity:1;transform:translate(-50%,-50%) scale(1) rotate(0)} 100%{opacity:0;transform:translate(-50%,-70%) scale(.92)} }

@media (max-width: 760px) {
  .topbar { inset: max(8px,env(safe-area-inset-top)) 9px auto; }
  .top-left { gap: 5px; }
  .scene-back-button, .restart-button { width:42px; height:42px; border-radius:13px; }
  .scene-back-button .control-icon { font-size:22px; }
  .restart-icon { font-size:24px; }
  .brand { width:42px; height:42px; padding:5px; border-radius:13px; }
  .brand-paw { width: 32px; height: 32px; }
  .click-counter { min-width:56px; height:42px; padding:0 7px; border-radius:13px; }
  .click-counter b { font-size:17px; }
  .click-counter small { font-size:10px; }
  .scene-menu { top:max(62px,calc(env(safe-area-inset-top) + 54px)); left:9px; width:calc(100vw - 18px); padding:14px; }
  .scene-menu-grid { grid-template-columns:repeat(4,1fr); }
  .top-actions { gap: 5px; }
  .music-button { width:42px; height:42px; border-radius:13px; }
  .music-cat { font-size:19px; }
  .music-note { font-size:14px; }
  .progress { padding: 8px 10px; }
  .notebook-button { padding: 5px; }
  .notebook-icon { width: 44px; height: 35px; }
  .notebook-label { width:23px; height:21px; font-size:13px; }
  .wand-hotspot { left: 51.7%; }
  .cat { width: 24%; }
  .dialogue { grid-template-columns: 74px 1fr; gap: 10px; padding: 14px; bottom: 12px; border-radius: 20px; }
  .dialogue-cat { width: 74px; height: 74px; border-radius: 16px; }
  .dialogue-copy h2 { font-size: 15px; margin-bottom: 9px; }
  .choices { grid-template-columns: 1fr; gap: 5px; }
  .choices button { padding: 7px 9px; font-size: 12px; }
  .choices span { width: 20px; height: 20px; }
  .notebook-modal { grid-template-columns: 1fr; height: calc(100vh - 22px); width: calc(100vw - 18px); }
  .notebook-tabs { padding: 10px 46px 0 10px; flex-direction: row; overflow-x: auto; background: #5b3323; }
  .cat-tab { min-width: 62px; min-height: 40px; border-radius: 10px 10px 0 0; flex-direction: column; gap: 0; padding: 5px; font-size: 11px; }
  .notebook-page { padding: 24px 18px 30px; }
  .notebook-page::before { display:none; }
  .notebook-heading h2 { font-size: 31px; }
  .found-stamp { padding: 12px 7px; font-size: 11px; }
  .notebook-grid { grid-template-columns: 1fr; gap: 20px; }
  .album-grid { grid-template-columns: 1fr 1fr; }
  .quiz-modal { padding: 26px 20px; }
  .quiz-options { grid-template-columns: 1fr; }
  .welcome-card { padding: 27px 23px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .confetti-piece, .firework-burst { display:none; }
}
