* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #16130f;
  color: #fff8ed;
  font-family: Arial, Helvetica, sans-serif;
}

#game-root,
canvas.webgl {
  position: fixed;
  inset: 0;
}

canvas.webgl {
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.hud {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.hud-panel {
  position: absolute;
  top: 18px;
  left: 18px;
  min-width: 210px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 242, 220, 0.18);
  background: rgba(20, 16, 12, 0.58);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
  line-height: 1.65;
  font-size: 14px;
}

.hud-panel strong {
  float: right;
  color: #ffd372;
}

#center-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 14px rgba(255, 230, 180, 0.75);
}

.controls {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: min(720px, calc(100vw - 28px));
  padding: 10px 14px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 242, 220, 0.15);
  background: rgba(20, 16, 12, 0.54);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  text-align: center;
  font-size: 13px;
  color: rgba(255, 248, 237, 0.9);
  backdrop-filter: blur(8px);
}

.start-button {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 3;
  padding: 14px 20px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 226, 165, 0.45);
  background: linear-gradient(180deg, #ffd783, #a96f23);
  color: #24170a;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.4);
  font: 700 16px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.start-button.hidden {
  display: none;
}

.shop {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: rgba(13, 9, 6, 0.42);
  pointer-events: auto;
}

.shop.hidden {
  display: none;
}

.shop-card {
  width: min(330px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid rgba(255, 221, 152, 0.35);
  background: rgba(31, 20, 12, 0.92);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52);
  color: #fff2d8;
}

.shop-card h1 {
  margin: 0 0 14px;
  font-size: 21px;
  letter-spacing: 0;
}

.shop-card p {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
  color: rgba(255, 242, 216, 0.86);
}

.shop-card strong {
  color: #ffd372;
}

.shop-card button {
  width: 100%;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 226, 165, 0.35);
  background: #d69a3d;
  color: #221407;
  font-weight: 700;
  cursor: pointer;
}

.shop-card button + button {
  background: transparent;
  color: #fff2d8;
}

.mobile-controls {
  position: fixed;
  left: 50%;
  bottom: 64px;
  z-index: 3;
  display: grid;
  grid-template-columns: 54px minmax(124px, 164px) 54px;
  gap: 10px;
  transform: translateX(-50%);
  pointer-events: auto;
}

.mobile-controls.hidden {
  display: none;
}

.mobile-controls button {
  min-height: 48px;
  border: 1px solid rgba(255, 226, 165, 0.38);
  background: rgba(34, 22, 13, 0.76);
  color: #fff2d8;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.scan-message {
  position: fixed;
  right: 18px;
  top: 84px;
  z-index: 3;
  padding: 10px 12px;
  border: 1px solid rgba(255, 226, 165, 0.36);
  background: rgba(31, 20, 12, 0.78);
  color: #ffd372;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
  font-size: 13px;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.scan-message.hidden {
  display: none;
}

.developer-toggle {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  min-width: 48px;
  min-height: 38px;
  border: 1px solid rgba(255, 226, 165, 0.35);
  background: rgba(24, 16, 10, 0.78);
  color: #ffd372;
  font-weight: 700;
  pointer-events: auto;
  backdrop-filter: blur(8px);
}

.developer-panel {
  position: fixed;
  right: 12px;
  bottom: 58px;
  z-index: 5;
  width: min(360px, calc(100vw - 24px));
  max-height: min(440px, calc(100vh - 88px));
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(255, 226, 165, 0.28);
  background: rgba(10, 8, 6, 0.88);
  color: #fff2d8;
  font: 12px/1.45 Consolas, Monaco, monospace;
  white-space: pre-wrap;
  pointer-events: auto;
  backdrop-filter: blur(8px);
}

.developer-panel.hidden {
  display: none;
}

@media (pointer: coarse), (max-width: 820px) {
  .hud-panel {
    top: 10px;
    left: 10px;
    min-width: 170px;
    padding: 9px 10px;
    font-size: 12px;
  }

  .controls {
    bottom: 10px;
    padding: 8px 10px;
    font-size: 11px;
  }

  .start-button {
    top: 54%;
    min-height: 48px;
  }
}
