/* 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_04_house_interior.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: 10px 14px calc(10px + var(--safe-b)); gap: 8px; }

.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: 26px/1 var(--head); color: var(--coral-dark); }
.brand small { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.status { display: flex; justify-content: space-between; font-size: 13px; color: #6d5a49; background: rgba(255, 250, 243, .82); border-radius: 14px; padding: 6px 12px; box-shadow: var(--shadow); }
.stage { flex: 1; min-height: 0; display: grid; place-items: center; container-type: size; }
.card { width: min(100cqw, 100cqh); aspect-ratio: 1; padding: 10px; border-radius: 28px; position: relative; background:
    repeating-linear-gradient(135deg, rgba(232, 214, 192, .18) 0 6px, transparent 6px 12px),
    repeating-linear-gradient(45deg, rgba(232, 214, 192, .18) 0 6px, transparent 6px 12px), var(--paper);
  box-shadow: var(--shadow); }
.card::before { content: ""; position: absolute; inset: 5px; border: 2px dashed var(--stitch); border-radius: 24px; pointer-events: none; }
.card canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.card.won { animation: glow 1.2s ease; }
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tool { display: flex; align-items: center; justify-content: center; gap: 6px; height: 50px; border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); font: 17px var(--head); color: #6d5a49; }
.tool img { width: 26px; height: 26px; }
.tool:active { transform: scale(.96); }
.tool:disabled { opacity: .45; }
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 10px 0; }
.grid button { aspect-ratio: 1; border-radius: 14px; background: #fff3e2; font: 17px var(--head); color: #6d4f35; display: grid; place-items: center; line-height: 1; position: relative; }
.grid button small { font-size: 9px; color: var(--gold); letter-spacing: -1px; }
.grid button.cur { box-shadow: 0 0 0 3px var(--coral); }
.grid button:disabled { opacity: .35; }
.stars { font-size: 30px; color: var(--gold); letter-spacing: 4px; }
@keyframes glow { 50% { box-shadow: var(--shadow), 0 0 0 6px rgba(233, 180, 76, .55); } }

/* 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; } }

.completion-guide { margin: 0; flex: none; font-size: 12px; line-height: 1.4; text-align: center; color: #6d5a49; }
