/* 보물 합치기 v4 — 물리 떨어뜨려 합치기 + 박물관 진열장 테마 */
.game-shell {
  position: relative;
  border-radius: 22px;
  padding: 12px 10px 14px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 206, 115, 0.22), transparent 55%),
    linear-gradient(180deg, #3c2418 0%, #24150e 100%);
  border: 2px solid #8c5c38;
  box-shadow: 0 14px 36px rgba(24, 13, 8, 0.4), inset 0 1px 0 rgba(255, 226, 168, 0.25);
  color: #fff8ec;
  overflow: hidden;
}

.game-shell.has-bg-art {
  background-image: linear-gradient(180deg, rgba(36,21,14,0.58), rgba(22,12,8,0.78)), url('./img/bg_museum_vault.webp');
  background-size: cover;
  background-position: center;
}

.game-font {
  font-family: 'Jua', 'Malgun Gothic', sans-serif;
  letter-spacing: 0.01em;
}

.game-hud {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.hud-scores {
  display: flex;
  gap: 6px;
}

.score-pill {
  background: linear-gradient(180deg, #4b2f1f 0%, #301b10 100%);
  border: 1.5px solid #96633c;
  border-radius: 12px;
  padding: 4px 9px;
  min-width: 68px;
  text-align: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.38);
}

.score-pill-label {
  display: block;
  font-size: 0.65rem;
  color: #e6c699;
  font-weight: 700;
}

.score-pill-val {
  display: block;
  font-size: 1.04rem;
  color: #fff6db;
  line-height: 1.15;
}

.next-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(180deg, #563622 0%, #341f12 100%);
  border: 1.5px solid #d49c46;
  border-radius: 13px;
  padding: 4px 10px 4px 7px;
}

.next-thumb {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid #ffe49c;
  flex-shrink: 0;
}

.next-thumb img { width: 88%; height: 88%; object-fit: contain; }

.next-meta { line-height: 1.15; }
.next-label { display: block; font-size: 0.64rem; color: #f2cf8d; font-weight: 700; }
.next-name { display: block; font-size: 0.82rem; color: #fff8e7; }

.goal-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
  border-radius: 11px;
  background: linear-gradient(90deg, rgba(245,194,73,0.18), rgba(184,119,11,0.12));
  border: 1px solid rgba(245,194,73,0.42);
  font-size: 0.8rem;
}

.goal-text strong { color: #ffe394; }

.combo-pill {
  padding: 2px 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff9f1c, #d95d00);
  color: #fff;
  font-weight: 800;
  font-size: 0.76rem;
  white-space: nowrap;
}

.danger-bar {
  margin-bottom: 7px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(201, 42, 42, 0.9);
  color: #fff;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  animation: pulse-warn 0.6s ease-in-out infinite;
}

@keyframes pulse-warn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.game-ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.gbtn {
  font-family: 'Jua', 'Malgun Gothic', sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  border-radius: 13px;
  padding: 7px 11px;
  font-size: 0.84rem;
  cursor: pointer;
  color: #fff8ec;
  background: linear-gradient(180deg, #8b5a34 0%, #633d20 100%);
  box-shadow: 0 4px 0 #3a210f, 0 5px 10px rgba(0,0,0,0.3);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.gbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #3a210f; }

.gbtn--gold {
  color: #3d2105;
  background: linear-gradient(180deg, #ffe285 0%, #e59f1d 100%);
  box-shadow: 0 4px 0 #945d05, 0 5px 12px rgba(229,159,29,0.35);
}

.gbtn--gold:active { box-shadow: 0 1px 0 #945d05; }
.gbtn--sm { padding: 6px 9px; font-size: 0.78rem; }
.gbtn.is-off { opacity: 0.56; filter: grayscale(0.4); }

/* 물리 캔버스 상자 영역 */
.canvas-stage-wrap {
  position: relative;
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  border-radius: 18px;
  padding: 6px;
  background: linear-gradient(180deg, #744a2c 0%, #4b2c17 100%);
  border: 2px solid #a87549;
  box-shadow: inset 0 3px 10px rgba(0,0,0,0.45), 0 8px 20px rgba(0,0,0,0.38);
  touch-action: none;
  user-select: none;
}

.canvas-stage-wrap.shake { animation: board-shake 0.2s ease; }

@keyframes board-shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, -1px); }
}

#drop-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 11.4 / 13.8;
  border-radius: 13px;
  cursor: pointer;
  touch-action: none;
}

.discover-toast {
  margin-top: 9px;
  padding: 8px 11px;
  border-radius: 12px;
  background: linear-gradient(90deg, #593310, #7c4711);
  border: 1.5px solid #ffd46b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
}

.discover-toast strong { color: #ffe58f; }

.game-hint-line {
  margin: 7px 0 0;
  text-align: center;
  font-size: 0.76rem;
  color: #e2c8a4;
}

/* 모달 */
.game-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(18, 10, 6, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.game-modal.hidden { display: none !important; }

.game-modal-card {
  width: 100%;
  max-width: 440px;
  max-height: 86vh;
  overflow-y: auto;
  border-radius: 20px;
  background: #fff9ef;
  color: #2b1a10;
  border: 3px solid #b57b3b;
  padding: 20px 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}

.game-modal-title { margin: 0 0 10px; font-size: 1.32rem; color: #4b280b; }
.tut-steps { display: flex; flex-direction: column; gap: 9px; margin: 12px 0 16px; }
.tut-step { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #f8ecd9; border: 1px solid #e2c8a2; font-size: 0.89rem; }
.tut-num { width: 25px; height: 25px; border-radius: 50%; background: #b8770b; color: #fff; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dex-list { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.dex-item { display: flex; gap: 11px; align-items: flex-start; padding: 10px; border-radius: 14px; border: 1.5px solid #e4cfa9; background: #fffdf8; }
.dex-item.is-locked { opacity: 0.62; background: #f2ebe1; }
.dex-icon { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 4px; border: 2px solid rgba(130,85,35,0.4); }
.dex-icon img { width: 92%; height: 92%; object-fit: contain; }
.dex-name { font-weight: 900; font-size: 0.94rem; color: #2b1a10; }
.dex-era { font-size: 0.74rem; font-weight: 800; color: #9a5a08; margin-left: 4px; }
.dex-line { margin: 3px 0 0; font-size: 0.84rem; color: #4b3525; font-weight: 700; }
.dex-more { margin: 3px 0 0; font-size: 0.79rem; color: #6c5240; line-height: 1.52; }
.dex-src { margin: 3px 0 0; font-size: 0.71rem; color: #8c7462; }
