* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0a0a14;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: 'Courier New', monospace;
}

#gc {
  width: 100%;
  max-width: 680px;
  background: #12121f;
  border-radius: 10px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  border: 1px solid #1e1e36;
}

/* HUD */
#hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 18px;
  background: #0d0d1e;
  border-bottom: 1px solid #1e1e36;
  gap: 6px;
}

.hi {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 44px;
}

.hl {
  font-size: 9px;
  color: #44446a;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.hv {
  font-size: 14px;
  font-weight: 900;
  color: #c8c8e0;
}

.hv.coin  { color: #e8c46a; }
.hv.life  { color: #e74c3c; }
.hv.lvl   { color: #5dade2; }

#title {
  font-size: 15px;
  font-weight: 900;
  color: #c8c8e0;
  letter-spacing: 3px;
}

/* Health bar */
#healthBar {
  display: flex;
  align-items: center;
  gap: 6px;
}

#healthBar .hl {
  font-size: 9px;
  color: #44446a;
  letter-spacing: 1.5px;
}

#hpTrack {
  width: 72px;
  height: 7px;
  background: #1a1a30;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #2a2a48;
}

#hpFill {
  height: 100%;
  width: 100%;
  background: #2ecc71;
  border-radius: 4px;
  transition: width 0.2s, background 0.3s;
}

/* Canvas */
canvas {
  display: block;
  width: 100%;
  height: 340px;
  image-rendering: pixelated;
}

/* Overlay */
#ov {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: #12121f;
  color: #c8c8e0;
  text-align: center;
  gap: 14px;
  min-height: 340px;
}

#ov h2 {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #c8c8e0;
}

#ov .sub {
  color: #55556a;
  font-size: 12px;
  line-height: 1.6;
}

.legend {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: #55556a;
}

.legend span { display: flex; align-items: center; gap: 5px; }

.dot {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
}

#ov .keys {
  color: #44446a;
  font-size: 11px;
}

.k {
  display: inline-block;
  background: #1a1a2e;
  border: 1px solid #2e2e50;
  border-radius: 3px;
  padding: 2px 7px;
  font-size: 10px;
  color: #7777aa;
}

#sb {
  padding: 11px 36px;
  background: transparent;
  border: 1px solid #3a3a60;
  border-radius: 6px;
  color: #c8c8e0;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
  transition: background 0.15s, border-color 0.15s;
}

#sb:hover  { background: #1e1e38; border-color: #5a5a88; }
#sb:active { transform: scale(0.97); }

.mobile-note { font-size: 10px; color: #2a2a3e; }

/* Controls */
#ctrl {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #0d0d1e;
  border-top: 1px solid #1e1e36;
}

.cg { display: flex; gap: 8px; }

.btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid #2a2a48;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, background 0.1s;
  -webkit-tap-highlight-color: transparent;
  background: #16162a;
  color: #5555aa;
}

.btn:active { transform: scale(0.87); background: #1e1e3a; }

.btn.jump {
  width: 58px;
  height: 58px;
  font-size: 20px;
  background: #1e1e38;
  color: #8888cc;
  border: 1px solid #3a3a68;
}