* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #1a120b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #f8fafc;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#game-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #2b1810;
  cursor: crosshair;
}

/* --- SlayArcade Floating Minimalist HUD (Top-Left) --- */
.slay-card {
  position: absolute;
  top: 18px;
  left: 20px;
  min-width: 180px;
  padding: 14px 18px;
  background: rgba(18, 16, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
  pointer-events: auto;
}

.card-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: scale(1.08);
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.mode-pill {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: rgba(147, 51, 234, 0.22);
  color: #c084fc;
  border: 1px solid rgba(147, 51, 234, 0.4);
}

.score-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.star-glyph {
  font-size: 18px;
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}

.hud-score-val {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.best-row {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.stat-line {
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.sub-line {
  font-size: 10px;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  align-self: flex-start;
}

/* --- Top-Right Wooden Strikes Board --- */
.strikes-board {
  position: absolute;
  top: 18px;
  right: 22px;
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(24, 16, 12, 0.7);
  border: 1px solid rgba(180, 83, 9, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  z-index: 10;
  pointer-events: none;
}

.wood-strike {
  font-size: 26px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.15);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.wood-strike.active {
  color: #ef4444;
  text-shadow: 0 0 16px rgba(239, 68, 68, 0.85), 0 0 28px rgba(239, 68, 68, 0.5);
  transform: scale(1.18);
}

/* --- Hint Tooltip --- */
.hint-popup {
  position: absolute;
  top: 70px;
  left: 200px;
  background: rgba(15, 12, 28, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 16px;
  width: 260px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  z-index: 25;
  backdrop-filter: blur(14px);
}

.hint-content h3 {
  font-size: 14px;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 8px;
}

.hint-content p {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 6px;
}

.btn-micro {
  margin-top: 8px;
  background: #3b82f6;
  border: none;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

/* --- Overlay Menus --- */
.overlay-screen {
  position: absolute;
  inset: 0;
  background: rgba(12, 8, 20, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
  padding: 20px;
  transition: opacity 0.3s ease;
}

.overlay-screen.hidden, .hidden {
  display: none !important;
}

.menu-card {
  background: rgba(24, 20, 38, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 32px 36px;
  max-width: 460px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.menu-card.compact {
  max-width: 360px;
  padding: 28px 24px;
}

.blade-badge {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.35);
  padding: 5px 14px;
  border-radius: 9999px;
  margin-bottom: 12px;
}

.blade-badge.red {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
}

.game-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 8px;
}

.game-desc {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 24px;
}

.mode-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  margin-bottom: 24px;
}

.mode-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: #cbd5e1;
}

.mode-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.mode-card.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
}

.mode-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.mode-name {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.mode-info {
  font-size: 9px;
  color: #94a3b8;
  margin-top: 4px;
  line-height: 1.2;
}

.btn {
  width: 100%;
  padding: 14px 24px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.35);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(234, 88, 12, 0.5);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.text-amber { color: #f59e0b; }
.text-emerald { color: #10b981; }
.text-cyan { color: #06b6d4; }
.text-purple { color: #a855f7; }

@media (max-width: 640px) {
  .slay-card {
    top: 10px;
    left: 10px;
    padding: 10px 14px;
    min-width: 140px;
  }
  .card-title {
    font-size: 13px;
  }
  .hud-score-val {
    font-size: 20px;
  }
  .strikes-board {
    top: 10px;
    right: 10px;
    padding: 6px 10px;
  }
  .wood-strike {
    font-size: 20px;
  }
}
