:root {
  --bg: #111827;
  --panel: #1f2937;
  --panel2: #273449;
  --text: #f9fafb;
  --muted: #aab4c4;
  --accent: #fbbf24;
  --line: #3b4657;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-family: ui-rounded, "Pretendard", system-ui, sans-serif; background: radial-gradient(circle at top, #29364d, var(--bg) 48%); color: var(--text); }
a { color: inherit; text-decoration: none; }
.wrap { width: min(calc(100% - 28px), 980px); margin: 0 auto; }
.topbar { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.back { color: var(--muted); font-weight: 800; }
.game-shell { padding: 26px 0 60px; }
.title { text-align: center; }
.title h1 { margin: 8px 0 4px; font-size: clamp(2rem, 7vw, 3.6rem); letter-spacing: -.055em; }
.title p { margin: 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 24px 0; }
.stat { background: rgba(31,41,55,.9); border: 1px solid var(--line); border-radius: 18px; padding: 16px; text-align: center; }
.stat strong { display: block; font-size: 1.45rem; }
.stat span { color: var(--muted); font-size: .82rem; }
.play-area { display: grid; grid-template-columns: 1.05fr .95fr; gap: 18px; align-items: stretch; }
.mine-panel, .shop { background: rgba(31,41,55,.92); border: 1px solid var(--line); border-radius: 24px; padding: 22px; }
.mine-panel { min-height: 450px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.cat-btn { width: min(280px, 78vw); aspect-ratio: 1; border-radius: 50%; border: 0; background: linear-gradient(160deg,#fef3c7,#fde68a); font-size: 8rem; cursor: pointer; box-shadow: inset 0 -14px 0 rgba(0,0,0,.08), 0 18px 40px rgba(0,0,0,.25); transition: transform .08s ease; }
.cat-btn:active { transform: scale(.94); }
.tap-note { color: var(--muted); margin-top: 18px; font-weight: 800; }
.float { position: absolute; pointer-events: none; font-weight: 900; color: var(--accent); animation: fly .75s ease-out forwards; }
@keyframes fly { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-70px) scale(1.25); } }
.shop h2 { margin-top: 0; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item p { margin: 3px 0 0; color: var(--muted); font-size: .9rem; }
.buy { border: 0; border-radius: 12px; padding: 10px 12px; background: var(--accent); color: #3b2a05; font-weight: 900; cursor: pointer; min-width: 110px; }
.buy:disabled { opacity: .4; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; justify-content: center; }
.small-btn { border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.ad-slot { margin: 56px 0 20px; min-height: 100px; border: 1.5px dashed #5a6678; border-radius: 18px; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 18px; }
.info { color: var(--muted); font-size: .9rem; line-height: 1.6; }
@media (max-width: 760px) { .play-area { grid-template-columns: 1fr; } .stats { grid-template-columns: 1fr 1fr 1fr; } .cat-btn { font-size: 6rem; } }

.info.center { text-align: center; max-width: 620px; margin: 14px auto 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50;
  background: #fef3c7; color: #3b2a05; font-weight: 800; padding: 12px 18px; border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.35);
  transition: opacity .25s, transform .25s; width: max-content; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 520px) {
  .game-shell { padding-top: 10px; }
  .stat { padding: 12px 6px; }
  .stat strong { font-size: 1.15rem; }
  .mine-panel { min-height: 340px; }
  .cat-btn { width: min(220px, 64vw); font-size: 5.5rem; }
  .item { grid-template-columns: 1fr; gap: 8px; }
  .buy { width: 100%; min-height: 44px; }
}
