/* Same palette, type and card language as the other Hoodimong games (cream cards, stitch lines, round buttons). */
:root {
  --cream: #f6eee3;
  --paper: #fffaf3;
  --ink: #3b3029;
  --muted: #8b7d70;
  --line: #eadccb;
  --coral: #e8846a;
  --coral-dark: #c96a52;
  --gold: #e9b44c;
  --stitch: #e0c6a8;
  --shadow: 0 6px 18px rgba(92, 66, 40, .14);
  --head: "Jua", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --body: -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--cream) url(assets/bg/bg_03_house_exterior.jpg) center / cover no-repeat fixed;
  color: var(--ink);
  font: 15px/1.45 var(--body);
  overscroll-behavior: none;
  touch-action: manipulation;
}
body::before { content: ""; position: fixed; inset: 0; background: rgba(246, 238, 227, .72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: -1; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }

#app { max-width: 480px; height: 100dvh; margin: 0 auto; overflow: hidden; display: flex; flex-direction: column; padding: 8px 12px calc(8px + var(--safe-b)); gap: 7px; }

.icon-btn { width: 44px; height: 44px; border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); display: grid; place-items: center; flex: none; }
.icon-btn img { width: 30px; height: 30px; }
.icon-btn:active { transform: scale(.94); }
.lang-btn { width: 40px; font: 15px/1 var(--head); color: var(--coral-dark); }
.sheet .lang-btn { width: 52px; }

