/* 두더지 팡 화면 — 흙 갈색·잔디 초록·주황(들판) */
:root {
  --soil: #8a5a3b; --soil2: #6b4229; --soilD: #4a2c17;
  --grass: #74c94e; --grass2: #4fa83a; --grassD: #2f7a2a;
  --orange: #ff8a1f; --orange2: #d96a00;
  --cream: #fff6e4; --ink: #3b2414; --gold: #ffd23f;
  --cell: 100px;
}
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  background: #141a33; overflow: hidden; position: fixed;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: rgba(0,0,0,0);
  -webkit-text-size-adjust: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  color: var(--ink);
}
button { font-family: inherit; cursor: pointer; touch-action: manipulation; -webkit-appearance: none; appearance: none; }
svg text { font-family: inherit; }
.hidden { display: none !important; }
#app { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
.screen { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }

/* ===== 공통 단추 ===== */
.ibtn {
  -webkit-flex: none; flex: none;
  width: 56px; height: 56px; border: 0; border-radius: 18px; padding: 0;
  background: rgba(255,255,255,0.2); color: #fff; font-size: 26px; line-height: 56px; text-align: center;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.18);
  -webkit-transition: -webkit-transform 0.1s; transition: transform 0.1s;
}
.ibtn:active { -webkit-transform: scale(0.92); transform: scale(0.92); }
.ibtn.dark { background: var(--soil); }
.btn {
  min-height: 60px; min-width: 120px; border: 0; border-radius: 20px; padding: 0 22px; margin: 6px;
  font-size: 21px; font-weight: 900; color: #fff; background: var(--orange);
  box-shadow: inset 0 -5px 0 rgba(0,0,0,0.2), 0 4px 0 rgba(74,44,23,0.25);
  -webkit-transition: -webkit-transform 0.1s; transition: transform 0.1s;
}
.btn:active { -webkit-transform: translateY(2px) scale(0.97); transform: translateY(2px) scale(0.97); }
.btn.big { min-height: 68px; font-size: 24px; min-width: 220px; }
.btn.green { background: var(--grass2); }
.btn.brown { background: var(--soil); }
.btn.ghost { background: rgba(138,90,59,0.15); color: var(--soil2); box-shadow: none; }
.btn:disabled { opacity: 0.42; }
.btnRow { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; -webkit-justify-content: center; justify-content: center; }

.coins {
  display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center;
  height: 44px; padding: 0 14px 0 8px; border-radius: 22px; background: rgba(0,0,0,0.25);
  color: #ffe27a; font-weight: 900; font-size: 20px; white-space: nowrap; margin: 0 6px;
}
.coins.inCard { display: -webkit-inline-flex; display: inline-flex; background: var(--soil2); color: #ffe27a; margin: 4px 0 10px; }
.coin {
  display: inline-block; position: relative; width: 26px; height: 26px; border-radius: 50%; margin-right: 6px;
  background: radial-gradient(circle at 35% 32%, #fff6b0 0, #ffd23f 42%, #e2a200 100%);
  box-shadow: inset 0 0 0 2px #c48600;
}
.coin::after { content: "★"; position: absolute; left: 0; top: 0; width: 100%; line-height: 26px; text-align: center; font-size: 13px; color: #b27800; }

/* ===== 지도 ===== */
#mapScreen {
  display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column;
  background-color: var(--grass);
  background-image: radial-gradient(rgba(255,255,255,0.14) 2px, transparent 3px), radial-gradient(rgba(47,122,42,0.25) 3px, transparent 4px);
  background-size: 34px 34px, 52px 52px; background-position: 0 0, 17px 21px;
}
.topbar {
  -webkit-flex: none; flex: none; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center;
  padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top, 0px));
  padding-left: calc(10px + env(safe-area-inset-left, 0px)); padding-right: calc(10px + env(safe-area-inset-right, 0px));
  background: var(--soil2); box-shadow: 0 4px 0 rgba(74,44,23,0.35); position: relative; z-index: 2;
}
.topbar h1 { -webkit-flex: 1; flex: 1; margin: 0 10px; font-size: 25px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 0 rgba(0,0,0,0.3); }
.topbar .ibtn + .ibtn { margin-left: 6px; }
.scroll {
  -webkit-flex: 1; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 14px 12px 30px; padding-left: calc(12px + env(safe-area-inset-left, 0px));
  padding-right: calc(12px + env(safe-area-inset-right, 0px)); padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
}
.wrapIn { max-width: 720px; margin: 0 auto; }
.hero {
  display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center;
  background: rgba(255,246,228,0.92); border-radius: 26px; padding: 8px 16px 8px 8px; margin-bottom: 16px;
  box-shadow: 0 6px 0 rgba(74,44,23,0.3);
}
.heroArt { width: 96px; height: 96px; -webkit-flex: none; flex: none; position: relative; }
.heroArt svg { width: 100%; height: 100%; display: block; }
.heroTxt { font-size: 21px; font-weight: 900; margin-left: 10px; line-height: 1.35; }
.heroTxt small { font-size: 15px; font-weight: 700; color: var(--soil); }

