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

html, body {
  height: 100%;
  background: #0b1020;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}

#game-wrap {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
}

#hud {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 24px;
  pointer-events: none;
}

.stat {
  display: flex;
  flex-direction: column;
  background: rgba(10, 16, 32, 0.55);
  padding: 8px 14px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
  min-width: 84px;
}

.stat .label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8aa0c8;
}

.stat span:last-child {
  font-size: 24px;
  font-weight: 700;
  color: #eef4ff;
  font-variant-numeric: tabular-nums;
}

#help {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: #9fb2d4;
  font-size: 13px;
  background: rgba(10, 16, 32, 0.5);
  padding: 8px 16px;
  border-radius: 999px;
  pointer-events: none;
}

kbd {
  background: #1d2740;
  border: 1px solid #34436b;
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 12px;
  color: #dbe6ff;
}

#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 11, 24, 0.72);
  backdrop-filter: blur(3px);
  z-index: 10;
}

#overlay.hidden { display: none; }

#overlay-card {
  background: #131a30;
  border: 1px solid #2a3656;
  border-radius: 16px;
  padding: 32px 36px;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

#overlay-card h1 {
  color: #eef4ff;
  font-size: 30px;
  margin-bottom: 10px;
}

#overlay-card p {
  color: #a8b9da;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 22px;
}

.format-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7e92b6;
  margin-bottom: 8px;
}

.format-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.fmt {
  background: #1d2740;
  border: 1px solid #34436b;
  color: #b8c8e6;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.fmt:hover { background: #243150; }

.fmt.selected {
  background: #2a4a7f;
  border-color: #5aa0ff;
  color: #eef4ff;
}

.btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-row button {
  flex: 1;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-row button:hover { background: #2f6fe0; }

.btn-row button.secondary {
  background: #1d2740;
  border: 1px solid #34436b;
}

.btn-row button.secondary:hover { background: #243150; }

#overlay-sub {
  margin-top: 16px;
  margin-bottom: 0;
  font-size: 12.5px;
  color: #7e92b6;
}

#mode-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(10, 16, 32, 0.55);
  color: #9fb2d4;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

#mode-badge.hidden { display: none; }

#sound-toggle {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(10, 16, 32, 0.55);
  color: #9fb2d4;
  border: 1px solid #2a3656;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s, color 0.15s;
  z-index: 20;
}

#sound-toggle:hover { background: rgba(29, 39, 64, 0.8); color: #dbe6ff; }
