/* ボルトタウン：ドット絵に合わせた見た目（角は丸めない・影は段々に） */
:root { --ink: #e9ecff; --dim: #8a93c8; --gold: #ffcf6b; --bg: #070916; --line: #3a4378; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: "DotGothic16", sans-serif; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
canvas { display: block; position: fixed; left: 0; top: 0; touch-action: none; }
.hide { display: none !important; }
button, a.btn { font-family: inherit; touch-action: manipulation; }

/* 嵐の間 */
#hud { position: fixed; top: 0; left: 0; right: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 14px 0; pointer-events: none; text-shadow: 2px 2px 0 var(--bg); }
.lbl { display: block; font-size: 12px; color: var(--dim); }
#hMoney { font-size: 26px; color: var(--gold); }
#hTime { font-size: 40px; line-height: 1; }
#hTime.low { color: #ff9a8a; }
.right { justify-self: end; width: min(170px, 100%); text-align: right; }
.meter { height: 10px; border: 2px solid var(--dim); background: #0b0d1f; margin-top: 4px; box-sizing: border-box; }
.meter i { display: block; height: 100%; background: #fff; }
#hLight { font-size: 12px; color: var(--gold); margin-top: 8px; }
#hint { position: fixed; left: 0; right: 0; bottom: max(2%, env(safe-area-inset-bottom)); text-align: center; font-size: 12px; color: var(--dim); pointer-events: none; text-shadow: 2px 2px 0 var(--bg); }

/* ボタン */
.btn { display: inline-block; box-sizing: border-box; text-align: center; text-decoration: none; font-size: 16px; padding: 10px 16px; color: var(--bg); background: var(--gold); border: 0;
  box-shadow: inset -3px -3px 0 #b8862e, inset 3px 3px 0 #ffe7a8; cursor: pointer; }
.btn:active:not(:disabled) { transform: translate(1px, 1px); }
.btn.ghost { background: #1a1f40; color: var(--ink); box-shadow: inset -3px -3px 0 #0b0d1f, inset 3px 3px 0 var(--line); }
.btn.danger { color: #ff9a8a; }
.btn:disabled { background: #22274a; color: #5a6290; box-shadow: none; cursor: default; }
.btn.wide { display: block; width: 100%; margin-top: 10px; }

/* タイトル */
#title { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 16px 18vh; pointer-events: none; }
#title > * { pointer-events: auto; }
#title .kick { font-size: 14px; color: #c4ccff; letter-spacing: .2em; text-shadow: 2px 2px 0 var(--bg); }
#title h1 { margin: 10px 0 2px; font-weight: 400; font-size: clamp(44px, 12vw, 84px); line-height: 1; color: var(--gold); text-shadow: 4px 4px 0 #6b3fa0, 8px 8px 0 #1a1f40; }
#title .en { font-size: 14px; letter-spacing: .6em; color: #c4ccff; margin: 6px 0 28px; text-shadow: 2px 2px 0 var(--bg); }
#title .btn { font-size: 18px; padding: 12px 28px; }
#title .ver { margin-top: 14px; font-size: 12px; color: var(--dim); }

/* スキルツリー */
#treeUI { position: fixed; inset: 0; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; }
#sum { pointer-events: auto; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; padding: max(14px, env(safe-area-inset-top)) 56px 0; font-size: 14px; color: var(--dim); text-shadow: 2px 2px 0 var(--bg); }
#sum b { color: var(--ink); font-weight: 400; font-size: 18px; }
#sum b.g { color: var(--gold); }
#sumNote { width: 100%; text-align: center; color: var(--gold); font-size: 13px; }
#info { pointer-events: auto; margin: 0 auto max(14px, env(safe-area-inset-bottom)); width: calc(100% - 32px); max-width: 560px; box-sizing: border-box; background: #0d1024;
  border: 2px solid var(--line); box-shadow: 4px 4px 0 #04050c; padding: 12px 14px; }
#iName { font-size: 18px; color: var(--gold); }
#iDesc { font-size: 13px; color: #c4ccff; margin: 6px 0 10px; line-height: 1.6; min-height: 2.6em; }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; min-width: 0; }

/* 歯車と窓 */
#gear { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 10px; width: 40px; height: 40px; padding: 8px; border: 0; background: #1a1f40; color: var(--ink);
  box-shadow: inset -3px -3px 0 #0b0d1f, inset 3px 3px 0 var(--line); cursor: pointer; }
#gear svg { display: block; width: 100%; height: 100%; }
.ov { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(4, 5, 12, .7); z-index: 10; touch-action: pan-y; }
.box { width: calc(100% - 32px); max-width: 420px; max-height: 90vh; overflow: auto; box-sizing: border-box; background: #0d1024; border: 2px solid var(--line); box-shadow: 4px 4px 0 #04050c; padding: 18px; }
.boxTitle { font-size: 20px; color: var(--gold); margin-bottom: 6px; }
.boxTitle.big { font-size: 24px; margin: 6px 0 10px; }
.box .kick { font-size: 13px; color: var(--dim); }
.box p { font-size: 14px; line-height: 1.7; color: #c4ccff; }
.stats { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; margin: 10px 0 6px; font-size: 14px; }
.stats dt { color: var(--dim); }
.stats dd { margin: 0; color: var(--ink); text-align: right; }
#errMsg { white-space: pre-wrap; word-break: break-all; font-size: 12px; color: #ff9a8a; background: #070916; padding: 8px; max-height: 30vh; overflow: auto; user-select: text; -webkit-user-select: text; }
#loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--dim); background: var(--bg); }
