:root {
  --cream: #fff3df;
  --cream2: #ffe6cd;
  --pink: #f49ab0;
  --pink2: #ffd0dc;
  --green: #8fbf7a;
  --sage: #d8e9cf;
  --brown: #6d4327;
  --gold: #ffca44;
  --teal: #7fc8c6;
  --shadow: 0 12px 35px rgba(111, 67, 39, .18);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: "Trebuchet MS", system-ui, sans-serif; color: var(--brown); background: radial-gradient(circle at 10% 5%, #fff9e9, transparent 35%), linear-gradient(160deg, #ffe8c8, #ffd6df 58%, #d8efc9); touch-action: manipulation; }
button, input { font: inherit; }
button { border: 0; cursor: pointer; transition: transform .12s ease, filter .12s ease; }
button:active { transform: scale(.97); }
.app-shell { width: min(100vw, 980px); min-height: 100svh; margin: 0 auto; padding: env(safe-area-inset-top) 10px calc(92px + env(safe-area-inset-bottom)); position: relative; overflow-x: hidden; }
.top-hero { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px 8px; position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px); }
.logo-card { background: rgba(255,246,226,.9); border: 3px solid rgba(255,255,255,.8); border-radius: 24px; padding: 9px 14px 7px; box-shadow: var(--shadow); min-width: 190px; }
.logo-main { color: #dd5778; font-size: clamp(28px, 8vw, 48px); line-height: .82; font-weight: 900; text-shadow: 0 2px 0 #fff; }
.logo-main span { color: #5d9852; display: block; font-size: .78em; }
.logo-sub { background: #f6b469; color: white; border-radius: 999px; text-align: center; padding: 2px 8px; font-weight: 800; margin-top: 5px; }
.resource-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pill, .round { background: rgba(255,246,226,.95); border: 2px solid rgba(255,255,255,.85); border-radius: 999px; min-height: 38px; padding: 6px 9px; box-shadow: 0 8px 20px rgba(111,67,39,.14); display: inline-flex; align-items: center; gap: 5px; font-weight: 900; }
.pill button, .round { background: #8bc76e; color: white; width: 26px; height: 26px; border-radius: 50%; font-weight: 900; }
.round { width: 40px; justify-content: center; background: rgba(255,246,226,.95); color: var(--brown); }
.connection-card, .orders-panel, .selected-panel, .task-card, .shop-card { background: rgba(255,245,226,.88); border: 2px solid rgba(255,255,255,.9); border-radius: 24px; padding: 12px; box-shadow: var(--shadow); }
.connection-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
#connectionBadge { color: #cf5570; margin-right: 8px; }
.join-row { display: flex; gap: 6px; }
.join-row input { border: 2px solid #f4c4a7; border-radius: 14px; padding: 8px 10px; max-width: 150px; background: #fff9ef; color: var(--brown); }
.join-row button, .selected-actions button, .room-cards button, #playStoryBtn, #dailyGiftBtn { background: linear-gradient(#9bd984, #71b45a); color: white; border-radius: 16px; padding: 10px 14px; font-weight: 900; box-shadow: 0 5px 0 #5c9548; }
.screen { display: none; animation: pop .22s ease; }
.screen.active { display: block; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.panel-title { font-size: 20px; font-weight: 900; color: #cf5570; display: flex; justify-content: space-between; align-items: baseline; }
.panel-title small { color: #8b654d; font-size: 12px; }
.orders-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.order-card { background: #fffaf0; border: 2px solid #ffe1bd; border-radius: 18px; padding: 8px; text-align: center; min-height: 104px; position: relative; }
.order-card.done { opacity: .58; filter: grayscale(.25); }
.order-icon { font-size: 31px; }
.order-card h3 { font-size: 13px; margin: 2px 0; }
.order-reward { font-weight: 900; font-size: 12px; color: #8a5a34; }
.order-card button { margin-top: 5px; background: var(--pink); color: #fff; border-radius: 999px; padding: 5px 10px; font-weight: 900; }
.board-wrap { margin: 8px 0; background: rgba(127, 95, 63, .16); border-radius: 24px; padding: 8px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.65); }
.board { display: grid; grid-template-columns: repeat(7, minmax(42px, 1fr)); gap: 5px; }
.cell { aspect-ratio: 1 / 1; background: linear-gradient(#fff7eb, #ffe8d1); border: 2px solid rgba(255,255,255,.75); border-radius: 15px; box-shadow: inset 0 -4px 7px rgba(111,67,39,.05), 0 3px 8px rgba(111,67,39,.08); display: grid; place-items: center; position: relative; padding: 2px; }
.cell.selected { outline: 4px solid var(--gold); background: #fff4ce; }
.cell.mergeable { box-shadow: 0 0 0 3px rgba(255,202,68,.65), inset 0 -4px 7px rgba(111,67,39,.05); }
.cell.empty::after { content: ""; width: 32%; height: 32%; border-radius: 50%; border: 2px dashed rgba(111,67,39,.14); }
.item-icon { font-size: clamp(21px, 7vw, 42px); filter: drop-shadow(0 3px 2px rgba(111,67,39,.14)); }
.item-label { position: absolute; left: 2px; right: 2px; bottom: 2px; font-size: 9px; line-height: 1; text-align: center; background: rgba(255,250,240,.82); border-radius: 9px; padding: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.level-badge, .gen-badge { position: absolute; top: 3px; right: 3px; background: var(--gold); border-radius: 999px; min-width: 18px; height: 18px; display: grid; place-items: center; font-size: 10px; font-weight: 900; color: #6d4327; }
.gen-badge { left: 3px; right: auto; background: #8ed1d1; color: white; }
.selected-panel { display: grid; grid-template-columns: 1fr auto 54px; align-items: center; gap: 8px; }
.selected-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cat { font-size: 42px; background: #fff6ed; border-radius: 50%; width: 54px; height: 54px; display: grid; place-items: center; box-shadow: 0 6px 14px rgba(111,67,39,.12); }
.bottom-nav { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100vw, 980px); display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(255,238,205,.9), rgba(255,211,178,.97)); border-top-left-radius: 24px; border-top-right-radius: 24px; box-shadow: 0 -8px 30px rgba(111,67,39,.18); z-index: 10; }
.tab { background: #fff1d9; border: 2px solid rgba(255,255,255,.9); border-radius: 20px; min-height: 64px; color: var(--brown); font-weight: 900; font-size: 24px; }
.tab span { display: block; font-size: 13px; }
.tab.active { background: linear-gradient(#ffced9, #f497af); color: white; text-shadow: 0 1px 0 rgba(111,67,39,.2); }
.room-scene, .decor-room, .scrapbook, .shop-card { min-height: 62svh; }
.room-scene { text-align: center; padding: 34px 18px; border-radius: 28px; background: linear-gradient(160deg, rgba(255,250,240,.9), rgba(218,235,206,.9)), url('/assets/mockups/mockup-decor-screen.png') center/cover; box-shadow: var(--shadow); overflow: hidden; }
.room-scene h2 { font-size: 34px; color: #cf5570; }
.hero-helper { font-size: 60px; }
.room-cards { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.decor-room { position: relative; border-radius: 28px; padding: 25px; background: linear-gradient(160deg, #ffe8d1, #d8ead0); box-shadow: var(--shadow); overflow: hidden; }
.decor-room::before { content: ""; position: absolute; inset: 0; background: url('/assets/mockups/mockup-decor-screen.png') center/cover; opacity: .28; }
.decor-room > div { position: absolute; font-size: 52px; filter: drop-shadow(0 10px 8px rgba(111,67,39,.18)); }
.sofa { left: 30%; bottom: 18%; } .lamp { right: 12%; top: 23%; } .table { left: 42%; bottom: 9%; } .pet-bed { right: 11%; bottom: 7%; }
.task-card { margin-top: -48px; position: relative; }
.task-card h2 { color: #cf5570; margin: 0 0 4px; display: flex; justify-content: space-between; }
.decor-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.decor-choice { background: #fffaf0; border: 2px solid #ffdfbe; border-radius: 18px; padding: 10px; text-align: center; min-height: 122px; }
.decor-choice .icon { font-size: 42px; }
.decor-choice button { background: #f49ab0; color: white; border-radius: 999px; padding: 6px 10px; font-weight: 900; }
.scrapbook { display: grid; grid-template-columns: 34% 1fr; gap: 10px; padding: 14px; background: linear-gradient(#fff5e6, #ffe6cf); border: 2px solid rgba(255,255,255,.8); border-radius: 28px; box-shadow: var(--shadow); }
.scrapbook aside { display: flex; flex-direction: column; gap: 8px; }
.chapter { min-height: 64px; background: #fffaf0; color: var(--brown); border-radius: 16px; padding: 8px; font-weight: 900; box-shadow: inset 0 -3px 0 rgba(111,67,39,.08); }
.chapter.active { background: #ffd4df; color: #bf4f68; }
.chapter.locked { opacity: .65; }
.scrapbook article { background: #fffaf2; border-radius: 22px; padding: 16px; text-align: center; }
.photo { margin: auto; display: grid; place-items: center; width: min(260px, 90%); aspect-ratio: 4/3; background: linear-gradient(160deg, #d7edd2, #ffcad8); border: 10px solid #fff; box-shadow: 0 8px 20px rgba(111,67,39,.18); font-size: 60px; transform: rotate(-1deg); }
.shop-card { text-align: center; padding: 40px 18px; }
@media (max-width: 640px) {
  .top-hero { align-items: flex-start; }
  .logo-card { min-width: 0; width: 46%; padding: 7px 9px; }
  .resource-bar { width: 54%; }
  .pill { min-height: 32px; padding: 4px 7px; font-size: 13px; }
  .connection-card { display: block; }
  .join-row { margin-top: 8px; }
  .join-row input { flex: 1; max-width: none; }
  .orders-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board { gap: 4px; }
  .cell { border-radius: 12px; }
  .selected-panel { grid-template-columns: 1fr; }
  .cat { display: none; }
  .decor-choices { grid-template-columns: 1fr; }
  .scrapbook { grid-template-columns: 1fr; }
  .scrapbook aside { display: grid; grid-template-columns: repeat(2, 1fr); }
}
