[data-study-content][hidden] { display: none !important; }
[data-study] { padding: 14px; margin: 10px auto 18px; max-width: 680px; border: 2px solid #ead8bc; border-radius: 18px; background: #fffaf0; color: #473227; font: 1rem/1.5 system-ui,sans-serif; text-align: left; }
[data-study] button, [data-study] input, [data-study] a { display: inline-flex; align-items: center; min-height: 44px; padding: 7px 10px; margin: 3px; font: inherit; color: inherit; }
[data-study] button { border: 1px solid #c79b59; border-radius: 10px; background: #ffe8ad; cursor: pointer; touch-action: manipulation; }
[data-study] button:disabled { opacity: .52; cursor: default; }
[data-study] input { max-width: 100%; border: 1px solid #c79b59; border-radius: 8px; }
.study-room-page {
  margin: 0;
  background: linear-gradient(160deg,#fff2e4,#f2eaff 65%,#fff5e8);
  color: #523746;
  font: 1rem/1.5 system-ui,sans-serif;
}
.study-room-page main { max-width: 720px; padding: 16px; margin: auto; }
.study-room-page h1 { margin: 12px 0 2px; letter-spacing: -.05em; }
.study-room-page a { color: #65446c; }
.study-room-page nav a {
  display: inline-block;
  margin: 4px 2px;
  padding: 10px;
  border-radius: 999px;
  background: #fff9;
}
.study-room-page [data-study] { background: #fffaf6; border-color: #ead8e4; box-shadow: 0 8px 30px #84566d16; }
.study-room {
  position: relative;
  isolation: isolate;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 18px;
  background: #f6dddb url('/study/art/room.webp') center / cover;
  box-shadow: 0 3px 10px #6a425a26;
}
.room-item { position: absolute; line-height: 0; }
.room-item .study-figure { display: block; width: 100%; height: auto; filter: drop-shadow(0 4px 3px #6c435746); }
.item-rug { width: 31%; left: 32%; bottom: 6%; z-index: 1; }
.item-plant { width: 15%; left: 7%; bottom: 21%; z-index: 2; }
.item-lamp { width: 17%; right: 11%; bottom: 25%; z-index: 2; }
.item-sofa { width: 37%; left: 32%; bottom: 26%; z-index: 2; }
.item-dragon { width: 15%; right: 6%; bottom: 12%; z-index: 3; }
.item-unicorn { width: 13%; left: 21%; bottom: 13%; z-index: 3; }
.study-shop { display: grid; grid-template-columns: repeat(auto-fit,minmax(125px,1fr)); gap: 10px; }
.study-shop article {
  display: grid;
  grid-template-rows: 96px 1fr auto;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border: 1px solid #ead8e4;
  border-radius: 16px;
  text-align: center;
  background: #fff1e6;
}
.study-shop article[data-price="3"] { background: #f3edff; }
.study-shop article[data-price="10"] { background: radial-gradient(ellipse at top,#fff5c3,#fce7ed 75%); border-color: #e3bf80; }
.study-shop article button { justify-content: center; width: calc(100% - 6px); }
.study-shop .study-figure { display: block; width: 100%; height: 94px; object-fit: contain; margin: auto; }

[data-study] button.room-item {
  display: block;
  padding: 0;
  margin: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
}
[data-study] button.room-item:active { cursor: grabbing; z-index: 4; }
.room-item img { pointer-events: none; user-select: none; }
.study-storage > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid #ead8e4; }

.study-pet { margin: 16px 0; padding: 12px; border: 1px solid #ead8e4; border-radius: 16px; background: #fff0e3; }
.study-pet h2 { margin: 0 0 4px; }
.study-pet p { margin: 4px 0 8px; }
.study-pet > img { float: right; width: 76px; height: 76px; object-fit: contain; }
.study-pet::after { content: ""; display: block; clear: both; }
.pet-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.pet-controls button { justify-content: center; }
.pet-house { position: absolute; left: 4%; bottom: 5%; font-size: clamp(26px,8vw,58px); line-height: 1; z-index: 2; }
.room-puppy { position: absolute; width: 14%; height: auto; left: 19%; bottom: 7%; z-index: 3; pointer-events: none; filter: drop-shadow(0 3px 3px #6c435746); }
.room-puppy[data-mood="rested"] { left: 8%; bottom: 6%; width: 10%; transform: rotate(-8deg); }
@media (prefers-reduced-motion: no-preference) {
  .room-puppy[data-mood]:not([data-mood=""]) { animation: puppy-bounce .36s ease-out; }
  @keyframes puppy-bounce { 50% { translate: 0 -5px; } }
}

.study-room-page main { max-width: 880px; }
.study-room-page [data-study] { max-width: none; }
.room-tabs, .shop-groups { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
[data-study] button[aria-pressed="true"] { background: #815899; border-color: #704584; color: white; font-weight: 800; }
.study-room[data-room="1"] { background-image: url('/study/art/bedroom.webp'); }
.study-room[data-room="2"] { background-image: url('/study/art/playroom.webp'); }
.room-item[data-category] { width: 19%; left: 39%; bottom: 17%; z-index: 2; }
.room-item[data-category="액자"] { width: 15%; left: 53%; bottom: 61%; z-index: 1; }
.room-item[data-category="장난감·피규어"] { width: 15%; left: 66%; bottom: 10%; z-index: 3; }
.room-item.item-rug { width:31%; left:32%; bottom:6%; z-index:1; }
.room-item.item-plant { width:15%; left:7%; bottom:21%; }
.room-item.item-lamp { width:17%; left:auto; right:11%; bottom:25%; }
.room-item.item-sofa { width:37%; left:32%; bottom:26%; }
.room-item.item-dragon { width:15%; left:auto; right:6%; bottom:12%; }
.room-item.item-unicorn { width:13%; left:21%; bottom:13%; }
.study-shop article[data-price="6"] { background: #ecf5ff; }
