* { box-sizing: border-box; }
:root { --blue: #4dabf7; --ink: #1f2a36; --muted: #66727f; --line: #dfe6ee; --gold: #f59f00; --gr-accent: #f59f00; }
html, body { margin: 0; color: var(--ink); font-family: Pretendard, "Noto Sans KR", system-ui, "Malgun Gothic", sans-serif; }
body { min-height: 100vh; background: #fff9e8; -webkit-user-select: none; user-select: none; }
button { font: inherit; cursor: pointer; color: inherit; }
[hidden] { display: none !important; }

.bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.bar a { color: var(--ink); text-decoration: none; font-weight: 800; white-space: nowrap; }
.bar-actions { display: flex; gap: 6px; }
.bar button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 12px; white-space: nowrap; }

.shell { max-width: 1000px; margin: 0 auto; padding: 10px 16px 28px; }
.hud { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 900; margin-bottom: 8px; }
.money { font-size: 20px; color: #a35f00; font-variant-numeric: tabular-nums; }
.income { color: #2b8a3e; font-variant-numeric: tabular-nums; }
.carry { padding: 3px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.spacer { flex: 1; }
.hud button { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 14px; font-weight: 900; white-space: nowrap; }
.hud button:disabled { opacity: .55; cursor: default; }
.shop-btn { background: linear-gradient(135deg, #ffd43b, #f59f00) !important; border: 0 !important; }

.stage { position: relative; border-radius: 16px; overflow: hidden; border: 3px solid #fff; box-shadow: 0 12px 30px #1f2a3622; }
.stage canvas { display: block; width: 100%; aspect-ratio: 960 / 600; touch-action: none; }
.toast { position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 20px); max-width: calc(100% - 24px); padding: 10px 16px; border-radius: 14px; background: rgba(20, 24, 32, .85); color: #fff; font-weight: 800; text-align: center; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { background: rgba(43, 138, 62, .92); }
.toast.bad { background: rgba(201, 42, 42, .92); }
.help { text-align: center; color: var(--muted); font-size: 14px; line-height: 1.6; }

.dialog { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 20, 30, .5); z-index: 20; }
.dialog-card { width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; padding: 18px; border-radius: 20px; background: #fff; }
.dialog-card h2 { margin: 0 0 6px; }
.dialog-card h3 { margin: 14px 0 6px; font-size: 16px; }
.where { margin: 0; color: var(--muted); font-weight: 700; }
.list .row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; }
.list .row:nth-child(odd) { background: #fbf7ee; }
.list .name { flex: 1; font-weight: 700; line-height: 1.4; }
.list button { border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 900; background: #ffe066; white-space: nowrap; }
.list button:disabled { background: #eee; color: #999; cursor: default; }
.primary { display: block; width: 100%; margin-top: 14px; border: 0; border-radius: 14px; padding: 13px; font-size: 17px; font-weight: 900; background: linear-gradient(135deg, #ffd43b, #f59f00); }
.danger { display: block; width: 100%; margin-top: 8px; border: 1px solid #ffc9c9; border-radius: 12px; padding: 9px; background: #fff5f5; color: #c92a2a; font-weight: 800; }
.guide { padding-left: 20px; line-height: 1.6; }
.guide li { margin-bottom: 8px; }
.guide small, .small { color: var(--muted); }

@media (max-width: 560px) {
  .hud { gap: 6px; font-size: 14px; }
  .money { font-size: 17px; }
  .hud button { padding: 7px 10px; }
}