.topbar { display: flex; align-items: center; gap: 8px; }
.brand { flex: 1; display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand b { font: 23px/1 var(--head); color: var(--coral-dark); white-space: nowrap; }
.brand small { color: var(--muted); font-size: 12px; margin-top: 3px; }
.stars { display: flex; align-items: center; gap: 4px; background: var(--paper); border-radius: 999px; padding: 7px 12px; box-shadow: var(--shadow); font: 18px var(--head); }
.stars span { color: var(--gold); }
.stars.bump b { animation: bump .4s ease; }

/* the garden */
.house { position: relative; flex: 1; min-height: 130px; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); background: #f3efe9; }
.house::after { content: ""; position: absolute; inset: 5px; border: 2px dashed rgba(255, 255, 255, .8); border-radius: 20px; pointer-events: none; }
.scene { position: absolute; left: 0; width: 100%; aspect-ratio: 720 / 1284; background: url(assets/bg/bg_03_house_exterior.jpg) center / 100% 100% no-repeat; }
.deco { position: absolute; transform: translate(-50%, -50%); filter: drop-shadow(0 3px 3px rgba(92, 66, 40, .25)); }
.deco.new { animation: placed .7s cubic-bezier(.2, .9, .3, 1.4); }
.spot { position: absolute; transform: translate(-50%, -50%); aspect-ratio: 1; border-radius: 50%; border: 3px dashed rgba(201, 106, 82, .7); background: rgba(255, 250, 243, .55); display: grid; place-items: center; font: 20px var(--head); color: var(--coral-dark); animation: breathe 1.6s ease-in-out infinite; }
.visitor { position: absolute; top: 75%; width: 15%; transform: translate(-50%, -100%); animation: placed .8s cubic-bezier(.2, .9, .3, 1.4) both; filter: drop-shadow(0 3px 3px rgba(92, 66, 40, .25)); }

.decorbar { display: flex; align-items: center; gap: 8px; background: rgba(255, 250, 243, .9); border-radius: 16px; padding: 5px 6px 5px 12px; box-shadow: var(--shadow); font-size: 13.5px; }
.decorbar > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deco-btn { background: linear-gradient(180deg, #ef977d, var(--coral)); color: #fff; font: 16px var(--head); border-radius: 12px; padding: 7px 12px; box-shadow: 0 3px 0 var(--coral-dark); white-space: nowrap; }
.deco-btn:disabled { background: #e6d8c7; color: #9b8b7c; box-shadow: none; }
.deco-btn.ready { animation: ready 1s ease-in-out infinite; }

/* orders */
.orders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.order { background: var(--paper); border-radius: 16px; box-shadow: var(--shadow); padding: 5px 6px; display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; gap: 2px 4px; align-items: center; text-align: left; position: relative; min-height: 70px; }
.order > img { width: 34px; height: 40px; object-fit: contain; grid-row: 1 / 3; }
.order .wants { display: flex; gap: 2px; }
.order .want { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.order .want img { width: 80%; height: 80%; object-fit: contain; }
.order .want.have::after { content: "✓"; position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; border-radius: 50%; background: #7fae6a; color: #fff; font-size: 10px; display: grid; place-items: center; }
.order small { font: 13px var(--head); color: #8a6a4c; }
.order small b { color: var(--gold); }
.order.ready { box-shadow: 0 0 0 3px var(--gold), var(--shadow); animation: ready 1s ease-in-out infinite; }
.order.ready small::after { content: attr(data-ready); margin-left: 4px; color: var(--coral-dark); }
.order.new { animation: placed .5s ease; }

/* board */
.boardwrap { display: grid; place-items: center; }
.board { width: min(100%, calc((100dvh - 505px) * 6 / 7)); min-width: 240px; aspect-ratio: 6 / 7; display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(7, 1fr); gap: 4px; padding: 6px; border-radius: 20px; background:
    repeating-linear-gradient(135deg, rgba(232, 214, 192, .2) 0 6px, transparent 6px 12px), var(--paper); box-shadow: var(--shadow); touch-action: none; }
.cell { border-radius: 12px; background: rgba(234, 220, 203, .45); position: relative; display: grid; place-items: center; }
.cell.over { box-shadow: inset 0 0 0 3px var(--gold); }
.item { width: 92%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; position: relative; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .07), 0 2px 4px rgba(92, 66, 40, .18); touch-action: none; }
.item::before { content: ""; position: absolute; inset: 9%; border-radius: 50%; border: 1.5px dashed rgba(255, 255, 255, .75); }
.item img { width: 74%; height: 74%; object-fit: contain; pointer-events: none; }
.item.lift { opacity: .25; }
.item.pop { animation: pop .45s cubic-bezier(.2, .9, .3, 1.4); }
.item.wanted { box-shadow: 0 0 0 2px var(--gold), 0 2px 4px rgba(92, 66, 40, .18); }
.ghost { position: fixed; z-index: 50; pointer-events: none; transform: translate(-50%, -60%) scale(1.15); }
.ghost .item { width: 100%; }

.givers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.giver { display: flex; align-items: center; gap: 6px; height: 50px; border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); padding: 0 10px; font: 15px var(--head); color: #6d5a49; }
.giver > img { width: 40px; height: 46px; object-fit: contain; margin-top: -8px; }
.giver .mini { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; margin-left: auto; }
.giver .mini img { width: 80%; }
.giver:active { transform: scale(.96); }

@keyframes placed { 0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; } 60% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1); } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes breathe { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.08); } }

/* sheets, buttons, toast (as in the puzzle game) */
.overlay { position: fixed; inset: 0; z-index: 30; background: rgba(59, 48, 41, .42); display: grid; place-items: end center; animation: fade .2s ease; }
.sheet { width: min(480px, 100%); background: var(--paper); border-radius: 28px 28px 0 0; padding: 18px 20px calc(20px + var(--safe-b)); box-shadow: 0 -8px 30px rgba(60, 40, 25, .25); animation: rise .28s cubic-bezier(.2, .9, .3, 1.1); text-align: center; max-height: 92dvh; overflow: auto; }
.sheet .eyebrow { font-size: 12px; letter-spacing: .5px; color: var(--muted); }
.sheet h2 { font: 26px/1.25 var(--head); margin: 4px 0 6px; }
.sheet p { margin: 6px 0; color: #5d4f44; }
.sheet .actor { display: flex; justify-content: center; align-items: flex-end; gap: 4px; min-height: 120px; margin: 4px 0; }
.sheet .actor img { width: 110px; }
.sheet .steps { text-align: left; margin: 10px 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.sheet .steps li { background: #fff3e2; border-radius: 14px; padding: 8px 12px; font-size: 14px; color: #6d4f35; display: flex; gap: 8px; align-items: center; }
.sheet .steps img { width: 30px; height: 30px; object-fit: contain; flex: none; }
.sheet .tip { background: #fff3e2; border-radius: 14px; padding: 8px 12px; font-size: 13.5px; color: #7a5a3c; }
.sheet .result { display: flex; justify-content: center; gap: 10px; margin: 10px 0 4px; flex-wrap: wrap; }
.sheet .result span { background: #fff3e2; border-radius: 14px; padding: 6px 12px; font: 16px var(--head); display: flex; align-items: center; gap: 6px; }
.sheet .result img { width: 28px; height: 28px; object-fit: contain; }
.btn { width: 100%; height: 54px; border-radius: 18px; font: 21px var(--head); margin-top: 10px; }
.btn.primary { background: linear-gradient(180deg, #ef977d, var(--coral)); color: #fff; box-shadow: 0 5px 0 var(--coral-dark); }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--coral-dark); }
.btn.ghost { background: #f3e8da; color: #6d5a49; }
.setting { display: flex; justify-content: space-between; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.switch { width: 52px; height: 30px; border-radius: 15px; background: #ddd0c0; position: relative; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--coral); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
.toast { position: fixed; left: 50%; top: 14px; transform: translate(-50%, -140%); background: #3b3029; color: #fff; padding: 10px 16px; border-radius: 14px; z-index: 40; font-size: 14px; transition: transform .25s ease; max-width: 90vw; text-align: center; }
.toast.show { transform: translate(-50%, 0); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes pulse { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.08); } }
@keyframes ready { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-4px) scale(1.05); } }
@keyframes alarm { 50% { box-shadow: var(--shadow), 0 0 0 6px rgba(232, 132, 106, .35); } }
@keyframes cheer { 0% { transform: translateY(40%) scale(.6); opacity: 0; } 18% { transform: translateY(-6%) scale(1.04); opacity: 1; } 30% { transform: translateY(0) scale(1); } 80% { opacity: 1; } 100% { transform: translateY(20%) scale(.9); opacity: 0; } }

body.reduced *, body.reduced *::before, body.reduced *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
@media (max-height: 700px) { .friend .ring { width: 48px; height: 48px; } .friend .ring img { width: 40px; height: 40px; } .friend small { min-height: 0; } }
