[hidden] { display: none !important; }

:root {
  --bg: #15161f;
  --panel: rgba(20, 22, 36, .92);
  --text: #fff;
  --muted: #a8adc6;
  --gold: #ffd34d;
  --xp: #4fc3ff;
  --red: #ff4d63;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; }

html, body { margin: 0; height: 100%; background: #0b0c12; color: var(--text); overscroll-behavior: none;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; }

button { font: inherit; color: inherit; border: 0; cursor: pointer; }

.app { position: relative; width: 100%; max-width: 480px; height: 100dvh; margin: 0 auto; overflow: hidden; background: var(--bg); touch-action: none; }
canvas { display: block; width: 100%; height: 100%; }

/* HUD */
.hud { position: absolute; left: 0; right: 0; top: 0; padding: calc(env(safe-area-inset-top) + 6px) 10px 0; pointer-events: none; }
.xpbar { position: relative; height: 16px; border-radius: 8px; background: rgba(0,0,0,.55); border: 2px solid #000; overflow: hidden; }
.xpfill { height: 100%; width: 0; background: linear-gradient(90deg, #2fa8ff, #7fe0ff); transition: width .15s; }
.lv { position: absolute; right: 8px; top: -1px; font-size: 12px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.hud-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.kills { font-weight: 800; text-shadow: 0 1px 2px #000; display: flex; align-items: center; gap: 4px; }
.kills img { width: 20px; height: 20px; }
.timer { font-size: 22px; font-weight: 900; letter-spacing: .04em; text-shadow: 0 2px 0 #000; }
.pause { pointer-events: auto; width: 36px; height: 36px; border-radius: 10px; background: rgba(0,0,0,.45); font-size: 16px; }
.slots { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.slot { width: 30px; height: 30px; border-radius: 7px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.15); display: grid; place-items: center; position: relative; font-size: 16px; }
.slot img { width: 24px; height: 24px; object-fit: contain; }
.slot .slv { position: absolute; right: -2px; bottom: -4px; font-size: 9px; font-weight: 900; text-shadow: 0 1px 1px #000; }
.slot.evo { border-color: var(--gold); box-shadow: 0 0 6px var(--gold); }
.slots.big .slot { width: 46px; height: 46px; }
.slots.big .slot img { width: 36px; height: 36px; }

.banner { position: absolute; left: 0; right: 0; top: 32%; text-align: center; font-size: 34px; font-weight: 900; color: var(--red);
  text-shadow: 0 3px 0 #000, 0 0 16px rgba(255, 77, 99, .7); animation: bannerIn .4s ease-out; pointer-events: none; }
@keyframes bannerIn { from { transform: scale(1.8); opacity: 0; } }

/* Overlays */
.overlay { position: absolute; inset: 0; background: rgba(5, 6, 12, .78); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; z-index: 5; }
.lu-title { font-size: 30px; font-weight: 900; color: var(--gold); text-shadow: 0 3px 0 #6b4a00; }
.lu-sub { color: var(--muted); margin-top: -6px; }
.cards { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 360px; }
.card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: #262a44; border: 2px solid #3d4370; text-align: left; animation: cardIn .25s ease-out backwards; }
.card:nth-child(2) { animation-delay: .06s; } .card:nth-child(3) { animation-delay: .12s; }
@keyframes cardIn { from { transform: translateY(16px); opacity: 0; } }
.card:active { transform: scale(.97); }
.card.evolve { border-color: var(--gold); background: linear-gradient(135deg, #4a3a10, #262a44); }
.card-icon { width: 56px; height: 56px; border-radius: 12px; background: rgba(0,0,0,.35); display: grid; place-items: center; font-size: 30px; flex-shrink: 0; }
.card-icon img { width: 46px; height: 46px; object-fit: contain; }
.card-name { font-weight: 800; }
.card-name .tag { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: #4fc3ff; color: #00263b; margin-left: 6px; vertical-align: 2px; }
.card.evolve .tag { background: var(--gold); color: #3b2a00; }
.card-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stars { color: var(--gold); font-size: 12px; letter-spacing: 1px; margin-top: 3px; }

.btn { min-width: 200px; padding: 14px 22px; border-radius: 14px; background: linear-gradient(#ffd34d, #f0a51c); color: #3b2a00; font-weight: 900; font-size: 18px; box-shadow: 0 4px 0 #a46a00; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #a46a00; }
.btn.ghost { background: #2c3050; color: var(--muted); box-shadow: 0 4px 0 #1a1d33; font-size: 15px; }

.start { background: radial-gradient(circle at 50% 35%, rgba(60, 120, 60, .55), rgba(5, 6, 12, .92)); }
.logo { font-size: 44px; font-weight: 900; color: #fff; text-shadow: 0 4px 0 #b3202f, 0 8px 18px rgba(0,0,0,.6); transform: rotate(-3deg); }
.logo-sub { color: var(--gold); font-weight: 800; }
.howto { color: var(--muted); text-align: center; line-height: 1.6; margin: 10px 0; }
.best { color: var(--muted); font-size: 13px; }
.result-stats { text-align: center; line-height: 1.9; font-size: 17px; }
.result-stats b { color: var(--gold); }
