* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #070b14;
  color: #f8fafc;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 12px;
}

.game-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 420px;
}

.back-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background-color: #111827;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid #1f2937;
}

.hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background-color: #111827;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #1f2937;
  text-align: center;
}

.hud-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #9ca3af;
}

.value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #38bdf8;
}

.value.gold {
  color: #facc15;
}

.canvas-container {
  position: relative;
  width: 100%;
  aspect-ratio: 420 / 640;
  max-height: 74vh;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #1e293b;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
  touch-action: none;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  background-color: #0f172a;
}

.overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(7, 11, 20, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}

.overlay.hidden {
  display: none;
}

.overlay h1 {
  font-size: 2.3rem;
  font-weight: 900;
  margin-bottom: 14px;
  background: linear-gradient(to right, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.overlay p {
  color: #cbd5e1;
  line-height: 1.8;
  font-size: 0.92rem;
  margin-bottom: 28px;
}

.overlay strong {
  color: #38bdf8;
}

.play-btn {
  background: linear-gradient(135deg, #38bdf8, #3b82f6);
  color: #ffffff;
  border: none;
  padding: 14px 36px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
}