* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #111; color: #fff;
  font-family: 'Jua', 'Malgun Gothic', sans-serif; user-select: none; -webkit-user-select: none; touch-action: none; }
canvas { display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; }
.screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: auto; padding: 16px; }
.screen.dim { background: rgba(0,0,0,.55); }
.hidden { display: none !important; }
.panel { background: #1e2233ee; border: 3px solid #f5c542; border-radius: 18px; padding: 28px 32px; max-width: 520px; width: 100%;
  box-shadow: 0 10px 40px #0009; text-align: center; max-height: 100%; overflow-y: auto; }
.panel.wide { max-width: 760px; }
.title-panel { background: #1e2233dd; }
.logo { font-size: 64px; line-height: 1; color: #fff; text-shadow: 4px 4px 0 #e2563b, 8px 8px 0 #0006; margin-bottom: 14px; }
.logo span { color: #f5c542; }
.sub { opacity: .85; margin-bottom: 12px; }
.stats-line { margin-bottom: 18px; opacity: .9; }
h2 { font-size: 30px; margin-bottom: 16px; color: #f5c542; font-weight: normal; }
h2 small { font-size: 16px; color: #ddd; margin-left: 8px; }
.btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
button { font-family: inherit; font-size: 20px; padding: 10px 22px; border-radius: 12px; border: none; cursor: pointer;
  background: #3a4060; color: #fff; box-shadow: 0 4px 0 #222638; transition: transform .08s; }
button:hover { transform: translateY(-2px); background: #4a5178; }
button:active { transform: translateY(2px); box-shadow: 0 1px 0 #222638; }
button.primary { background: #e2563b; box-shadow: 0 4px 0 #8e2e1d; }
button.primary:hover { background: #f06a4f; }
button:disabled { opacity: .45; cursor: default; transform: none; }
.help { text-align: left; list-style: none; line-height: 1.9; font-size: 18px; }
.levelup { text-align: center; width: 100%; max-width: 900px; }
.levelup h2 { font-size: 40px; text-shadow: 3px 3px 0 #000; }
.cards { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.card { width: 250px; background: #262b40; border: 3px solid #6a7099; border-radius: 16px; padding: 18px 16px; cursor: pointer;
  text-align: center; transition: transform .1s, border-color .1s; position: relative; }
.card:hover { transform: translateY(-6px); border-color: #f5c542; }
.card .ic { width: 72px; height: 72px; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; font-size: 52px; }
.card .ic img { max-width: 72px; max-height: 72px; }
.card .nm { font-size: 22px; color: #f5c542; }
.card .lv { font-size: 15px; color: #8fd3ff; margin: 2px 0 8px; }
.card .ds { font-size: 16px; opacity: .9; line-height: 1.4; }
.card .key { position: absolute; top: 8px; left: 10px; font-size: 14px; opacity: .5; }
.card .new { position: absolute; top: 8px; right: 10px; font-size: 13px; background: #e2563b; padding: 2px 8px; border-radius: 8px; }
.shop-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; text-align: left; }
.shop-item { background: #262b40; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.shop-item .t { font-size: 19px; color: #f5c542; }
.shop-item .d { font-size: 15px; opacity: .85; }
.shop-item .pips { letter-spacing: 3px; color: #8fd3ff; }
.shop-item button { font-size: 16px; padding: 6px 10px; margin-top: 4px; }
.result { margin: 0 auto; font-size: 20px; border-spacing: 18px 6px; }
.result td:first-child { text-align: right; opacity: .75; }
.result td:last-child { text-align: left; color: #f5c542; }
.build { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.build span { background: #262b40; border-radius: 8px; padding: 4px 10px; font-size: 16px; }
@media (max-width: 600px) {
  .logo { font-size: 46px; }
  .card { width: 100%; padding: 12px; display: grid; grid-template-columns: 60px 1fr; text-align: left; gap: 0 10px; }
  .card .ic { grid-row: span 3; width: 60px; height: 60px; font-size: 40px; margin: 0; }
  .card .ic img { max-width: 60px; max-height: 60px; }
  .card .key { display: none; }
  .levelup h2 { font-size: 30px; }
  .panel { padding: 20px 16px; }
}
