@font-face { font-family: "DC Gureum Sans"; src: url("fonts/DCGureumSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DC Gureum Sans"; src: url("fonts/DCGureumSans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #5a3e2b;
  --cream: #fff8ee;
  --card: rgba(255, 250, 242, 0.92);
  --accent: #ff8a65;
  --line: #5a3e2b;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "DC Gureum Sans", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: #f4e6d2;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- 처음 ---------- */
#start {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: #f4e6d2 url("art/room.webp?v=1") 38% 100% / cover no-repeat;
}
.startCard {
  width: min(420px, 100%); background: var(--card); border-radius: 28px; padding: 24px 20px 18px;
  text-align: center; box-shadow: 0 10px 30px rgba(90, 62, 43, 0.2);
}
.startCard h1 { margin: 0; font-size: 40px; letter-spacing: -1px; }
.lead { margin: 4px 0 16px; opacity: 0.8; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  background: #fff; border: 3px solid transparent; border-radius: 22px; padding: 8px 6px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 700;
}
.choice img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.choice[aria-pressed="true"] { border-color: var(--accent); background: #fff3ea; }
.nameLabel { display: block; margin: 16px 0 6px; font-weight: 700; }
#name {
  width: 100%; font: inherit; font-size: 20px; text-align: center; padding: 12px; border-radius: 16px;
  border: 2px solid #e6d3bd; background: #fff; color: var(--ink);
}
.big {
  margin-top: 12px; width: 100%; border: 0; border-radius: 999px; padding: 14px; font-size: 20px; font-weight: 700;
  background: var(--accent); color: #fff; box-shadow: 0 4px 0 #d9684a;
}
.big:active { transform: translateY(3px); box-shadow: 0 1px 0 #d9684a; }
.made { margin: 12px 0 0; font-size: 13px; opacity: 0.7; }

/* ---------- 집 ---------- */
#home {
  position: fixed; inset: 0; overflow: hidden;
  background: #f4e6d2 url("art/room.webp?v=1") 38% 100% / cover no-repeat;
}
.top { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 16px; right: 16px; }
.card { background: var(--card); border-radius: 22px; padding: 12px 14px 8px; box-shadow: 0 6px 18px rgba(90, 62, 43, 0.15); max-width: 520px; margin: 0 auto; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.name { font-weight: 700; font-size: 22px; }
.sub { font-size: 13px; opacity: 0.75; }
.share { border: 0; background: var(--accent); color: #fff; border-radius: 999px; padding: 9px 14px; font-weight: 700; white-space: nowrap; box-shadow: 0 3px 0 #d9684a; }
.streak { margin: 6px 0 8px; font-size: 14px; font-weight: 700; color: #e0663f; }
.gauges { display: grid; grid-template-columns: auto 1fr 2.2em; gap: 5px 8px; align-items: center; font-size: 13px; }
.gauges b { text-align: right; font-weight: 700; }
.bar { height: 11px; border-radius: 99px; background: #efe2d0; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: #8ccf7e; transition: width 0.6s, background 0.6s; }
.brand { margin: 8px 0 0; font-size: 11px; opacity: 0.65; text-align: right; }

.stage {
  position: absolute; left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center;
}
.petWrap { position: relative; width: min(66vw, 330px, 40vh); }
.pet { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(90, 62, 43, 0.2)); }
.pet.bounce { animation: bounce 0.7s ease; }
.pet.shake { animation: shake 0.45s ease; }
@keyframes bounce { 0%, 100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-18px) scale(1.04, 0.97); } 60% { transform: translateY(0) scale(0.97, 1.03); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

.product {
  position: absolute; right: -14%; bottom: 2%; height: 58%; width: auto; z-index: 2;
  opacity: 0; transform: translateX(40px) rotate(12deg); transition: opacity 0.25s, transform 0.35s;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.25)); pointer-events: none;
}
.product.show { opacity: 1; transform: translateX(0) rotate(8deg); }

.bubble {
  position: relative; margin-bottom: 8px; max-width: 320px; background: #fff; border: 2px solid var(--line);
  border-radius: 18px; padding: 9px 14px; font-size: 15px; font-weight: 700; text-align: center; line-height: 1.35;
  box-shadow: 0 4px 0 rgba(90, 62, 43, 0.25); animation: pop 0.25s ease;
}
.bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -9px; width: 14px; height: 14px; background: #fff;
  border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: translateX(-50%) rotate(45deg);
}
@keyframes pop { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.fx { position: absolute; inset: 0; pointer-events: none; }
.fx span { position: absolute; font-size: 26px; animation: rise 1.2s ease-out forwards; }
@keyframes rise { from { transform: translateY(0) scale(0.6); opacity: 1; } to { transform: translateY(-90px) scale(1.2); opacity: 0; } }

.actions {
  position: absolute; left: 16px; right: 16px; bottom: max(14px, env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 520px; margin: 0 auto;
}
.act {
  background: #fffaf2; border: 2px solid var(--line); border-radius: 22px; padding: 8px 0 7px;
  display: flex; flex-direction: column; align-items: center; font-size: 15px; font-weight: 700;
  box-shadow: 0 4px 0 var(--line);
}
.act span { font-size: 26px; line-height: 1.1; }
.act:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.act:disabled { opacity: 0.55; }

/* ---------- 자랑하기 ---------- */
.sheet { position: fixed; inset: 0; background: rgba(40, 28, 20, 0.7); display: grid; place-items: center; padding: 16px; z-index: 10; }
.sheetCard { background: var(--cream); border-radius: 24px; padding: 14px; width: min(420px, 100%); text-align: center; }
.sheetCard img { width: 100%; max-height: 62vh; object-fit: contain; border-radius: 14px; }
.sheetCard p { margin: 8px 0 0; font-size: 14px; }
.sheetBtns { display: grid; gap: 6px; }
.plain { border: 0; background: none; padding: 10px; font-weight: 700; opacity: 0.7; }

@media (min-height: 760px) { .stage { bottom: calc(110px + env(safe-area-inset-bottom)); } }
