:root {
  --ink: #513656;
  --pink: #ff78ad;
  --paper: #fffdf7;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 12% 10%, #fff3a4 0 4%, transparent 4.2%), radial-gradient(circle at 85% 15%, #d9b9ff 0 5%, transparent 5.2%), linear-gradient(135deg, #ffd7e8, #e2d5ff 48%, #bdf2e2);
  font-family: Nunito, sans-serif;
}

button { font: inherit; cursor: pointer; }

.access-gate { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #ffd7e8ee, #e2d5ffee 48%, #bdf2e2ee); transition: opacity .35s, visibility .35s; }
.access-gate.unlocked { opacity: 0; visibility: hidden; pointer-events: none; }
.access-card { width: min(100%, 390px); padding: 32px; border: 4px solid #fff; border-radius: 32px; background: #fffdf9; text-align: center; box-shadow: 0 16px 45px #65436d3d; }
.gate-icon { font-size: 4.5rem; }.access-card h1 { font-size: 2.4rem; }.access-card > p:not(.eyebrow, .access-error) { font-weight: 700; }.access-card label { display: block; margin: 18px 0 7px; text-align: left; font-weight: 900; }
.access-card input { width: 100%; padding: 13px; border: 3px solid #dbc7e5; border-radius: 14px; color: var(--ink); font: inherit; outline: none; }.access-card input:focus { border-color: #ef669d; }
.access-card .primary-button { width: 100%; margin-top: 15px; }.access-error { min-height: 1.3em; margin: 12px 0 0; color: #c9436b; font-weight: 900; }

.app-shell {
  width: min(100% - 32px, 900px);
  min-height: calc(100vh - 66px);
  margin: 0 auto;
  padding: 38px 0 20px;
}

.screen { display: none; text-align: center; }
.screen.active { display: block; animation: appear .35s ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

h1, h2, h3, .card-title { font-family: Fredoka, sans-serif; }
h1, h2 { margin: 0; font-size: clamp(2.25rem, 7vw, 4.5rem); line-height: .98; }
h1 span { color: #ed5795; }
h2 { font-size: clamp(2rem, 6vw, 3.4rem); }
.eyebrow { margin: 0 0 12px; color: #9b5e92; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; font-size: .78rem; }
.intro { margin: 16px auto 28px; font-size: clamp(1.05rem, 2vw, 1.25rem); }

.sparkle { position: absolute; color: #fff; font-size: 3rem; text-shadow: 0 2px 6px #9c6aad55; animation: twinkle 1.8s infinite alternate; }
.sparkle-one { top: 8%; left: 10%; } .sparkle-two { right: 10%; top: 18%; animation-delay: .7s; }
@keyframes twinkle { to { transform: scale(.7) rotate(25deg); opacity: .6; } }

.game-menu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; max-width: 900px; margin: auto; }
.game-card {
  position: relative; overflow: hidden; min-height: 300px; padding: 30px 20px 22px; border: 4px solid #fff9; border-radius: 32px;
  box-shadow: 0 12px 0 #7d548526, 0 18px 32px #82548b38; color: var(--ink); transition: transform .18s, box-shadow .18s;
}
.game-card:hover, .game-card:focus-visible { transform: translateY(-7px) rotate(-1deg); box-shadow: 0 18px 0 #7d548526, 0 24px 38px #82548b38; outline: none; }
.monster-card { background: linear-gradient(150deg, #baf4dc, #83d9bd); }
.story-card { background: linear-gradient(150deg, #ffccdf, #ddabed); }
.pet-card { background: linear-gradient(150deg, #ffe2a7, #ffb987); }
.card-emoji { display: block; font-size: 7.5rem; line-height: 1; filter: drop-shadow(0 5px 2px #754c6140); }
.card-title { display: block; margin: 15px 0 5px; font-size: 1.65rem; font-weight: 700; }
.card-text { display: block; font-weight: 700; }
.play-bubble { display: inline-block; margin-top: 18px; padding: 8px 16px; color: #fff; background: #73507c; border-radius: 999px; font-weight: 800; }

.back-button { display: inline-flex; gap: 6px; align-items: center; margin-bottom: 18px; padding: 8px 14px; border: 0; border-radius: 999px; background: #fff9; color: var(--ink); font-weight: 800; box-shadow: 0 3px 8px #67486f20; }
.back-button:hover { background: white; }
.monster-workshop { display: grid; grid-template-columns: 1fr 1.05fr; gap: 28px; max-width: 800px; margin: 26px auto 0; padding: 26px; border-radius: 32px; background: #fff9; box-shadow: 0 12px 35px #72577924; }
.monster-stage { display: grid; place-items: center; align-content: center; min-height: 330px; border-radius: 24px; background: linear-gradient(145deg, #e8fff6, #fff9d6); }
.monster {
  position: relative; width: 185px; height: 180px; border: 5px solid #513656; border-radius: 48% 52% 42% 58% / 50% 42% 58% 50%;
  box-shadow: inset -12px -13px #0000000d, 0 9px 0 #5136561c; transition: background .25s, transform .25s;
}
.monster:hover { transform: rotate(3deg) scale(1.03); }
.monster.mint { background: #79dcb8; } .monster.pink { background: #ff93bd; } .monster.purple { background: #bd92e8; } .monster.sunny { background: #ffd96f; } .monster.sky { background: #82cfff; } .monster.coral { background: #ff9a82; } .monster.lime { background: #bde76d; }
.monster.round { border-radius: 50%; }.monster.square { border-radius: 22px; }.monster.tall { width: 145px; height: 215px; border-radius: 46% 54% 40% 60% / 37% 42% 58% 63%; }.monster.blob { border-radius: 62% 38% 53% 47% / 39% 62% 38% 61%; transform: rotate(-4deg); }
.monster-horns { position: absolute; top: -42px; left: 27px; font-size: 3.2rem; }
.monster-eyes { position: absolute; top: 53px; left: 43px; font-size: 3.25rem; letter-spacing: 4px; line-height: 1; }
.monster-mouth { position: absolute; top: 110px; width: 100%; font-size: 3.5rem; font-family: Fredoka; font-weight: 600; }
.monster-accessory { position: absolute; right: -16px; top: -22px; font-size: 3rem; transform: rotate(20deg); }
.monster-name { margin: 20px 0 0; font: 700 1.5rem Fredoka; }
.controls { text-align: left; display: grid; align-content: center; gap: 16px; }
fieldset { margin: 0; padding: 0; border: 0; } legend { margin-bottom: 8px; font-weight: 900; }
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice-row button { display: grid; place-items: center; width: 47px; height: 47px; border: 3px solid transparent; border-radius: 15px; background: #f3eafb; font-size: 1.5rem; }
.choice-row button:hover, .choice-row button.selected { border-color: #72507b; transform: translateY(-2px); }
.color-choice.mint { background: #79dcb8; }.color-choice.pink { background: #ff93bd; }.color-choice.purple { background: #bd92e8; }.color-choice.sunny { background: #ffd96f; }.color-choice.sky { background: #82cfff; }.color-choice.coral { background: #ff9a82; }.color-choice.lime { background: #bde76d; }
.primary-button { margin-top: 3px; padding: 13px 20px; border: 0; border-radius: 16px; color: white; background: #ef669d; box-shadow: 0 5px 0 #bc3e70; font-weight: 900; }
.primary-button:active { transform: translateY(4px); box-shadow: 0 1px 0 #bc3e70; }

.story-card { max-width: 760px; margin: 24px auto; padding: 18px; border: 4px solid #fff9; border-radius: 32px; background: #fffaf0e8; box-shadow: 0 12px 35px #72577924; }
.story-world { position: relative; min-height: 355px; overflow: hidden; border: 4px solid #fff; border-radius: 24px; background: linear-gradient(#aee8ff 0 62%, #97d46f 62% 76%, #6ebf61 76%); }
.story-world.castle { background: linear-gradient(#d3c7ff 0 60%, #b8e18d 60% 76%, #79ba67 76%); }.story-world.cave { background: linear-gradient(#c7dcff 0 62%, #86c16e 62% 76%, #579c5d 76%); }.story-world.celebration { background: linear-gradient(#ffc9eb 0 62%, #f5cd78 62% 76%, #e1a25b 76%); }
.world-sun, .world-tree, .world-flower { position: absolute; z-index: 1; }.world-sun { top: 16px; right: 30px; font-size: 3.7rem; }.world-tree { bottom: 55px; font-size: 6rem; }.tree-one { left: -18px; }.tree-two { right: -18px; }.world-flower { bottom: 16px; left: 29%; font-size: 2.5rem; }
.story-destination { position: absolute; z-index: 3; display: grid; place-items: center; gap: 2px; width: 118px; min-height: 90px; padding: 4px; border: 0; border-radius: 22px; background: #fff9; color: var(--ink); font-weight: 900; box-shadow: 0 5px 0 #634b6924; transition: transform .2s, background .2s; animation: destination-wiggle 1.5s infinite alternate; }.story-destination:hover, .story-destination:focus-visible { transform: scale(1.12); background: #fff; outline: 3px solid #755283; }.destination-icon { font-size: 3rem; line-height: 1; }.destination-label { font-size: .75rem; line-height: 1.1; }
@keyframes destination-wiggle { to { translate: 0 -5px; } }
.story-unicorn { position: absolute; z-index: 4; left: 39%; bottom: 38px; font-size: 5.5rem; filter: drop-shadow(0 6px 2px #4f516333); transition: left .65s ease, bottom .65s ease, transform .2s; }.story-unicorn.walking { transform: scale(1.12) rotate(-7deg); }
.story-narration { padding: 13px 10px 2px; }.story-card h3 { margin: 0 0 8px; font-size: 1.9rem; }.story-card p { max-width: 600px; margin: auto; font-size: 1.1rem; font-weight: 700; line-height: 1.45; }.story-hint { margin-top: 12px !important; color: #966585; font-size: .88rem !important; }

.pet-picker { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin: 20px auto; }
.pet-choice { display: flex; align-items: center; gap: 7px; padding: 9px 14px; border: 3px solid transparent; border-radius: 16px; background: #fff9; color: var(--ink); font-weight: 900; font-size: 1.35rem; }
.pet-choice span { font-size: .92rem; }.pet-choice.selected, .pet-choice:hover { border-color: #e97390; background: #fff; }
.photo-controls { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 9px; margin: -8px auto 16px; }.photo-upload, .photo-controls button { padding: 8px 12px; border: 2px solid #d6bae2; border-radius: 13px; background: #fff9; color: var(--ink); font: 800 .8rem Nunito; cursor: pointer; }.photo-upload:hover, .photo-controls button:hover { border-color: #e97390; background: #fff; }.photo-upload input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.room-menu { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; margin: 0 auto 16px; }.room-choice { display: flex; align-items: center; gap: 5px; padding: 8px 12px; border: 3px solid transparent; border-radius: 14px; background: #fff9; color: var(--ink); font-weight: 900; }.room-choice.selected, .room-choice:hover { border-color: #ef8ab2; background: #fff; }.room-choice:disabled { cursor: not-allowed; opacity: .55; }
.pet-game { display: grid; grid-template-columns: 1.35fr .9fr; gap: 20px; max-width: 850px; margin: 0 auto; padding: 20px; border-radius: 32px; background: #fff9; box-shadow: 0 12px 35px #72577924; }
.pet-room { position: relative; min-height: 360px; overflow: hidden; border: 5px solid #fff; border-radius: 25px; background: linear-gradient(#bce8ff 0 67%, #e4b67e 67%); box-shadow: inset 0 -12px #c89665; }
.pet-room.living { background: linear-gradient(#ffe4b6 0 67%, #d59669 67%); }.pet-room.kitchen { background: linear-gradient(#d9f2ff 0 67%, #c9b29c 67%); }.pet-room.bathroom { background: linear-gradient(#d8efff 0 67%, #b6d3df 67%); }
.pet-room.night { background: linear-gradient(#25205c 0 67%, #8c5c8b 67%); box-shadow: inset 0 -12px #674360; }
.pet-room.night::before { content: "✦  ·  ✦   ·   ✧"; position: absolute; top: 25px; right: 20px; color: #fff6b5; font-size: 1.4rem; letter-spacing: 9px; }
.pet-room.night .toy-ball { display: none; }
.room-bed { position: absolute; z-index: 2; bottom: 10px; right: 13%; font-size: 3rem; }.room-name { position: absolute; z-index: 3; top: 11px; left: 50%; translate: -50%; padding: 4px 10px; border-radius: 999px; background: #fff9; font-size: .75rem; font-weight: 900; white-space: nowrap; }
.room-furniture { position: absolute; z-index: 2; inset: 0; }.furniture-item { position: absolute; padding: 0; border: 0; background: transparent; font-size: 3.3rem; filter: drop-shadow(0 4px 2px #573c4033); touch-action: none; cursor: grab; animation: furniture-pop .25s ease-out; }.furniture-item.selected { outline: 3px dashed #ef6fa2; outline-offset: 3px; border-radius: 10px; }.furniture-item:active { cursor: grabbing; }@keyframes furniture-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pet-character { position: absolute; z-index: 4; left: 43%; bottom: 55px; padding: 0; border: 0; background: transparent; font-size: 5.2rem; filter: drop-shadow(0 7px 2px #61443542); transition: left .6s ease, bottom .6s ease, transform .18s; }.pet-character:hover { transform: scale(1.12); }
.pet-character.has-photo { width: 100px; height: 100px; overflow: hidden; border: 4px solid white; border-radius: 50%; background: white; }.pet-character.has-photo #pet-emoji { display: none; }.pet-character img { width: 100%; height: 100%; object-fit: cover; }
.pet-character.chasing { transform: scale(1.15) rotate(-8deg); }
.pet-expression { position: absolute; z-index: 5; left: 57%; bottom: 135px; display: grid; place-items: center; width: 39px; height: 34px; border-radius: 16px 16px 16px 3px; background: white; font-size: 1.35rem; box-shadow: 0 3px 8px #60445a28; transition: left .6s ease, bottom .6s ease; }
.toy-ball { position: absolute; z-index: 4; top: 45%; left: 24%; padding: 0; border: 0; background: transparent; font-size: 2.6rem; filter: drop-shadow(0 3px 1px #60445a3b); transition: left .7s ease, top .7s ease, transform .2s; animation: bounce 1s infinite alternate; }.toy-ball:hover { transform: scale(1.2); }
@keyframes bounce { to { translate: 0 -8px; } }
.move-hint { position: absolute; z-index: 3; bottom: 2px; left: 0; right: 0; margin: 0; color: #77543e; font-size: .8rem; font-weight: 900; }
.pet-care { align-self: center; text-align: left; }.pet-care h3 { margin: 0 0 14px; font-size: 2rem; }.needs { display: grid; gap: 12px; }.needs > div { font-size: .85rem; font-weight: 900; }.needs span { display: block; margin-bottom: 4px; }
.meter { height: 13px; overflow: hidden; border-radius: 99px; background: #eadce6; }.meter i { display: block; height: 100%; width: 75%; border-radius: inherit; background: linear-gradient(90deg, #ff88ae, #ffcf75); transition: width .3s; }
.care-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 20px; }.care-actions button { padding: 11px 5px; border: 0; border-radius: 13px; background: #f6d3a5; color: var(--ink); font-weight: 900; }.care-actions button:hover { background: #ffbd86; transform: translateY(-2px); }
.care-actions button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.wake-button { grid-column: 1 / -1; background: #f18bb2 !important; color: white !important; }
.furniture-panel { margin-top: 20px; padding-top: 15px; border-top: 2px dashed #ddbfc8; }.furniture-panel h4 { margin: 0; font: 700 1.25rem Fredoka; }.furniture-panel p { margin: 4px 0 9px; font-size: .78rem; font-weight: 800; }.furniture-options { display: flex; flex-wrap: wrap; gap: 7px; }.furniture-options button { width: 43px; height: 43px; border: 2px solid transparent; border-radius: 12px; background: #e8d4f2; font-size: 1.5rem; }.furniture-options button:hover { border-color: #82568c; transform: translateY(-2px); }.furniture-size-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px; padding: 9px; border-radius: 14px; background: #fbe8f1; font-size: .75rem; font-weight: 900; }.furniture-size-controls button { padding: 6px 8px; border: 0; border-radius: 9px; background: #d9bdeb; color: var(--ink); font-weight: 900; }.furniture-size-controls button:hover { background: #c59de0; }.furniture-size-controls .delete-furniture { background: #ef829e; color: white; }.furniture-size-controls .delete-furniture:hover { background: #db587c; }
footer { padding: 18px; text-align: center; color: #73507c; font-weight: 800; }

@media (max-width: 620px) {
  .app-shell { width: min(100% - 24px, 900px); padding-top: 28px; }
  .game-menu, .monster-workshop, .pet-game { grid-template-columns: 1fr; }
  .game-card { min-height: 230px; }.card-emoji { font-size: 5.8rem; }
  .monster-workshop { padding: 16px; gap: 16px; }.monster-stage { min-height: 265px; }
  .story-world { min-height: 320px; }.story-destination { width: 96px; min-height: 80px; }.destination-icon { font-size: 2.5rem; }.destination-label { font-size: .67rem; }.story-unicorn { font-size: 4.7rem; }
  .back-button span { display: none; }
}
