* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  background: #1a1a2e;
  overflow: hidden;
  font-family: "Courier New", monospace;
  touch-action: none;
  user-select: none;
}
canvas {
  display: block;
}
/* Top-left stat panel */
#stat-box {
  position: fixed;
  top: 10px;
  left: 14px;
  z-index: 15;
  background: rgba(0, 0, 0, 0.82);
  border: 2px solid #f0a500;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: all;
  min-width: 140px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #f0a500;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  gap: 12px;
}
.stat-val {
  color: #fff;
}
#reset-btn {
  align-self: stretch;
  margin-top: 2px;
  background: #cc2222;
  border: 2px solid #ff4444;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  padding: 0;
}
#reset-btn:hover {
  background: #ee3333;
}
#info-bar {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 180, 255, 0.92);
  border: 2px solid #00c8ff;
  color: #fff;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 4px;
  z-index: 10;
  display: none;
  text-align: center;
  white-space: nowrap;
}
#min-bar {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(180, 20, 20, 0.92);
  border: 2px solid #ff5050;
  color: #fff;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 4px;
  z-index: 10;
  display: none;
  text-align: center;
  white-space: nowrap;
}
/* Joystick */
#joystick-wrap {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 130px;
  height: 130px;
  z-index: 10;
  touch-action: none;
}
#joystick-base {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(240, 165, 0, 0.12);
  border: 2px solid rgba(240, 165, 0, 0.45);
  position: absolute;
  top: 0;
  left: 0;
}
#joystick-knob {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(240, 165, 0, 0.7);
  border: 2px solid #f0a500;
  position: absolute;
  top: 38px;
  left: 38px;
  box-shadow: 0 0 12px rgba(240, 165, 0, 0.5);
  pointer-events: none;
}
/* Loading tpad */
#tpad {
  position: fixed;
  bottom: 28px;
  right: 20px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
}
#tpad .row {
  display: flex;
  gap: 8px;
}
.tbtn {
  width: 50px;
  height: 50px;
  background: rgba(0, 200, 255, 0.18);
  border: 2px solid #00c8ff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00c8ff;
  font-size: 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tbtn.on {
  background: rgba(0, 200, 255, 0.5);
}
#drop-btn {
  width: 116px;
  height: 46px;
  background: rgba(255, 70, 70, 0.18);
  border: 2px solid #ff5050;
  border-radius: 6px;
  color: #ff5050;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
#drop-btn.on {
  background: rgba(255, 70, 70, 0.5);
}
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}
#obox {
  border: 3px solid #f0a500;
  background: #0d0d1a;
  color: #f0a500;
  padding: 28px 36px;
  border-radius: 8px;
  text-align: center;
  font-size: 15px;
  line-height: 2;
  max-width: 330px;
}
#obox h2 {
  font-size: 21px;
  margin-bottom: 6px;
}
#obox button {
  margin-top: 14px;
  background: #f0a500;
  color: #000;
  border: none;
  padding: 10px 32px;
  font-size: 15px;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
}
#bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  z-index: 10;
}
#bfill {
  height: 100%;
  background: linear-gradient(90deg, #f0a500, #ff5050);
  width: 0;
  transition: width 0.4s;
}
/* Minimap — top-right, collapsible */
#minimap-wrap {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 15;
  cursor: pointer;
}
#minimap {
  border: 2px solid rgba(240, 165, 0, 0.6);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.7);
  display: block;
  image-rendering: pixelated;
  transition:
    width 0.25s,
    height 0.25s,
    opacity 0.25s;
}
#minimap-label {
  color: rgba(240, 165, 0, 0.8);
  font-size: 9px;
  letter-spacing: 1px;
  text-align: center;
  margin-top: 2px;
}
#minimap-wrap.collapsed #minimap {
  width: 36px !important;
  height: 36px !important;
  opacity: 0.6;
}
#minimap-wrap.collapsed #minimap-label {
  display: none;
}
.profile-link{
  text-decoration: none; color: #f0a500; font-weight: bold; 
}