.chapter { background: var(--cream); border-radius: 24px; margin: 0 0 16px; box-shadow: 0 6px 0 rgba(74,44,23,0.32); overflow: hidden; }
.chHead {
  display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center;
  padding: 10px 14px; background: var(--chc, #ffd23f); font-weight: 900; font-size: 19px; color: var(--ink);
}
.chIcon { font-size: 26px; margin-right: 8px; }
.chNum { background: rgba(255,255,255,0.65); border-radius: 12px; padding: 2px 9px; margin-right: 8px; font-size: 15px; white-space: nowrap; }
.chName { -webkit-flex: 1; flex: 1; }
.chProg { font-size: 15px; opacity: 0.75; white-space: nowrap; }
.lvGrid { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; padding: 6px; }
.lv {
  position: relative; width: calc(25% - 12px); margin: 6px; min-height: 76px; border: 0; border-radius: 22px; padding: 6px 2px;
  background: var(--soil); color: #fff; box-shadow: inset 0 -7px 0 rgba(0,0,0,0.25);
  display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column;
  -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center;
  -webkit-transition: -webkit-transform 0.1s; transition: transform 0.1s;
}
.lv:active { -webkit-transform: scale(0.94); transform: scale(0.94); }
.lv b { font-size: 26px; line-height: 1.05; }
.lv small { font-size: 12px; font-weight: 800; color: #ffe27a; margin-top: 3px; white-space: nowrap; }
.lv.done { background: #6b8f3a; }
.lv.cur { background: var(--orange); box-shadow: inset 0 -7px 0 rgba(0,0,0,0.2), 0 0 0 4px #fff, 0 0 0 7px var(--orange); }
.q2 .lv.cur { -webkit-animation: curPulse 1.1s ease-in-out infinite; animation: curPulse 1.1s ease-in-out infinite; }
.lv.cur small { color: #fff; }
.lv.locked { background: #bba98f; color: rgba(255,255,255,0.85); box-shadow: inset 0 -5px 0 rgba(0,0,0,0.12); }
.lv.locked b { font-size: 20px; }
.lv.locked small { color: rgba(255,255,255,0.9); font-size: 15px; }
.lv.nope { -webkit-animation: nope 0.35s; animation: nope 0.35s; }
@-webkit-keyframes curPulse { 0%,100% { -webkit-transform: scale(1); } 50% { -webkit-transform: scale(1.06); } }
@keyframes curPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@-webkit-keyframes nope { 0%,100% { -webkit-transform: translateX(0); } 25% { -webkit-transform: translateX(-6px); } 75% { -webkit-transform: translateX(6px); } }
@keyframes nope { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.modes { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -6px; }
.mode {
  width: calc(50% - 12px); margin: 6px; min-height: 96px; border: 0; border-radius: 24px; padding: 12px 14px; text-align: left;
  color: #fff; box-shadow: inset 0 -7px 0 rgba(0,0,0,0.2), 0 6px 0 rgba(74,44,23,0.28);
  display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center;
}
.mode.daily { background: linear-gradient(135deg, #ffa53a, #ff7a1a); }
.mode.endless { background: linear-gradient(135deg, #5aa83f, #2f7a2a); }
.mode.locked { background: #bba98f; }
.mode .mIco { font-size: 40px; margin-right: 12px; -webkit-flex: none; flex: none; }
.mode .mTxt { -webkit-flex: 1; flex: 1; }
.mode .mTxt b { display: block; font-size: 22px; }
.mode .mTxt small { display: block; font-size: 14px; font-weight: 800; margin-top: 3px; opacity: 0.95; }
.saveNote { text-align: center; color: #fff; font-weight: 800; font-size: 14px; background: rgba(74,44,23,0.55); border-radius: 14px; padding: 8px 12px; }
@media (max-width: 520px) {
  .mode { width: calc(100% - 12px); }
  .lv { min-height: 70px; }
  .topbar h1 { font-size: 21px; margin: 0 6px; }
  .coins { padding: 0 10px 0 6px; font-size: 18px; margin: 0 4px; }
}
@media (max-width: 360px) {
  .topbar h1 { font-size: 0; margin: 0; }
}

/* ===== 게임 화면 ===== */
#gameScreen {
  display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column;
  background-color: #6cc04a;
  background-image: radial-gradient(rgba(255,255,255,0.13) 2px, transparent 3px), radial-gradient(rgba(47,122,42,0.28) 3px, transparent 4px);
  background-size: 34px 34px, 52px 52px; background-position: 0 0, 17px 21px;
}
#hud {
  -webkit-flex: none; flex: none; color: #fff; position: relative; z-index: 3;
  padding: 8px 10px 10px; padding-top: calc(8px + env(safe-area-inset-top, 0px));
  padding-left: calc(10px + env(safe-area-inset-left, 0px)); padding-right: calc(10px + env(safe-area-inset-right, 0px));
  background: rgba(74,44,23,0.9); box-shadow: 0 4px 0 rgba(0,0,0,0.18);
}
.hudRow { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; }
#lvTitle { -webkit-flex: 1; flex: 1; text-align: center; font-weight: 900; font-size: 19px; line-height: 1.2; padding: 0 6px; }
.bar { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; margin-top: 8px; }
.bIco { width: 32px; font-size: 22px; text-align: center; -webkit-flex: none; flex: none; }
.track {
  -webkit-flex: 1; flex: 1; position: relative; height: 22px; margin: 0 8px; border-radius: 11px; overflow: hidden;
  background: rgba(0,0,0,0.38); box-shadow: inset 0 3px 0 rgba(0,0,0,0.25);
}
.fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 11px; }
#timeFill { background: linear-gradient(#9cf07a, #4fbf3a); }
#goalFill { background: linear-gradient(#ffd27a, #ff8a1f); -webkit-transition: width 0.18s; transition: width 0.18s; }
.bTxt { min-width: 62px; text-align: right; font-size: 19px; font-weight: 900; white-space: nowrap; }
#timeBar.low #timeFill { background: linear-gradient(#ff9a7a, #ff4f3f); }
#timeBar.low .bTxt { color: #ffb0a0; -webkit-animation: blink 0.5s ease-in-out infinite alternate; animation: blink 0.5s ease-in-out infinite alternate; }
#timeBar.plus .track { box-shadow: 0 0 0 3px #8dffb0, 0 0 14px #8dffb0; }
#goalBar.reached #goalFill { background: linear-gradient(#fff3a0, #ffc21a); }
#goalBar.reached .track { box-shadow: 0 0 0 3px #ffd23f; }
#goalBar.reached .bTxt { color: #ffe27a; }
.scoreRow { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; margin-top: 8px; font-weight: 900; font-size: 17px; }
.scoreRow span:first-child { opacity: 0.85; margin: 0 8px 0 6px; }
#scoreTxt { font-size: 24px; color: #ffe27a; display: inline-block; }
#scoreTxt.pop { -webkit-animation: pop 0.25s; animation: pop 0.25s; }
.goalOk { margin-left: auto; background: var(--gold); color: var(--ink); border-radius: 14px; padding: 3px 10px; font-size: 15px; }
@-webkit-keyframes blink { from { opacity: 1; } to { opacity: 0.35; } }
@keyframes blink { from { opacity: 1; } to { opacity: 0.35; } }
@-webkit-keyframes pop { 0% { -webkit-transform: scale(1); } 50% { -webkit-transform: scale(1.3); } 100% { -webkit-transform: scale(1); } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }

#gameScreen.wide { -webkit-flex-direction: row; flex-direction: row; }
#gameScreen.wide #hud {
  width: 250px; box-sizing: border-box; overflow-y: auto;
  padding-left: calc(12px + env(safe-area-inset-left, 0px)); padding-right: 12px;
  display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; -webkit-justify-content: center; justify-content: center;
}
#gameScreen.wide .hudRow { -webkit-flex-wrap: wrap; flex-wrap: wrap; -webkit-justify-content: space-between; justify-content: space-between; }
#gameScreen.wide #lvTitle { -webkit-order: 3; order: 3; width: 100%; -webkit-flex: none; flex: none; margin-top: 12px; padding: 0; }
#gameScreen.wide .bar { margin-top: 14px; }
#gameScreen.wide .track { margin: 0 6px; }
#gameScreen.wide .bTxt { min-width: 52px; font-size: 17px; }
#gameScreen.wide .scoreRow { margin-top: 14px; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
#gameScreen.wide .goalOk { margin: 8px 0 0; }

#boardArea {
  -webkit-flex: 1; flex: 1; position: relative; min-height: 0; min-width: 0;
  margin-bottom: env(safe-area-inset-bottom, 0px); margin-right: env(safe-area-inset-right, 0px);
}
#board {
  position: absolute; left: 50%; top: 50%; width: 300px; height: 300px;
  -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);
  display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap;
  touch-action: none;
}
#board.shake { -webkit-animation: shake 0.3s; animation: shake 0.3s; }
@-webkit-keyframes shake { 0%,100% { -webkit-transform: translate(-50%,-50%); } 20% { -webkit-transform: translate(calc(-50% - 7px),-50%); } 40% { -webkit-transform: translate(calc(-50% + 7px),calc(-50% + 3px)); } 60% { -webkit-transform: translate(calc(-50% - 5px),-50%); } 80% { -webkit-transform: translate(calc(-50% + 4px),-50%); } }
@keyframes shake { 0%,100% { transform: translate(-50%,-50%); } 20% { transform: translate(calc(-50% - 7px),-50%); } 40% { transform: translate(calc(-50% + 7px),calc(-50% + 3px)); } 60% { transform: translate(calc(-50% - 5px),-50%); } 80% { transform: translate(calc(-50% + 4px),-50%); } }

/* 구멍 하나 = 칸 전체가 터치 영역 */
.cell { position: relative; width: 33.3333%; height: 33.3333%; touch-action: none; }
#board.w4 .cell { width: 25%; height: 25%; }
.mound {
  position: absolute; left: 7%; right: 7%; bottom: 8%; height: 38%; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 35%, #a8734c 0, #8a5a3b 55%, #6b4229 100%);
}
.q2 .mound { box-shadow: 0 6px 0 rgba(47,90,30,0.45); }
.q1 .mound { box-shadow: 0 5px 0 rgba(47,90,30,0.35); }
.pit {
  position: absolute; left: 17%; right: 17%; bottom: 15%; height: 23%; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 30%, #1d0f07 0, #2b1a10 60%, #3e2615 100%);
}
.cell.danger .mound { background: radial-gradient(ellipse at 50% 35%, #b5714c 0, #8a4a3b 55%, #6b3229 100%); }
.cell.danger .mound::after {
  content: ""; position: absolute; left: -4%; right: -4%; top: -6%; bottom: -6%; border-radius: 50%;
  border: 4px dashed #ff4d4d;
}
.q2 .cell.danger .mound::after { -webkit-animation: blink 0.45s ease-in-out infinite alternate; animation: blink 0.45s ease-in-out infinite alternate; }
.clip { position: absolute; left: 14%; right: 14%; top: 0; bottom: 26.5%; overflow: hidden; pointer-events: none; }
.mole {
  position: absolute; left: 6%; width: 88%; bottom: -12%;
  -webkit-transform: translateY(0); transform: translateY(0);
  -webkit-animation: rise 0.15s ease-out; animation: rise 0.15s ease-out;
}
.mole svg { display: block; width: 100%; height: auto; -webkit-transform-origin: 50% 100%; transform-origin: 50% 100%; }
.mole.down {
  -webkit-animation: none; animation: none;
  -webkit-transform: translateY(125%); transform: translateY(125%);
  -webkit-transition: -webkit-transform 0.2s ease-in; transition: transform 0.2s ease-in;
}
@-webkit-keyframes rise { from { -webkit-transform: translateY(125%); } to { -webkit-transform: translateY(0); } }
@keyframes rise { from { transform: translateY(125%); } to { transform: translateY(0); } }
.ex, .bandage { display: none; }
.mole.bonk .eo { display: none; }
.mole.bonk .ex { display: inline; }
.mole.bonk svg { -webkit-transform: scale(1.14, 0.78); transform: scale(1.14, 0.78); }
.mole.cracked .hat { display: none; }
.mole.cracked .bandage { display: inline; }
.mole.cracked .p2 { fill: rgba(255,255,255,0.35); }
.mole.cracked svg { -webkit-animation: wobble 0.3s; animation: wobble 0.3s; }
.mole.boom svg { -webkit-transform: scale(1.35); transform: scale(1.35); opacity: 0; -webkit-transition: opacity 0.18s, -webkit-transform 0.18s; transition: opacity 0.18s, transform 0.18s; }
.mole.ring svg { -webkit-animation: wobble 0.25s; animation: wobble 0.25s; }
@-webkit-keyframes wobble { 0%,100% { -webkit-transform: rotate(0); } 25% { -webkit-transform: rotate(-9deg); } 75% { -webkit-transform: rotate(9deg); } }
@keyframes wobble { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
.q2 .mole .spk { -webkit-animation: twinkle 0.8s ease-in-out infinite alternate; animation: twinkle 0.8s ease-in-out infinite alternate; }
.q2 .mole .spk.s2 { -webkit-animation-delay: 0.4s; animation-delay: 0.4s; }
.q2 .mole .fuse, .q1 .mole .fuse { -webkit-animation: blink 0.18s ease-in-out infinite alternate; animation: blink 0.18s ease-in-out infinite alternate; }
.q2 .mole.k-gold svg { -webkit-filter: drop-shadow(0 0 6px rgba(255,220,80,0.95)); filter: drop-shadow(0 0 6px rgba(255,220,80,0.95)); }
@-webkit-keyframes twinkle { from { opacity: 0.25; } to { opacity: 1; } }
@keyframes twinkle { from { opacity: 0.25; } to { opacity: 1; } }

#banner {
  position: absolute; left: 50%; top: 50%; z-index: 4; pointer-events: none; white-space: nowrap;
  -webkit-transform: translate(-50%,-50%); transform: translate(-50%,-50%);
  background: var(--cream); color: var(--ink); border: 5px solid var(--orange); border-radius: 26px;
  padding: 12px 24px; font-size: 30px; font-weight: 900; box-shadow: 0 8px 0 rgba(74,44,23,0.35);
  -webkit-animation: bannerIn 0.3s ease-out; animation: bannerIn 0.3s ease-out;
}
#banner.top { top: 14%; font-size: 22px; padding: 8px 18px; border-color: var(--gold); }
@-webkit-keyframes bannerIn { from { -webkit-transform: translate(-50%,-50%) scale(0.5); opacity: 0; } to { -webkit-transform: translate(-50%,-50%) scale(1); opacity: 1; } }
@keyframes bannerIn { from { transform: translate(-50%,-50%) scale(0.5); opacity: 0; } to { transform: translate(-50%,-50%) scale(1); opacity: 1; } }

/* ===== 효과 층(망치·점수 글자) ===== */
#fx { position: fixed; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.hammer {
  position: absolute; width: 90px; height: 133px;
  -webkit-transform-origin: 50% 100%; transform-origin: 50% 100%;
  -webkit-animation: whack 0.32s ease-out forwards; animation: whack 0.32s ease-out forwards;
}
.hammer svg { display: block; width: 100%; height: 100%; }
@-webkit-keyframes whack {
  0% { -webkit-transform: rotate(-55deg); opacity: 1; }
  35% { -webkit-transform: rotate(6deg); opacity: 1; }
  50% { -webkit-transform: rotate(0); opacity: 1; }
  100% { -webkit-transform: rotate(-8deg); opacity: 0; }
}
@keyframes whack {
  0% { transform: rotate(-55deg); opacity: 1; }
  35% { transform: rotate(6deg); opacity: 1; }
  50% { transform: rotate(0); opacity: 1; }
  100% { transform: rotate(-8deg); opacity: 0; }
}
.float {
  position: absolute; white-space: nowrap; font-weight: 900; font-size: 26px; color: #fff;
  font-size: calc(var(--cell) * 0.24 + 6px);
  text-shadow: 0 3px 0 #4a2c17, 2px 0 0 #4a2c17, -2px 0 0 #4a2c17, 0 -2px 0 #4a2c17;
  -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);
  -webkit-animation: floatUp 0.85s ease-out forwards; animation: floatUp 0.85s ease-out forwards;
}
.float.gold { color: #ffe066; }
.float.minus { color: #ff7b7b; }
.float.time { color: #8dffb0; }
.float.soft { color: #fff3c4; font-size: calc(var(--cell) * 0.17 + 6px); }
@-webkit-keyframes floatUp { 0% { -webkit-transform: translate(-50%,-30%) scale(0.6); opacity: 0; } 15% { -webkit-transform: translate(-50%,-60%) scale(1.15); opacity: 1; } 100% { -webkit-transform: translate(-50%,-170%) scale(1); opacity: 0; } }
@keyframes floatUp { 0% { transform: translate(-50%,-30%) scale(0.6); opacity: 0; } 15% { transform: translate(-50%,-60%) scale(1.15); opacity: 1; } 100% { transform: translate(-50%,-170%) scale(1); opacity: 0; } }
.burst {
  position: absolute; width: 80px; height: 80px; margin: -40px 0 0 -40px;
  -webkit-animation: burst 0.3s ease-out forwards; animation: burst 0.3s ease-out forwards;
}
.burst svg { display: block; width: 100%; height: 100%; }
@-webkit-keyframes burst { from { -webkit-transform: scale(0.3); opacity: 1; } to { -webkit-transform: scale(1.25); opacity: 0; } }
@keyframes burst { from { transform: scale(0.3); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.q0 .burst { display: none; }
.flyHat {
  position: absolute; width: 60px; height: 40px; margin: -20px 0 0 -30px;
  -webkit-animation: flyHat 0.6s ease-out forwards; animation: flyHat 0.6s ease-out forwards;
}
.flyHat svg { display: block; width: 100%; height: 100%; }
@-webkit-keyframes flyHat { 0% { -webkit-transform: translate(0,0) rotate(0); opacity: 1; } 100% { -webkit-transform: translate(60px,-90px) rotate(160deg); opacity: 0; } }
@keyframes flyHat { 0% { transform: translate(0,0) rotate(0); opacity: 1; } 100% { transform: translate(60px,-90px) rotate(160deg); opacity: 0; } }

/* ===== 겹창 ===== */
.ov {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(20,26,51,0.72);
  display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.ov.light { background: rgba(20,26,51,0.35); pointer-events: none; }
.card {
  box-sizing: border-box; width: 92%; max-width: 440px; max-height: 92%; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--cream); border-radius: 28px; padding: 20px 16px; text-align: center;
  box-shadow: 0 10px 0 rgba(74,44,23,0.45);
  -webkit-animation: cardIn 0.22s ease-out; animation: cardIn 0.22s ease-out;
}
.card h2 { margin: 2px 0 8px; font-size: 28px; }
@-webkit-keyframes cardIn { from { -webkit-transform: scale(0.85); opacity: 0; } to { -webkit-transform: scale(1); opacity: 1; } }
@keyframes cardIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.introArt { width: 130px; height: 130px; margin: 0 auto -6px; }
.introArt svg { width: 100%; height: 100%; display: block; }
.bubble {
  position: relative; background: #fff; border: 4px solid var(--orange); border-radius: 24px;
  padding: 16px 14px; margin: 14px 0 14px; font-size: 22px; font-weight: 900; line-height: 1.4;
}
.bubble::before {
  content: ""; position: absolute; left: 50%; top: -18px; margin-left: -14px;
  border: 14px solid transparent; border-top: 0; border-bottom: 18px solid var(--orange);
}
.bubble .line { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; text-align: left; }
.bubble .line + .line { margin-top: 12px; padding-top: 12px; border-top: 2px dashed #f2d7b5; }
.bubble .ico { width: 64px; height: 64px; -webkit-flex: none; flex: none; margin-right: 10px; }
.bubble .ico svg { width: 100%; height: 100%; display: block; }
.miniGrid { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; width: 56px; height: 56px; margin: 4px; }
.miniGrid i { width: 10px; height: 10px; margin: 2px; border-radius: 50%; background: var(--soil); }

.countBox { text-align: center; color: #fff; }
.countTitle { font-size: 24px; font-weight: 900; text-shadow: 0 3px 0 rgba(0,0,0,0.4); }
.countNum {
  font-size: 30vmin; font-weight: 900; line-height: 1.1; color: #fff;
  text-shadow: 0 8px 0 #d96a00, 0 0 0 #000, 5px 0 0 #d96a00, -5px 0 0 #d96a00, 0 -5px 0 #d96a00;
  -webkit-animation: countPop 0.55s ease-out; animation: countPop 0.55s ease-out;
}
.countNum.go { font-size: 18vmin; color: #ffe066; }
.countGoal { display: inline-block; font-size: 22px; font-weight: 900; background: rgba(74,44,23,0.85); border-radius: 18px; padding: 6px 16px; }
@-webkit-keyframes countPop { 0% { -webkit-transform: scale(1.8); opacity: 0; } 30% { -webkit-transform: scale(1); opacity: 1; } 100% { -webkit-transform: scale(0.9); opacity: 1; } }
@keyframes countPop { 0% { transform: scale(1.8); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 100% { transform: scale(0.9); opacity: 1; } }

.resultCard .rArt { width: 120px; height: 120px; margin: -4px auto 0; }
.resultCard .rArt svg { width: 100%; height: 100%; display: block; }
.resultCard .rScore { font-size: 44px; font-weight: 900; color: var(--orange2); line-height: 1.1; }
.resultCard .rSub { font-size: 17px; font-weight: 800; color: var(--soil2); margin: 6px 0; line-height: 1.45; }
.resultCard .rBadge { display: inline-block; background: var(--gold); border-radius: 14px; padding: 3px 12px; font-weight: 900; font-size: 16px; margin: 4px; }
.resultCard .rCoin {
  display: -webkit-inline-flex; display: inline-flex; -webkit-align-items: center; align-items: center;
  background: var(--soil2); color: #ffe27a; font-size: 26px; font-weight: 900; border-radius: 22px; padding: 6px 18px 6px 10px; margin: 8px 0 4px;
}
.resultCard .rCoin .coin { width: 30px; height: 30px; }
.resultCard .rCoin .coin::after { line-height: 30px; font-size: 15px; }
.resultCard .rWarn { background: #ffe3d6; color: #a33a12; border-radius: 16px; padding: 10px 12px; font-weight: 900; font-size: 17px; margin: 8px 0; }
.resultCard .rWait { color: var(--soil); font-weight: 800; font-size: 17px; margin: 10px 0; }

.shopCard { max-width: 640px; padding: 14px 12px 16px; }
.shopHead { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; }
.shopHead h2 { -webkit-flex: 1; flex: 1; margin: 0; text-align: left; padding-left: 6px; font-size: 25px; }
.shopHead .coins { margin: 0 10px 0 0; }
.shopTip { margin: 8px 4px 4px; font-size: 14px; font-weight: 800; color: var(--soil); text-align: left; }
.shopList { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.item {
  box-sizing: border-box; width: calc(33.333% - 10px); margin: 5px; background: #fff; border-radius: 20px; padding: 8px 6px 10px;
  box-shadow: 0 4px 0 rgba(74,44,23,0.18); border: 3px solid transparent;
}
.item.on { border-color: var(--grass2); }
.item .pv { height: 104px; position: relative; }
.item .pv svg { height: 100%; width: auto; display: block; margin: 0 auto; -webkit-transform-origin: 50% 100%; transform-origin: 50% 100%; }
.item .pv.whack svg { -webkit-animation: pvWhack 0.3s ease-out; animation: pvWhack 0.3s ease-out; }
@-webkit-keyframes pvWhack { 0% { -webkit-transform: rotate(-40deg); } 45% { -webkit-transform: rotate(8deg); } 100% { -webkit-transform: rotate(0); } }
@keyframes pvWhack { 0% { transform: rotate(-40deg); } 45% { transform: rotate(8deg); } 100% { transform: rotate(0); } }
.item .nm { font-size: 16px; font-weight: 900; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .pr { font-size: 15px; font-weight: 800; color: var(--soil); margin: 2px 0 6px; display: -webkit-flex; display: flex; -webkit-justify-content: center; justify-content: center; -webkit-align-items: center; align-items: center; }
.item .pr .coin { width: 18px; height: 18px; margin-right: 4px; }
.item .pr .coin::after { line-height: 18px; font-size: 10px; }
.item .btn { min-width: 0; width: calc(100% - 4px); margin: 0 2px; min-height: 56px; font-size: 18px; padding: 0 6px; }
.item .btn.using, .item .btn.using:disabled { background: var(--grass2); opacity: 1; }
@media (max-width: 520px) { .item { width: calc(50% - 10px); } }

#toast {
  position: fixed; left: 50%; bottom: 26px; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); z-index: 80;
  -webkit-transform: translateX(-50%); transform: translateX(-50%); max-width: 86%;
  background: rgba(59,36,20,0.95); color: #fff; font-weight: 900; font-size: 18px; text-align: center;
  border-radius: 20px; padding: 12px 18px; pointer-events: none;
}

/* 화질 낮음: 그림자·반복 애니메이션 줄이기 */
.q0 .mound, .q0 .chapter, .q0 .hero, .q0 .mode, .q0 .card { box-shadow: none; }
.q0 .mole .spk, .q0 .mole .fuse { -webkit-animation: none; animation: none; }
.q0 .mole.cracked svg, .q0 .mole.ring svg { -webkit-animation: none; animation: none; }
