:root { --wood: #8b5a3b; --ink: #33291f; --pink: #ffb3c8; --pink-dark: #e8a9c2; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(#ffd6e8, #ffeef5 40%, #dff0e2 75%, #cfe8c8);
  min-height: 100vh;
}
body.night { background: linear-gradient(#2a1e3a, #4a2a4a 45%, #1d2b4a 80%, #16233a); color: #fff6f0; }
body.night header, body.night .panel, body.night .control { color: #33291f; }
header { max-width: 1020px; margin: 0 auto; padding: 20px 16px 8px; }
header h1 { margin: 0 0 4px; font-size: 30px; }
header p { margin: 4px 0; }
.statusbar { max-width: 1020px; margin: 0 auto; padding: 0 16px 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.pill { background: #fffdf7; border: 1px solid #d9c7a5; border-radius: 999px; padding: 6px 12px; font-size: 14px; box-shadow: 0 2px 0 rgba(139, 90, 59, 0.12); }
.scene { max-width: 1020px; margin: 0 auto; padding: 0 16px 16px; position: relative; }
.sky {
  height: 130px; border-radius: 22px 22px 0 0; position: relative; overflow: hidden;
  border: 6px solid var(--wood); border-bottom: 0;
  background: linear-gradient(#aee0ff, #ffeef5);
}
.sky.night { background: linear-gradient(#1d2b4a, #3a4a72); }
.sky.rainy { background: linear-gradient(#9aa8b8, #c8d2dc); }
.sky.thunder { background: linear-gradient(#3a3f52, #6b7288); }
.stars { position: absolute; inset: 0; opacity: 0; background-image: radial-gradient(#fff 1.2px, transparent 1.6px), radial-gradient(#ffe9a8 1.2px, transparent 1.6px); background-size: 68px 52px, 92px 70px; transition: opacity 1s; animation: twinkle 3s ease-in-out infinite alternate; }
.sky.night .stars { opacity: 1; }
@keyframes twinkle { from { opacity: 0.5; } to { opacity: 1; } }
.sun, .moon { position: absolute; top: 22px; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; }
.sun { background: #ffd94d; box-shadow: 0 0 34px #ffdf7a; left: var(--sun-left, 20%); }
.moon { background: #f4f1de; box-shadow: 0 0 24px #fff7c2; left: var(--moon-left, 20%); }
.cloud { position: absolute; top: 18px; font-size: 36px; opacity: 0.95; animation: drift 26s linear infinite alternate; }
.cloud.c2 { top: 54px; left: 62%; animation-duration: 34s; }
.cloud.c3 { top: 8px; left: 42%; animation-duration: 30s; }
.sky.rainy .cloud, .sky.thunder .cloud { filter: grayscale(1) brightness(0.75); }
@keyframes drift { from { transform: translateX(-12px); } to { transform: translateX(22px); } }
.birds { position: absolute; top: 18px; left: 0; font-size: 22px; animation: flyAcross 18s linear infinite; opacity: 0; }
@keyframes flyAcross { from { transform: translateX(-10%); } to { transform: translateX(110%); } }
.rain { position: absolute; inset: 0; pointer-events: none; background-image: repeating-linear-gradient(105deg, transparent 0 14px, rgba(120,160,220,0.55) 14px 15px); opacity: 0; }
.rain.on { opacity: 1; animation: rainmove 0.7s linear infinite; }
@keyframes rainmove { from { background-position-y: 0; } to { background-position-y: 36px; } }
.storm { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: rgba(255,255,255,0.0); }
.storm.on { animation: stormFlash 7s infinite; }
.lightning { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: white; }
.sky.thunder .lightning { animation: lightningFlash 7s infinite; }
@keyframes lightningFlash { 0%, 92%, 100% { opacity: 0; } 2% { opacity: 0.7; } 4% { opacity: 0; } 6% { opacity: 0.45; } 8% { opacity: 0; } }
@keyframes stormFlash { 0%, 92%, 100% { opacity: 0; } 2% { opacity: 0.25; } 4% { opacity: 0; } }
.house { position: relative; border: 6px solid var(--wood); border-top: 0; border-radius: 0 0 22px 22px; overflow: hidden; box-shadow: 0 18px 30px rgba(70, 50, 30, 0.22); background: #fff6f0; }
.house-img { width: 100%; height: auto; display: block; }
.room-dark { position: absolute; background: #0d1b3a; opacity: 0; pointer-events: none; transition: opacity 1s; z-index: 20; }
.room-dark[data-room-dark="bedroom"] { left: 19%; top: 18%; width: 31%; height: 26%; }
.room-dark[data-room-dark="study"] { left: 51%; top: 18%; width: 37%; height: 26%; }
.room-dark[data-room-dark="living"] { left: 19%; top: 44%; width: 31%; height: 25%; }
.room-dark[data-room-dark="kitchen"] { left: 51%; top: 44%; width: 37%; height: 25%; }
.room-dark[data-room-dark="entry"] { left: 19%; top: 69%; width: 31%; height: 28%; }
.room-dark[data-room-dark="sunroom"] { left: 51%; top: 69%; width: 38%; height: 28%; }
.room-glow { position: absolute; width: 26%; height: 20%; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(255,220,130,0.55), transparent 70%); pointer-events: none; z-index: 21; opacity: 0; transition: opacity 1s, left 1.1s ease, top 1.1s ease; }
.lighting { position: absolute; inset: 0; background: #0d1b3a; opacity: var(--night-opacity, 0); pointer-events: none; transition: opacity 1s; z-index: 19; }
.lampglow { position: absolute; inset: 0; pointer-events: none; opacity: var(--lamp-opacity, 0); background: radial-gradient(circle at 50% 40%, rgba(255,220,130,0.25), transparent 65%); z-index: 19; }
.sun-shadow { position: absolute; inset: 0; pointer-events: none; z-index: 18; background: linear-gradient(105deg, transparent 60%, rgba(70, 50, 30, 0.12) 100%); }
.moonlight { position: absolute; left: 20%; top: 19%; width: 28%; height: 24%; pointer-events: none; z-index: 22; opacity: 0; background: linear-gradient(115deg, rgba(190,210,255,0.35), transparent 70%); transition: opacity 1s; }
.fairy-row { position: absolute; left: 4%; right: 4%; height: 18px; pointer-events: none; z-index: 24; background-image: radial-gradient(circle at 8px 4px, #ffe27a 4px, transparent 5px), radial-gradient(circle at 26px 8px, #ffb3c8 4px, transparent 5px), radial-gradient(circle at 44px 4px, #a8e6b0 4px, transparent 5px); background-size: 54px 18px; background-repeat: repeat-x; filter: drop-shadow(0 0 5px rgba(255,220,120,0.9)); animation: twinkle 2.2s ease-in-out infinite alternate; }
.fairy-top { top: 18%; } .fairy-mid { top: 44%; } .fairy-ground { top: 69%; }
.fire-glow { position: absolute; left: 28%; top: 54%; width: 10%; height: 8%; background: radial-gradient(circle, rgba(255,150,60,0.55), transparent 70%); pointer-events: none; z-index: 23; animation: flickGlow 1s ease-in-out infinite alternate; }
@keyframes flickGlow { from { opacity: 0.5; transform: scale(1); } to { opacity: 0.9; transform: scale(1.15); } }
.flame { position: absolute; left: 31%; top: 52%; font-size: 26px; pointer-events: none; z-index: 23; transform-origin: bottom center; animation: flick 0.85s ease-in-out infinite alternate; }
@keyframes flick { from { transform: scale(1) rotate(-2deg); } to { transform: scale(1.12, 1.18) rotate(2deg); } }
.computer-glow { position: absolute; left: 66%; top: 30%; width: 10%; height: 8%; background: radial-gradient(circle, rgba(190,230,255,0.6), transparent 70%); pointer-events: none; z-index: 23; opacity: 0; transition: opacity 1s; }
.fridge-light { position: absolute; left: 68%; top: 54%; width: 8%; height: 10%; background: radial-gradient(circle, rgba(255,240,180,0.55), transparent 70%); pointer-events: none; z-index: 23; opacity: 0; transition: opacity 1s; }
.steam { position: absolute; left: 68%; top: 50%; font-size: 24px; pointer-events: none; z-index: 24; opacity: 0; animation: steamRise 2.5s ease-in-out infinite; }
@keyframes steamRise { from { transform: translateY(6px); opacity: 0; } 50% { opacity: 0.9; } to { transform: translateY(-14px); opacity: 0; } }
.water-drops { position: absolute; left: 72%; top: 78%; font-size: 20px; pointer-events: none; z-index: 24; opacity: 0; animation: dropFall 1.4s linear infinite; }
@keyframes dropFall { from { transform: translateY(-6px); opacity: 0; } 50% { opacity: 1; } to { transform: translateY(10px); opacity: 0; } }
.curtain { position: absolute; width: 5%; height: 12%; background: linear-gradient(#ffb3c8, #ffc2d4); border-radius: 0 0 12px 12px; pointer-events: none; z-index: 23; transform-origin: top center; animation: curtainSway 4s ease-in-out infinite alternate; }
.curtain-bed { left: 22%; top: 20%; } .curtain-study { left: 84%; top: 20%; }
@keyframes curtainSway { from { transform: rotate(-2deg); } to { transform: rotate(3deg); } }
.sway-plant { position: absolute; font-size: 28px; pointer-events: none; z-index: 23; transform-origin: bottom center; animation: sway 3.2s ease-in-out infinite alternate; }
.sway-a { left: 84%; top: 76%; } .sway-b { left: 46%; top: 84%; } .sway-c { left: 90%; top: 58%; }
@keyframes sway { from { transform: rotate(-2deg); } to { transform: rotate(3deg); } }
.window-rain { position: absolute; left: 20%; top: 20%; font-size: 18px; pointer-events: none; z-index: 24; opacity: 0; }
.umbrella { position: absolute; left: 20%; top: 80%; font-size: 30px; pointer-events: none; z-index: 24; opacity: 0; }
.shoes { position: absolute; left: 24%; top: 88%; font-size: 22px; pointer-events: none; z-index: 24; opacity: 0; }
.fridge-notes { position: absolute; left: 62%; top: 52%; display: flex; flex-direction: column; gap: 3px; z-index: 25; pointer-events: none; }
.fridge-notes span { font-size: 10px; padding: 3px 5px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.note-pink { background: #ffb3c8; transform: rotate(-3deg); } .note-yellow { background: #ffe27a; transform: rotate(2deg); } .note-green { background: #a8e6b0; transform: rotate(-1deg); }
.digital-clock { position: absolute; left: 22%; top: 45%; width: 15%; min-width: 110px; background: #ffd6e8; border: 3px solid #ff8fab; border-radius: 14px; padding: 6px 8px; text-align: center; z-index: 35; box-shadow: 0 4px 12px rgba(180, 60, 100, 0.35); transition: opacity 1s, box-shadow 1s; }
.digital-clock.dim { opacity: 0.45; box-shadow: none; }
.digital-time { font-size: 18px; font-weight: 700; color: #7a2a4a; letter-spacing: 0.5px; }
.digital-date { font-size: 11px; color: #7a2a4a; }
.wall-clock { position: absolute; left: 60%; top: 20%; width: 7%; min-width: 52px; aspect-ratio: 1; z-index: 26; text-align: center; }
.wall-face { position: relative; width: 100%; aspect-ratio: 1; background: #fffdf7; border: 3px solid #8b5a3b; border-radius: 50%; }
.hand { position: absolute; left: 50%; bottom: 50%; transform-origin: bottom center; background: #33291f; border-radius: 3px; }
.hour-hand { width: 3px; height: 28%; margin-left: -1.5px; } .minute-hand { width: 2px; height: 40%; margin-left: -1px; } .second-hand { width: 1.5px; height: 44%; margin-left: -0.75px; background: #e87a6b; }
.hand-dot { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; background: #e87a6b; border-radius: 50%; }
.wall-label { font-size: 10px; background: rgba(255,253,247,0.9); border-radius: 999px; padding: 1px 4px; margin-top: 2px; display: inline-block; }
.room-anchor { position: absolute; width: 1px; height: 1px; pointer-events: none; }
.hotspot { position: absolute; transform: translate(-50%, -50%); z-index: 30; padding: 4px 8px; border-radius: 999px; border: 1px solid #d9c7a5; background: rgba(255,253,247,0.92); cursor: pointer; font-size: 11px; box-shadow: 0 2px 4px rgba(0,0,0,0.15); white-space: nowrap; }
.hotspot:hover { background: #ffeef5; }
.bubble { position: absolute; z-index: 40; max-width: 240px; background: #fffdf7; border: 2px solid #7fae8a; border-radius: 16px; padding: 9px 11px; font-size: 14px; transform: translate(-50%, -130%); display: none; box-shadow: 0 6px 14px rgba(70, 50, 30, 0.18); }
.bubble.show { display: block; }
.character-wrap { position: absolute; width: 11%; min-width: 72px; max-width: 120px; aspect-ratio: 120 / 150; z-index: 32; transform: translate(-50%, -50%); transition: left 1.1s ease, top 1.1s ease; pointer-events: none; filter: drop-shadow(0 6px 4px rgba(70, 50, 30, 0.25)); }
.character { width: 100%; height: 100%; }
.character .body { transition: transform 0.3s; transform-origin: bottom center; }
.character.walking .body { animation: bob 0.55s ease-in-out infinite alternate; }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-5px); } }
.character.sitting .body { transform: scaleY(0.82); }
.character.lying .body { transform: rotate(-88deg) translateX(20px) scale(1.12, 0.78); transform-origin: center; }
.character-wrap.waving .character { animation: waveAnim 0.6s ease-in-out infinite alternate; }
@keyframes waveAnim { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
.character-wrap.stretch .character .body { animation: stretchAnim 2s ease-in-out infinite alternate; }
@keyframes stretchAnim { from { transform: scaleY(1); } to { transform: scaleY(1.12); } }
.character-wrap.typing .character .body { animation: typeBob 0.3s ease-in-out infinite alternate; }
@keyframes typeBob { from { transform: translateY(0); } to { transform: translateY(-2px); } }
.eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.4s infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.08); } }
.zzz { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 16px; font-weight: 700; color: #7a5aa8; opacity: 0; animation: floatUp 2.5s ease-in-out infinite; }
.zzz.show { opacity: 1; }
@keyframes floatUp { from { transform: translate(-50%, 6px); opacity: 0; } 50% { opacity: 1; } to { transform: translate(-50%, -12px); opacity: 0; } }
.activity-label { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); background: rgba(255,253,247,0.95); border: 1px solid #e2cfae; border-radius: 999px; padding: 3px 8px; font-size: 11px; white-space: nowrap; box-shadow: 0 2px 4px rgba(0,0,0,0.15); }
.mailbox { position: absolute; left: 6%; bottom: 3%; z-index: 33; cursor: pointer; font-size: 13px; background: #fffdf7; border: 1px solid #b9d2bd; border-radius: 999px; padding: 7px 11px; box-shadow: 0 2px 0 rgba(139, 90, 59, 0.12); }
.mailbox.has-letter { background: #ffd6e8; border-color: #ff8fab; animation: mailboxPop 1s ease-in-out infinite alternate; }
@keyframes mailboxPop { from { transform: scale(1); } to { transform: scale(1.08); } }
.mail-envelope { position: absolute; left: 12%; bottom: 8%; font-size: 26px; pointer-events: none; z-index: 33; opacity: 0; }
.mail-envelope.pop { animation: envelopePop 3s ease-in-out; }
@keyframes envelopePop { 0% { opacity: 0; transform: translateY(10px) scale(0.8); } 20% { opacity: 1; transform: translateY(0) scale(1.1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
.decoration { position: absolute; font-size: 30px; z-index: 28; }
.garden { position: relative; margin-top: -6px; background: linear-gradient(#cfe8c8, #a8d5b0); border: 6px solid var(--wood); border-top: 0; border-radius: 0 0 22px 22px; padding: 10px 10px 4px; overflow: hidden; }
body.night .garden { background: linear-gradient(#2a3a2a, #1d2b2a); }
.garden-svg { width: 100%; height: 90px; display: block; }
.garden-plants { text-align: center; font-size: 24px; letter-spacing: 6px; }
.butterflies { position: absolute; top: 8px; left: 0; font-size: 22px; opacity: 0; animation: flyAcross 16s linear infinite; }
.fireflies { position: absolute; top: 10px; left: 10%; right: 10%; text-align: center; font-size: 16px; opacity: 0; animation: twinkle 2s ease-in-out infinite alternate; }
.puddles { position: absolute; bottom: 18px; left: 10%; right: 10%; display: flex; justify-content: space-around; opacity: 0; }
.puddle { width: 70px; height: 16px; background: rgba(160,200,240,0.7); border-radius: 50%; animation: ripple 2.5s ease-in-out infinite alternate; }
@keyframes ripple { from { transform: scaleX(1); } to { transform: scaleX(1.2); } }
.panel, .control { max-width: 1020px; margin: 12px auto; background: #fffdf7; border: 1px solid #e2cfae; border-radius: 18px; padding: 16px; box-shadow: 0 8px 20px rgba(70, 50, 30, 0.10); }
.panel { margin-left: 16px; margin-right: 16px; }
@media (min-width: 1052px) { .panel { margin-left: auto; margin-right: auto; } }
.panel h2, .control h2 { margin-top: 0; }
.control label { display: block; margin: 8px 0 4px; font-size: 14px; }
.control input, .control select, .control textarea { width: 100%; padding: 8px; border: 1px solid #c5d6c8; border-radius: 10px; font-size: 14px; background: white; }
.control button, .panel button { margin-top: 10px; padding: 9px 14px; border: 0; border-radius: 999px; background: #5f9c72; color: white; cursor: pointer; font-size: 14px; }
.control button.secondary, .panel button.secondary { background: #eef3ee; color: #2f3a33; border: 1px solid #cfe3d2; }
.muted { color: #66766b; font-size: 13px; }
.todo-list { list-style: none; padding: 0; margin: 8px 0; }
.todo-list li { padding: 6px 0; border-bottom: 1px solid #eee; }
.todo-list li.done { color: #5f9c72; text-decoration: line-through; }
.letter { border-top: 1px solid #e2e8e2; padding: 10px 0; }
.letter:first-child { border-top: 0; }
footer { max-width: 1020px; margin: 0 auto; padding: 0 16px 24px; }
@media (max-width: 600px) {
  .hotspot { font-size: 10px; padding: 3px 6px; }
  .digital-time { font-size: 14px; }
  .digital-clock { min-width: 90px; }
  .character-wrap { min-width: 64px; }
  header h1 { font-size: 26px; }
}
